Small interface fixes
pull/372/head
Aidaho 2023-11-06 20:47:27 +03:00
parent 3885b281b7
commit f91f329308
4 changed files with 21 additions and 6 deletions

View File

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

View File

@ -66,9 +66,9 @@
<th style="width: 15%;">{{lang.words.Hostname}}</th>
<th style="width: 5%;">{{lang.words.port|title()}}</th>
<th style="width: 5%;">{{lang.words.enabled|title()}}</th>
<th style="width: 11%;">Telegram</th>
<th style="width: 11%;">Slack</th>
<th style="width: 11%;">PagerDuty</th>
<th style="width: 15%;">Telegram</th>
<th style="width: 15%;">Slack</th>
<th style="width: 15%;">PagerDuty</th>
<th style="width: 10%;">{{lang.words.group|title()}}</th>
<th style="width: 100%;">{{lang.words.desc|title()}}</th>
<th></th>

View File

@ -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: {

View File

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