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)
|
script_links = ast.literal_eval(script_l.field_2)
|
||||||
svr_content = ''
|
svr_content = ''
|
||||||
for i in sl:
|
for i in sl:
|
||||||
if i.ip == '':
|
try:
|
||||||
break
|
if time.time() - ping_list[i.name] < 20:
|
||||||
elif i.ip != '':
|
svr_status = '''<div class="alert alert-success">
|
||||||
try:
|
<strong>Online</strong>
|
||||||
if time.time() - ping_list[i.name] < 20:
|
</div> '''
|
||||||
svr_status = '''<div class="alert alert-success">
|
elif time.time() - ping_list[i.name] <= 300:
|
||||||
<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:
|
|
||||||
svr_status = '''<div class="alert alert-warning">
|
svr_status = '''<div class="alert alert-warning">
|
||||||
<strong>Unknown</strong>
|
<strong>Unknown <br /> (No pings, less than 5 min.)</strong>
|
||||||
</div> '''
|
</div> '''
|
||||||
|
elif time.time() - ping_list[i.name] > 300:
|
||||||
svr_content = svr_content + '''
|
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">
|
||||||
<div class="card-header" style="text-align: center;"><h3>''' + i.name + '''</h3></div>
|
<div class="card-header" style="text-align: center;"><h3>''' + i.name + '''</h3></div>
|
||||||
<div class="card-body container-fluid center;">
|
<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>
|
<td style="width: 78.7895%;"> <input name="dash_url" type="text" value="''' + str(s.dash_url) + '''"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
<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>
|
<td style="width: 78.7895%;"> <input name="server_ip" type="text" value="''' + str(s.ip) + '''"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
@ -3941,7 +3940,7 @@ TG #: <strong> ''' + str(tg_d.tg) + '''</strong>
|
|||||||
<td style="width: 70%;"> <input name="dash_url" type="text" /></td>
|
<td style="width: 70%;"> <input name="dash_url" type="text" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
<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>
|
<td style="width: 78.7895%;"> <input name="server_ip" type="text" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user