mirror of https://github.com/Aidaho12/haproxy-wi
parent
3bcd2a5077
commit
333b53a327
|
@ -1391,6 +1391,7 @@ def insert_metrics(serv, curr_con, cur_ssl_con, sess_rate, max_sess_rate):
|
|||
if not conn.is_closed():
|
||||
conn.close()
|
||||
|
||||
|
||||
def insert_metrics_http(serv, http_2xx, http_3xx, http_4xx, http_5xx):
|
||||
cur_date = get_date.return_date('regular')
|
||||
try:
|
||||
|
@ -4141,3 +4142,52 @@ def is_user_super_admin(user_id: int) -> bool:
|
|||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
|
||||
def get_roxy_tools():
|
||||
query = RoxyTool.select()
|
||||
try:
|
||||
query_res = query.where(RoxyTool.is_roxy == 1).execute()
|
||||
except Exception as e:
|
||||
out_error(e)
|
||||
else:
|
||||
tools = []
|
||||
for tool in query_res:
|
||||
tools.append(tool.name)
|
||||
return tools
|
||||
|
||||
|
||||
def get_all_tools():
|
||||
try:
|
||||
query_res = RoxyTool.select().execute()
|
||||
except Exception as e:
|
||||
out_error(e)
|
||||
else:
|
||||
tools = {}
|
||||
for tool in query_res:
|
||||
tools.setdefault(tool.name, {'current_version': tool.current_version, 'new_version': tool.new_version, 'desc': tool.desc})
|
||||
|
||||
return tools
|
||||
|
||||
|
||||
def update_tool_cur_version(tool_name: str, version: str):
|
||||
try:
|
||||
RoxyTool.update(current_version=version).where(RoxyTool.name == tool_name).execute()
|
||||
except Exception as e:
|
||||
out_error(e)
|
||||
|
||||
|
||||
def update_tool_new_version(tool_name: str, version: str):
|
||||
try:
|
||||
RoxyTool.update(new_version=version).where(RoxyTool.name == tool_name).execute()
|
||||
except Exception as e:
|
||||
out_error(e)
|
||||
|
||||
|
||||
def get_tool_cur_version(tool_name: str):
|
||||
try:
|
||||
query = RoxyTool.get(RoxyTool.name == tool_name).current_version
|
||||
except Exception as e:
|
||||
out_error(e)
|
||||
else:
|
||||
return query
|
||||
|
|
|
@ -185,8 +185,8 @@ def delete_ip_from_list():
|
|||
@bp.route('/list/add', methods=['POST'])
|
||||
def add_ip_to_list():
|
||||
ip = request.form.get('list_ip_for_add')
|
||||
ip = ip.strip()
|
||||
ip = common.is_ip_or_dns(ip)
|
||||
ip = common.is_ip_or_dns(ip.strip())
|
||||
serv = common.is_ip_or_dns(request.form.get('serv'))
|
||||
list_id = common.checkAjaxInput(request.form.get('list_id_for_add'))
|
||||
list_name = common.checkAjaxInput(request.form.get('list_name'))
|
||||
|
||||
|
|
|
@ -124,7 +124,7 @@
|
|||
<li><a href="{{ url_for('admin.admin') }}#servers" title="{{lang.words.admin_area|title()}}: {{lang.words.manage|title()}} {{lang.words.servers2}}" class="runtime servers head-submenu" id="admin-area-servers">{{lang.words.servers|title()}}</a></li>
|
||||
<li><a href="{{ url_for('admin.admin') }}#ssh" title="{{lang.words.admin_area|title()}}: {{lang.words.manage|title()}} SSH {{lang.words.creds2}}" class="admin ssh head-submenu" id="admin-area-ssh">SSH {{lang.words.creds|title()}}</a></li>
|
||||
<li><a href="{{ url_for('admin.admin') }}#settings" title="{{lang.words.admin_area|title()}}: {{lang.words.manage|title()}} Roxy-WI {{lang.words.settings2}}" class="settings head-submenu" id="admin-area-settings">{{lang.words.settings|title()}}</a></li>
|
||||
<li><a href="{{ url_for('admin.admin') }}#tools" title="{{lang.words.admin_area|title()}}: {{lang.words.manage|title()}} Roxy-WI {{lang.words.tools}}" class="services head-submenu" id="admin-area-services">{{lang.words.tools|title()}}</a></li>
|
||||
<li><a href="{{ url_for('admin.admin') }}#tools" title="{{lang.words.admin_area|title()}}: {{lang.words.manage|title()}} Roxy-WI {{lang.words.tools}}" class="tools head-submenu" id="admin-area-services">{{lang.words.tools|title()}}</a></li>
|
||||
<li><a href="{{ url_for('logs.logs_internal') }}" title="{{lang.words.admin_area|title()}}: {{lang.words.view|title()}} {{lang.words.internal2}} {{lang.words.logs2}}" class="logs head-submenu" id="admin-area-logs">{{lang.words.internal|title()}} {{lang.words.logs}}</a></li>
|
||||
<li><a href="{{ url_for('admin.admin') }}#updatehapwi" title="{{lang.words.admin_area|title()}}: {{lang.words.w_update|title()}} Roxy-WI" class="upload updatehapwi head-submenu" id="admin-area-update">{{lang.words.w_update|title()}}</a></li>
|
||||
</ul>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
configparser>=3.5.0
|
||||
pytz>=2017.3
|
||||
tzlocal==2.0.0
|
||||
pyTelegramBotAPI>=3.6.3
|
||||
slack-sdk>=3.4.0
|
||||
distro>=1.2.0
|
||||
|
@ -12,4 +13,3 @@ python3-nmap<=1.5.1
|
|||
aio-pika>=7.1.0
|
||||
pika>=1.2.0
|
||||
websockets>=9.0
|
||||
retry>=0.9.2
|
||||
|
|
|
@ -7,6 +7,7 @@ peewee>=3.14.10
|
|||
PyMySQL>=1.0.2
|
||||
retry>=0.9.2
|
||||
pdpyras>=4.5.2
|
||||
tzlocal==2.0.0
|
||||
pika>=1.3.1
|
||||
Flask>=2.0.3
|
||||
Flask-Login>=0.4.1
|
||||
|
@ -16,4 +17,3 @@ python3-nmap<=1.5.1
|
|||
aio-pika>=7.1.0
|
||||
pika>=1.2.0
|
||||
websockets>=9.0
|
||||
retry>=0.9.2
|
||||
|
|
|
@ -7,6 +7,7 @@ peewee>=3.14.10
|
|||
PyMySQL>=1.0.2
|
||||
bottle>=0.12.18
|
||||
retry>=0.9.2
|
||||
tzlocal==2.0.0
|
||||
pdpyras>=4.5.2
|
||||
pika>=1.3.1
|
||||
Flask>=2.0.3
|
||||
|
@ -17,4 +18,3 @@ python3-nmap<=1.5.1
|
|||
aio-pika>=7.1.0
|
||||
pika>=1.2.0
|
||||
websockets>=9.0
|
||||
retry>=0.9.2
|
||||
|
|
|
@ -17,4 +17,4 @@ python3-nmap<=1.5.1
|
|||
aio-pika>=7.1.0
|
||||
pika>=1.2.0
|
||||
websockets>=9.0
|
||||
retry>=0.9.2
|
||||
tzlocal==2.0.0
|
||||
|
|
|
@ -146,6 +146,7 @@
|
|||
font-family: "Font Awesome 5 Solid";
|
||||
content: "\f1da";
|
||||
}
|
||||
.tools::before,
|
||||
.services::before {
|
||||
display: none;
|
||||
font-family: "Font Awesome 5 Solid";
|
||||
|
|
|
@ -580,13 +580,9 @@ function ShowOverviewLogs() {
|
|||
},
|
||||
success: function( data ) {
|
||||
data = data.replace(/\s+/g,' ');
|
||||
if (data.indexOf('error:') != '-1') {
|
||||
toastr.error(data);
|
||||
} else {
|
||||
$("#overview-logs").html(data);
|
||||
$.getScript("/inc/fontawesome.min.js")
|
||||
$.getScript("/inc/overview.js")
|
||||
}
|
||||
$("#overview-logs").html(data);
|
||||
$.getScript("/inc/fontawesome.min.js")
|
||||
$.getScript("/inc/overview.js")
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
|
|
@ -319,7 +319,7 @@ function addNewIp() {
|
|||
var ip = $('#list_add_ip_new_ip').val();
|
||||
if(valid) {
|
||||
$.ajax({
|
||||
url: "/app/runtimeapi/add/",
|
||||
url: "/app/runtimeapi/list/add/",
|
||||
data: {
|
||||
serv: $('#list_serv_select').val(),
|
||||
list_ip_for_add: ip,
|
||||
|
|
|
@ -359,7 +359,6 @@ function showLog() {
|
|||
var serv = $("#serv").val();
|
||||
if ((file === undefined || file === null) && (waf == '' || waf === undefined)) {
|
||||
var file_from_get = findGetParameter('file');
|
||||
console.log(file_from_get)
|
||||
if (file_from_get === undefined || file_from_get === null) {
|
||||
toastr.warning('Select a log file first')
|
||||
return false;
|
||||
|
@ -884,6 +883,7 @@ $( function() {
|
|||
} else if (data.indexOf('error') != '-1') {
|
||||
toastr.error(data);
|
||||
} else {
|
||||
sessionStorage.removeItem('check-service');
|
||||
window.location.replace(data);
|
||||
}
|
||||
}
|
||||
|
|
15
inc/users.js
15
inc/users.js
|
@ -917,8 +917,6 @@ $( function() {
|
|||
$("#tabs ul li").click(function() {
|
||||
var activeTab = $(this).find("a").attr("href");
|
||||
var activeTabClass = activeTab.replace('#', '');
|
||||
console.log(activeTab)
|
||||
console.log(activeTabClass)
|
||||
$('.menu li ul li').each(function () {
|
||||
$(this).find('a').css('border-left', '0px solid var(--right-menu-blue-rolor)');
|
||||
$(this).find('a').css('padding-left', '20px')
|
||||
|
@ -2412,6 +2410,7 @@ function updateService(service, action='update') {
|
|||
}
|
||||
$("#ajax-update").html('');
|
||||
loadupdatehapwi();
|
||||
loadServices();
|
||||
show_version();
|
||||
}
|
||||
});
|
||||
|
@ -2569,6 +2568,18 @@ function loadupdatehapwi() {
|
|||
}
|
||||
} );
|
||||
}
|
||||
function checkUpdateRoxy() {
|
||||
$.ajax({
|
||||
url: "/app/admin/update/check",
|
||||
// data: {
|
||||
// token: $('#token').val()
|
||||
// },
|
||||
// type: "POST",
|
||||
success: function (data) {
|
||||
loadupdatehapwi();
|
||||
}
|
||||
} );
|
||||
}
|
||||
function loadchecker() {
|
||||
$.ajax({
|
||||
url: "/app/checker/settings/load",
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
configparser>=3.5.0
|
||||
paramiko-ng>=2.5.0
|
||||
pytz>=2017.3
|
||||
tzlocal==2.0.0
|
||||
requests>=2.22.0
|
||||
pyTelegramBotAPI>=3.6.3
|
||||
networkx>=2.6
|
||||
|
|
Loading…
Reference in New Issue