mirror of https://github.com/Aidaho12/haproxy-wi
v3.4.6
parent
510f11146e
commit
3bb60bb4f1
10
app/funct.py
10
app/funct.py
|
@ -516,16 +516,16 @@ def check_ver():
|
||||||
def check_new_version():
|
def check_new_version():
|
||||||
import requests
|
import requests
|
||||||
import ssl
|
import ssl
|
||||||
import sql
|
import sql
|
||||||
|
|
||||||
proxy = sql.get_setting('proxy')
|
proxy = sql.get_setting('proxy')
|
||||||
|
|
||||||
if proxy:
|
if proxy:
|
||||||
proxyDict = { "https" : proxy, "http" : proxy }
|
proxyDict = { "https" : proxy, "http" : proxy }
|
||||||
response = requests.get('https://haproxy-wi.org/update.py?last_ver=1', verify=False, proxies=proxyDict)
|
response = requests.get('https://haproxy-wi.org/update.py?last_ver=1', verify=False, timeout=10, proxies=proxyDict)
|
||||||
else:
|
else:
|
||||||
response = requests.get('https://haproxy-wi.org/update.py?last_ver=1', verify=False)
|
response = requests.get('https://haproxy-wi.org/update.py?last_ver=1', verify=False, timeout=10)
|
||||||
|
|
||||||
res = response.content().decode(encoding='UTF-8')
|
res = response.content.decode(encoding='UTF-8')
|
||||||
|
|
||||||
return res
|
return res
|
|
@ -151,6 +151,14 @@ $( function() {
|
||||||
$('.alert-danger').remove();
|
$('.alert-danger').remove();
|
||||||
$('.alert-warning').remove();
|
$('.alert-warning').remove();
|
||||||
$("#ajax").html('<div class="alert alert-warning">It is seems like you do not have HAProxy-WI repository settings. Please read docs for<a href="https://haproxy-wi.org/updates.py">detail</a></data>');
|
$("#ajax").html('<div class="alert alert-warning">It is seems like you do not have HAProxy-WI repository settings. Please read docs for<a href="https://haproxy-wi.org/updates.py">detail</a></data>');
|
||||||
|
} else if (data.indexOf('password for') != '-1') {
|
||||||
|
$('.alert-danger').remove();
|
||||||
|
$('.alert-warning').remove();
|
||||||
|
$("#ajax").html('<div class="alert alert-warning">It is seems like you need add Apache user to sudoers. Please read docs for<a href="https://haproxy-wi.org/updates.py">detail</a></data>');
|
||||||
|
} else if (data.indexOf('No packages marked for update') != '-1') {
|
||||||
|
$('.alert-danger').remove();
|
||||||
|
$('.alert-warning').remove();
|
||||||
|
$("#ajax").html('<div class="alert alert-warning">It is seems like you have the last version HAProxy-WI</data>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
Loading…
Reference in New Issue