Browse Source

Correções no sistema de cronjobs

pull/170/head 3.0.74
Sesóstris Vieira 10 months ago
parent
commit
50134c78fd
  1. 11
      sigi/apps/utils/admin.py
  2. 2
      sigi/menu_conf.yaml

11
sigi/apps/utils/admin.py

@ -31,12 +31,19 @@ class JobScheduleInline(admin.TabularInline):
return False
@mark_safe
@admin.display(description=_("executar"))
@admin.display(description=_("Ver/executar"))
def get_runner(self, sched):
if sched.status == JobSchedule.STATUS_AGENDADO:
url = reverse("admin:utils_jobschedule_runjob", args=[sched.id])
return (
f"<a href='{url}'><i class='material-icons'>play_arrow</i></a>"
f"<a href='{url}' title='{_('Executar')}'>"
"<i class='material-icons'>play_arrow</i></a>"
)
elif sched.status == JobSchedule.STATUS_CONCLUIDO:
url = reverse("admin:utils_jobschedule_change", args=[sched.id])
return (
f"<a href='{url}' title='{_('Ver resultado')}'>"
"<i class='material-icons'>description</i></a>"
)
return ""

2
sigi/menu_conf.yaml

@ -21,7 +21,7 @@ admin_menu:
- title: Jobs de cron
view_name: admin:utils_cronjob_changelist
- title: Jobs agendados
view_name: admin_utils_jobschedule_changelist
view_name: admin:utils_jobschedule_changelist
querystr: status__exact=A
main_menu:

Loading…
Cancel
Save