fix server listing
This commit is contained in:
parent
f5f1f9b91f
commit
1847f13471
57
web/app.py
57
web/app.py
@ -919,34 +919,33 @@ def hbnet_web_service():
|
||||
script_links = ast.literal_eval(script_l.field_2)
|
||||
svr_content = ''
|
||||
for i in sl:
|
||||
if i.ip == '':
|
||||
break
|
||||
elif i.ip != '':
|
||||
try:
|
||||
if time.time() - ping_list[i.name] < 20:
|
||||
svr_status = '''<div class="alert alert-success">
|
||||
<strong>Online</strong>
|
||||
</div> '''
|
||||
elif time.time() - ping_list[i.name] <= 300:
|
||||
svr_status = '''<div class="alert alert-warning">
|
||||
<strong>Unknown <br /> (No pings, less than 5 min.)</strong>
|
||||
</div> '''
|
||||
elif time.time() - ping_list[i.name] > 300:
|
||||
svr_status = '''<div class="alert alert-danger">
|
||||
<strong>Offline</strong>
|
||||
</div> '''
|
||||
else:
|
||||
svr_status = '''<div class="alert alert-warning">
|
||||
<strong>Unknown Condition</strong>
|
||||
</div> '''
|
||||
print(ping_list)
|
||||
print(time.time())
|
||||
except:
|
||||
try:
|
||||
if time.time() - ping_list[i.name] < 20:
|
||||
svr_status = '''<div class="alert alert-success">
|
||||
<strong>Online</strong>
|
||||
</div> '''
|
||||
elif time.time() - ping_list[i.name] <= 300:
|
||||
svr_status = '''<div class="alert alert-warning">
|
||||
<strong>Unknown</strong>
|
||||
</div> '''
|
||||
|
||||
svr_content = svr_content + '''
|
||||
<strong>Unknown <br /> (No pings, less than 5 min.)</strong>
|
||||
</div> '''
|
||||
elif time.time() - ping_list[i.name] > 300:
|
||||
svr_status = '''<div class="alert alert-danger">
|
||||
<strong>Offline</strong>
|
||||
</div> '''
|
||||
else:
|
||||
svr_status = '''<div class="alert alert-warning">
|
||||
<strong>Unknown Condition</strong>
|
||||
</div> '''
|
||||
print(ping_list)
|
||||
print(time.time())
|
||||
except:
|
||||
svr_status = '''<div class="alert alert-warning">
|
||||
<strong>Unknown</strong>
|
||||
</div> '''
|
||||
if i.ip == '':
|
||||
pass
|
||||
else:
|
||||
svr_content = svr_content + '''
|
||||
<div class="card">
|
||||
<div class="card-header" style="text-align: center;"><h3>''' + i.name + '''</h3></div>
|
||||
<div class="card-body container-fluid center;">
|
||||
@ -3734,7 +3733,7 @@ TG #: <strong> ''' + str(tg_d.tg) + '''</strong>
|
||||
<td style="width: 78.7895%;"> <input name="dash_url" type="text" value="''' + str(s.dash_url) + '''"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 16.0381%;"><strong> Host (IP/DNS, for listing on passphrase page, blank to not list):</strong></td>
|
||||
<td style="width: 16.0381%;"><strong> Host (IP/DNS, for listing on passphrase page):</strong></td>
|
||||
<td style="width: 78.7895%;"> <input name="server_ip" type="text" value="''' + str(s.ip) + '''"/></td>
|
||||
</tr>
|
||||
|
||||
@ -3941,7 +3940,7 @@ TG #: <strong> ''' + str(tg_d.tg) + '''</strong>
|
||||
<td style="width: 70%;"> <input name="dash_url" type="text" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 16.0381%;"><strong> Host (IP/DNS, blank to not list):</strong></td>
|
||||
<td style="width: 16.0381%;"><strong> Host (IP/DNS):</strong></td>
|
||||
<td style="width: 78.7895%;"> <input name="server_ip" type="text" /></td>
|
||||
</tr>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user