mirror of https://github.com/Aidaho12/haproxy-wi
parent
534916b1c8
commit
2448b04426
|
@ -1,7 +1,10 @@
|
|||
from playhouse.migrate import *
|
||||
from datetime import datetime
|
||||
|
||||
from playhouse.migrate import *
|
||||
from flask_login import UserMixin
|
||||
from playhouse.shortcuts import ReconnectMixin
|
||||
from playhouse.sqlite_ext import SqliteExtDatabase
|
||||
|
||||
import modules.roxy_wi_tools as roxy_wi_tools
|
||||
|
||||
get_config = roxy_wi_tools.GetConfigVar()
|
||||
|
@ -23,7 +26,11 @@ def connect(get_migrator=None):
|
|||
migrator = MySQLMigrator(conn)
|
||||
else:
|
||||
db = "/var/lib/roxy-wi/roxy-wi.db"
|
||||
conn = SqliteDatabase(db, pragmas={'timeout': 1000, 'foreign_keys': 1})
|
||||
conn = SqliteExtDatabase(db, pragmas=(
|
||||
('cache_size', -1024 * 64), # 64MB page-cache.
|
||||
('journal_mode', 'wal'),
|
||||
('foreign_keys', 1)
|
||||
))
|
||||
migrator = SqliteMigrator(conn)
|
||||
if get_migrator:
|
||||
return migrator
|
||||
|
|
|
@ -20,8 +20,10 @@ def is_docker() -> bool:
|
|||
for line in f:
|
||||
if re.match("\d+:[\w=]+:/docker(-[ce]e)?/\w+", line):
|
||||
return True
|
||||
return False
|
||||
|
||||
return_out = server_mod.subprocess_execute_with_rc('systemctl status sshd')
|
||||
if return_out['rc']:
|
||||
return True
|
||||
return False
|
||||
|
||||
def check_ver():
|
||||
return roxy_sql.get_ver()
|
||||
|
|
|
@ -3,10 +3,8 @@
|
|||
{% for agent in agents %}
|
||||
<div id="agent-{{agent.id}}" class="div-server-hapwi">
|
||||
<div class="server-name">
|
||||
<a href="/app/ha/agent/{{agent.id}}" style="color: #5d9ceb" title="{{lang.words.open|title()}} {{lang.words.agent}}">
|
||||
<span id="agent-name-{{agent.id}}">{{agent.name.replace("'","")}}</span>
|
||||
<span id="agent-desc-{{agent.id}}">{% if agent.desc != '' %} ({{agent.desc.replace("'", "")}}) {% endif %}</span>
|
||||
</a>
|
||||
<span id="agent-name-{{agent.id}}">{{agent.name.replace("'","")}}</span>
|
||||
<span id="agent-desc-{{agent.id}}">{% if agent.desc != '' %} ({{agent.desc.replace("'", "")}}) {% endif %}</span>
|
||||
<span class="server-action">
|
||||
{% if g.user_params['role'] <= 3 %}
|
||||
<a id="start-{{ agent.id }}" class="start" title="{{lang.words.start|title()}}">
|
||||
|
|
10
inc/smon.js
10
inc/smon.js
|
@ -231,11 +231,15 @@ function getCheckSettings(smon_id, check_type) {
|
|||
$('#new-smon-resolver-server').val(data['resolver']);
|
||||
$('#new-smon-dns_record_typer').val(data['record_type']);
|
||||
$('#new-smon-url').val(data['url']);
|
||||
$('#new-smon-group').val(data['group']);
|
||||
$('#new-smon-description').val(data['desc'])
|
||||
$('#new-smon-group').val(data['group'].replaceAll("'", ""));
|
||||
$('#new-smon-description').val(data['desc'].replaceAll("'", ""))
|
||||
$('#new-smon-packet_size').val(data['packet_size'])
|
||||
$('#new-smon-interval').val(data['interval'])
|
||||
$('#new-smon-body').val(data['body'])
|
||||
try {
|
||||
$('#new-smon-body').val(data['body'].replaceAll("'", ""))
|
||||
} catch (e) {
|
||||
$('#new-smon-body').val(data['body'])
|
||||
}
|
||||
$('#new-smon-agent-id').val(data['agent_id']).change()
|
||||
$('#new-smon-telegram').val(data['tg']).change()
|
||||
$('#new-smon-slack').val(data['slack']).change()
|
||||
|
|
Loading…
Reference in New Issue