-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reapplied last fixes before transition to public repo
- Loading branch information
1 parent
fe616b3
commit c6033cd
Showing
23 changed files
with
351 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('core', '0014_auto_20230213_0505'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='tenant', | ||
name='audescribe_active', | ||
field=models.BooleanField(default=False), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import json | ||
from datetime import datetime, timedelta | ||
|
||
from django_celery_beat.models import IntervalSchedule, PeriodicTask | ||
|
||
|
||
class PeriodicTaskService: | ||
|
||
@classmethod | ||
def create_periodic_task(cls, service_type, task, video, start_time=None, end_time=None): | ||
schedule, created = IntervalSchedule.objects.get_or_create( | ||
every=10, | ||
period=IntervalSchedule.MINUTES, | ||
) | ||
|
||
if PeriodicTask.objects.filter(name=f"Check AWS StandaloneTranslation for video={video.pk}").count(): | ||
return | ||
|
||
periodic = PeriodicTask.objects.create( | ||
interval=schedule, | ||
name=f'Check AWS StandaloneTranslation for video={video.pk}', | ||
task=task, | ||
start_time=datetime.now() + timedelta(minutes=15), | ||
kwargs=json.dumps({ | ||
'tenant_id': video.tenant_id, | ||
'video_id': video.pk, | ||
}) | ||
) | ||
|
||
return periodic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
{% extends "subtitles/base.html" %} | ||
{% block content %} | ||
{% load static %} | ||
{% load utils %} | ||
<link rel="stylesheet" href="{% static 'subtitles/css/mooclink.css' %}"> | ||
|
||
<div class="container-fluid"> | ||
<h1>Pending Videos</h1> | ||
|
||
<table class="table table-sm"> | ||
<thead> | ||
<tr> | ||
<th>Video</th> | ||
<th>Service</th> | ||
<th>Started</th> | ||
<th>Action</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for video in pending_videos %} | ||
<tr> | ||
<td> | ||
<a href="{% tenant_url 'mooclink.video.index' course_id=video.course_section.course.ext_id video_id=video.ext_id tenant=video.tenant %}" target="_blank"> | ||
{{ video }} | ||
</a> | ||
</td> | ||
<td>{{ video.workflow_status }}</td> | ||
<td>{{ video.job_initiated }}</td> | ||
<td> | ||
<button form="cancellation-form" type="submit" name="video_id" value="{{ video.id }}" | ||
class="btn btn-danger btn-sm" | ||
onclick="confirm('Please confirm the cancellation of job for video `{{ video }}`')"> | ||
Cancel | ||
</button> | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
|
||
<h2>Orphaned Periodic Tasks</h2> | ||
<table class="table table-sm"> | ||
<thead> | ||
<tr> | ||
<th>Video</th> | ||
<th>Started</th> | ||
<th>Action</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for orphaned in orphaned_tasks %} | ||
<tr> | ||
<td> | ||
<a href="{% tenant_url 'mooclink.video.index' course_id=orphaned.video.course_section.course.ext_id video_id=orphaned.video.ext_id tenant=orphaned.video.tenant %}" target="_blank"> | ||
{{ orphaned.video }} | ||
</a> | ||
</td> | ||
<td>{{ orphaned.task.start_time }}</td> | ||
<td> | ||
<button type="submit" class="btn btn-sm btn-danger" name="periodic_task_id" | ||
value="{{ orphaned.task.pk }}" form="cancellation-form">Cancel | ||
</button> | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
</div> | ||
<form action="{% url "mooclink.jobs.reset" %}" method="post" id="cancellation-form"> | ||
{% csrf_token %} | ||
</form> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 0 additions & 4 deletions
4
pipeline/mooclink/templates/mooclink/partials/subtitle_legend.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
<div class="row"> | ||
<div class="col-2"> | ||
<h4>Legend</h4> | ||
|
||
<div class="row"> | ||
<div class="col-2"> | ||
<h4>Legend</h4> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.