diff --git a/app/jobs.py b/app/jobs.py index 67b585bf..6f933b5f 100644 --- a/app/jobs.py +++ b/app/jobs.py @@ -1,6 +1,8 @@ import os import datetime +import distro + from app import scheduler import app.modules.db.sql as sql import app.modules.roxywi.roxy as roxy @@ -64,3 +66,15 @@ def delete_old_logs(): os.remove(curpath) except Exception as e: print(f'error: cannot delete old log files: {e}') + + +@scheduler.task('interval', id='update_owner_on_log', hours=12, misfire_grace_time=None) +def update_owner_on_log(): + log_path = get_config.get_config_var('main', 'log_path') + try: + if distro.id() == 'ubuntu': + os.system(f'sudo chown www-data:www-data -R {log_path}') + else: + os.system(f'sudo chown apache:apache -R {log_path}') + except Exception: + pass diff --git a/app/templates/smon/add.html b/app/templates/smon/add.html index 34195726..ef562203 100644 --- a/app/templates/smon/add.html +++ b/app/templates/smon/add.html @@ -66,9 +66,9 @@ {{lang.words.Hostname}} {{lang.words.port|title()}} {{lang.words.enabled|title()}} - Telegram - Slack - PagerDuty + Telegram + Slack + PagerDuty {{lang.words.group|title()}} {{lang.words.desc|title()}} diff --git a/inc/add.js b/inc/add.js index 90782088..29cc7a91 100644 --- a/inc/add.js +++ b/inc/add.js @@ -1640,8 +1640,8 @@ function editList(list, color) { } ); } function saveList(action, list, color) { - var serv = $( "#serv-"+color+"-list option:selected" ).val(); - if(!checkIsServerFiled($("#serv-"+color+"-list"))) return false; + var serv = $("#serv-" + color + "-list option:selected").val(); + if (!checkIsServerFiled($("#serv-" + color + "-list"))) return false; $.ajax({ url: "/app/add/haproxy/bwlist/save", data: { diff --git a/inc/script.js b/inc/script.js index 27e97394..764965ee 100644 --- a/inc/script.js +++ b/inc/script.js @@ -693,7 +693,8 @@ $( function() { try { var cur_path = window.location.pathname; var attr = $(this).attr('href'); - if (cur_path == '/app/add/haproxy' || cur_path == '/app/add/nginx' || cur_path == '/app/servers' || cur_path == '/app/admin' || cur_path == '/app/install') { + if (cur_path == '/app/add/haproxy' || cur_path == '/app/add/nginx' || cur_path == '/app/servers' || + cur_path == '/app/admin' || cur_path == '/app/install' || cur_path == '/app/runtimeapi') { if (typeof attr !== typeof undefined && attr !== false) { $('title').text($(this).attr('title')); history.pushState({}, '', $(this).attr('href'));