Compare commits
2 Commits
4ce1e00c46
...
60d8fcace9
| Author | SHA1 | Date | |
|---|---|---|---|
| 60d8fcace9 | |||
| 39a2300aa3 |
@@ -1,5 +1,7 @@
|
|||||||
# checks.py
|
# checks.py
|
||||||
import socket
|
import socket
|
||||||
|
import urllib.request
|
||||||
|
import urllib.error
|
||||||
|
|
||||||
|
|
||||||
class SystemChecks:
|
class SystemChecks:
|
||||||
@@ -16,11 +18,21 @@ class SystemChecks:
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
def check_ziti_status(self):
|
def check_ziti_status(self):
|
||||||
"""Probes the configured Ziti target endpoint."""
|
"""Makes an HTTP request to the configured address."""
|
||||||
if not self.ziti_target:
|
if not self.ziti_target:
|
||||||
return False
|
return False
|
||||||
host, port = self.ziti_target
|
|
||||||
return self._tcp_ping(host, int(port), timeout=1.0)
|
try:
|
||||||
|
request = urllib.request.Request(
|
||||||
|
self.ziti_target,
|
||||||
|
method="GET",
|
||||||
|
)
|
||||||
|
|
||||||
|
with urllib.request.urlopen(request, timeout=2.0) as response:
|
||||||
|
return 200 <= response.status < 300
|
||||||
|
|
||||||
|
except (urllib.error.URLError, TimeoutError, OSError):
|
||||||
|
return False
|
||||||
|
|
||||||
def _tcp_ping(self, host, port, timeout=1):
|
def _tcp_ping(self, host, port, timeout=1):
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -6,6 +6,12 @@ window {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Large, prominent clock */
|
/* Large, prominent clock */
|
||||||
|
label.date-display {
|
||||||
|
font-size: 30px;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #fafafa;
|
||||||
|
padding-right: 30px;
|
||||||
|
}
|
||||||
label.clock-display {
|
label.clock-display {
|
||||||
font-size: 32px;
|
font-size: 32px;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
|
|||||||
Reference in New Issue
Block a user