From 47b48c3ee40ef527d48aa7be1033243da6a4651b Mon Sep 17 00:00:00 2001 From: Andrew Date: Tue, 11 Jan 2022 18:51:07 -0500 Subject: [PATCH] Fix translations in schedules --- app/classes/shared/tasks.py | 2 +- app/classes/web/panel_handler.py | 2 +- .../templates/panel/server_schedule_edit.html | 26 ------------------- .../templates/panel/server_tasks.html | 8 +++--- app/translations/en_EN.json | 7 +++++ 5 files changed, 13 insertions(+), 32 deletions(-) diff --git a/app/classes/shared/tasks.py b/app/classes/shared/tasks.py index bdbd81c5..21418650 100644 --- a/app/classes/shared/tasks.py +++ b/app/classes/shared/tasks.py @@ -182,7 +182,7 @@ class TasksManager: def schedule_job(self, job_data): - sch_id = management_helper.create_scheduled_task(job_data['server_id'], job_data['action'], job_data['interval'], job_data['interval_type'], job_data['time'], job_data['command'], "None", job_data['enabled'], job_data['one_time'], job_data['cron_string']) + sch_id = management_helper.create_scheduled_task(job_data['server_id'], job_data['action'], job_data['interval'], job_data['interval_type'], job_data['start_time'], job_data['command'], "None", job_data['enabled'], job_data['one_time'], job_data['cron_string']) if job_data['enabled']: if job_data['cron_string'] != "": cron = job_data['cron_string'].split(' ') diff --git a/app/classes/web/panel_handler.py b/app/classes/web/panel_handler.py index 79211b1e..7184b5cb 100644 --- a/app/classes/web/panel_handler.py +++ b/app/classes/web/panel_handler.py @@ -921,7 +921,7 @@ class PanelHandler(BaseHandler): self.redirect("/panel/server_detail?id={}&subpage=backup".format(server_id)) - if page == "add_schedule": + if page == "new_schedule": server_id = bleach.clean(self.get_argument('id', None)) difficulty = bleach.clean(self.get_argument('difficulty', None)) server_obj = self.controller.servers.get_server_obj(server_id) diff --git a/app/frontend/templates/panel/server_schedule_edit.html b/app/frontend/templates/panel/server_schedule_edit.html index 8eda7c78..be4d3782 100644 --- a/app/frontend/templates/panel/server_schedule_edit.html +++ b/app/frontend/templates/panel/server_schedule_edit.html @@ -170,32 +170,6 @@ function ifDays() { } } -$( ".del_button" ).click(function() { - var sch_id = $(this).data('sch'); - var server_id = {{ data['server_stats']['server_id']['server_id'] }}; - - console.log(sch_id) - - bootbox.confirm({ - title: "Test", - message: "{{ translate('serverBackups', 'confirmDelete', data['lang']) }}", - buttons: { - cancel: { - label: ' {{ translate("serverBackups", "cancel", data['lang']) }}' - }, - confirm: { - label: ' {{ translate("serverBackups", "confirm", data['lang']) }}' - } - }, - callback: function (result) { - console.log(result); - if (result == true) { - del_task(sch_id, server_id); - } - } - }); -}); - function del_task(sch_id, id){ var token = getCookie("_xsrf") diff --git a/app/frontend/templates/panel/server_tasks.html b/app/frontend/templates/panel/server_tasks.html index f5aa57e6..ff84cd56 100644 --- a/app/frontend/templates/panel/server_tasks.html +++ b/app/frontend/templates/panel/server_tasks.html @@ -168,14 +168,14 @@ $( ".del_button" ).click(function() { console.log(sch_id) bootbox.confirm({ - title: "Test", - message: "{{ translate('serverBackups', 'confirmDelete', data['lang']) }}", + title: "{{ translate('serverSchedules', 'areYouSure', data['lang']) }}", + message: "{{ translate('serverSchedules', 'confirmDelete', data['lang']) }}", buttons: { cancel: { - label: ' {{ translate("serverBackups", "cancel", data['lang']) }}' + label: ' {{ translate("serverSchedules", "cancel", data['lang']) }}' }, confirm: { - label: ' {{ translate("serverBackups", "confirm", data['lang']) }}' + label: ' {{ translate("serverSchedules", "confirm", data['lang']) }}' } }, callback: function (result) { diff --git a/app/translations/en_EN.json b/app/translations/en_EN.json index c0f35f9b..30be9e79 100644 --- a/app/translations/en_EN.json +++ b/app/translations/en_EN.json @@ -172,6 +172,13 @@ "bannedPlayers": "Banned Players", "loadingBannedPlayers": "Loading Banned Players" }, + "serverSchedules":{ + "areYouSure": "Deleted Scheduled Task?", + "confirmDelete": "Do you want to delete this scheduled task? This cannot be undone.", + "cancel": "Cancel", + "confirm": "Confirm" + }, + "serverBackups": { "backupNow": "Backup Now!", "backupAtMidnight": "Auto-backup at midnight?",