mirror of https://github.com/Aidaho12/haproxy-wi
parent
8b16de3c8d
commit
cec381b6e4
1613
app/create_db.py
1613
app/create_db.py
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,406 @@
|
|||
from peewee import *
|
||||
from datetime import datetime
|
||||
from funct import get_config_var
|
||||
|
||||
mysql_enable = get_config_var('mysql', 'enable')
|
||||
|
||||
if mysql_enable == '1':
|
||||
mysql_user = funct.get_config_var('mysql', 'mysql_user')
|
||||
mysql_password = funct.get_config_var('mysql', 'mysql_password')
|
||||
mysql_db = funct.get_config_var('mysql', 'mysql_db')
|
||||
mysql_host = funct.get_config_var('mysql', 'mysql_host')
|
||||
mysql_port = funct.get_config_var('mysql', 'mysql_port')
|
||||
conn = MySQLDatabase(mysql_db, user=mysql_user, password=mysql_password, host=mysql_host, port=mysql_port)
|
||||
else:
|
||||
db = "roxy-wi.db"
|
||||
conn = SqliteDatabase(db)
|
||||
|
||||
|
||||
class BaseModel(Model):
|
||||
class Meta:
|
||||
database = conn
|
||||
|
||||
|
||||
class User(BaseModel):
|
||||
user_id = AutoField(column_name='id')
|
||||
username = TextField(constraints=[SQL('UNIQUE')])
|
||||
email = TextField(constraints=[SQL('UNIQUE')])
|
||||
password = TextField(null=True)
|
||||
role = TextField()
|
||||
groups = TextField()
|
||||
ldap_user = IntegerField(default=0)
|
||||
activeuser = IntegerField(default=1)
|
||||
|
||||
class Meta:
|
||||
table_name = 'user'
|
||||
|
||||
|
||||
class Server(BaseModel):
|
||||
server_id = AutoField(column_name='id')
|
||||
hostname = TextField()
|
||||
ip = TextField()
|
||||
groups = TextField()
|
||||
type_ip = IntegerField(default=0)
|
||||
enable = IntegerField(default=1)
|
||||
master = IntegerField(default=0)
|
||||
cred = IntegerField(default=1)
|
||||
alert = IntegerField(default=0)
|
||||
metrics = IntegerField(default=0)
|
||||
port = IntegerField(default=22)
|
||||
desc = TextField(null=True)
|
||||
active = IntegerField(default=0)
|
||||
keepalived = IntegerField(default=0)
|
||||
nginx = IntegerField(default=0)
|
||||
haproxy = IntegerField(default=0)
|
||||
pos = IntegerField(default=0)
|
||||
nginx_active = IntegerField(default=0)
|
||||
firewall_enable = IntegerField(default=0)
|
||||
nginx_alert = IntegerField(default=0)
|
||||
protected = IntegerField(default=0)
|
||||
|
||||
class Meta:
|
||||
table_name = 'servers'
|
||||
|
||||
|
||||
class Role(BaseModel):
|
||||
role_id = AutoField(column_name='id')
|
||||
name = TextField(constraints=[SQL('UNIQUE')])
|
||||
description = DateTimeField()
|
||||
|
||||
class Meta:
|
||||
table_name = 'role'
|
||||
|
||||
|
||||
class Telegram(BaseModel):
|
||||
id = AutoField()
|
||||
token = TextField()
|
||||
chanel_name = TextField()
|
||||
groups = IntegerField()
|
||||
|
||||
class Meta:
|
||||
table_name = 'telegram'
|
||||
|
||||
|
||||
class Slack(BaseModel):
|
||||
id = AutoField()
|
||||
token = TextField()
|
||||
chanel_name = TextField()
|
||||
groups = IntegerField()
|
||||
|
||||
class Meta:
|
||||
table_name = 'slack'
|
||||
|
||||
|
||||
class UUID(BaseModel):
|
||||
user_id = IntegerField()
|
||||
uuid = TextField()
|
||||
exp = DateTimeField(default=datetime.now)
|
||||
|
||||
class Meta:
|
||||
table_name = 'uuid'
|
||||
primary_key = False
|
||||
|
||||
|
||||
class Token(BaseModel):
|
||||
user_id = IntegerField()
|
||||
token = TextField()
|
||||
exp = DateTimeField(default=datetime.now)
|
||||
|
||||
class Meta:
|
||||
table_name = 'token'
|
||||
primary_key = False
|
||||
|
||||
|
||||
class ApiToken(BaseModel):
|
||||
token = TextField()
|
||||
user_name = TextField()
|
||||
user_group_id = IntegerField()
|
||||
user_role = IntegerField()
|
||||
create_date = DateTimeField(default=datetime.now)
|
||||
expire_date = DateTimeField(default=datetime.now)
|
||||
|
||||
class Meta:
|
||||
table_name = 'api_tokens'
|
||||
primary_key = False
|
||||
|
||||
|
||||
class Setting(BaseModel):
|
||||
param = TextField()
|
||||
value = TextField(null=True)
|
||||
section = TextField()
|
||||
desc = TextField()
|
||||
group = IntegerField(null=True, constraints=[SQL('DEFAULT 1')])
|
||||
|
||||
class Meta:
|
||||
table_name = 'settings'
|
||||
primary_key = False
|
||||
constraints = [SQL('UNIQUE (param, `group`)')]
|
||||
|
||||
|
||||
class Groups(BaseModel):
|
||||
group_id = AutoField(column_name='id')
|
||||
name = TextField(constraints=[SQL('UNIQUE')])
|
||||
description = TextField(null=True)
|
||||
|
||||
class Meta:
|
||||
table_name = 'groups'
|
||||
|
||||
|
||||
class UserGroups(BaseModel):
|
||||
user_id = IntegerField()
|
||||
user_group_id = IntegerField()
|
||||
|
||||
class Meta:
|
||||
table_name = 'user_groups'
|
||||
primary_key = False
|
||||
constraints = [SQL('UNIQUE (user_id, user_group_id)')]
|
||||
|
||||
|
||||
class Cred(BaseModel):
|
||||
id = AutoField()
|
||||
name = TextField()
|
||||
enable = IntegerField(constraints=[SQL('DEFAULT 1')])
|
||||
username = TextField()
|
||||
password = TextField(null=True)
|
||||
groups = IntegerField(constraints=[SQL('DEFAULT 1')])
|
||||
|
||||
class Meta:
|
||||
table_name = 'cred'
|
||||
constraints = [SQL('UNIQUE (name, groups)')]
|
||||
|
||||
|
||||
class Backup(BaseModel):
|
||||
id = AutoField()
|
||||
server = TextField()
|
||||
rhost = TextField()
|
||||
rpath = TextField()
|
||||
backup_type = TextField(column_name='type')
|
||||
time = TextField()
|
||||
cred = IntegerField()
|
||||
description = TextField(null=True)
|
||||
|
||||
class Meta:
|
||||
table_name = 'backups'
|
||||
|
||||
|
||||
class Metrics(BaseModel):
|
||||
serv = TextField()
|
||||
curr_con = IntegerField()
|
||||
cur_ssl_con = IntegerField()
|
||||
sess_rate = IntegerField()
|
||||
max_sess_rate = IntegerField()
|
||||
date = DateTimeField(default=datetime.now)
|
||||
|
||||
class Meta:
|
||||
table_name = 'metrics'
|
||||
primary_key = False
|
||||
|
||||
|
||||
class WafMetrics(BaseModel):
|
||||
serv = TextField()
|
||||
conn = IntegerField()
|
||||
date = DateTimeField(default=datetime.now)
|
||||
|
||||
class Meta:
|
||||
table_name = 'waf_metrics'
|
||||
primary_key = False
|
||||
|
||||
|
||||
class Version(BaseModel):
|
||||
version = TextField()
|
||||
|
||||
class Meta:
|
||||
table_name = 'version'
|
||||
primary_key = False
|
||||
|
||||
|
||||
class Option(BaseModel):
|
||||
id = AutoField()
|
||||
options = TextField()
|
||||
groups = TextField()
|
||||
|
||||
class Meta:
|
||||
table_name = 'options'
|
||||
|
||||
|
||||
class SavedServer(BaseModel):
|
||||
id = AutoField()
|
||||
server = TextField()
|
||||
description = TextField(null=True)
|
||||
groups = TextField()
|
||||
|
||||
class Meta:
|
||||
table_name = 'saved_servers'
|
||||
|
||||
|
||||
class Waf(BaseModel):
|
||||
server_id = IntegerField()
|
||||
metrics = IntegerField()
|
||||
|
||||
class Meta:
|
||||
table_name = 'waf'
|
||||
primary_key = False
|
||||
constraints = [SQL('UNIQUE (server_id)')]
|
||||
|
||||
|
||||
class WafRules(BaseModel):
|
||||
id = AutoField()
|
||||
serv = TextField()
|
||||
rule_name = TextField()
|
||||
rule_file = TextField()
|
||||
desc = TextField(null=True)
|
||||
en = IntegerField(constraints=[SQL('DEFAULT 1')])
|
||||
|
||||
class Meta:
|
||||
table_name = 'waf_rules'
|
||||
constraints = [SQL('UNIQUE (serv, rule_name)')]
|
||||
|
||||
|
||||
class PortScannerSettings(BaseModel):
|
||||
server_id = IntegerField()
|
||||
user_group_id = IntegerField()
|
||||
enabled = IntegerField()
|
||||
notify = IntegerField()
|
||||
history = IntegerField()
|
||||
|
||||
class Meta:
|
||||
table_name = 'port_scanner_settings'
|
||||
primary_key = False
|
||||
constraints = [SQL('UNIQUE (server_id)')]
|
||||
|
||||
|
||||
class PortScannerPorts(BaseModel):
|
||||
serv = TextField()
|
||||
user_group_id = IntegerField()
|
||||
port = IntegerField()
|
||||
service_name = TextField()
|
||||
date = DateTimeField(default=datetime.now)
|
||||
|
||||
class Meta:
|
||||
table_name = 'port_scanner_ports'
|
||||
primary_key = False
|
||||
|
||||
|
||||
class PortScannerHistory(BaseModel):
|
||||
serv = TextField()
|
||||
port = IntegerField()
|
||||
status = TextField()
|
||||
service_name = TextField()
|
||||
date = DateTimeField(default=datetime.now)
|
||||
|
||||
class Meta:
|
||||
table_name = 'port_scanner_history'
|
||||
primary_key = False
|
||||
|
||||
|
||||
class ProvidersCreds(BaseModel):
|
||||
id = AutoField()
|
||||
name = TextField()
|
||||
type = TextField()
|
||||
group = TextField()
|
||||
key = TextField()
|
||||
secret = TextField(null=True)
|
||||
create_date = DateTimeField(default=datetime.now)
|
||||
edit_date = DateTimeField(default=datetime.now)
|
||||
|
||||
class Meta:
|
||||
table_name = 'providers_creds'
|
||||
|
||||
|
||||
class ProvisionedServers(BaseModel):
|
||||
id = AutoField()
|
||||
region = TextField()
|
||||
instance_type = TextField()
|
||||
public_ip = IntegerField(null=True)
|
||||
floating_ip = IntegerField(null=True)
|
||||
volume_size = IntegerField(null=True)
|
||||
backup = IntegerField(null=True)
|
||||
monitoring = IntegerField(null=True)
|
||||
private_networking = IntegerField(null=True)
|
||||
ssh_key_name = TextField(null=True)
|
||||
ssh_ids = TextField(null=True)
|
||||
name = TextField()
|
||||
os = TextField()
|
||||
firewall = IntegerField()
|
||||
provider_id = IntegerField()
|
||||
type = TextField()
|
||||
status = TextField()
|
||||
group_id = IntegerField()
|
||||
date = DateTimeField(default=datetime.now)
|
||||
IP = TextField(null=True)
|
||||
last_error = TextField(null=True)
|
||||
delete_on_termination = IntegerField(null=True)
|
||||
project = TextField(null=True)
|
||||
network_name = TextField(null=True)
|
||||
volume_type = TextField(null=True)
|
||||
name_template = TextField(null=True)
|
||||
|
||||
class Meta:
|
||||
table_name = 'provisioned_servers'
|
||||
|
||||
|
||||
class MetricsHttpStatus(BaseModel):
|
||||
serv = TextField()
|
||||
ok_ans = IntegerField(column_name='2xx')
|
||||
redir_ans = IntegerField(column_name='3xx')
|
||||
not_found_ans = IntegerField(column_name='4xx')
|
||||
err_ans = IntegerField(column_name='5xx')
|
||||
date = DateTimeField(default=datetime.now)
|
||||
|
||||
class Meta:
|
||||
table_name = 'metrics_http_status'
|
||||
primary_key = False
|
||||
|
||||
|
||||
class SMON(BaseModel):
|
||||
id = AutoField()
|
||||
ip = IntegerField(null=True)
|
||||
port = IntegerField(null=True)
|
||||
status = IntegerField(constraints=[SQL('DEFAULT 1')])
|
||||
en = IntegerField(constraints=[SQL('DEFAULT 1')])
|
||||
desc = TextField(null=True)
|
||||
response_time = TextField(null=True)
|
||||
time_state = IntegerField(constraints=[SQL('DEFAULT 0')])
|
||||
group = TextField(null=True)
|
||||
script = TextField(null=True)
|
||||
http = TextField(null=True)
|
||||
http_status = IntegerField(constraints=[SQL('DEFAULT 1')])
|
||||
body = TextField(null=True)
|
||||
body_status = IntegerField(constraints=[SQL('DEFAULT 1')])
|
||||
telegram_channel_id = IntegerField(null=True)
|
||||
user_group = IntegerField()
|
||||
|
||||
class Meta:
|
||||
table_name = 'smon'
|
||||
constraints = [SQL('UNIQUE (ip, port, http, body)')]
|
||||
|
||||
|
||||
class Alerts(BaseModel):
|
||||
message = TextField()
|
||||
level = TextField()
|
||||
ip = TextField()
|
||||
port = IntegerField()
|
||||
user_group = IntegerField(constraints=[SQL('DEFAULT 1')])
|
||||
service = TextField()
|
||||
date = DateTimeField(default=datetime.now)
|
||||
|
||||
class Meta:
|
||||
table_name = 'alerts'
|
||||
primary_key = False
|
||||
|
||||
|
||||
class GeoipCodes(BaseModel):
|
||||
code = TextField()
|
||||
name = TextField()
|
||||
|
||||
class Meta:
|
||||
table_name = 'geoip_codes'
|
||||
primary_key = False
|
||||
constraints = [SQL('UNIQUE (code, name)')]
|
||||
|
||||
def create_tables():
|
||||
with conn:
|
||||
conn.create_tables([User, Server, Role, Telegram, Slack, UUID, Token, ApiToken, Groups, UserGroups,
|
||||
Setting, Cred, Backup, Metrics, WafMetrics, Version, Option, SavedServer, Waf,
|
||||
PortScannerSettings, PortScannerPorts, PortScannerHistory, ProvidersCreds,
|
||||
ProvisionedServers, MetricsHttpStatus, SMON, WafRules, Alerts, GeoipCodes])
|
56
app/funct.py
56
app/funct.py
|
@ -46,6 +46,8 @@ def get_data(log_type):
|
|||
fmt = '%Y%m%d'
|
||||
elif log_type == "date_in_log":
|
||||
fmt = "%b %d %H:%M:%S"
|
||||
elif log_type == 'regular':
|
||||
fmt = "%Y-%m-%d %H:%M:%S"
|
||||
|
||||
return now_utc.strftime(fmt)
|
||||
|
||||
|
@ -60,11 +62,11 @@ def get_user_group(**kwargs):
|
|||
user_group_id1 = user_group_id.value
|
||||
groups = sql.select_groups(id=user_group_id1)
|
||||
for g in groups:
|
||||
if g[0] == int(user_group_id1):
|
||||
if g.group_id == int(user_group_id1):
|
||||
if kwargs.get('id'):
|
||||
user_group = g[0]
|
||||
user_group = g.group_id
|
||||
else:
|
||||
user_group = g[1]
|
||||
user_group = g.name
|
||||
except Exception:
|
||||
check_user_group()
|
||||
|
||||
|
@ -145,8 +147,8 @@ def telegram_send_mess(mess, **kwargs):
|
|||
proxy = sql.get_setting('proxy')
|
||||
|
||||
for telegram in telegrams:
|
||||
token_bot = telegram[1]
|
||||
channel_name = telegram[2]
|
||||
token_bot = telegram.token
|
||||
channel_name = telegram.chanel_name
|
||||
|
||||
if token_bot == '' or channel_name == '':
|
||||
mess = " error: Can't send message. Add Telegram channel before use alerting at this servers group"
|
||||
|
@ -231,8 +233,9 @@ def is_admin(**kwargs):
|
|||
|
||||
try:
|
||||
return True if role <= level else False
|
||||
except Exception:
|
||||
return False
|
||||
except Exception as e:
|
||||
print('error: '+str(e))
|
||||
# return False
|
||||
|
||||
|
||||
def page_for_admin(**kwargs):
|
||||
|
@ -257,16 +260,16 @@ def return_ssh_keys_path(serv, **kwargs):
|
|||
|
||||
if kwargs.get('id'):
|
||||
for sshs in sql.select_ssh(id=kwargs.get('id')):
|
||||
ssh_enable = sshs[2]
|
||||
ssh_user_name = sshs[3]
|
||||
ssh_user_password = sshs[4]
|
||||
ssh_key_name = full_path+'/keys/%s.pem' % sshs[1]
|
||||
ssh_enable = sshs.enable
|
||||
ssh_user_name = sshs.username
|
||||
ssh_user_password = sshs.password
|
||||
ssh_key_name = full_path+'/keys/%s.pem' % sshs.name
|
||||
else:
|
||||
for sshs in sql.select_ssh(serv=serv):
|
||||
ssh_enable = sshs[3]
|
||||
ssh_user_name = sshs[4]
|
||||
ssh_user_password = sshs[5]
|
||||
ssh_key_name = full_path+'/keys/%s.pem' % sshs[2]
|
||||
ssh_enable = sshs.enable
|
||||
ssh_user_name = sshs.username
|
||||
ssh_user_password = sshs.password
|
||||
ssh_key_name = full_path+'/keys/%s.pem' % sshs.name
|
||||
|
||||
return ssh_enable, ssh_user_name, ssh_user_password, ssh_key_name
|
||||
|
||||
|
@ -1001,10 +1004,13 @@ def haproxy_wi_log(**kwargs):
|
|||
else:
|
||||
group_grep = ''
|
||||
cmd = "find "+log_path+"/roxy-wi-* -type f -exec stat --format '%Y :%y %n' '{}' \; | sort -nr | cut -d: -f2- | head -1 |awk '{print $4}' |xargs tail"+group_grep+"|sort -r"
|
||||
output, stderr = subprocess_execute(cmd)
|
||||
return output
|
||||
|
||||
|
||||
try:
|
||||
output, stderr = subprocess_execute(cmd)
|
||||
return output
|
||||
except:
|
||||
return ''
|
||||
|
||||
|
||||
def show_ip(stdout):
|
||||
for line in stdout:
|
||||
if "Permission denied" in line:
|
||||
|
@ -1203,11 +1209,8 @@ def get_hash(value):
|
|||
return p
|
||||
|
||||
|
||||
def out_error(e):
|
||||
if get_config_var('mysql', 'enable') == '1':
|
||||
error = e
|
||||
else:
|
||||
error = e.args[0]
|
||||
def out_error(error):
|
||||
error = str(error)
|
||||
try:
|
||||
logging('localhost', error, haproxywi=1, login=1)
|
||||
except Exception:
|
||||
|
@ -1291,7 +1294,10 @@ def get_services_status():
|
|||
service_name = 'grafana'
|
||||
else:
|
||||
service_name = s
|
||||
cmd = "rpm --query " + service_name + "-* |awk -F\"" + service_name + "\" '{print $2}' |awk -F\".noa\" '{print $1}' |sed 's/-//1' |sed 's/-/./'"
|
||||
if service_name == 'prometheus':
|
||||
cmd = "prometheus --version 2>&1 |grep prometheus|awk '{print $3}'"
|
||||
else:
|
||||
cmd = "rpm --query " + service_name + "-* |awk -F\"" + service_name + "\" '{print $2}' |awk -F\".noa\" '{print $1}' |sed 's/-//1' |sed 's/-/./'"
|
||||
service_ver, stderr = subprocess_execute(cmd)
|
||||
|
||||
try:
|
||||
|
|
|
@ -11,7 +11,6 @@ funct.check_login()
|
|||
|
||||
try:
|
||||
user, user_id, role, token, servers = funct.get_users_params()
|
||||
users = sql.select_users()
|
||||
services = []
|
||||
except:
|
||||
pass
|
||||
|
@ -74,29 +73,40 @@ for s in servers:
|
|||
servers_with_status.append(s[2])
|
||||
servers_with_status.append(s[11])
|
||||
if service == 'nginx':
|
||||
h = (['', ''],)
|
||||
cmd = [
|
||||
"/usr/sbin/nginx -v 2>&1|awk '{print $3}' && systemctl status nginx |grep -e 'Active' |awk '{print $2, $9$10$11$12$13}' && ps ax |grep nginx:|grep -v grep |wc -l"]
|
||||
out = funct.ssh_command(s[2], cmd)
|
||||
h = ()
|
||||
out1 = []
|
||||
for k in out.split():
|
||||
out1.append(k)
|
||||
h = (out1,)
|
||||
servers_with_status.append(h)
|
||||
servers_with_status.append(h)
|
||||
servers_with_status.append(s[17])
|
||||
try:
|
||||
out = funct.ssh_command(s[2], cmd)
|
||||
h = ()
|
||||
out1 = []
|
||||
for k in out.split():
|
||||
out1.append(k)
|
||||
h = (out1,)
|
||||
servers_with_status.append(h)
|
||||
servers_with_status.append(h)
|
||||
servers_with_status.append(s[17])
|
||||
except:
|
||||
servers_with_status.append(h)
|
||||
servers_with_status.append(h)
|
||||
servers_with_status.append(s[17])
|
||||
elif service == 'keepalived':
|
||||
h = (['',''],)
|
||||
cmd = [
|
||||
"/usr/sbin/keepalived -v 2>&1|head -1|awk '{print $2}' && systemctl status keepalived |grep -e 'Active' |awk '{print $2, $9$10$11$12$13}' && ps ax |grep keepalived|grep -v grep |wc -l"]
|
||||
out = funct.ssh_command(s[2], cmd)
|
||||
h = ()
|
||||
out1 = []
|
||||
for k in out.split():
|
||||
out1.append(k)
|
||||
h = (out1,)
|
||||
servers_with_status.append(h)
|
||||
servers_with_status.append(h)
|
||||
servers_with_status.append(s[17])
|
||||
try:
|
||||
out = funct.ssh_command(s[2], cmd)
|
||||
out1 = []
|
||||
for k in out.split():
|
||||
out1.append(k)
|
||||
h = (out1,)
|
||||
servers_with_status.append(h)
|
||||
servers_with_status.append(h)
|
||||
servers_with_status.append(s[17])
|
||||
except:
|
||||
servers_with_status.append(h)
|
||||
servers_with_status.append(h)
|
||||
servers_with_status.append(s[17])
|
||||
else:
|
||||
cmd = 'echo "show info" |nc %s %s -w 1 |grep -e "Ver\|Uptime:\|Process_num"' % (s[2], haproxy_sock_port)
|
||||
out = funct.subprocess_execute(cmd)
|
||||
|
@ -112,7 +122,7 @@ for s in servers:
|
|||
servers_with_status.append(sql.is_master(s[2]))
|
||||
servers_with_status.append(sql.select_servers(server=s[2]))
|
||||
|
||||
is_keepalived = sql.select_keealived(s[2])
|
||||
is_keepalived = sql.select_keepalived(s[2])
|
||||
|
||||
if is_keepalived:
|
||||
try:
|
||||
|
@ -132,7 +142,6 @@ template = template.render(h2=1,
|
|||
title=title,
|
||||
role=role,
|
||||
user=user,
|
||||
users=users,
|
||||
servers=servers_with_status1,
|
||||
keep_alive=''.join(keep_alive),
|
||||
serv=serv,
|
||||
|
|
30
app/login.py
30
app/login.py
|
@ -33,17 +33,17 @@ def send_cookie(login):
|
|||
sql.write_user_uuid(login, user_uuid)
|
||||
sql.write_user_token(login, user_token)
|
||||
|
||||
id = sql.get_user_id_by_uuid(user_uuid)
|
||||
user_id = sql.get_user_id_by_uuid(user_uuid)
|
||||
try:
|
||||
cookie = http.cookies.SimpleCookie(os.environ.get("HTTP_COOKIE"))
|
||||
user_group_id = cookie.get('group')
|
||||
user_group_id = user_group_id.value
|
||||
if sql.check_user_group(id, user_group_id):
|
||||
if sql.check_user_group(user_id, user_group_id):
|
||||
user_groups = user_group_id
|
||||
else:
|
||||
user_groups = sql.select_user_groups(id, limit=1)
|
||||
except:
|
||||
user_groups = sql.select_user_groups(id, limit=1)
|
||||
user_groups = sql.select_user_groups(user_id, limit=1)
|
||||
except Exception:
|
||||
user_groups = sql.select_user_groups(user_id, limit=1)
|
||||
|
||||
c = http.cookies.SimpleCookie(os.environ.get("HTTP_COOKIE"))
|
||||
c["uuid"] = user_uuid
|
||||
|
@ -63,13 +63,13 @@ def send_cookie(login):
|
|||
for g in groups:
|
||||
if g[0] == int(user_groups):
|
||||
user_group = g[1]
|
||||
except:
|
||||
except Exception:
|
||||
user_group = ''
|
||||
|
||||
try:
|
||||
user_name = sql.get_user_name_by_uuid(user_uuid)
|
||||
funct.logging('localhost', ' user: ' + user_name + ', group: ' + user_group + ' log in', haproxywi=1)
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
print("Content-type: text/html\n")
|
||||
print('ok')
|
||||
|
@ -86,7 +86,7 @@ def ban():
|
|||
c["ban"]["expires"] = expires.strftime("%a, %d %b %Y %H:%M:%S GMT")
|
||||
try:
|
||||
funct.logging('localhost', login+' failed log in', haproxywi=1, login=1)
|
||||
except:
|
||||
except Exception:
|
||||
funct.logging('localhost', ' Failed log in. Wrong username', haproxywi=1)
|
||||
print(c.output())
|
||||
print("Content-type: text/html\n")
|
||||
|
@ -150,7 +150,7 @@ if form.getvalue('error'):
|
|||
try:
|
||||
if sql.get_setting('session_ttl'):
|
||||
session_ttl = sql.get_setting('session_ttl')
|
||||
except:
|
||||
except Exception:
|
||||
error = '<center><div class="alert alert-danger">Cannot find "session_ttl" parameter. ' \
|
||||
'Check it into settings, "main" section</div>'
|
||||
pass
|
||||
|
@ -158,7 +158,7 @@ except:
|
|||
try:
|
||||
role = sql.get_user_role_by_uuid(user_id.value)
|
||||
user = sql.get_user_name_by_uuid(user_id.value)
|
||||
except:
|
||||
except Exception:
|
||||
role = ""
|
||||
user = ""
|
||||
pass
|
||||
|
@ -167,7 +167,7 @@ except:
|
|||
if form.getvalue('logout'):
|
||||
try:
|
||||
sql.delete_uuid(user_id.value)
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
print("Set-cookie: uuid=; expires=Wed, May 18 03:33:20 2003; path=/app; httponly")
|
||||
print("Content-type: text/html\n")
|
||||
|
@ -178,16 +178,16 @@ if login is not None and password is not None:
|
|||
USERS = sql.select_users(user=login)
|
||||
|
||||
for users in USERS:
|
||||
if users[7] == 0:
|
||||
if users.activeuser == 0:
|
||||
print("Content-type: text/html\n")
|
||||
print('Your login is disabled')
|
||||
sys.exit()
|
||||
if users[6] == 1:
|
||||
if login in users[1]:
|
||||
if users.ldap_user == 1:
|
||||
if login in users.username:
|
||||
check_in_ldap(login, password)
|
||||
else:
|
||||
passwordHashed = funct.get_hash(password)
|
||||
if login in users[1] and passwordHashed == users[3]:
|
||||
if login in users.username and passwordHashed == users.password:
|
||||
send_cookie(login)
|
||||
break
|
||||
else:
|
||||
|
|
|
@ -18,9 +18,9 @@ try:
|
|||
if service_ver[0] == '* is not installed':
|
||||
servers = ''
|
||||
else:
|
||||
servers = sql.select_servers_metrics(user_id.value)
|
||||
servers = sql.select_servers_metrics()
|
||||
services = '1'
|
||||
except Exception:
|
||||
except Exception as e:
|
||||
pass
|
||||
|
||||
|
||||
|
|
253
app/options.py
253
app/options.py
|
@ -14,7 +14,9 @@ if (form.getvalue('new_metrics') or
|
|||
form.getvalue('new_http_metrics') or
|
||||
form.getvalue('new_waf_metrics') or
|
||||
form.getvalue('metrics_hapwi_ram') or
|
||||
form.getvalue('metrics_hapwi_cpu')):
|
||||
form.getvalue('metrics_hapwi_cpu') or
|
||||
form.getvalue('getoption') or
|
||||
form.getvalue('getsavedserver')):
|
||||
print('Content-type: application/json\n')
|
||||
else:
|
||||
print('Content-type: text/html\n')
|
||||
|
@ -41,7 +43,10 @@ if form.getvalue('getcerts') is not None and serv is not None:
|
|||
print('error: Cannot connect to the server: ' + e.args[0])
|
||||
|
||||
if form.getvalue('checkSshConnect') is not None and serv is not None:
|
||||
print(funct.ssh_command(serv, ["ls -1t"]))
|
||||
try:
|
||||
print(funct.ssh_command(serv, ["ls -1t"]))
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
if form.getvalue('getcert') is not None and serv is not None:
|
||||
cert_id = form.getvalue('getcert')
|
||||
|
@ -517,7 +522,7 @@ if act == "overview":
|
|||
|
||||
async def async_get_overview(serv1, serv2):
|
||||
haproxy = sql.select_haproxy(serv2)
|
||||
keepalived = sql.select_keealived(serv2)
|
||||
keepalived = sql.select_keepalived(serv2)
|
||||
nginx = sql.select_nginx(serv2)
|
||||
waf = sql.select_waf_servers(serv2)
|
||||
haproxy_process = ''
|
||||
|
@ -525,6 +530,11 @@ if act == "overview":
|
|||
nginx_process = ''
|
||||
waf_process = ''
|
||||
|
||||
try:
|
||||
waf_len = len(waf)
|
||||
except:
|
||||
waf_len = 0
|
||||
|
||||
if haproxy == 1:
|
||||
cmd = 'echo "show info" |nc %s %s -w 1|grep -e "Process_num"' % (serv2, sql.get_setting('haproxy_sock_port'))
|
||||
haproxy_process = funct.server_status(funct.subprocess_execute(cmd))
|
||||
|
@ -534,14 +544,12 @@ if act == "overview":
|
|||
keepalived_process = funct.ssh_command(serv2, command)
|
||||
|
||||
if nginx == 1:
|
||||
# command = ["ps ax |grep nginx:|grep -v grep|wc -l"]
|
||||
# nginx_process = funct.ssh_command(serv2, command)
|
||||
nginx_cmd = 'echo "something" |nc %s %s -w 1' % (serv2, sql.get_setting('nginx_stats_port'))
|
||||
nginx_process = funct.server_status(funct.subprocess_execute(nginx_cmd))
|
||||
|
||||
if len(waf) == 1:
|
||||
commands2 = ["ps ax |grep waf/bin/modsecurity |grep -v grep |wc -l"]
|
||||
waf_process = funct.ssh_command(serv2, commands2)
|
||||
if waf_len >= 1:
|
||||
command = ["ps ax |grep waf/bin/modsecurity |grep -v grep |wc -l"]
|
||||
waf_process = funct.ssh_command(serv2, command)
|
||||
|
||||
server_status = (serv1,
|
||||
serv2,
|
||||
|
@ -889,6 +897,7 @@ if serv is not None and act == "showMap":
|
|||
|
||||
print('<img src="/map%s.png" alt="map">' % date)
|
||||
|
||||
|
||||
if form.getvalue('servaction') is not None:
|
||||
server_state_file = sql.get_setting('server_state_file')
|
||||
haproxy_sock = sql.get_setting('haproxy_sock')
|
||||
|
@ -1012,8 +1021,8 @@ if form.getvalue('master'):
|
|||
haproxy = form.getvalue('hap')
|
||||
nginx = form.getvalue('nginx')
|
||||
script = "install_keepalived.sh"
|
||||
fullpath = funct.get_config_var('main', 'fullpath')
|
||||
proxy = sql.get_setting('proxy')
|
||||
ssh_port = 22
|
||||
ssh_enable, ssh_user_name, ssh_user_password, ssh_key_name = funct.return_ssh_keys_path(master)
|
||||
|
||||
if ssh_enable == 0:
|
||||
|
@ -1044,7 +1053,7 @@ if form.getvalue('master'):
|
|||
group_id = sql.get_group_id_by_server_ip(master)
|
||||
cred_id = sql.get_cred_id_by_server_ip(master)
|
||||
hostname = sql.get_hostname_by_server_ip(master)
|
||||
sql.add_server(hostname+'-VIP', IP, group_id, '1', '1', '1', cred_id, ssh_port, 'VRRP IP for '+master, haproxy, nginx, '0')
|
||||
sql.add_server(hostname+'-VIP', IP, group_id, '1', '1', '0', cred_id, ssh_port, 'VRRP IP for '+master, haproxy, nginx, '0')
|
||||
|
||||
if form.getvalue('master_slave'):
|
||||
master = form.getvalue('master')
|
||||
|
@ -1053,8 +1062,8 @@ if form.getvalue('master_slave'):
|
|||
IP = form.getvalue('vrrpip')
|
||||
syn_flood = form.getvalue('syn_flood')
|
||||
script = "install_keepalived.sh"
|
||||
fullpath = funct.get_config_var('main', 'fullpath')
|
||||
proxy = sql.get_setting('proxy')
|
||||
ssh_port = 22
|
||||
ssh_enable, ssh_user_name, ssh_user_password, ssh_key_name = funct.return_ssh_keys_path(slave)
|
||||
|
||||
if ssh_enable == 0:
|
||||
|
@ -1091,6 +1100,7 @@ if form.getvalue('masteradd'):
|
|||
kp = form.getvalue('kp')
|
||||
script = "install_keepalived.sh"
|
||||
proxy = sql.get_setting('proxy')
|
||||
ssh_port = 22
|
||||
ssh_enable, ssh_user_name, ssh_user_password, ssh_key_name = funct.return_ssh_keys_path(master)
|
||||
|
||||
if ssh_enable == 0:
|
||||
|
@ -1124,6 +1134,7 @@ if form.getvalue('masteradd_slave'):
|
|||
kp = form.getvalue('kp')
|
||||
script = "install_keepalived.sh"
|
||||
proxy = sql.get_setting('proxy')
|
||||
ssh_port = 22
|
||||
ssh_enable, ssh_user_name, ssh_user_password, ssh_key_name = funct.return_ssh_keys_path(slave)
|
||||
|
||||
if ssh_enable == 0:
|
||||
|
@ -1218,6 +1229,7 @@ if form.getvalue('haproxy_exp_install'):
|
|||
stats_password = sql.get_setting('stats_password')
|
||||
stat_page = sql.get_setting('stats_page')
|
||||
proxy = sql.get_setting('proxy')
|
||||
ssh_port = 22
|
||||
ssh_enable, ssh_user_name, ssh_user_password, ssh_key_name = funct.return_ssh_keys_path(serv)
|
||||
|
||||
if ssh_enable == 0:
|
||||
|
@ -1254,6 +1266,7 @@ if form.getvalue('nginx_exp_install'):
|
|||
stats_port = sql.get_setting('nginx_stats_port')
|
||||
stats_page = sql.get_setting('nginx_stats_page')
|
||||
proxy = sql.get_setting('proxy')
|
||||
ssh_port = 22
|
||||
ssh_enable, ssh_user_name, ssh_user_password, ssh_key_name = funct.return_ssh_keys_path(serv)
|
||||
|
||||
if ssh_enable == 0:
|
||||
|
@ -1285,6 +1298,7 @@ if form.getvalue('node_exp_install'):
|
|||
serv = form.getvalue('node_exp_install')
|
||||
script = "install_node_exporter.sh"
|
||||
proxy = sql.get_setting('proxy')
|
||||
ssh_port = 22
|
||||
ssh_enable, ssh_user_name, ssh_user_password, ssh_key_name = funct.return_ssh_keys_path(serv)
|
||||
|
||||
if ssh_enable == 0:
|
||||
|
@ -1314,19 +1328,20 @@ if form.getvalue('backup') or form.getvalue('deljob') or form.getvalue('backupup
|
|||
serv = form.getvalue('server')
|
||||
rpath = form.getvalue('rpath')
|
||||
time = form.getvalue('time')
|
||||
type = form.getvalue('type')
|
||||
backup_type = form.getvalue('type')
|
||||
rserver = form.getvalue('rserver')
|
||||
cred = form.getvalue('cred')
|
||||
deljob = form.getvalue('deljob')
|
||||
update = form.getvalue('backupupdate')
|
||||
description = form.getvalue('description')
|
||||
script = "backup.sh"
|
||||
script = 'backup.sh'
|
||||
ssh_port = 22
|
||||
ssh_enable, ssh_user_name, ssh_user_password, ssh_key_name = funct.return_ssh_keys_path('localhost', id=int(cred))
|
||||
|
||||
if deljob:
|
||||
time = ''
|
||||
rpath = ''
|
||||
type = ''
|
||||
backup_type = ''
|
||||
elif update:
|
||||
deljob = ''
|
||||
else:
|
||||
|
@ -1341,46 +1356,42 @@ if form.getvalue('backup') or form.getvalue('deljob') or form.getvalue('backupup
|
|||
|
||||
os.system("cp scripts/%s ." % script)
|
||||
|
||||
commands = ["chmod +x " + script + " && ./" + script + " HOST=" + rserver + " SERVER=" + serv + " TYPE=" + type +
|
||||
" SSH_PORT=" + ssh_port + " TIME=" + time +
|
||||
commands = ["chmod +x " + script + " && ./" + script + " HOST=" + rserver + " SERVER=" + serv +
|
||||
" TYPE=" + backup_type + " SSH_PORT=" + ssh_port + " TIME=" + time +
|
||||
" RPATH=" + rpath + " DELJOB=" + deljob + " USER=" + str(ssh_user_name) + " KEY=" + str(ssh_key_name)]
|
||||
|
||||
output, error = funct.subprocess_execute(commands[0])
|
||||
|
||||
if error:
|
||||
funct.logging('backup', error, haproxywi=1)
|
||||
print('error: ' + error)
|
||||
for l in output:
|
||||
if "Traceback" in l or "FAILED" in l:
|
||||
try:
|
||||
print('error: ' + l)
|
||||
break
|
||||
except Exception:
|
||||
print('error: ' + output)
|
||||
break
|
||||
else:
|
||||
for l in output:
|
||||
if "Traceback" in l or "FAILED" in l:
|
||||
try:
|
||||
print('error: ' + l)
|
||||
break
|
||||
except Exception:
|
||||
print('error: ' + output)
|
||||
break
|
||||
else:
|
||||
if not deljob and not update:
|
||||
if sql.insert_backup_job(serv, rserver, rpath, type, time, cred, description):
|
||||
from jinja2 import Environment, FileSystemLoader
|
||||
if not deljob and not update:
|
||||
if sql.insert_backup_job(serv, rserver, rpath, backup_type, time, cred, description):
|
||||
from jinja2 import Environment, FileSystemLoader
|
||||
|
||||
env = Environment(loader=FileSystemLoader('templates/ajax'), autoescape=True)
|
||||
template = env.get_template('new_backup.html')
|
||||
template = template.render(backups=sql.select_backups(server=serv, rserver=rserver),
|
||||
env = Environment(loader=FileSystemLoader('templates/ajax'), autoescape=True)
|
||||
template = env.get_template('new_backup.html')
|
||||
template = template.render(backups=sql.select_backups(server=serv, rserver=rserver),
|
||||
sshs=sql.select_ssh())
|
||||
print(template)
|
||||
print('success: Backup job has been created')
|
||||
funct.logging('backup ', ' a new backup job for server ' + serv + ' has been created', haproxywi=1, login=1)
|
||||
else:
|
||||
print('error: Cannot add job into DB')
|
||||
elif deljob:
|
||||
sql.delete_backups(deljob)
|
||||
print('Ok')
|
||||
funct.logging('backup ', ' a backup job for server ' + serv + ' has been deleted', haproxywi=1, login=1)
|
||||
elif update:
|
||||
sql.update_backup(serv, rserver, rpath, type, time, cred, description, update)
|
||||
print('Ok')
|
||||
funct.logging('backup ', ' a backup job for server ' + serv + ' has been updated', haproxywi=1, login=1)
|
||||
print(template)
|
||||
print('success: Backup job has been created')
|
||||
funct.logging('backup ', ' a new backup job for server ' + serv + ' has been created', haproxywi=1, login=1)
|
||||
else:
|
||||
print('error: Cannot add job into DB')
|
||||
elif deljob:
|
||||
sql.delete_backups(deljob)
|
||||
print('Ok')
|
||||
funct.logging('backup ', ' a backup job for server ' + serv + ' has been deleted', haproxywi=1, login=1)
|
||||
elif update:
|
||||
sql.update_backup(serv, rserver, rpath, backup_type, time, cred, description, update)
|
||||
print('Ok')
|
||||
funct.logging('backup ', ' a backup job for server ' + serv + ' has been updated', haproxywi=1, login=1)
|
||||
|
||||
if form.getvalue('install_nginx'):
|
||||
funct.install_nginx(form.getvalue('install_nginx'))
|
||||
|
@ -1666,7 +1677,7 @@ if form.getvalue('bwlists_delete'):
|
|||
else:
|
||||
print('success: ' + color + ' list was delete on ' + serv + ' , ')
|
||||
try:
|
||||
funct.logging(serv, 'has deleted ' + color + ' list ' + bwlists_save, haproxywi=1, login=1)
|
||||
funct.logging(serv, 'has deleted ' + color + ' list ' + bwlists_delete, haproxywi=1, login=1)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
|
@ -1734,6 +1745,7 @@ if form.getvalue('newuser') is not None:
|
|||
group = form.getvalue('newgroupuser')
|
||||
role_id = sql.get_role_id_by_name(role)
|
||||
|
||||
|
||||
if funct.check_user_group():
|
||||
if funct.is_admin(level=role_id):
|
||||
if sql.add_user(new_user, email, password, role, activeuser, group):
|
||||
|
@ -1750,14 +1762,17 @@ if form.getvalue('newuser') is not None:
|
|||
print(template)
|
||||
funct.logging('a new user ' + new_user, ' has created ', haproxywi=1, login=1)
|
||||
else:
|
||||
print('error: dalsdm')
|
||||
funct.logging(new_user, ' tried to privilege escalation', haproxywi=1, login=1)
|
||||
else:
|
||||
print('error: dalsdm123')
|
||||
|
||||
if form.getvalue('userdel') is not None:
|
||||
userdel = form.getvalue('userdel')
|
||||
user = sql.select_users(id=userdel)
|
||||
username = ''
|
||||
for u in user:
|
||||
username = u[1]
|
||||
username = u.username
|
||||
if sql.delete_user(userdel):
|
||||
sql.delete_user_groups(userdel)
|
||||
funct.logging(username, ' has deleted user ', haproxywi=1, login=1)
|
||||
|
@ -1767,14 +1782,14 @@ if form.getvalue('updateuser') is not None:
|
|||
email = form.getvalue('email')
|
||||
role = form.getvalue('role')
|
||||
new_user = form.getvalue('updateuser')
|
||||
id = form.getvalue('id')
|
||||
user_id = form.getvalue('id')
|
||||
activeuser = form.getvalue('activeuser')
|
||||
group = form.getvalue('usergroup')
|
||||
role_id = sql.get_role_id_by_name(role)
|
||||
|
||||
if funct.check_user_group():
|
||||
if funct.is_admin(level=role_id):
|
||||
sql.update_user(new_user, email, role, id, activeuser)
|
||||
sql.update_user(new_user, email, role, user_id, activeuser)
|
||||
funct.logging(new_user, ' has updated user ', haproxywi=1, login=1)
|
||||
else:
|
||||
funct.logging(new_user, ' tried to privilege escalation', haproxywi=1, login=1)
|
||||
|
@ -1784,7 +1799,7 @@ if form.getvalue('updatepassowrd') is not None:
|
|||
user_id = form.getvalue('id')
|
||||
user = sql.select_users(id=user_id)
|
||||
for u in user:
|
||||
username = u[1]
|
||||
username = u.username
|
||||
sql.update_user_password(password, user_id)
|
||||
funct.logging('user ' + username, ' has changed password ', haproxywi=1, login=1)
|
||||
print("Ok")
|
||||
|
@ -1826,6 +1841,7 @@ if form.getvalue('newserver') is not None:
|
|||
|
||||
if funct.is_file_exists(ip, haproxy_dir + '/waf/bin/modsecurity'):
|
||||
sql.insert_waf_metrics_enable(ip, "0")
|
||||
sql.insert_waf_rules(ip)
|
||||
|
||||
if funct.is_service_active(ip, 'firewalld'):
|
||||
sql.update_firewall(ip)
|
||||
|
@ -1839,7 +1855,6 @@ if form.getvalue('newserver') is not None:
|
|||
|
||||
template = template.render(groups=sql.select_groups(),
|
||||
servers=sql.select_servers(server=ip),
|
||||
roles=sql.select_roles(),
|
||||
masters=sql.select_servers(get_master_servers=1),
|
||||
sshs=sql.select_ssh(group=group),
|
||||
page=page,
|
||||
|
@ -1890,6 +1905,7 @@ if form.getvalue('serverdel') is not None:
|
|||
if sql.delete_server(serverdel):
|
||||
sql.delete_waf_server(serverdel)
|
||||
sql.delete_port_scanner_settings(serverdel)
|
||||
sql.delete_waf_rules(ip)
|
||||
print("Ok")
|
||||
funct.logging(hostname, ' has been deleted server with ', haproxywi=1, login=1)
|
||||
|
||||
|
@ -1907,16 +1923,16 @@ if form.getvalue('newgroup') is not None:
|
|||
|
||||
output_from_parsed_template = template.render(groups=sql.select_groups(group=newgroup))
|
||||
print(output_from_parsed_template)
|
||||
funct.logging('a new group ' + newgroup, ' created ', haproxywi=1, login=1)
|
||||
funct.logging('a new group ' + newgroup, ' has been created ', haproxywi=1, login=1)
|
||||
|
||||
if form.getvalue('groupdel') is not None:
|
||||
groupdel = form.getvalue('groupdel')
|
||||
group = sql.select_groups(id=groupdel)
|
||||
for g in group:
|
||||
groupname = g[1]
|
||||
groupname = g.name
|
||||
if sql.delete_group(groupdel):
|
||||
print("Ok")
|
||||
funct.logging(groupname, ' has deleted group ', haproxywi=1, login=1)
|
||||
funct.logging(groupname, ' has been deleted group ', haproxywi=1, login=1)
|
||||
|
||||
if form.getvalue('updategroup') is not None:
|
||||
name = form.getvalue('updategroup')
|
||||
|
@ -1960,9 +1976,9 @@ if form.getvalue('sshdel') is not None:
|
|||
sshdel = form.getvalue('sshdel')
|
||||
|
||||
for sshs in sql.select_ssh(id=sshdel):
|
||||
ssh_enable = sshs[2]
|
||||
name = sshs[1]
|
||||
ssh_key_name = fullpath + '/keys/%s.pem' % sshs[1]
|
||||
ssh_enable = sshs.enable
|
||||
name = sshs.name
|
||||
ssh_key_name = fullpath + '/keys/%s.pem' % sshs.name
|
||||
|
||||
if ssh_enable == 1:
|
||||
cmd = 'rm -f %s' % ssh_key_name
|
||||
|
@ -1988,8 +2004,8 @@ if form.getvalue('updatessh'):
|
|||
fullpath = funct.get_config_var('main', 'fullpath')
|
||||
|
||||
for sshs in sql.select_ssh(id=ssh_id):
|
||||
ssh_enable = sshs[2]
|
||||
ssh_key_name = fullpath + '/keys/%s.pem' % sshs[1]
|
||||
ssh_enable = sshs.enable
|
||||
ssh_key_name = fullpath + '/keys/%s.pem' % sshs.name
|
||||
new_ssh_key_name = fullpath + '/keys/%s.pem' % name
|
||||
|
||||
if ssh_enable == 1:
|
||||
|
@ -2062,7 +2078,7 @@ if form.getvalue('newtelegram'):
|
|||
output_from_parsed_template = template.render(groups=sql.select_groups(),
|
||||
telegrams=sql.select_telegram(token=token), page=page)
|
||||
print(output_from_parsed_template)
|
||||
funct.logging(channel, ' has created a new Telegram channel ', haproxywi=1, login=1)
|
||||
funct.logging(channel, ' a new Telegram channel has been created ', haproxywi=1, login=1)
|
||||
|
||||
if form.getvalue('newslack'):
|
||||
token = form.getvalue('newslack')
|
||||
|
@ -2088,7 +2104,7 @@ if form.getvalue('telegramdel') is not None:
|
|||
telegramdel = form.getvalue('telegramdel')
|
||||
telegram = sql.select_telegram(id=telegramdel)
|
||||
for t in telegram:
|
||||
telegram_name = t[1]
|
||||
telegram_name = t.token
|
||||
if sql.delete_telegram(telegramdel):
|
||||
print("Ok")
|
||||
funct.logging(telegram_name, ' has deleted the Telegram channel ', haproxywi=1, login=1)
|
||||
|
@ -2132,16 +2148,16 @@ if form.getvalue('updatesettings') is not None:
|
|||
print("Ok")
|
||||
|
||||
if form.getvalue('getusergroups'):
|
||||
group_id = form.getvalue('getusergroups')
|
||||
user_id = form.getvalue('getusergroups')
|
||||
groups = []
|
||||
u_g = sql.select_user_groups(id=group_id)
|
||||
u_g = sql.select_user_groups(user_id)
|
||||
for g in u_g:
|
||||
groups.append(g[0])
|
||||
groups.append(g.user_group_id)
|
||||
from jinja2 import Environment, FileSystemLoader
|
||||
|
||||
env = Environment(loader=FileSystemLoader('templates/ajax'), autoescape=True)
|
||||
template = env.get_template('/show_user_groups.html')
|
||||
template = template.render(groups=sql.select_groups(), user_groups=groups, id=group_id)
|
||||
template = template.render(groups=sql.select_groups(), user_groups=groups, id=user_id)
|
||||
print(template)
|
||||
|
||||
if form.getvalue('changeUserGroupId') is not None:
|
||||
|
@ -2152,7 +2168,7 @@ if form.getvalue('changeUserGroupId') is not None:
|
|||
for group in groups:
|
||||
if group[0] == ',':
|
||||
continue
|
||||
sql.update_user_groups(groups=group[0], id=group_id)
|
||||
sql.update_user_groups(groups=group[0], user_group_id=group_id)
|
||||
|
||||
funct.logging('localhost', ' has upgraded groups for user: ' + user, haproxywi=1, login=1)
|
||||
|
||||
|
@ -2172,7 +2188,7 @@ if form.getvalue('getcurrentusergroup') is not None:
|
|||
user_id = cookie.get('uuid')
|
||||
group = cookie.get('group')
|
||||
group_id = sql.get_user_id_by_uuid(user_id.value)
|
||||
groups = sql.select_user_groups_with_names(id=group_id)
|
||||
groups = sql.select_user_groups_with_names(group_id)
|
||||
|
||||
from jinja2 import Environment, FileSystemLoader
|
||||
|
||||
|
@ -2265,6 +2281,7 @@ if form.getvalue('updateSmonIp') is not None:
|
|||
print('SMON error: Cannot be HTTP with 443 port')
|
||||
sys.exit()
|
||||
|
||||
|
||||
if sql.update_smon(smon_id, ip, port, body, telegram, group, desc, en):
|
||||
print("Ok")
|
||||
funct.logging('SMON', ' Has been update the server ' + ip + ' to SMON ', haproxywi=1, login=1)
|
||||
|
@ -2335,8 +2352,8 @@ if form.getvalue('waf_rule_id'):
|
|||
rule_id = form.getvalue('waf_rule_id')
|
||||
haproxy_path = sql.get_setting('haproxy_dir')
|
||||
rule_file = sql.select_waf_rule_by_id(rule_id)
|
||||
conf_file_path = haproxy_path + 'waf/modsecurity.conf'
|
||||
rule_file_path = 'Include ' + haproxy_path + '/waf/rules/' + rule_file
|
||||
conf_file_path = haproxy_path + '/waf/modsecurity.conf'
|
||||
rule_file_path = 'Include ' + haproxy_path + '//waf/rules/' + rule_file
|
||||
|
||||
if enable == '0':
|
||||
cmd = ["sudo sed -i 's!" + rule_file_path + "!#" + rule_file_path + "!' " + conf_file_path]
|
||||
|
@ -3438,3 +3455,97 @@ if form.getvalue('check_slack'):
|
|||
slack_id = form.getvalue('check_slack')
|
||||
mess = 'Test message from Roxy-WI'
|
||||
funct.slack_send_mess(mess, slack_channel_id=slack_id)
|
||||
|
||||
if form.getvalue('getoption'):
|
||||
group = form.getvalue('getoption')
|
||||
term = form.getvalue('term')
|
||||
options = sql.select_options(group=group, term=term)
|
||||
|
||||
a = {}
|
||||
v = 0
|
||||
|
||||
for i in options:
|
||||
a[v] = i.options
|
||||
v = v + 1
|
||||
import json
|
||||
print(json.dumps(a))
|
||||
|
||||
|
||||
if form.getvalue('newtoption'):
|
||||
option = form.getvalue('newtoption')
|
||||
group = form.getvalue('newoptiongroup')
|
||||
if option is None or group is None:
|
||||
print(error_mess)
|
||||
else:
|
||||
if sql.insert_new_option(option, group):
|
||||
from jinja2 import Environment, FileSystemLoader
|
||||
|
||||
env = Environment(loader=FileSystemLoader('templates/ajax'), autoescape=True)
|
||||
template = env.get_template('/new_option.html')
|
||||
|
||||
template = template.render(options=sql.select_options(option=option))
|
||||
print(template)
|
||||
|
||||
|
||||
if form.getvalue('updateoption') is not None:
|
||||
option = form.getvalue('updateoption')
|
||||
option_id = form.getvalue('id')
|
||||
if option is None or option_id is None:
|
||||
print(error_mess)
|
||||
else:
|
||||
sql.update_options(option, option_id)
|
||||
|
||||
|
||||
if form.getvalue('optiondel') is not None:
|
||||
if sql.delete_option(form.getvalue('optiondel')):
|
||||
print("Ok")
|
||||
|
||||
|
||||
if form.getvalue('getsavedserver'):
|
||||
group = form.getvalue('getsavedserver')
|
||||
term = form.getvalue('term')
|
||||
servers = sql.select_saved_servers(group=group, term=term)
|
||||
|
||||
a = {}
|
||||
v = 0
|
||||
for i in servers:
|
||||
a[v] = {}
|
||||
a[v]['value'] = {}
|
||||
a[v]['desc'] = {}
|
||||
a[v]['value'] = i.server
|
||||
a[v]['desc'] = i.description
|
||||
v = v + 1
|
||||
import json
|
||||
print(json.dumps(a))
|
||||
|
||||
|
||||
if form.getvalue('newsavedserver'):
|
||||
savedserver = form.getvalue('newsavedserver')
|
||||
description = form.getvalue('newsavedserverdesc')
|
||||
group = form.getvalue('newsavedservergroup')
|
||||
if savedserver is None or group is None:
|
||||
print(error_mess)
|
||||
else:
|
||||
if sql.insert_new_savedserver(savedserver, description, group):
|
||||
from jinja2 import Environment, FileSystemLoader
|
||||
|
||||
env = Environment(loader=FileSystemLoader('templates/ajax'), autoescape=True)
|
||||
template = env.get_template('/new_saved_servers.html')
|
||||
|
||||
template = template.render(server=sql.select_saved_servers(server=savedserver))
|
||||
print(template)
|
||||
|
||||
|
||||
if form.getvalue('updatesavedserver') is not None:
|
||||
savedserver = form.getvalue('updatesavedserver')
|
||||
description = form.getvalue('description')
|
||||
savedserver_id = form.getvalue('id')
|
||||
if savedserver is None or savedserver_id is None:
|
||||
print(error_mess)
|
||||
else:
|
||||
sql.update_savedserver(savedserver, description, savedserver_id)
|
||||
|
||||
|
||||
if form.getvalue('savedserverdel') is not None:
|
||||
if sql.delete_savedserver(form.getvalue('savedserverdel')):
|
||||
print("Ok")
|
||||
|
|
|
@ -10,10 +10,7 @@ template = env.get_template('ovw.html')
|
|||
|
||||
print('Content-type: text/html\n')
|
||||
|
||||
if create_db.check_db():
|
||||
if create_db.create_table():
|
||||
create_db.update_all()
|
||||
create_db.update_all_silent()
|
||||
# create_db.update_all_silent()
|
||||
funct.check_login()
|
||||
|
||||
try:
|
||||
|
@ -104,6 +101,7 @@ except Exception as e:
|
|||
is_checker_worker = ''
|
||||
is_metrics_worker = ''
|
||||
token = ''
|
||||
print(str(e))
|
||||
|
||||
|
||||
template = template.render(h2=1,
|
||||
|
@ -124,7 +122,7 @@ template = template.render(h2=1,
|
|||
port_scanner=''.join(port_scanner),
|
||||
grafana=''.join(grafana),
|
||||
prometheus=''.join(prometheus),
|
||||
haproxy_wi_log_id=funct.haproxy_wi_log(log_id=1, file="haproxy-wi-", with_date=1),
|
||||
haproxy_wi_log_id=funct.haproxy_wi_log(log_id=1, file="roxy-wi-", with_date=1),
|
||||
metrics_log_id=funct.haproxy_wi_log(log_id=1, file="metrics-", with_date=1),
|
||||
checker_log_id=funct.haproxy_wi_log(log_id=1, file="checker-", with_date=1),
|
||||
keep_alive_log_id=funct.haproxy_wi_log(log_id=1, file="keep_alive"),
|
||||
|
|
3294
app/sql.py
3294
app/sql.py
File diff suppressed because it is too large
Load Diff
|
@ -761,15 +761,15 @@
|
|||
</tr>
|
||||
{% for option in options %}
|
||||
<tr id="option-{{ option.0 }}" class="{{ loop.cycle('odd', 'even') }}">
|
||||
{% if option.2 == group or group == '1' %}
|
||||
{% if option.groups == group or group == '1' %}
|
||||
<td class="padding10 first-collumn">
|
||||
{{ option.0 }}
|
||||
{{ option.id }}
|
||||
</td>
|
||||
<td class="padding10 first-collumn" style="width: 77%;">
|
||||
<input type="text" id="option-body-{{ option.0 }}" value="{{ option.1 }}" size="60" class="form-control">
|
||||
<input type="text" id="option-body-{{ option.id }}" value="{{ option.options }}" size="60" class="form-control">
|
||||
</td>
|
||||
<td>
|
||||
<a class="delete" onclick="confirmDeleteOption({{ option.0 }})" title="Delete option {{option.1}}" style="cursor: pointer;"></a>
|
||||
<a class="delete" onclick="confirmDeleteOption({{ option.id }})" title="Delete option {{option.options}}" style="cursor: pointer;"></a>
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
|
@ -815,16 +815,16 @@
|
|||
<td></td>
|
||||
</tr>
|
||||
{% for s in saved_servers %}
|
||||
<tr id="servers-saved-{{ s.0 }}" class="{{ loop.cycle('odd', 'even') }}">
|
||||
{% if s.3 == group or group == '1' %}
|
||||
<tr id="servers-saved-{{ s.id }}" class="{{ loop.cycle('odd', 'even') }}">
|
||||
{% if s.groups == group or group == '1' %}
|
||||
<td class="padding10 first-collumn">
|
||||
<input type="text" id="servers-ip-{{ s.0 }}" value="{{ s.1 }}" size="15" class="form-control">
|
||||
<input type="text" id="servers-ip-{{ s.id }}" value="{{ s.server }}" size="15" class="form-control">
|
||||
</td>
|
||||
<td class="padding10 first-collumn" style="width: 77%;">
|
||||
<input type="text" id="servers-desc-{{ s.0 }}" value="{{ s.2 }}" size="50" class="form-control">
|
||||
<input type="text" id="servers-desc-{{ s.id }}" value="{{ s.description }}" size="50" class="form-control">
|
||||
</td>
|
||||
<td>
|
||||
<a class="delete" onclick="confirmDeleteSavedServer({{ s.0 }})" title="Delete server {{s.1}}" style="cursor: pointer;"></a>
|
||||
<a class="delete" onclick="confirmDeleteSavedServer({{ s.id }})" title="Delete server {{s.server}}" style="cursor: pointer;"></a>
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
|
@ -846,7 +846,7 @@
|
|||
{{ input('new-saved-servers-description', size='50') }}
|
||||
</td>
|
||||
<td>
|
||||
<button class="add-admin" id="add-saved-server-new" title="Add new server" style="cursor: pointer;"></button>
|
||||
<span class="add-admin" id="add-saved-server-new" title="Add new server" style="cursor: pointer;"></span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
|
@ -35,26 +35,26 @@
|
|||
</tr>
|
||||
<tbody>
|
||||
{% for group in groups %}
|
||||
<tr id="group-{{ group.0 }}" class="{{ loop.cycle('odd', 'even') }}">
|
||||
{% if group.1 == "All" %}
|
||||
<td class="padding10 first-collumn">{{ group.1 }}</td>
|
||||
<td>{{ group.2 }}</td>
|
||||
<tr id="group-{{ group.group_id }}" class="{{ loop.cycle('odd', 'even') }}">
|
||||
{% if group.name == "All" %}
|
||||
<td class="padding10 first-collumn">{{ group.name }}</td>
|
||||
<td>{{ group.description }}</td>
|
||||
<td></td>
|
||||
{% else %}
|
||||
<td class="padding10 first-collumn">
|
||||
{% set id = 'name-' + group.0|string() %}
|
||||
{{ input(id, value=group.1) }}
|
||||
{{ input(id, value=group.name) }}
|
||||
</td>
|
||||
<td>
|
||||
{% set id = 'descript-' + group.0|string() %}
|
||||
{% if group.2 != "None" %}
|
||||
{{ input(id, value=group.2, size='60') }}
|
||||
{% set id = 'descript-' + group.group_id|string() %}
|
||||
{% if group.description is not none %}
|
||||
{{ input(id, value=group.description, size='60') }}
|
||||
{% else %}
|
||||
{{ input(id, value='', size='60') }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<a class="delete" onclick="confirmDeleteGroup({{ group.0 }})" title="Delete group {{group.1}}" style="cursor: pointer;"></a>
|
||||
<a class="delete" onclick="confirmDeleteGroup({{ group.group_id }})" title="Delete group {{group.name}}" style="cursor: pointer;"></a>
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
|
@ -149,7 +149,7 @@
|
|||
<script>
|
||||
$( function() {
|
||||
{% for user in users %}
|
||||
$("#role-{{user.0}}" ).selectmenu({
|
||||
$("#role-{{user.role_id}}" ).selectmenu({
|
||||
width: 100
|
||||
});
|
||||
{% endfor %}
|
||||
|
@ -172,13 +172,13 @@
|
|||
}
|
||||
{% endfor %}
|
||||
{% for server in backups %}
|
||||
$("#backup-time-{{ server.0}}" ).selectmenu({
|
||||
$("#backup-time-{{ server.id}}" ).selectmenu({
|
||||
width: 100
|
||||
});
|
||||
$("#backup-type-{{server.0}}" ).selectmenu({
|
||||
$("#backup-type-{{server.id}}" ).selectmenu({
|
||||
width: 130
|
||||
});
|
||||
$("#backup-credentials-{{server.0}}" ).selectmenu({
|
||||
$("#backup-credentials-{{server.id}}" ).selectmenu({
|
||||
width: 150
|
||||
});
|
||||
{% endfor %}
|
||||
|
|
|
@ -31,5 +31,6 @@
|
|||
<td>
|
||||
{{ s.2 }}
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
{% endfor %}
|
|
@ -17,37 +17,37 @@
|
|||
<td><span onclick="loadchecker()" class="service-reload" title="Reload Telegram channels"></span></td>
|
||||
</tr>
|
||||
{% for telegram in telegrams %}
|
||||
<tr id="telegram-table-{{telegram.0}}" class="{{ loop.cycle('odd', 'even') }}">
|
||||
<tr id="telegram-table-{{telegram.id}}" class="{{ loop.cycle('odd', 'even') }}">
|
||||
<td class="padding10 first-collumn">
|
||||
{% set id = 'telegram-token-' + telegram.0|string() %}
|
||||
{{ input(id, value=telegram.1, size='30') }}
|
||||
{% set id = 'telegram-token-' + telegram.id|string() %}
|
||||
{{ input(id, value=telegram.token, size='30') }}
|
||||
</td>
|
||||
<td>
|
||||
{% set id = 'telegram-chanel-' + telegram.0|string() %}
|
||||
{{ input(id, value=telegram.2, size='30') }}
|
||||
{% set id = 'telegram-chanel-' + telegram.id|string() %}
|
||||
{{ input(id, value=telegram.chanel_name, size='30') }}
|
||||
</td>
|
||||
{% if page != "servers.py" %}
|
||||
<td>
|
||||
<select id="telegramgroup-{{telegram.0}}" name="telegramgroup-{{telegram.0}}">
|
||||
<select id="telegramgroup-{{telegram.id}}" name="telegramgroup-{{telegram.id}}">
|
||||
<option disabled selected>Choose group</option>
|
||||
{% for group in groups %}
|
||||
{% if telegram.3|string() == group.0|string() %}
|
||||
<option value="{{ group.0 }}" selected>{{ group.1 }}</option>
|
||||
{% if telegram.groups|string() == group.group_id|string() %}
|
||||
<option value="{{ group.group_id }}" selected>{{ group.name }}</option>
|
||||
{% else %}
|
||||
<option value="{{ group.0 }}">{{ group.1 }}</option>
|
||||
<option value="{{ group.group_id }}">{{ group.name }}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
{% endif %}
|
||||
<td>
|
||||
<button title="Send test message" onclick="checkTelegram({{telegram.0}})">Test</button>
|
||||
<button title="Send test message" onclick="checkTelegram({{telegram.id}})">Test</button>
|
||||
</td>
|
||||
<td>
|
||||
<a class="add" onclick="cloneTelegram({{telegram.0}})" id="clone-{{telegram.0}}" title="Clone {{telegram.2}}" style="cursor: pointer;"></a>
|
||||
<a class="add" onclick="cloneTelegram({{telegram.id}})" id="clone-{{telegram.id}}" title="Clone {{telegram.chanel_name}}" style="cursor: pointer;"></a>
|
||||
</td>
|
||||
<td>
|
||||
<a class="delete" onclick="confirmDeleteTelegram({{telegram.0}})" title="Delete channel {{telegram.2}}" style="cursor: pointer;"></a>
|
||||
<a class="delete" onclick="confirmDeleteTelegram({{telegram.id}})" title="Delete channel {{telegram.chanel_name}}" style="cursor: pointer;"></a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
@ -69,37 +69,37 @@
|
|||
<td><span onclick="loadchecker()" class="service-reload" title="Reload Slack channels"></span></td>
|
||||
</tr>
|
||||
{% for slack in slacks %}
|
||||
<tr id="slack-table-{{slack.0}}" class="{{ loop.cycle('odd', 'even') }}">
|
||||
<tr id="slack-table-{{slack.id}}" class="{{ loop.cycle('odd', 'even') }}">
|
||||
<td class="padding10 first-collumn">
|
||||
{% set id = 'slack-token-' + slack.0|string() %}
|
||||
{{ input(id, value=slack.1, size='30') }}
|
||||
{% set id = 'slack-token-' + slack.id|string() %}
|
||||
{{ input(id, value=slack.token, size='30') }}
|
||||
</td>
|
||||
<td>
|
||||
{% set id = 'slack-chanel-' + slack.0|string() %}
|
||||
{{ input(id, value=slack.2, size='30') }}
|
||||
{% set id = 'slack-chanel-' + slack.id|string() %}
|
||||
{{ input(id, value=slack.chanel_name, size='30') }}
|
||||
</td>
|
||||
{% if page != "servers.py" %}
|
||||
<td>
|
||||
<select id="slackgroup-{{slack.0}}" name="slackgroup-{{slack.0}}">
|
||||
<select id="slackgroup-{{slack.id}}" name="slackgroup-{{slack.id}}">
|
||||
<option disabled selected>Choose group</option>
|
||||
{% for group in groups %}
|
||||
{% if slack.3|string() == group.0|string() %}
|
||||
<option value="{{ group.0 }}" selected>{{ group.1 }}</option>
|
||||
{% if slack.groups|string() == group.group_id|string() %}
|
||||
<option value="{{ group.group_id }}" selected>{{ group.name }}</option>
|
||||
{% else %}
|
||||
<option value="{{ group.0 }}">{{ group.1 }}</option>
|
||||
<option value="{{ group.group_id }}">{{ group.name }}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
{% endif %}
|
||||
<td>
|
||||
<button title="Send test message" onclick="checkSlack({{slack.0}})">Test</button>
|
||||
<button title="Send test message" onclick="checkSlack({{slack.id}})">Test</button>
|
||||
</td>
|
||||
<td>
|
||||
<a class="add" onclick="cloneSlack({{slack.0}})" id="clone-{{slack.0}}" title="Clone {{slack.2}}" style="cursor: pointer;"></a>
|
||||
<a class="add" onclick="cloneSlack({{slack.id}})" id="clone-{{slack.id}}" title="Clone {{slack.chanel_name}}" style="cursor: pointer;"></a>
|
||||
</td>
|
||||
<td>
|
||||
<a class="delete" onclick="confirmDeleteSlack({{slack.0}})" title="Delete channel {{slack.2}}" style="cursor: pointer;"></a>
|
||||
<a class="delete" onclick="confirmDeleteSlack({{slack.id}})" title="Delete channel {{slack.chanel_name}}" style="cursor: pointer;"></a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
{% set new_ver = versions.1 %}
|
||||
{% set current_ver_without_dots = versions.2 %}
|
||||
{% set new_ver_without_dots = versions.3 %}
|
||||
<tr>
|
||||
<tr class="odd">
|
||||
<td class="padding10 first-collumn">
|
||||
Roxy-WI
|
||||
</td>
|
||||
|
@ -30,10 +30,11 @@
|
|||
<td>
|
||||
The main application
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
{% for s in services %}
|
||||
{% if s.0 == 'roxy-wi-smon' or s.0 == 'roxy-wi-checker' or s.0 == 'roxy-wi-keep_alive' or s.0 == 'roxy-wi-metrics' or s.0 == 'roxy-wi-portscanner' %}
|
||||
<tr>
|
||||
<tr class="{{ loop.cycle('even', 'odd') }}">
|
||||
{% set is_need_update = 0 %}
|
||||
{% if s.0 == 'roxy-wi-smon' %}
|
||||
{% set service_name = 'SMON' %}
|
||||
|
@ -117,6 +118,7 @@
|
|||
<td>
|
||||
Read more about <a href="{{desc_link}}" title="Read more about {{service_name}}" target="_blank" class="link">{{service_name}}</a>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% endfor %}
|
|
@ -1,19 +1,19 @@
|
|||
{% for b in backups %}
|
||||
<tr class="newbackup" id="backup-table-{{b.0}}">
|
||||
<tr class="newbackup" id="backup-table-{{b.id}}">
|
||||
<td class="padding10 first-collumn">
|
||||
<span id="backup-server-{{b.0}}">{{ b.1 }}</span>
|
||||
<span id="backup-server-{{b.id}}">{{ b.server }}</span>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="backup-rserver-{{b.0}}" value="{{b.2}}" size="14" class="form-control">
|
||||
<input type="text" id="backup-rserver-{{b.id}}" value="{{b.rhost}}" size="14" class="form-control">
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="backup-rpath-{{b.0}}" value="{{b.3}}" class="form-control">
|
||||
<input type="text" id="backup-rpath-{{b.id}}" value="{{b.rpath}}" class="form-control">
|
||||
</td>
|
||||
<td>
|
||||
{% set values = {'backup':'backup','synchronization':'synchronization'} %}
|
||||
<select name="backup-type-{{b.0}}" id="backup-type-{{b.0}}" class="force_close">
|
||||
<select name="backup-type-{{b.id}}" id="backup-type-{{b.id}}" class="force_close">
|
||||
{% for v, des in values|dictsort(false, 'value') %}
|
||||
{% if v == b.4 %}
|
||||
{% if v == b.backup_type %}
|
||||
<option value="{{v}}" selected>{{des}}</option>
|
||||
{% else %}
|
||||
<option value="{{v}}">{{des}}</option>
|
||||
|
@ -23,9 +23,9 @@
|
|||
</td>
|
||||
<td>
|
||||
{% set values = {'hourly':'hourly','daily':'daily','weekly':'weekly', 'monthly':'monthly'} %}
|
||||
<select name="backup-time-{{b.0}}" id="backup-time-{{b.0}}" class="force_close">
|
||||
<select name="backup-time-{{b.id}}" id="backup-time-{{b.id}}" class="force_close">
|
||||
{% for v, des in values|dictsort(false, 'value') %}
|
||||
{% if v == b.5 %}
|
||||
{% if v == b.time %}
|
||||
<option value="{{v}}" selected>{{des}}</option>
|
||||
{% else %}
|
||||
<option value="{{v}}">{{des}}</option>
|
||||
|
@ -34,42 +34,42 @@
|
|||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<select id="backup-credentials-{{b.0}}" required>
|
||||
<select id="backup-credentials-{{b.id}}" required>
|
||||
<option disabled selected>Choose credentials</option>
|
||||
{% for ssh in sshs %}
|
||||
{% if ssh.2 == 1 %}
|
||||
{% if ssh.0 == b.6 %}
|
||||
<option value="{{ssh.0}}" selected="selected">{{ssh.1}}</option>
|
||||
{% if ssh.enable == 1 %}
|
||||
{% if ssh.id == b.cred %}
|
||||
<option value="{{ssh.id}}" selected="selected">{{ssh.name}}</option>
|
||||
{% else %}
|
||||
<option value="{{ssh.0}}">{{ssh.1}}</option>
|
||||
<option value="{{ssh.id}}">{{ssh.name}}</option>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
{% if b.7 != 'None' %}
|
||||
<input type="text" id="backup-description-{{b.0}}" value="{{b.7}}" class="form-control">
|
||||
{% if b.description != 'None' %}
|
||||
<input type="text" id="backup-description-{{b.id}}" value="{{b.description}}" class="form-control">
|
||||
{% else %}
|
||||
<input type="text" id="backup-description-{{b.0}}" class="form-control">
|
||||
<input type="text" id="backup-description-{{b.id}}" class="form-control">
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<a class="add" onclick="cloneBackup({{b.0}})" id="clone-backup{{b.0}}" title="Clone {{b.1}}" style="cursor: pointer;"></a>
|
||||
<a class="add" onclick="cloneBackup({{b.id}})" id="clone-backup{{b.id}}" title="Clone {{b.server}}" style="cursor: pointer;"></a>
|
||||
</td>
|
||||
<td>
|
||||
<a class="delete" onclick="confirmDeleteBackup({{b.0}})" title="Delete backup {{b.1}}" style="cursor: pointer;"></a>
|
||||
<a class="delete" onclick="confirmDeleteBackup({{b.id}})" title="Delete backup {{b.server}}" style="cursor: pointer;"></a>
|
||||
</td>
|
||||
</tr>
|
||||
<script>
|
||||
$( function() {
|
||||
$("#backup-time-{{ b.0}}" ).selectmenu({
|
||||
$("#backup-time-{{ b.id}}" ).selectmenu({
|
||||
width: 100
|
||||
});
|
||||
$("#backup-type-{{b.0}}" ).selectmenu({
|
||||
$("#backup-type-{{b.id}}" ).selectmenu({
|
||||
width: 130
|
||||
});
|
||||
$("#backup-credentials-{{b.0}}" ).selectmenu({
|
||||
$("#backup-credentials-{{b.id}}" ).selectmenu({
|
||||
width: 150
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
{% for group in groups %}
|
||||
<tr id="group-{{ group.0 }}" class="newgroup">
|
||||
<tr id="group-{{ group.group_id }}" class="newgroup">
|
||||
<td class="padding10 first-collumn">
|
||||
<input type="text" id="name-{{ group.0 }}" value="{{ group.1 }}" class="form-control">
|
||||
<input type="text" id="name-{{ group.group_id }}" value="{{ group.name }}" class="form-control">
|
||||
</td>
|
||||
<td style="width: 100%;">
|
||||
{% if group.2 != 'None' %}
|
||||
<input type="text" id="descript-{{ group.0 }}" value="{{ group.2 }}" class="form-control" size="60">
|
||||
{% if group.description is not none %}
|
||||
<input type="text" id="descript-{{ group.group_id }}" value="{{ group.description }}" class="form-control" size="60">
|
||||
{% else %}
|
||||
<input type="text" id="descript-{{ group.0 }}" class="form-control" size="60">
|
||||
<input type="text" id="descript-{{ group.group_id }}" class="form-control" size="60">
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<a class="delete" onclick="confirmDeleteGroup({{ group.0 }})" style="cursor: pointer;"></a>
|
||||
<a class="delete" onclick="confirmDeleteGroup({{ group.group_id }})" style="cursor: pointer;"></a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
|
@ -1,13 +1,13 @@
|
|||
{% for option in options %}
|
||||
<tr style="width: 50%;" id="option-{{option.0}}" class="newoption update">
|
||||
<tr style="width: 50%;" id="option-{{option.id}}" class="newoption update">
|
||||
<td class="padding10 first-collumn">
|
||||
{{ option.0 }}
|
||||
{{ option.id }}
|
||||
</td>
|
||||
<td class="first-collumn" style="width: 77%;">
|
||||
<input type="text" id="option-body-{{option.0}}" class="form-control" value="{{option.1}}" size="60">
|
||||
<input type="text" id="option-body-{{option.id}}" class="form-control" value="{{option.options}}" size="60">
|
||||
</td>
|
||||
<td>
|
||||
<a class="delete" onclick="confirmDeleteOption({{option.0}})" style="cursor: pointer;"></a>
|
||||
<a class="delete" onclick="confirmDeleteOption({{option.id}})" style="cursor: pointer;"></a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
|
@ -1,13 +1,13 @@
|
|||
{% for s in server %}
|
||||
<tr style="width: 50%;" id="servers-saved-{{s.0}}" class="newsavedserver update">
|
||||
<tr style="width: 50%;" id="servers-saved-{{s.id}}" class="newsavedserver update">
|
||||
<td class="padding10 first-collumn">
|
||||
<input type="text" id="servers-ip-{{s.0}}" class="form-control" value="{{s.1}}" size="15">
|
||||
<input type="text" id="servers-ip-{{s.id}}" class="form-control" value="{{s.server}}" size="15">
|
||||
</td>
|
||||
<td class="first-collumn" style="width: 77%;">
|
||||
<input type="text" id="servers-desc-{{s.0}}" class="form-control" value="{{s.2}}" size="50">
|
||||
<input type="text" id="servers-desc-{{s.id}}" class="form-control" value="{{s.description}}" size="50">
|
||||
</td>
|
||||
<td>
|
||||
<a class="delete" onclick="confirmDeleteSavedServer({{s.0}})" style="cursor: pointer;"></a>
|
||||
<a class="delete" onclick="confirmDeleteSavedServer({{s.id}})" style="cursor: pointer;"></a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
|
@ -1,33 +1,33 @@
|
|||
{% for slack in slacks %}
|
||||
<tr style="width: 50%;" id="slack-table-{{slack.0}}" class="newgroup">
|
||||
<tr style="width: 50%;" id="slack-table-{{slack.id}}" class="newgroup">
|
||||
<td class="padding10 first-collumn">
|
||||
<input type="text" id="slack-token-{{slack.0}}" class="form-control" value="{{slack.1}}">
|
||||
<input type="hidden" id="slackgroup-{{slack.0}}" name="slackgroup-{{slack.0}}">
|
||||
<input type="text" id="slack-token-{{slack.id}}" class="form-control" value="{{slack.token}}" size="30">
|
||||
<input type="hidden" id="slackgroup-{{slack.id}}" name="slackgroup-{{slack.id}}">
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="slack-chanel-{{slack.0}}" class="form-control" value="{{slack.2}}">
|
||||
<input type="text" id="slack-chanel-{{slack.id}}" class="form-control" value="{{slack.chanel_name}}" size="30">
|
||||
</td>
|
||||
{% if page != "servers.py" %}
|
||||
<td>
|
||||
<select id="slackgroup-{{slack.0}}" name="slackgroup-{{slack.0}}">
|
||||
<select id="slackgroup-{{slack.id}}" name="slackgroup-{{slack.id}}">
|
||||
{% for group in groups %}
|
||||
{% if slack.3 == group.0 %}
|
||||
<option value="{{ group.0 }}" selected>{{ group.1 }}</option>
|
||||
{% if slack.groups == group.group_id %}
|
||||
<option value="{{ group.group_id }}" selected>{{ group.name }}</option>
|
||||
{% else %}
|
||||
<option value="{{ group.0 }}">{{ group.1 }}</option>
|
||||
<option value="{{ group.group_id }}">{{ group.name }}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
{% endif %}
|
||||
<td>
|
||||
<button title="Send test message" onclick="checkSlack({{slack.0}})">Test</button>
|
||||
<button title="Send test message" onclick="checkSlack({{slack.id}})">Test</button>
|
||||
</td>
|
||||
<td>
|
||||
<a class="add" onclick="cloneSlack({{slack.0}})" id="clone-{{slack.0}}" title="Clone {{slack.2}}" style="cursor: pointer;"></a>
|
||||
<a class="add" onclick="cloneSlack({{slack.id}})" id="clone-{{slack.id}}" title="Clone {{slack.chanel_name}}" style="cursor: pointer;"></a>
|
||||
</td>
|
||||
<td>
|
||||
<a class="delete" onclick="confirmDeleteSlack({{slack.0}})" style="cursor: pointer;"></a>
|
||||
<a class="delete" onclick="confirmDeleteSlack({{slack.id}})" style="cursor: pointer;"></a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
|
@ -1,23 +1,23 @@
|
|||
{% for ssh in sshs %}
|
||||
<tr style="width: 50%;" id="ssh-table-{{ssh.0}}" class="ssh-table-{{ssh.0}}">
|
||||
<tr style="width: 50%;" id="ssh-table-{{ssh.id}}" class="ssh-table-{{ssh.id}}">
|
||||
<td class="first-collumn">
|
||||
<input type="text" id="ssh_name-{{ssh.0}}" class="form-control" value="{{ssh.1}}" style="margin-bottom: 23px;">
|
||||
<input type="text" id="ssh_name-{{ssh.id}}" class="form-control" value="{{ssh.name}}" style="margin-bottom: 23px;">
|
||||
</td>
|
||||
<td class="first-collumn" valign="top" style="padding-top: 15px;">
|
||||
{% if ssh.2 == 1 %}
|
||||
<label for="ssh_enable-{{ssh.0}}">Enable SSH key</label><input type="checkbox" id="ssh_enable-{{ssh.0}}" checked>
|
||||
{% if ssh.enable == 1 %}
|
||||
<label for="ssh_enable-{{ssh.id}}">Enable SSH key</label><input type="checkbox" id="ssh_enable-{{ssh.id}}" checked>
|
||||
{% else %}
|
||||
<label for="ssh_enable-{{ssh.0}}">Enable SSH key</label><input type="checkbox" id="ssh_enable-{{ssh.0}}">
|
||||
<label for="ssh_enable-{{ssh.id}}">Enable SSH key</label><input type="checkbox" id="ssh_enable-{{ssh.id}}">
|
||||
{% endif %}
|
||||
</td>
|
||||
{% if page != "servers.py" %}
|
||||
<td>
|
||||
<select id="sshgroup-{{ssh.0}}" name="sshgroup-{{ssh.0}}">
|
||||
<select id="sshgroup-{{ssh.id}}" name="sshgroup-{{ssh.id}}">
|
||||
{% for group in groups %}
|
||||
{% if ssh.5 == group.0 %}
|
||||
<option value="{{ group.0 }}" selected>{{ group.1 }}</option>
|
||||
{% if ssh.5 == group.group_id %}
|
||||
<option value="{{ group.group_id }}" selected>{{ group.name }}</option>
|
||||
{% else %}
|
||||
<option value="{{ group.0 }}">{{ group.1 }}</option>
|
||||
<option value="{{ group.group_id }}">{{ group.name }}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
@ -25,17 +25,17 @@
|
|||
{% endif %}
|
||||
<td style="padding-top: 15px;">
|
||||
<p>
|
||||
<input type="text" id="ssh_user-{{ssh.0}}" class="form-control" value="{{ssh.3}}">
|
||||
<input type="text" id="ssh_user-{{ssh.id}}" class="form-control" value="{{ssh.username}}">
|
||||
</p>
|
||||
{% if ssh.2 == 1 %}
|
||||
<input type="password" id="ssh_pass-{{ssh.0}}" class="form-control" value="{{ssh.4}}" style="display: none;">
|
||||
{% if ssh.enable == 1 %}
|
||||
<input type="password" id="ssh_pass-{{ssh.id}}" class="form-control" placeholder="*****" style="display: none;">
|
||||
{% else %}
|
||||
<input type="password" id="ssh_pass-{{ssh.0}}" class="form-control" value="{{ssh.4}}">
|
||||
<input type="password" id="ssh_pass-{{ssh.id}}" class="form-control" placeholder="*****">
|
||||
{% endif %}
|
||||
<br>
|
||||
</td>
|
||||
<td>
|
||||
<a class="delete" onclick="confirmDeleteSsh({{ssh.0}})" style="cursor: pointer;"></a>
|
||||
<a class="delete" onclick="confirmDeleteSsh({{ssh.id}})" style="cursor: pointer;"></a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
|
@ -1,33 +1,33 @@
|
|||
{% for telegram in telegrams %}
|
||||
<tr style="width: 50%;" id="telegram-table-{{telegram.0}}" class="newgroup">
|
||||
<tr style="width: 50%;" id="telegram-table-{{telegram.id}}" class="newgroup">
|
||||
<td class="padding10 first-collumn">
|
||||
<input type="text" id="telegram-token-{{telegram.0}}" class="form-control" value="{{telegram.1}}">
|
||||
<input type="hidden" id="telegramgroup-{{telegram.0}}" name="telegramgroup-{{telegram.0}}">
|
||||
<input type="text" id="telegram-token-{{telegram.id}}" class="form-control" value="{{telegram.token}}">
|
||||
<input type="hidden" id="telegramgroup-{{telegram.id}}" name="telegramgroup-{{telegram.id}}">
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="telegram-chanel-{{telegram.0}}" class="form-control" value="{{telegram.2}}">
|
||||
<input type="text" id="telegram-chanel-{{telegram.id}}" class="form-control" value="{{telegram.chanel_name}}">
|
||||
</td>
|
||||
{% if page != "servers.py" %}
|
||||
<td>
|
||||
<select id="sshgroup-{{telegram.0}}" name="sshgroup-{{telegram.0}}">
|
||||
<select id="sshgroup-{{telegram.id}}" name="sshgroup-{{telegram.id}}">
|
||||
{% for group in groups %}
|
||||
{% if telegram.3 == group.0 %}
|
||||
<option value="{{ group.0 }}" selected>{{ group.1 }}</option>
|
||||
{% if telegram.groups == group.group_id %}
|
||||
<option value="{{ group.group_id }}" selected>{{ group.name }}</option>
|
||||
{% else %}
|
||||
<option value="{{ group.0 }}">{{ group.1 }}</option>
|
||||
<option value="{{ group.group_id }}">{{ group.name }}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
{% endif %}
|
||||
<td>
|
||||
<button title="Send test message" onclick="checkTelegram({{telegram.0}})">Test</button>
|
||||
<button title="Send test message" onclick="checkTelegram({{telegram.id}})">Test</button>
|
||||
</td>
|
||||
<td>
|
||||
<a class="add" onclick="cloneTelegram({{telegram.0}})" id="clone-{{telegram.0}}" title="Clone {{telegram.2}}" style="cursor: pointer;"></a>
|
||||
<a class="add" onclick="cloneTelegram({{telegram.id}})" id="clone-{{telegram.id}}" title="Clone {{telegram.chanel_name}}" style="cursor: pointer;"></a>
|
||||
</td>
|
||||
<td>
|
||||
<a class="delete" onclick="confirmDeleteTelegram({{telegram.0}})" style="cursor: pointer;"></a>
|
||||
<a class="delete" onclick="confirmDeleteTelegram({{telegram.id}})" style="cursor: pointer;"></a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
|
@ -5,18 +5,22 @@
|
|||
</a>
|
||||
</td>
|
||||
<td>
|
||||
{% if service.2|int() >= 1 %}
|
||||
<span class="serverUp server-status" title="running {{service.2 }} processes" style="margin-left: 25px !important;"></span>
|
||||
{% if service.2|int() == 0 %}
|
||||
<span class="serverNone server-status" title="HAProxy is not installed" style="margin-left: 25px !important;"></span>
|
||||
{% else %}
|
||||
<span class="serverDown server-status" style="margin-left: 25px !important;"></span>
|
||||
{% endif %}
|
||||
{% if service.3|int() >= 1 %}
|
||||
<span class="serverUp server-status" title="running {{ service.3 }} processes" style="margin-left: 25px !important;"></span>
|
||||
{% else %}
|
||||
<span class="serverDown server-status" title="HAProxy is down" style="margin-left: 25px !important;"></span>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="padding10 first-collumn">
|
||||
{% if service.8|int() == 0 %}
|
||||
<span class="serverNone server-status" title="Nginx is not installed" style="margin-left: 4px !important;"></span>
|
||||
{% else %}
|
||||
{% if service.9|int() >= 1 %}
|
||||
<span class="serverUp server-status" title="running {{service.9 }} processes" style="margin-left: 4px !important;"></span>
|
||||
<span class="serverUp server-status" title="Nginx is running" style="margin-left: 4px !important;"></span>
|
||||
{% else %}
|
||||
<span class="serverDown server-status" title="Nginx is down" style="margin-left: 4px !important;"></span>
|
||||
{% endif %}
|
||||
|
@ -39,7 +43,7 @@
|
|||
{% elif service.5.0 != '' and service.4|int() == 0 %}
|
||||
<span class="serverDown server-status" title="WAF is down" style="margin-left: 4px !important;"></span>
|
||||
{% elif service.5.0 != '' and service.4|int() >= 1 %}
|
||||
<span class="serverUp server-status" title="running {{service.4 }} processes" style="margin-left: 4px !important;"></span>
|
||||
<span class="serverUp server-status" title="running {{ service.4 }} processes" style="margin-left: 4px !important;"></span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td></td>
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
{%- for service in service_status -%}
|
||||
<div class="server-info">
|
||||
{% if service_page == 'nginx' %}
|
||||
{% if service_page == 'nginx' or service_page == 'keepalived' %}
|
||||
<div class="server-name" style="padding-bottom: 0px;">
|
||||
{% else %}
|
||||
<div class="server-name">
|
||||
{% endif %}
|
||||
Server status
|
||||
<span class="update-icon" style="margin-right: 10px">
|
||||
<span class="update-icon">
|
||||
<a onclick="showOverviewServer('{{ service.0 }}', '{{ service.1 }}', '{{id}}', '{{service_page}}')" title="Refresh">
|
||||
<span class="service-reload"></span>
|
||||
</a>
|
||||
|
@ -17,7 +17,7 @@
|
|||
{{ service.2 }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if service_page == 'nginx' %}
|
||||
{% if service_page == 'nginx' or service_page == 'keepalived' %}
|
||||
<div class="top-info" style="margin-top: 5px; width: 100%;">
|
||||
{% else %}
|
||||
<div class="top-info" style="width: 640px;">
|
||||
|
|
|
@ -15,11 +15,11 @@
|
|||
Server name
|
||||
</td>
|
||||
<td>
|
||||
<span id="aws_edit_server_name">{{s.6}}</span>
|
||||
<span id="aws_edit_server_name">{{s.name}}</span>
|
||||
</td>
|
||||
</tr>
|
||||
{{input('aws_edit_group', value=s.10, type='hidden')}}
|
||||
{{input('aws_edit_id', value=s.11, type='hidden')}}
|
||||
{{input('aws_edit_group', value=s.group_id, type='hidden')}}
|
||||
{{input('aws_edit_id', value=s.id, type='hidden')}}
|
||||
<tr>
|
||||
<td class="padding20">
|
||||
Provider credentials
|
||||
|
@ -29,7 +29,7 @@
|
|||
<select id="aws_edit_id_provider">
|
||||
{% for p in providers %}
|
||||
{% if p.2 == 'aws' %}
|
||||
{% if s.9|int() == p.0|int() %}
|
||||
{% if s.provider_id|int() == p.0|int() %}
|
||||
<option value="{{ p.0 }}" selected>{{ p.1 }}</option>
|
||||
{% else %}
|
||||
<option value="{{ p.0 }}">{{ p.1 }}</option>
|
||||
|
@ -45,11 +45,11 @@
|
|||
</td>
|
||||
<td>
|
||||
{% for key, value in aws_regions.items() %}
|
||||
{% if s.0|int() == key|int() %}
|
||||
{% if s.region|int() == key|int() %}
|
||||
{% do region_name.append(value) %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<span id="aws_edit_region" style="display: none;">{{s.0}}</span>
|
||||
<span id="aws_edit_region" style="display: none;">{{s.region}}</span>
|
||||
{{region_name.0}}
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -64,7 +64,7 @@
|
|||
<span class="need-field">*</span>
|
||||
</td>
|
||||
<td>
|
||||
{{input('aws_edit_size', size='26', value=s.1)}}
|
||||
{{input('aws_edit_size', size='26', value=s.instance_type)}}
|
||||
<div class="tooltip tooltipTop tooltipTd">
|
||||
Instance types list is <a href="https://aws.amazon.com/ec2/instance-types/" title="Instance types list" target="_blank">here</a>
|
||||
</div>
|
||||
|
@ -76,7 +76,7 @@
|
|||
<span class="need-field">*</span>
|
||||
</td>
|
||||
<td>
|
||||
{{ select('aws_edit_oss', values=aws_oss, first=s.7, disabled='false') }}
|
||||
{{ select('aws_edit_oss', values=aws_oss, first=s.os, disabled='false') }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -85,7 +85,7 @@
|
|||
<span class="need-field">*</span>
|
||||
</td>
|
||||
<td>
|
||||
{{input('aws_edit_ssh_name', size='26', value=s.5)}}
|
||||
{{input('aws_edit_ssh_name', size='26', value=s.ssh_key_name)}}
|
||||
<div class="tooltip tooltipTop tooltipTd">SSH key must exists in region where instance create</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -100,7 +100,7 @@
|
|||
<span class="need-field">*</span>
|
||||
</td>
|
||||
<td>
|
||||
{{input('aws_edit_volume_size', size='26', value=s.4, type='number')}}Gb
|
||||
{{input('aws_edit_volume_size', size='26', value=s.volume_size, type='number')}}Gb
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -111,7 +111,7 @@
|
|||
<td>
|
||||
<select id="aws_edit_volume_type">
|
||||
{% for key, value in aws_volume_type.items() %}
|
||||
{% if s.13 == key %}
|
||||
{% if s.volume_type == key %}
|
||||
<option value="{{key}}" selected>{{value}}</option>
|
||||
{% else %}
|
||||
<option value="{{key}}">{{value}}</option>
|
||||
|
@ -124,7 +124,7 @@
|
|||
<td class="padding20 padding-top20">Delete on termination</td>
|
||||
<td>
|
||||
{% set checked='checked' %}
|
||||
{% if s.12 == 'false' %}
|
||||
{% if s.delete_on_termination == 'false' %}
|
||||
{% set checked='' %}
|
||||
{% endif %}
|
||||
{{checkbox('aws_edit_delete_on_termination', checked=checked)}}
|
||||
|
@ -140,17 +140,17 @@
|
|||
<td class="padding20">Public IP</td>
|
||||
<td>
|
||||
<select id="aws_edit_public_ip">
|
||||
{% if s.2 == 'true' %}
|
||||
{% if s.public_ip == 'true' %}
|
||||
<option value="public" selected>Public IP</option>
|
||||
{% else %}
|
||||
<option value="public">Public IP</option>
|
||||
{% endif %}
|
||||
{% if s.3 == 'true' %}
|
||||
{% if s.floating_ip == 'true' %}
|
||||
<option value="elastic" selected>Elastic IP</option>
|
||||
{% else %}
|
||||
<option value="elastic">Elastic IP</option>
|
||||
{% endif %}
|
||||
{% if s.2 == 'false' and s.3 == 'false' %}
|
||||
{% if s.public_ip == 'false' and s.floating_ip == 'false' %}
|
||||
<option value="none" selected>None</option>
|
||||
{% else %}
|
||||
<option value="none">None</option>
|
||||
|
@ -160,7 +160,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
{% set checked='checked' %}
|
||||
{% if s.8 == 'false' %}
|
||||
{% if s.firewall == 'false' %}
|
||||
{% set checked='' %}
|
||||
{% endif %}
|
||||
<td class="padding20" style="padding-bottom: 25px;padding-top: 25px;">Firewall</td>
|
||||
|
|
|
@ -15,11 +15,11 @@
|
|||
Server name
|
||||
</td>
|
||||
<td>
|
||||
<span id="do_edit_server_name">{{s.6}}</span>
|
||||
<span id="do_edit_server_name">{{s.name}}</span>
|
||||
</td>
|
||||
</tr>
|
||||
{{input('do_edit_group', value=s.12, type='hidden')}}
|
||||
{{input('do_edit_id', value=s.13, type='hidden')}}
|
||||
{{input('do_edit_group', value=s.group_id, type='hidden')}}
|
||||
{{input('do_edit_id', value=s.id, type='hidden')}}
|
||||
<tr>
|
||||
<td class="padding20">
|
||||
Provider credentials
|
||||
|
@ -29,7 +29,7 @@
|
|||
<select id="do_edit_id_provider">
|
||||
{% for p in providers %}
|
||||
{% if p.2 == 'do' %}
|
||||
{% if s.11|int() == p.0|int() %}
|
||||
{% if s.provider_id|int() == p.0|int() %}
|
||||
<option value="{{ p.0 }}" selected>{{ p.1 }}</option>
|
||||
{% else %}
|
||||
<option value="{{ p.0 }}">{{ p.1 }}</option>
|
||||
|
@ -45,11 +45,11 @@
|
|||
</td>
|
||||
<td>
|
||||
{% for key, value in do_regions.items() %}
|
||||
{% if s.0|int() == key|int() %}
|
||||
{% if s.region|int() == key|int() %}
|
||||
{% do region_name.append(value) %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<span id="do_edit_regions" style="display: none;">{{s.0}}</span>
|
||||
<span id="do_edit_regions" style="display: none;">{{s.region}}</span>
|
||||
{{region_name.0}}
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -63,7 +63,7 @@
|
|||
Size
|
||||
<span class="need-field">*</span>
|
||||
</td>
|
||||
<td>{{input('do_edit_size', size='30', value=s.1)}}</td>
|
||||
<td>{{input('do_edit_size', size='30', value=s.instance_type)}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padding20">
|
||||
|
@ -71,7 +71,7 @@
|
|||
<span class="need-field">*</span>
|
||||
</td>
|
||||
<td>
|
||||
{{ select('do_edit_oss', values=do_oss, first=s.7, disabled='false') }}
|
||||
{{ select('do_edit_oss', values=do_oss, first=s.os, disabled='false') }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -81,12 +81,12 @@
|
|||
</td>
|
||||
<td>
|
||||
<select id="do_edit_ssh_choose">
|
||||
{% if s.5 != 'None' %}
|
||||
{% if s.ssh_key_name is not none %}
|
||||
<option value="ssh_name" selected>Set SSH key name</option>
|
||||
{% else %}
|
||||
<option value="ssh_name">Set SSH key name</option>
|
||||
{% endif %}
|
||||
{% if s.4 != 'None' %}
|
||||
{% if s.ssh_ids is not none %}
|
||||
<option value="ssh_ids" selected>Set SSH key ids</option>
|
||||
{% else %}
|
||||
<option value="ssh_ids">Set SSH key ids</option>
|
||||
|
@ -94,29 +94,29 @@
|
|||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="do_edit_ssh_ids_tr" {% if s.4 == 'None' %}style="display: none;"{% endif %}>
|
||||
<tr id="do_edit_ssh_ids_tr" {% if s.ssh_ids is none %}style="display: none;"{% endif %}>
|
||||
<td class="padding20 padding-top20">
|
||||
SSH key ids
|
||||
<span class="need-field">*</span>
|
||||
</td>
|
||||
<td>
|
||||
{{input('do_edit_ssh_ids', size='30', value=s.4)}}
|
||||
{{input('do_edit_ssh_ids', size='30', value=s.ssh_ids)}}
|
||||
<div class="tooltip tooltipTop tooltipTd">List comma separated. Required if SSH key name is empty</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="do_edit_ssh_name_tr" {% if s.5 == 'None' %}style="display: none;"{% endif %}>
|
||||
<tr id="do_edit_ssh_name_tr" {% if s.ssh_key_name is none %}style="display: none;"{% endif %}>
|
||||
<td class="padding20 padding-top20">
|
||||
SSH key name
|
||||
<span class="need-field">*</span>
|
||||
</td>
|
||||
<td>
|
||||
{{input('do_edit_ssh_name', size='30', value=s.5)}}
|
||||
{{input('do_edit_ssh_name', size='30', value=s.ssh_key_name)}}
|
||||
<div class="tooltip tooltipTop tooltipTd">Required if SSH key ids is empty</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
{% set checked='checked' %}
|
||||
{% if s.10 == 'false' %}
|
||||
{% if s.monitoring == 'false' %}
|
||||
{% set checked='' %}
|
||||
{% endif %}
|
||||
<td class="padding20">Monitoring</td>
|
||||
|
@ -126,7 +126,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
{% set checked='checked' %}
|
||||
{% if s.9 == 'false' %}
|
||||
{% if s.backup == 'false' %}
|
||||
{% set checked='' %}
|
||||
{% endif %}
|
||||
<td class="padding20">Backup</td>
|
||||
|
@ -141,7 +141,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
{% set checked='checked' %}
|
||||
{% if s.2 == 'false' %}
|
||||
{% if s.private_networking == 'false' %}
|
||||
{% set checked='' %}
|
||||
{% endif %}
|
||||
<td class="padding20">Private IP</td>
|
||||
|
@ -151,7 +151,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
{% set checked='checked' %}
|
||||
{% if s.3 == 'false' %}
|
||||
{% if s.floating_ip == 'false' %}
|
||||
{% set checked='' %}
|
||||
{% endif %}
|
||||
<td class="padding20">Floating Ip</td>
|
||||
|
@ -161,7 +161,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
{% set checked='checked' %}
|
||||
{% if s.8 == 'false' %}
|
||||
{% if s.firewall == 'false' %}
|
||||
{% set checked='' %}
|
||||
{% endif %}
|
||||
<td class="padding20" style="padding-bottom: 25px;padding-top: 25px;">Firewall</td>
|
||||
|
|
|
@ -15,11 +15,11 @@
|
|||
Server name
|
||||
</td>
|
||||
<td>
|
||||
<span id="gcore_edit_server_name">{{s.6}}</span>({{s.16}})
|
||||
<span id="gcore_edit_server_name">{{s.name}}</span>({{s.name_template}})
|
||||
</td>
|
||||
</tr>
|
||||
{{input('gcore_edit_group', value=s.10, type='hidden')}}
|
||||
{{input('gcore_edit_id', value=s.11, type='hidden')}}
|
||||
{{input('gcore_edit_group', value=s.group_id, type='hidden')}}
|
||||
{{input('gcore_edit_id', value=s.id, type='hidden')}}
|
||||
<tr>
|
||||
<td class="padding20">
|
||||
Provider credentials
|
||||
|
@ -29,7 +29,7 @@
|
|||
<select id="gcore_edit_id_provider">
|
||||
{% for p in providers %}
|
||||
{% if p.2 == 'gcore' %}
|
||||
{% if s.9|int() == p.0|int() %}
|
||||
{% if s.provider_id|int() == p.0|int() %}
|
||||
<option value="{{ p.0 }}" selected>{{ p.1 }}</option>
|
||||
{% else %}
|
||||
<option value="{{ p.0 }}">{{ p.1 }}</option>
|
||||
|
@ -45,11 +45,11 @@
|
|||
</td>
|
||||
<td>
|
||||
{% for key, value in gcore_regions.items() %}
|
||||
{% if s.0|int() == key|int() %}
|
||||
{% if s.region|int() == key|int() %}
|
||||
{% do region_name.append(value) %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<span id="gcore_edit_region" style="display: none;">{{s.0}}</span>
|
||||
<span id="gcore_edit_region" style="display: none;">{{s.region}}</span>
|
||||
{{region_name.0}}
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -58,7 +58,7 @@
|
|||
Project name
|
||||
</td>
|
||||
<td>
|
||||
<span id="gcore_edit_project_name">{{s.13}}</span>
|
||||
<span id="gcore_edit_project_name">{{s.project}}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -72,7 +72,7 @@
|
|||
<span class="need-field">*</span>
|
||||
</td>
|
||||
<td>
|
||||
{{input('gcore_edit_size', size='26', value=s.1)}}
|
||||
{{input('gcore_edit_size', size='26', value=s.instance_type)}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -86,7 +86,7 @@
|
|||
"fedora-coreos-32-x64": "Fedora CoreOS 32", "ubuntu-16.04-x64": "Ubuntu 16.04", "ubuntu-18.04-x64": "Ubuntu 18.04",
|
||||
"ubuntu-20.04-x64": "Ubuntu 20.04", "ubuntu-20.10-x64": "Ubuntu 20.10", "debian-9.7-x64-qcow2": "Debian 9.7",
|
||||
"debian-10.1-x64-qcow2": "Debian 10.1", "debian-10.3-x64-qcow2": "Debian 10.3"} %}
|
||||
{{ select('gcore_edit_oss', values=oss, first=s.7, disabled='false') }}
|
||||
{{ select('gcore_edit_oss', values=oss, first=s.os, disabled='false') }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -95,7 +95,7 @@
|
|||
<span class="need-field">*</span>
|
||||
</td>
|
||||
<td>
|
||||
{{input('gcore_edit_ssh_name', size='26', value=s.5)}}
|
||||
{{input('gcore_edit_ssh_name', size='26', value=s.ssh_key_name)}}
|
||||
<div class="tooltip tooltipTop tooltipTd">SSH key must exists in region where instance edit</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -110,7 +110,7 @@
|
|||
<span class="need-field">*</span>
|
||||
</td>
|
||||
<td>
|
||||
{{input('gcore_edit_volume_size', size='26', value=s.4, type='number')}}Gb
|
||||
{{input('gcore_edit_volume_size', size='26', value=s.volume_size, type='number')}}Gb
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -121,7 +121,7 @@
|
|||
<td>
|
||||
<select id="gcore_edit_volume_type">
|
||||
{% for key, value in gcore_volume_type.items() %}
|
||||
{% if s.15 == key %}
|
||||
{% if s.volume_type == key %}
|
||||
<option value="{{key}}" selected>{{value}}</option>
|
||||
{% else %}
|
||||
<option value="{{key}}">{{value}}</option>
|
||||
|
@ -134,7 +134,7 @@
|
|||
<td class="padding20 padding-top20">Delete on termination</td>
|
||||
<td>
|
||||
{% set checked='checked' %}
|
||||
{% if s.12 == 'false' %}
|
||||
{% if s.delete_on_termination == 'false' %}
|
||||
{% set checked='' %}
|
||||
{% endif %}
|
||||
{{checkbox('gcore_edit_delete_on_termination', checked=checked)}}
|
||||
|
@ -150,12 +150,12 @@
|
|||
<td class="padding20">Network Type</td>
|
||||
<td>
|
||||
<select id="gcore_edit_network_type">
|
||||
{% if s.2 == 'external' %}
|
||||
{% if s.public_ip == 'external' %}
|
||||
<option value="external" selected>External IP</option>
|
||||
{% else %}
|
||||
<option value="external">External IP</option>
|
||||
{% endif %}
|
||||
{% if s.2 == 'any_subnet' %}
|
||||
{% if s.public_ip == 'any_subnet' %}
|
||||
<option value="any_subnet" selected>Custom network</option>
|
||||
{% set style = 'display: table-row;' %}
|
||||
{% else %}
|
||||
|
@ -170,11 +170,11 @@
|
|||
Network name
|
||||
<span class="need-field">*</span>
|
||||
</td>
|
||||
<td>{{input('gcore_edit_network_name', size='26', value=s.14)}}</td>
|
||||
<td>{{input('gcore_edit_network_name', size='26', value=s.network_name)}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
{% set checked='checked' %}
|
||||
{% if s.8 == 'false' %}
|
||||
{% if s.firewall == 'false' %}
|
||||
{% set checked='' %}
|
||||
{% endif %}
|
||||
<td class="padding20" style="padding-bottom: 25px;padding-top: 25px;">Firewall</td>
|
||||
|
|
|
@ -19,12 +19,12 @@
|
|||
<td style="width: 10%">
|
||||
{% for g in groups %}
|
||||
{% if adding %}
|
||||
{% if user_group|int() == g.0|int() %}
|
||||
<span id="provider-group-{{p.0}}">{{ g.1 }}</span>
|
||||
{% if user_group|int() == g.group_id|int() %}
|
||||
<span id="provider-group-{{p.0}}">{{ g.name }}</span>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% if p.3|int() == g.0|int() %}
|
||||
<span id="provider-group-{{p.0}}">{{ g.1 }}</span>
|
||||
{% if p.3|int() == g.group_id|int() %}
|
||||
<span id="provider-group-{{p.0}}">{{ g.name }}</span>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
|
|
@ -2,43 +2,43 @@
|
|||
{% from 'include/input_macros.html' import copy_to_clipboard %}
|
||||
{% for s in servers %}
|
||||
{% set region_name = [] %}
|
||||
{% if s.3 == 'do' %}
|
||||
{% if s.type == 'do' %}
|
||||
{% set provider_full_name = 'DigitalOcean' %}
|
||||
{% set onclickEditAction = 'editDoServer' %}
|
||||
{% for key, value in do_regions.items() %}
|
||||
{% if s.8|int() == key|int() %}
|
||||
{% if s.region|int() == key|int() %}
|
||||
{% do region_name.append(value) %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% elif s.3 == 'aws' %}
|
||||
{% elif s.type == 'aws' %}
|
||||
{% set provider_full_name = 'AWS' %}
|
||||
{% set onclickEditAction = 'editAwsServer' %}
|
||||
{% for key, value in aws_regions.items() %}
|
||||
{% if s.8|int() == key|int() %}
|
||||
{% if s.region|int() == key|int() %}
|
||||
{% do region_name.append(value) %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% elif s.3 == 'gcore' %}
|
||||
{% elif s.type == 'gcore' %}
|
||||
{% set provider_full_name = 'G-Core Labs' %}
|
||||
{% set onclickEditAction = 'editGcoreServer' %}
|
||||
{% for key, value in gcore_regions.items() %}
|
||||
{% if s.8|int() == key|int() %}
|
||||
{% if s.region|int() == key|int() %}
|
||||
{% do region_name.append(value) %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
<tr id="server-{{s.0}}" class="{{ loop.cycle('odd', 'even') }} {% if adding %}newserver{% endif %}">
|
||||
<tr id="server-{{s.id}}" class="{{ loop.cycle('odd', 'even') }} {% if adding %}newserver{% endif %}">
|
||||
<td class="padding10 first-collumn">
|
||||
<span id="server-name-{{s.0}}">{{s.1}}</span>
|
||||
{% if s.3 == 'gcore' %}
|
||||
({{s.12}})
|
||||
<span id="server-name-{{s.id}}">{{s.name}}</span>
|
||||
{% if s.type == 'gcore' and s.name_template is defined %}
|
||||
({{s.name_template}})
|
||||
{% endif %}
|
||||
</td>
|
||||
<td style="width: 10%">
|
||||
{% for p in providers %}
|
||||
{% if p.0|int() == s.2|int() %}
|
||||
{% if p.0|int() == s.provider_id|int() %}
|
||||
<span>{{ p.1 }}</span>
|
||||
<span id="server-provider-{{s.0}}" style="display: none;">{{p.0}}</span>
|
||||
<span id="server-provider-{{s.id}}" style="display: none;">{{p.0}}</span>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</td>
|
||||
|
@ -46,56 +46,56 @@
|
|||
<td style="width: 5%">
|
||||
{% for g in groups %}
|
||||
{% if adding %}
|
||||
{% if user_group|int() == g.0|int() %}
|
||||
{{ g.1 }}
|
||||
<span id="server-group-{{s.0}}" style="display: none;">{{ g.0 }}</span>
|
||||
{% if user_group|int() == g.group_id|int() %}
|
||||
{{ g.name }}
|
||||
<span id="server-group-{{s.id}}" style="display: none;">{{ g.group_id }}</span>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% if s.4|int() == g.0|int() %}
|
||||
{{ g.1 }}
|
||||
<span id="server-group-{{s.0}}" style="display: none;">{{ g.0 }}</span>
|
||||
{% if s.group_id|int() == g.group_id|int() %}
|
||||
{{ g.name }}
|
||||
<span id="server-group-{{s.id}}" style="display: none;">{{ g.group_id }}</span>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</td>
|
||||
{% else %}
|
||||
<span id="server-group-{{s.0}}" style="display: none;">{{user_group}}</span>
|
||||
<span id="server-group-{{s.id}}" style="display: none;">{{user_group}}</span>
|
||||
{% endif %}
|
||||
<td style="width: 10%">
|
||||
{{provider_full_name}}
|
||||
<span id="server-cloud-{{s.0}}" style="display: none;">{{s.3}}</span>
|
||||
<span id="server-cloud-{{s.id}}" style="display: none;">{{s.type}}</span>
|
||||
</td>
|
||||
<td style="width: 10%">
|
||||
{{region_name.0}}
|
||||
</td>
|
||||
<td style="width: 10%">
|
||||
{% set id = "server-os-" + s.0|string() %}
|
||||
{{ copy_to_clipboard(id=id, value=s.9) }}
|
||||
{% set id = "server-os-" + s.id|string() %}
|
||||
{{ copy_to_clipboard(id=id, value=s.os) }}
|
||||
</td>
|
||||
<td style="width: 15%">
|
||||
{% set id = "server-ip-" + s.0|string() %}
|
||||
{{ copy_to_clipboard(id=id, value=s.10) }}
|
||||
{% set id = "server-ip-" + s.id|string() %}
|
||||
{{ copy_to_clipboard(id=id, value=s.IP) }}
|
||||
</td>
|
||||
<td style="width: 10%">
|
||||
{% set id = "server-size-" + s.0|string() %}
|
||||
{{ copy_to_clipboard(id=id, value=s.5) }}
|
||||
{% set id = "server-size-" + s.id|string() %}
|
||||
{{ copy_to_clipboard(id=id, value=s.instance_type) }}
|
||||
</td>
|
||||
<td style="width: 5%">
|
||||
{% if s.6 == 'Created' %}
|
||||
{% if s.status == 'Created' %}
|
||||
{% set style='color: var(--green-color);' %}
|
||||
{% elif s.6 == 'Error ' %}
|
||||
{% elif s.status == 'Error ' %}
|
||||
{% set style='color: red;cursor: help;' %}
|
||||
{% endif %}
|
||||
<span id="sever-status-{{s.0}}" title="Last error: {{s.11}}" style="font-weight: bold;{{style}}">{{s.6}}</span>
|
||||
<span id="sever-status-{{s.id}}" title="Last error: {{s.last_error}}" style="font-weight: bold;{{style}}">{{s.status}}</span>
|
||||
</td>
|
||||
<td style="width: 100%">
|
||||
{{s.7}}
|
||||
{{s.date}}
|
||||
</td>
|
||||
<td>
|
||||
<a class="edit" onclick="{{onclickEditAction}}({{s.0}})" title="Edit server {{s.1}}" style="cursor: pointer;"></a>
|
||||
<a class="edit" onclick="{{onclickEditAction}}({{s.id}})" title="Edit server {{s.name}}" style="cursor: pointer;"></a>
|
||||
</td>
|
||||
<td>
|
||||
<a class="delete" onclick="confirmDeleteProvisionedServer({{s.0}})" title="Delete server {{s.1}}" style="cursor: pointer;"></a>
|
||||
<a class="delete" onclick="confirmDeleteProvisionedServer({{s.id}})" title="Delete server {{s.name}}" style="cursor: pointer;"></a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
|
@ -3,10 +3,10 @@
|
|||
<td style="border: none">
|
||||
<select id="newCurrentGroup" name="newCurrentGroup" >
|
||||
{% for g in groups %}
|
||||
{% if g.0|string() == group|string() %}
|
||||
<option value="{{ g.0 }}" selected>{{ g.1 }}</option>
|
||||
{% if g.user_group_id|string() == group|string() %}
|
||||
<option value="{{ g.user_group_id }}" selected>{{ g.groups.name }}</option>
|
||||
{% else %}
|
||||
<option value="{{ g.0 }}">{{ g.1 }}</option>
|
||||
<option value="{{ g.user_group_id }}">{{ g.groups.name }}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
|
|
@ -58,10 +58,10 @@
|
|||
<td>
|
||||
<select id="usergroup-{{id}}" name="usergroup-{{id}}" multiple class="select-css">
|
||||
{% for group in groups %}
|
||||
{% if group.0 in user_groups %}
|
||||
<option value="{{ group.0 }}" selected>{{ group.1 }}</option>
|
||||
{% if group.group_id in user_groups %}
|
||||
<option value="{{ group.group_id }}" selected>{{ group.name }}</option>
|
||||
{% else %}
|
||||
<option value="{{ group.0 }}">{{ group.1 }}</option>
|
||||
<option value="{{ group.group_id }}">{{ group.name }}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
|
|
@ -31,17 +31,28 @@
|
|||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if group.append(s.7) %} {% endif %}
|
||||
{% if group.append(s.7) %} {% endif %}
|
||||
{% else %}
|
||||
<div class="smon_group">
|
||||
<div class="group_name">
|
||||
None
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if s.3 == 1 %}
|
||||
{% if s.2 == 1 and s.10 == 1 and s.12 == 1 %}
|
||||
<div class="smon_services good div-server-head-up">
|
||||
<div class="smon_services good div-server-head-up"
|
||||
{% else %}
|
||||
<div class="smon_services err div-server-head-down">
|
||||
<div class="smon_services err div-server-head-down"
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<div class="smon_services dis div-server-head-dis">
|
||||
<div class="smon_services dis div-server-head-dis"
|
||||
{% endif %}
|
||||
title="Enabled checks:
|
||||
Port check{% if s.9 %},
|
||||
HTTP status check: {{s.9.split(':')[0]}}://{{s.0}}:{{s.1}}{{s.9.split(':')[1]}}
|
||||
{% if s.11 and s.11 is not none %}, Body response check: {{s.11}}{% endif %}
|
||||
{% endif %}">
|
||||
<div class="ip">
|
||||
{% if s.0|string|length > 23 %}
|
||||
<span style="font-size: 11px;">
|
||||
|
@ -52,16 +63,12 @@
|
|||
{% else %}
|
||||
<span>
|
||||
{% endif %}
|
||||
<span title="Enabled checks:
|
||||
Port check{% if s.9 %},
|
||||
HTTP status check: {{s.9.split(':')[0]}}://{{s.0}}:{{s.1}}{{s.9.split(':')[1]}}
|
||||
{% if s.11 and s.11 != 'None' %}, Body response check: {{s.11}}{% endif %}
|
||||
{% endif %}"> {{s.0}}:{{s.1}}
|
||||
<a href="smon.py?action=history&host={{s.0}}" title="View history for {{s.0}} host" class="link">{{s.0}}:{{s.1}}</a>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="desc">
|
||||
{% if s.4 != 'None' %}
|
||||
{% if s.4 is not none %}
|
||||
<b>{{s.4}}</b>
|
||||
{% else %}
|
||||
Desc: None
|
||||
|
|
|
@ -12,52 +12,52 @@
|
|||
</tr>
|
||||
{% for b in backups %}
|
||||
{% for s in servers %}
|
||||
{% if b.1 in s.2 %}
|
||||
<tr id="backup-table-{{b.0}}">
|
||||
{% if b.server in s.2 %}
|
||||
<tr id="backup-table-{{b.id}}">
|
||||
<td class="padding10 first-collumn">
|
||||
{% set id = 'backup-server-' + b.0|string() %}
|
||||
{{ copy_to_clipboard(id=id, value=b.1) }}
|
||||
{% set id = 'backup-server-' + b.id|string() %}
|
||||
{{ copy_to_clipboard(id=id, value=b.server) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ input('backup-rserver-'+b.0|string(), value=b.2, size='14') }}
|
||||
{{ input('backup-rserver-'+b.id|string(), value=b.rhost, size='14') }}
|
||||
</td>
|
||||
<td>
|
||||
{{ input('backup-rpath-'+b.0|string(), value=b.3) }}
|
||||
{{ input('backup-rpath-'+b.id|string(), value=b.rpath) }}
|
||||
</td>
|
||||
<td>
|
||||
{% set values = {'backup':'backup','synchronization':'synchronization'} %}
|
||||
{{ select('backup-type-'+b.0|string(), values=values, selected=b.4, required='required', class='force_close') }}
|
||||
{{ select('backup-type-'+b.id|string(), values=values, selected=b.backup_type, required='required', class='force_close') }}
|
||||
</td>
|
||||
<td>
|
||||
{% set values = {'hourly':'hourly','daily':'daily','weekly':'weekly', 'monthly':'monthly'} %}
|
||||
{{ select('backup-time-'+b.0|string(), values=values, selected=b.5, required='required', class='force_close') }}
|
||||
{{ select('backup-time-'+b.id|string(), values=values, selected=b.time, required='required', class='force_close') }}
|
||||
</td>
|
||||
<td>
|
||||
<select id="backup-credentials-{{b.0}}" required>
|
||||
<select id="backup-credentials-{{b.id}}" required>
|
||||
<option disabled selected>Choose credentials</option>
|
||||
{% for ssh in sshs %}
|
||||
{% if ssh.2 == 1 %}
|
||||
{% if ssh.0 == b.6 %}
|
||||
<option value="{{ssh.0}}" selected="selected">{{ssh.1}}</option>
|
||||
{% if ssh.enable == 1 %}
|
||||
{% if ssh.id == b.cred %}
|
||||
<option value="{{ssh.id}}" selected="selected">{{ssh.name}}</option>
|
||||
{% else %}
|
||||
<option value="{{ssh.0}}">{{ssh.1}}</option>
|
||||
<option value="{{ssh.id}}">{{ssh.name}}</option>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
{% if b.7 != 'None' %}
|
||||
{{ input('backup-description-'+b.0|string(), value=b.7) }}
|
||||
{% if b.description is not none %}
|
||||
{{ input('backup-description-'+b.id|string(), value=b.description) }}
|
||||
{% else %}
|
||||
{{ input('backup-description-'+b.0|string()) }}
|
||||
{{ input('backup-description-'+b.id|string()) }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<a class="add" onclick="cloneBackup({{b.0}})" id="clone-backup{{b.0}}" title="Clone {{b.1}}" style="cursor: pointer;"></a>
|
||||
<a class="add" onclick="cloneBackup({{b.id}})" id="clone-backup{{b.id}}" title="Clone {{b.server}}" style="cursor: pointer;"></a>
|
||||
</td>
|
||||
<td>
|
||||
<a class="delete" onclick="confirmDeleteBackup({{b.0}})" title="Delete backup {{b.1}}" style="cursor: pointer;"></a>
|
||||
<a class="delete" onclick="confirmDeleteBackup({{b.id}})" title="Delete backup {{b.server}}" style="cursor: pointer;"></a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
<span title="Virtual IP, something like VRRP">Virt</span>
|
||||
</th>
|
||||
<th class="checkbox-head" style="width: 5%">HAProxy</th>
|
||||
<th style="width: 5%">Nginx</th>
|
||||
<th style="width: 10%;" class="help_cursor">
|
||||
<th class="checkbox-head" style="min-width: 50px;">Nginx</th>
|
||||
<th style="min-width: 100px;" class="help_cursor">
|
||||
<span title="If the server has a firewall enabled, enable this option">Firewalld</span>
|
||||
</th>
|
||||
<th class="checkbox-head" style="width: 5%" class="help_cursor">
|
||||
|
@ -51,10 +51,10 @@
|
|||
<select id="servergroup-{{server.0}}" name="servergroup-{{server.0}}">
|
||||
<option disabled selected>Choose group</option>
|
||||
{% for group in groups %}
|
||||
{% if server.3 == group.0|string() %}
|
||||
<option value="{{ group.0 }}" selected>{{ group.1 }}</option>
|
||||
{% if server.3 == group.group_id|string() %}
|
||||
<option value="{{ group.group_id }}" selected>{{ group.name }}</option>
|
||||
{% else %}
|
||||
<option value="{{ group.0 }}">{{ group.1 }}</option>
|
||||
<option value="{{ group.group_id }}">{{ group.name }}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
@ -132,10 +132,10 @@
|
|||
<select id="credentials-{{server.0}}">
|
||||
<option disabled selected>Choose credentials</option>
|
||||
{% for ssh in sshs %}
|
||||
{% if ssh.0 == server.7 %}
|
||||
<option value="{{ssh.0}}" selected>{{ssh.1}}</option>
|
||||
{% if ssh.id == server.7 %}
|
||||
<option value="{{ssh.id}}" selected>{{ssh.name}}</option>
|
||||
{% else %}
|
||||
<option value="{{ssh.0}}">{{ssh.1}}</option>
|
||||
<option value="{{ssh.id}}">{{ssh.name}}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
@ -144,7 +144,7 @@
|
|||
</td>
|
||||
<td>
|
||||
{% set id = 'desc-' + server.0|string() %}
|
||||
{% if server.11 != "None" %}
|
||||
{% if server.11 is not none %}
|
||||
{{ input(id, value=server.11, size='20') }}
|
||||
{% else %}
|
||||
{{ input(id, size='20') }}
|
||||
|
|
|
@ -1,43 +1,41 @@
|
|||
<table id="settings">
|
||||
<tr class="overviewHead">
|
||||
<td class="padding10 first-collumn" style="width: 10%;">
|
||||
Parameter
|
||||
</td>
|
||||
<td>
|
||||
Value
|
||||
</td>
|
||||
<td>
|
||||
Description
|
||||
</td>
|
||||
</tr>
|
||||
{% set section = namespace(section='') %}
|
||||
{% for set in settings %}
|
||||
{% if section.section|string() != set.2|string() %}
|
||||
<th colspan="3"><h3>{{ set.2 }} section</h3></th>
|
||||
{% endif %}
|
||||
{% set section.section = set.2 %}
|
||||
<tr class="{{ loop.cycle('odd', 'even') }}">
|
||||
<td class="addName">
|
||||
<a href="#{{set.0}}" title="{{set.0}}" style="color: #000;">{{set.0}}</a>
|
||||
</td>
|
||||
<td class="addOption">
|
||||
{% if set.0 == 'ldap_password' %}
|
||||
{% if set.1 == 'None' %}
|
||||
<input type="password" name="{{set.0}}" id="{{set.0}}" value="" title="" size="25" class="form-control" autocomplete="new-password">
|
||||
{% else %}
|
||||
<input type="password" name="{{set.0}}" id="{{set.0}}" value="" placeholder="*****" title="" size="25" class="form-control" autocomplete="new-password">
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% if set.1 == 'None' %}
|
||||
<input type="text" name="{{set.0}}" id="{{set.0}}" value="" title="" size="25" class="form-control">
|
||||
{% else %}
|
||||
<input type="text" name="{{set.0}}" id="{{set.0}}" value="{{set.1}}" title="" size="25" class="form-control">
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="addOption">
|
||||
{{set.3}}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
<tbody>
|
||||
{% set section = namespace(section='') %}
|
||||
{% for set in settings %}
|
||||
{% if section.section|string() != set.section|string() %}
|
||||
<th colspan="3" title="Show {{ set.section }} section" id="{{set.section}}-section-head" style="cursor: pointer; padding-top: 10px;">
|
||||
<h3 class="plus-after" id="{{set.section}}-section-h3" style="font-size: 1em; padding-left: 15px;">{{ set.section[0]|upper}}{{set.section[1:] }} section</h3>
|
||||
</th>
|
||||
<tr class="overviewHead {{set.section}}-section" style="display: none">
|
||||
<td class="padding10 first-collumn">Parameter</td>
|
||||
<td class="addOption">Value</td>
|
||||
<td class="addOption">Description</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% set section.section = set.section %}
|
||||
<tr class="{{ loop.cycle('odd', 'even') }} {{set.section}}-section" style="display: none">
|
||||
<td class="addName">
|
||||
<a href="#{{set.param}}" title="{{set.param}}" style="color: #000;">{{set.param}}</a>
|
||||
</td>
|
||||
<td class="addOption">
|
||||
{% if set.param == 'ldap_password' %}
|
||||
{% if set.value == 'None' %}
|
||||
<input type="password" name="{{set.param}}" id="{{set.param}}" value="" title="" size="25" class="form-control" autocomplete="new-password">
|
||||
{% else %}
|
||||
<input type="password" name="{{set.param}}" id="{{set.param}}" value="" placeholder="*****" title="" size="25" class="form-control" autocomplete="new-password">
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% if set.value == 'None' %}
|
||||
<input type="text" name="{{set.param}}" id="{{set.param}}" value="" title="" size="25" class="form-control">
|
||||
{% else %}
|
||||
<input type="text" name="{{set.param}}" id="{{set.param}}" value="{{set.value}}" title="" size="25" class="form-control">
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="addOption">
|
||||
{{set.desc}}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
|
@ -15,26 +15,26 @@
|
|||
<td></td>
|
||||
</tr>
|
||||
{% for ssh in sshs %}
|
||||
<tr style="width: 50%;" id="ssh-table-{{ssh.0}}" class="{{ loop.cycle('odd', 'even') }}">
|
||||
<tr style="width: 50%;" id="ssh-table-{{ssh.id}}" class="{{ loop.cycle('odd', 'even') }}">
|
||||
<td class="first-collumn">
|
||||
{% set id = 'ssh_name-' + ssh.0|string() %}
|
||||
{{ input(id, value=ssh.1, size='15') }}
|
||||
{% set id = 'ssh_name-' + ssh.id|string() %}
|
||||
{{ input(id, value=ssh.name, size='15') }}
|
||||
</td>
|
||||
<td class="first-collumn" valign="top" style="padding-top: 15px;">
|
||||
{% if ssh.2 == 1 %}
|
||||
<label for="ssh_enable-{{ssh.0}}">Enable SSH key</label><input type="checkbox" id="ssh_enable-{{ssh.0}}" checked>
|
||||
{% if ssh.enable == 1 %}
|
||||
<label for="ssh_enable-{{ssh.id}}">Enable SSH key</label><input type="checkbox" id="ssh_enable-{{ssh.id}}" checked>
|
||||
{% else %}
|
||||
<label for="ssh_enable-{{ssh.0}}">Enable SSH key</label><input type="checkbox" id="ssh_enable-{{ssh.0}}">
|
||||
<label for="ssh_enable-{{ssh.id}}">Enable SSH key</label><input type="checkbox" id="ssh_enable-{{ssh.id}}">
|
||||
{% endif %}
|
||||
</td>
|
||||
{% if page != "servers.py" %}
|
||||
<td>
|
||||
<select id="sshgroup-{{ssh.0}}" name="sshgroup-{{ssh.0}}">
|
||||
<select id="sshgroup-{{ssh.id}}" name="sshgroup-{{ssh.id}}">
|
||||
{% for group in groups %}
|
||||
{% if ssh.5 == group.0 %}
|
||||
<option value="{{ group.0 }}" selected>{{ group.1 }}</option>
|
||||
{% if ssh.5 == group.group_id %}
|
||||
<option value="{{ group.group_id }}" selected>{{ group.name }}</option>
|
||||
{% else %}
|
||||
<option value="{{ group.0 }}">{{ group.1 }}</option>
|
||||
<option value="{{ group.group_id }}">{{ group.name }}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
@ -42,18 +42,18 @@
|
|||
{% endif %}
|
||||
<td style="padding-top: 15px;">
|
||||
<p>
|
||||
{% set id = 'ssh_user-' + ssh.0|string() %}
|
||||
{{ input(id, value=ssh.3, title='SSH user name') }}
|
||||
{% set id = 'ssh_user-' + ssh.id|string() %}
|
||||
{{ input(id, value=ssh.username, title='SSH user name') }}
|
||||
</p>
|
||||
{% if ssh.2 == 1 %}
|
||||
<input type="password" id="ssh_pass-{{ssh.0}}" class="form-control" placeholder="*****" style="display: none;" autocomplete="new-password">
|
||||
{% if ssh.enable == 1 %}
|
||||
<input type="password" id="ssh_pass-{{ssh.id}}" class="form-control" placeholder="*****" style="display: none;" autocomplete="new-password">
|
||||
{% else %}
|
||||
<input type="password" id="ssh_pass-{{ssh.0}}" class="form-control" placeholder="*****" autocomplete="new-password">
|
||||
<input type="password" id="ssh_pass-{{ssh.id}}" class="form-control" placeholder="*****" autocomplete="new-password">
|
||||
{% endif %}
|
||||
<br>
|
||||
</td>
|
||||
<td>
|
||||
<a class="delete" onclick="confirmDeleteSsh({{ssh.0}})" title="Delete SSH credentials {{ssh.1}}" style="cursor: pointer;"></a>
|
||||
<a class="delete" onclick="confirmDeleteSsh({{ssh.id}})" title="Delete SSH credentials {{ssh.name}}" style="cursor: pointer;"></a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
@ -73,7 +73,7 @@
|
|||
<select id="ssh-key-name">
|
||||
<option disabled selected>Choose credentials</option>
|
||||
{% for ssh in sshs %}
|
||||
<option value={{ssh.1}}>{{ssh.1}}</option>
|
||||
<option value={{ssh.name}}>{{ssh.name}}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
|
|
|
@ -18,54 +18,54 @@
|
|||
<tbody>
|
||||
{% endif %}
|
||||
{% for user in users %}
|
||||
<tr id="user-{{user.0}}" class="{{ loop.cycle('odd', 'even') }} {% if adding %}newuser{% endif %}">
|
||||
<tr id="user-{{user.user_id}}" class="{{ loop.cycle('odd', 'even') }} {% if adding %}newuser{% endif %}">
|
||||
<td class="padding10 first-collumn">
|
||||
{% set login_id = 'login-' + user.0|string() %}
|
||||
{% set login_id = 'login-' + user.user_id|string() %}
|
||||
{% if user.6 == 1%}
|
||||
{{ input(login_id, value=user.1, readonly='readonly') }}
|
||||
{{ input(login_id, value=user.username, readonly='readonly') }}
|
||||
{% else %}
|
||||
{{ input(login_id, value=user.1) }}
|
||||
{{ input(login_id, value=user.username) }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{% if user.6 != 1%}
|
||||
<span title="Change password" style="cursor: pointer; margin-left: 15px;" class="div-pic" onclick="openChangeUserPasswordDialog('{{user.0}}')">
|
||||
<span title="Change password" style="cursor: pointer; margin-left: 15px;" class="div-pic" onclick="openChangeUserPasswordDialog('{{user.user_id}}')">
|
||||
</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="checkbox">
|
||||
{% set activeuser_id = 'activeuser-' + user.0|string() %}
|
||||
{% if user.7 == 1 %}
|
||||
{% set activeuser_id = 'activeuser-' + user.user_id|string() %}
|
||||
{% if user.activeuser == 1 %}
|
||||
{{ checkbox(activeuser_id, checked='checked') }}
|
||||
{% else %}
|
||||
{{ checkbox(activeuser_id) }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{% set email_id = 'email-' + user.0|string() %}
|
||||
{% if user.6 == 1%}
|
||||
{{ input(email_id, value=user.2, readonly='readonly') }}
|
||||
{% set email_id = 'email-' + user.user_id|string() %}
|
||||
{% if user.ldap_user == 1%}
|
||||
{{ input(email_id, value=user.email, readonly='readonly') }}
|
||||
{% else %}
|
||||
{{ input(email_id, value=user.2, type='email') }}
|
||||
{{ input(email_id, value=user.email, type='email') }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<select id="role-{{user.0}}" name="role-{{user.0}}">
|
||||
<select id="role-{{user.user_id}}" name="role-{{user.user_id}}">
|
||||
<option disabled selected>Choose role</option>
|
||||
{% for r in roles %}
|
||||
{% if page == "servers.py" %}
|
||||
{% if r.1 != "superAdmin" %}
|
||||
{% if user.4 == r.1 %}
|
||||
<option value="{{ r.1 }}" selected>{{ r.1 }}</option>
|
||||
{% if r.name != "superAdmin" %}
|
||||
{% if user.role == r.name %}
|
||||
<option value="{{ r.name }}" selected>{{ r.name }}</option>
|
||||
{% else %}
|
||||
<option value="{{ r.1 }}">{{ r.1 }}</option>
|
||||
<option value="{{ r.name }}">{{ r.name }}</option>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% if user.4 == r.1 %}
|
||||
<option value="{{ r.1 }}" selected>{{ r.1 }}</option>
|
||||
{% if user.role == r.name %}
|
||||
<option value="{{ r.name }}" selected>{{ r.name }}</option>
|
||||
{% else %}
|
||||
<option value="{{ r.1 }}">{{ r.1 }}</option>
|
||||
<option value="{{ r.name }}">{{ r.name }}</option>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
@ -73,14 +73,14 @@
|
|||
</td>
|
||||
{% if page != "servers.py" %}
|
||||
<td>
|
||||
<span title="Change user groups" style="cursor: pointer; margin-left: 15px;" class="div-pic" onclick="openChangeUserGroupDialog('{{user.0}}')">
|
||||
<span title="Change user groups" style="cursor: pointer; margin-left: 15px;" class="div-pic" onclick="openChangeUserGroupDialog('{{user.user_id}}')">
|
||||
</td>
|
||||
{% endif %}
|
||||
<td>
|
||||
<a class="add" onclick="cloneUser({{user.0}})" id="clone-{{user.0}}" title="Clone {{user.1}}" style="cursor: pointer;"></a>
|
||||
<a class="add" onclick="cloneUser({{user.user_id}})" id="clone-{{user.user_id}}" title="Clone {{user.1}}" style="cursor: pointer;"></a>
|
||||
</td>
|
||||
<td>
|
||||
<a class="delete" onclick="confirmDeleteUser({{user.0}})" title="Delete user {{user.1}}" style="cursor: pointer;"></a>
|
||||
<a class="delete" onclick="confirmDeleteUser({{user.user_id}})" title="Delete user {{user.1}}" style="cursor: pointer;"></a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<select id="new-role" name="new-role">
|
||||
<option disabled selected>Choose role</option>
|
||||
{% for role in roles %}
|
||||
<option value="{{ role.1 }}">{{ role.1 }}</option>
|
||||
<option value="{{ role.name }}">{{ role.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
|
@ -26,7 +26,7 @@
|
|||
<select id="new-group" name="new-group">
|
||||
<option disabled selected>Choose group</option>
|
||||
{% for group in groups %}
|
||||
<option value="{{ group.0 }}">{{ group.1 }}</option>
|
||||
<option value="{{ group.group_id }}">{{ group.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
|
@ -63,8 +63,8 @@
|
|||
<select id="new-role" name="new-role">
|
||||
<option disabled selected>Choose role</option>
|
||||
{% for role in roles %}
|
||||
{% if role.1 != "superAdmin" %}
|
||||
<option value="{{ role.1 }}">{{ role.1 }}</option>
|
||||
{% if role.name != "superAdmin" %}
|
||||
<option value="{{ role.name }}">{{ role.name }}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
@ -101,7 +101,7 @@
|
|||
<select id="new-server-group-add" name="new-server-group-add">
|
||||
<option disabled selected value="0">Choose group</option>
|
||||
{% for group in groups %}
|
||||
<option value="{{ group.0 }}">{{ group.1 }}</option>
|
||||
<option value="{{ group.group_id }}">{{ group.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
|
@ -133,7 +133,7 @@
|
|||
<td>
|
||||
<select id="new-sshgroup" name="new-sshgroup">
|
||||
{% for group in groups %}
|
||||
<option value="{{ group.0 }}">{{ group.1 }}</option>
|
||||
<option value="{{ group.group_id }}">{{ group.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
|
@ -181,7 +181,7 @@
|
|||
<select id="new-telegram-group-add" name="new-telegram-group-add">
|
||||
<option disabled selected value="0">Choose group</option>
|
||||
{% for group in groups %}
|
||||
<option value="{{ group.0 }}">{{ group.1 }}</option>
|
||||
<option value="{{ group.group_id }}">{{ group.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
|
@ -217,7 +217,7 @@
|
|||
<select id="new-slack-group-add" name="new-slack-group-add">
|
||||
<option disabled selected value="0">Choose group</option>
|
||||
{% for group in groups %}
|
||||
<option value="{{ group.0 }}">{{ group.1 }}</option>
|
||||
<option value="{{ group.group_id }}">{{ group.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
|
|
|
@ -43,4 +43,4 @@
|
|||
|
||||
{%- macro copy_to_clipboard(id='', value='', style='', class='') -%}
|
||||
<span id="{{id}}" style="{{style}}" class="copyToClipboard {{class}}" data-copy="{{value}}" title="Copy {{value}} to clipboard">{{value}}</span>
|
||||
{%- endmacro %}
|
||||
{%- endmacro %}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{% if user %}
|
||||
<span id="show-user-settings-button" class="menu-bar login" title="User settings" style="margin-top: 7px;margin-left: -10px;cursor: pointer;"></span>
|
||||
<a href=/app/login.py?logout=logout title="Logout, user name: {{ user }}" class="login"> Logout</a>
|
||||
<span id="show-user-settings-button" class="menu-bar login" title="User settings" style="margin-top: 7px;cursor: pointer;"></span>
|
||||
<!-- <a href=/app/login.py?logout=logout title="Logout, user name: {{ user }}" class="login"> Logout</a> -->
|
||||
{% else %}
|
||||
<a href=/app/login.py title="Login" class="login"> Login</a>
|
||||
{% endif %}
|
|
@ -10,7 +10,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td id="cur_grafana_ver" class="padding10 first-collumn">
|
||||
{% if grafana == "Active:" %}
|
||||
{% if grafana == "active" %}
|
||||
Grafana and Prometheus servers have already installed
|
||||
{% else %}
|
||||
There are no Grafana and Prometheus servers
|
||||
|
@ -24,7 +24,7 @@
|
|||
</td>
|
||||
<td></td>
|
||||
<td>
|
||||
{% if grafana != "Active:" %}
|
||||
{% if grafana != "active" %}
|
||||
<span class="ui-button ui-widget ui-corner-all" id="grafna_install" title="Install Grafana and Prometheus server">Install</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
$(document).ready(function() {
|
||||
$('#scan_history').on( 'page.dt' )
|
||||
.DataTable( {
|
||||
"order": [[ "5", "asc" ]],
|
||||
"order": [[ "4", "desc" ]],
|
||||
"pageLength": 25,
|
||||
"columnDefs": [
|
||||
{
|
||||
|
|
|
@ -31,32 +31,27 @@
|
|||
</td>
|
||||
<td>
|
||||
{% set id = 'smon-body-' + s.0|string() %}
|
||||
{% if s.5 != 'None' %}
|
||||
{% if s.5 is not none %}
|
||||
<span id="{{id}}">{{s.5}}</span>
|
||||
{% else %}
|
||||
<span id="{{id}}"></span>
|
||||
{% endif %}
|
||||
{#{% if s.5 != 'None' %}
|
||||
{{ input(id, value=s.5, size='10') }}
|
||||
{% else %}
|
||||
{{ input(id, size='10') }}
|
||||
{% endif %} #}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<select id="smon-telegram-{{s.0}}">
|
||||
<option value="0">Disabled</option>
|
||||
{% for t in telegrams %}
|
||||
{% if s.6|int() == t.0|int() %}
|
||||
<option value="{{t.0}}" selected>{{t.2}}</option>
|
||||
{% if s.6|int() == t.id|int() %}
|
||||
<option value="{{t.id}}" selected>{{t.chanel_name}}</option>
|
||||
{% else %}
|
||||
<option value="{{t.0}}">{{t.2}}</option>
|
||||
<option value="{{t.id}}">{{t.chanel_name}}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
{% set id = 'smon-group-' + s.0|string() %}
|
||||
{% if s.8 != 'None' %}
|
||||
{% if s.8 is not none %}
|
||||
{{ input(id, value=s.8, size='15') }}
|
||||
{% else %}
|
||||
{{ input(id, size='15') }}
|
||||
|
@ -64,15 +59,15 @@
|
|||
</td>
|
||||
<td>
|
||||
{% set id = 'smon-desc-' + s.0|string() %}
|
||||
{% if s.7 != 'None' %}
|
||||
{% if s.7 is not none %}
|
||||
{{ input(id, value=s.7, size='20') }}
|
||||
{% else %}
|
||||
{{ input(id, size='20') }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<!--<td>
|
||||
<td>
|
||||
<a class="add" onclick="cloneSmom({{s.0}})" id="clone-{{s.0}}" title="Clone {{s.1}}" style="cursor: pointer; color: #000;"></a>
|
||||
</td>-->
|
||||
</td>
|
||||
<td>
|
||||
<a class="delete" onclick="confirmDeleteSmon({{s.0}})" title="Delete server {{s.1}}" style="cursor: pointer; color: #000;"></a>
|
||||
</td>
|
||||
|
|
|
@ -49,20 +49,20 @@
|
|||
<input type="hidden" id="server-name-{{s.0}}" value="{{s.1}}" />
|
||||
{% for p in port_scanner_settings %}
|
||||
{% if port_scanner_settings|length > 0 %}
|
||||
{% if p.0 == s.0 and p.2 == 1 %}
|
||||
{% if p.server_id == s.0 and p.enabled == 1 %}
|
||||
{% if port_scanner == 'active' %}
|
||||
<span id="portscanner_enable_status-{{p.0}}" class="serverUp server-status" title="Port scanner is enabled and service is UP"></span>
|
||||
<span id="portscanner_enable_status-{{p.server_id}}" class="serverUp server-status" title="Port scanner is enabled and service is UP"></span>
|
||||
{% else %}
|
||||
<span id="portscanner_enable_status-{{p.0}}" class="serverDown server-status" title="Port scanner is enabled, but service is DOWN"></span>
|
||||
<span id="portscanner_enable_status-{{p.server_id}}" class="serverDown server-status" title="Port scanner is enabled, but service is DOWN"></span>
|
||||
{% endif %}
|
||||
{% elif p.0 == s.0 and p.2 == 0 %}
|
||||
<span id="portscanner_enable_status-{{p.0}}" class="serverNone server-status" title="Port scanner is disabled"></span>
|
||||
{% elif p.server_id == s.0 and p.enabled == 0 %}
|
||||
<span id="portscanner_enable_status-{{p.server_id}}" class="serverNone server-status" title="Port scanner is disabled"></span>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<span id="portscanner_enable_status-{{p.0}}" class="serverNone server-status" title="Port scanner is disabled"></span>
|
||||
<span id="portscanner_enable_status-{{p.server_id}}" class="serverNone server-status" title="Port scanner is disabled"></span>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% if s.0 not in port_scanner_settings|map(attribute=0) %}
|
||||
{% if s.0 not in port_scanner_settings|map(attribute='server_id') %}
|
||||
<span id="portscanner_enable_status-{{s.0}}" class="serverNone server-status" title="Port scanner is disabled"></span>
|
||||
{% endif %}
|
||||
{% if not serv %}
|
||||
|
@ -105,29 +105,29 @@
|
|||
{% set portscanner_history_id = 'portscanner_history-' + s.0|string() %}
|
||||
{% if port_scanner_settings|length > 0 %}
|
||||
{% for p in port_scanner_settings %}
|
||||
{% if p.0 == s.0 %}
|
||||
{% if p.server_id == s.0 %}
|
||||
{% set disabled = 'false' %}
|
||||
{% if p.2 == 0 %}
|
||||
{% if p.enabled == 0 %}
|
||||
{% set disabled = 'true' %}
|
||||
{% endif %}
|
||||
{% if p.2 == 1 %}
|
||||
{% if p.enabled == 1 %}
|
||||
{{ checkbox(portscanner_enable_id, title="Port scanner enabled", checked='checked', desc='Port scanner') }}
|
||||
{% else %}
|
||||
{{ checkbox(portscanner_enable_id, title="Port scanner disabled", desc='Port scanner') }}
|
||||
{% endif %}
|
||||
{% if p.3 == 1 %}
|
||||
{% if p.notify == 1 %}
|
||||
{{ checkbox(portscanner_notify_id, title="Notification via Telegram enabled", checked='checked', desc='Notify') }}
|
||||
{% else %}
|
||||
{{ checkbox(portscanner_notify_id, title="Notification via Telegram disabled", desc='Notify', disabled=disabled) }}
|
||||
{% endif %}
|
||||
{% if p.4 == 1 %}
|
||||
{% if p.history == 1 %}
|
||||
{{ checkbox(portscanner_history_id, title="Keeping history enabled", checked='checked', desc='Keep history') }}
|
||||
{% else %}
|
||||
{{ checkbox(portscanner_history_id, title="Keeping history disabled", desc='Keep history', disabled=disabled) }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% if s.0 not in port_scanner_settings|map(attribute=0) %}
|
||||
{% if s.0 not in port_scanner_settings|map(attribute='server_id') %}
|
||||
{{ checkbox(portscanner_enable_id, title="Port scanner disabled", desc='Port scanner') }}
|
||||
{{ checkbox(portscanner_notify_id, title="Notification via Telegram disabled", desc='Notify', disabled='true') }}
|
||||
{{ checkbox(portscanner_history_id, title="Keeping history disabled", desc='Keep history', disabled='true') }}
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
<input type="hidden" id="new-server-group-add" name="new-server-group-add" value="{{ group }}" >
|
||||
<input type="hidden" id="new-sshgroup" name="new-sshgroup" value="{{ group }}" >
|
||||
{{ input('new-telegram-group-add', type='hidden', value=group) }}
|
||||
{{ input('new-slack-group-add', type='hidden', value=group) }}
|
||||
<div id="tabs">
|
||||
<ul>
|
||||
<li><a href="#users" title="Servers: Manage users - Roxy-WI">Users</a></li>
|
||||
|
@ -157,7 +158,7 @@
|
|||
</table>
|
||||
<div id="geoip_country_codes" style="display: none;">
|
||||
{% for code in geoip_country_codes %}
|
||||
<div class="geoip_country_code" id="{{code.1}}">{{code.1}} ({{code.2}})</div>
|
||||
<div class="geoip_country_code" id="{{code.code}}">{{code.code}} ({{code.name}})</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -188,6 +189,17 @@
|
|||
width: 150
|
||||
});
|
||||
{% endfor %}
|
||||
{% for server in backups %}
|
||||
$("#backup-time-{{ server.id}}" ).selectmenu({
|
||||
width: 100
|
||||
});
|
||||
$("#backup-type-{{server.id}}" ).selectmenu({
|
||||
width: 130
|
||||
});
|
||||
$("#backup-credentials-{{server.id}}" ).selectmenu({
|
||||
width: 150
|
||||
});
|
||||
{% endfor %}
|
||||
});
|
||||
</script>
|
||||
<link href="/inc/servers.css" rel="stylesheet"/>
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
<th style="width: 15%;">Telegram</th>
|
||||
<th style="width: 10%;">Group</th>
|
||||
<th style="width: 100%;">Description</th>
|
||||
<!-- <th></th> -->
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
@ -119,7 +119,7 @@
|
|||
<select id="new-smon-telegram">
|
||||
<option value="0">Disabled</option>
|
||||
{% for t in telegrams %}
|
||||
<option value="{{t.0}}">{{t.2}}</option>
|
||||
<option value="{{t.id}}">{{t.chanel_name}}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
|
|
|
@ -16,17 +16,17 @@
|
|||
</td>
|
||||
</tr>
|
||||
{% for r in rules %}
|
||||
<tr class="{{ loop.cycle('odd', 'even') }}" id="rule-{{r.0}}">
|
||||
<td class="padding10 first-collumn">{{r.1}}</td>
|
||||
<tr class="{{ loop.cycle('odd', 'even') }}" id="rule-{{r.id}}">
|
||||
<td class="padding10 first-collumn">{{r.rule_name}}</td>
|
||||
<td class="checkbox">
|
||||
{% set id = 'rule_id-' + r.0|string() %}
|
||||
{% if r.2 == 1 %}
|
||||
{% set id = 'rule_id-' + r.id|string() %}
|
||||
{% if r.en == 1 %}
|
||||
{{ checkbox(id, checked='checked') }}
|
||||
{% else %}
|
||||
{{ checkbox(id) }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td style="padding-top: 5px;padding-bottom: 10px;">{{r.3}}</td>
|
||||
<td style="padding-top: 5px;padding-bottom: 10px;">{{r.desc}}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
|
25
inc/add.js
25
inc/add.js
|
@ -437,7 +437,7 @@ $( function() {
|
|||
});
|
||||
$( "#saved-options" ).autocomplete({
|
||||
dataType: "json",
|
||||
source: "sql.py?getoption="+$('#group').val()+'&token='+$('#token').val(),
|
||||
source: "options.py?getoption="+$('#group').val()+'&token='+$('#token').val(),
|
||||
autoFocus: true,
|
||||
minLength: 1,
|
||||
select: function( event, ui ) {
|
||||
|
@ -459,7 +459,7 @@ $( function() {
|
|||
|
||||
$( "#saved-options1" ).autocomplete({
|
||||
dataType: "json",
|
||||
source: "sql.py?getoption="+$('#group').val()+'&token='+$('#token').val(),
|
||||
source: "options.py?getoption="+$('#group').val()+'&token='+$('#token').val(),
|
||||
autoFocus: true,
|
||||
minLength: 1,
|
||||
select: function( event, ui ) {
|
||||
|
@ -480,7 +480,7 @@ $( function() {
|
|||
});
|
||||
$( "#saved-options2" ).autocomplete({
|
||||
dataType: "json",
|
||||
source: "sql.py?getoption="+$('#group').val()+'&token='+$('#token').val(),
|
||||
source: "options.py?getoption="+$('#group').val()+'&token='+$('#token').val(),
|
||||
autoFocus: true,
|
||||
minLength: 1,
|
||||
select: function( event, ui ) {
|
||||
|
@ -496,8 +496,7 @@ $( function() {
|
|||
});
|
||||
$('#add-option-new').click(function() {
|
||||
$.ajax( {
|
||||
|
||||
url: "sql.py",
|
||||
url: "options.py",
|
||||
data: {
|
||||
newtoption: $('#new-option').val(),
|
||||
newoptiongroup: $('#group').val(),
|
||||
|
@ -523,7 +522,7 @@ $( function() {
|
|||
|
||||
});
|
||||
$( '[name=servers]' ).autocomplete({
|
||||
source: "sql.py?getsavedserver="+$('#group').val()+'&token='+$('#token').val(),
|
||||
source: "options.py?getsavedserver="+$('#group').val()+'&token='+$('#token').val(),
|
||||
autoFocus: true,
|
||||
minLength: 1,
|
||||
select: function( event, ui ) {
|
||||
|
@ -544,7 +543,7 @@ $( function() {
|
|||
$('#add-saved-server-new').click(function() {
|
||||
$.ajax( {
|
||||
|
||||
url: "sql.py",
|
||||
url: "options.py",
|
||||
data: {
|
||||
newsavedserver: $('#new-saved-servers').val(),
|
||||
newsavedservergroup: $('#group').val(),
|
||||
|
@ -1312,7 +1311,7 @@ function confirmDeleteOption(id) {
|
|||
function removeOption(id) {
|
||||
$("#option-"+id).css("background-color", "#f2dede");
|
||||
$.ajax( {
|
||||
url: "sql.py",
|
||||
url: "options.py",
|
||||
data: {
|
||||
optiondel: id,
|
||||
token: $('#token').val()
|
||||
|
@ -1329,7 +1328,7 @@ function removeOption(id) {
|
|||
function updateOptions(id) {
|
||||
toastr.clear();
|
||||
$.ajax( {
|
||||
url: "sql.py",
|
||||
url: "options.py",
|
||||
data: {
|
||||
updateoption: $('#option-body-'+id).val(),
|
||||
id: id,
|
||||
|
@ -1370,7 +1369,7 @@ function confirmDeleteSavedServer(id) {
|
|||
function removeSavedServer(id) {
|
||||
$("#servers-saved-"+id).css("background-color", "#f2dede");
|
||||
$.ajax( {
|
||||
url: "sql.py",
|
||||
url: "options.py",
|
||||
data: {
|
||||
savedserverdel: id,
|
||||
token: $('#token').val()
|
||||
|
@ -1378,7 +1377,7 @@ function removeSavedServer(id) {
|
|||
type: "POST",
|
||||
success: function( data ) {
|
||||
data = data.replace(/\s+/g,' ');
|
||||
if(data == "Ok ") {
|
||||
if(data.indexOf('Ok') != '-1') {
|
||||
$("#servers-saved-"+id).remove();
|
||||
}
|
||||
}
|
||||
|
@ -1387,7 +1386,7 @@ function removeSavedServer(id) {
|
|||
function updateSavedServer(id) {
|
||||
toastr.clear();
|
||||
$.ajax( {
|
||||
url: "sql.py",
|
||||
url: "options.py",
|
||||
data: {
|
||||
updatesavedserver: $('#servers-ip-'+id).val(),
|
||||
description: $('#servers-desc-'+id).val(),
|
||||
|
@ -1816,4 +1815,4 @@ function showUserlists() {
|
|||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@
|
|||
font-family: "Font Awesome 5 Solid";
|
||||
content: "\f24d";
|
||||
}
|
||||
.add .fa-clone, .plus .fa-plus {
|
||||
.add .fa-clone, .plus .fa-plus, .plus-after .fa-plus, .minus-after .fa-minus {
|
||||
color: var(--green-color);
|
||||
}
|
||||
.add-proxy::before {
|
||||
|
@ -273,11 +273,25 @@
|
|||
font-family: "Font Awesome 5 Solid";
|
||||
content: "\f068";
|
||||
}
|
||||
.minus-after::after {
|
||||
display: none;
|
||||
font-family: "Font Awesome 5 Solid";
|
||||
content: "\f068";
|
||||
}
|
||||
.plus::before {
|
||||
display: none;
|
||||
font-family: "Font Awesome 5 Solid";
|
||||
content: "\f067";
|
||||
}
|
||||
.plus-after::after {
|
||||
display: none;
|
||||
font-family: "Font Awesome 5 Solid";
|
||||
content: "\f067";
|
||||
}
|
||||
.plus-after .fa-plus, .minus-after .fa-minus {
|
||||
padding-left: 10px;
|
||||
margin-bottom: -2px;
|
||||
}
|
||||
.row-down::after {
|
||||
display: none;
|
||||
font-family: "Font Awesome 5 Solid";
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
function getHttpChartData(server) {
|
||||
var hide_http_metrics = localStorage.getItem('hide_http_metrics');
|
||||
if (hide_http_metrics == 'disabled') {
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
url: "options.py",
|
||||
data: {
|
||||
|
@ -450,6 +454,30 @@ $( function() {
|
|||
$('#dis_table_metric').css('display', 'inline');
|
||||
loadMetrics();
|
||||
});
|
||||
|
||||
// Check is showing http metrics enabled
|
||||
var hide_http_metrics = localStorage.getItem('hide_http_metrics');
|
||||
if(hide_http_metrics === null) {
|
||||
$('#hide_http_metrics').prop('checked', false);
|
||||
$('#hide_http_metrics').checkboxradio('refresh');
|
||||
$('#http_metrics_div').show();
|
||||
} else if (hide_http_metrics === 'disabled') {
|
||||
$('#hide_http_metrics').prop('checked', true);
|
||||
$('#hide_http_metrics').checkboxradio('refresh');
|
||||
$('#http_metrics_div').hide();
|
||||
}
|
||||
// Disable or enable showing http metrics
|
||||
$('#hide_http_metrics').change(function() {
|
||||
if($(this).is(':checked')) {
|
||||
localStorage.setItem('hide_http_metrics', 'disabled');
|
||||
$('#http_metrics_div').hide();
|
||||
showMetrics();
|
||||
} else {
|
||||
localStorage.removeItem('hide_http_metrics');
|
||||
$('#http_metrics_div').show();
|
||||
showMetrics();
|
||||
}
|
||||
});
|
||||
});
|
||||
function removeData() {
|
||||
for (i = 0; i < charts.length; i++) {
|
||||
|
|
|
@ -889,9 +889,8 @@ $( function() {
|
|||
showCurrentGroup(this);
|
||||
$( this ).dialog( "close" );
|
||||
},
|
||||
Close: function() {
|
||||
$( this ).dialog( "close" );
|
||||
clearTips();
|
||||
Logout: function() {
|
||||
window.location.replace(window.location.origin+'/app/login.py?logout=logout');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1007,7 +1007,13 @@ label {
|
|||
height: 100px;
|
||||
}
|
||||
.server-desc {
|
||||
width: 300px;
|
||||
width: 380px;
|
||||
}
|
||||
.add_proxy {
|
||||
width: 300px;
|
||||
}
|
||||
.chart-container {
|
||||
width: 48.3%;
|
||||
}
|
||||
}
|
||||
@media (max-width: 1280px) {
|
||||
|
|
Loading…
Reference in New Issue