pull/145/head
Pavel Loginov 2019-09-14 17:31:17 +03:00
parent 510f11146e
commit 3bb60bb4f1
2 changed files with 13 additions and 5 deletions

View File

@ -516,16 +516,16 @@ def check_ver():
def check_new_version():
import requests
import ssl
import sql
import sql
proxy = sql.get_setting('proxy')
if 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:
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

View File

@ -151,6 +151,14 @@ $( function() {
$('.alert-danger').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>');
} 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>');
}
}
} );