Fix translations in schedules

This commit is contained in:
Andrew 2022-01-11 18:51:07 -05:00
parent 04952737ed
commit 47b48c3ee4
5 changed files with 13 additions and 32 deletions

View File

@ -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(' ')

View File

@ -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)

View File

@ -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: '<i class="fas fa-times"></i> {{ translate("serverBackups", "cancel", data['lang']) }}'
},
confirm: {
label: '<i class="fas fa-check"></i> {{ 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")

View File

@ -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: '<i class="fas fa-times"></i> {{ translate("serverBackups", "cancel", data['lang']) }}'
label: '<i class="fas fa-times"></i> {{ translate("serverSchedules", "cancel", data['lang']) }}'
},
confirm: {
label: '<i class="fas fa-check"></i> {{ translate("serverBackups", "confirm", data['lang']) }}'
label: '<i class="fas fa-check"></i> {{ translate("serverSchedules", "confirm", data['lang']) }}'
}
},
callback: function (result) {

View File

@ -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?",