pull/145/head
Pavel Loginov 2019-09-14 12:15:02 +03:00
parent f1d2d93ebd
commit 095d06f240
3 changed files with 4 additions and 2 deletions

View File

@ -522,7 +522,7 @@ def check_new_version():
context = ssl._create_unverified_context() context = ssl._create_unverified_context()
if proxy: if proxy:
proxyDict = { "https" : proxy } proxyDict = { "https" : proxy, "http" : proxy }
response = urllib.request.urlopen('https://haproxy-wi.org/update.py?last_ver=1', context=context, proxies=proxyDict) response = urllib.request.urlopen('https://haproxy-wi.org/update.py?last_ver=1', context=context, proxies=proxyDict)
else: else:
response = urllib.request.urlopen('https://haproxy-wi.org/update.py?last_ver=1', context=context) response = urllib.request.urlopen('https://haproxy-wi.org/update.py?last_ver=1', context=context)

View File

@ -16,7 +16,7 @@
</td> </td>
<td> <td>
{% if current_ver_without_dots < new_ver_without_dots and current_ver_without_dots != new_ver_without_dots and new_ver != "Sorry cannot get current version" %} {% if current_ver_without_dots < new_ver_without_dots and current_ver_without_dots != new_ver_without_dots and new_ver != "Sorry cannot get current version" %}
<a class="ui-button ui-widget ui-corner-all" id="install" title="Install HAProxy">Update</a> <a class="ui-button ui-widget ui-corner-all" id="update_haproxy_wi" title="Update HAProxy">Update</a>
{% endif %} {% endif %}
</td> </td>
</table> </table>

View File

@ -24,6 +24,7 @@ try:
current_ver_without_dots = ''.join(current_ver_without_dots) current_ver_without_dots = ''.join(current_ver_without_dots)
except: except:
current_ver = "Sorry cannot get current version" current_ver = "Sorry cannot get current version"
current_ver_without_dots = "Sorry cannot get current version"
try: try:
new_ver = funct.check_new_version() new_ver = funct.check_new_version()
@ -31,6 +32,7 @@ try:
new_ver_without_dots = ''.join(new_ver_without_dots) new_ver_without_dots = ''.join(new_ver_without_dots)
except: except:
new_ver = "Sorry cannot get new version" new_ver = "Sorry cannot get new version"
new_ver_without_dots = "Sorry cannot get new version"
output_from_parsed_template = template.render(h2 = 1, title = "Check updates", output_from_parsed_template = template.render(h2 = 1, title = "Check updates",
role = sql.get_user_role_by_uuid(user_id.value), role = sql.get_user_role_by_uuid(user_id.value),