Add requests to requirements.txt, assert that actions is not None when creating the buttons in the ui, move imports to the top in dashboard.system
This commit is contained in:
parent
fdf617b032
commit
c74ee7c6cb
3 changed files with 8 additions and 6 deletions
|
@ -10,9 +10,15 @@ import time
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
|
import requests, urllib3
|
||||||
|
|
||||||
from .mixins import PingableMixin, WakeOnLanMixin
|
from .mixins import PingableMixin, WakeOnLanMixin
|
||||||
|
|
||||||
|
|
||||||
|
# don't need the warning, bc. ssl verification needs to be disabled explicitly
|
||||||
|
urllib3.disable_warnings(category=urllib3.connectionpool.InsecureRequestWarning)
|
||||||
|
|
||||||
|
|
||||||
# base classes and types and stuff
|
# base classes and types and stuff
|
||||||
|
|
||||||
|
|
||||||
|
@ -110,12 +116,6 @@ class PingableWOLSystem(WakeOnLanMixin, PingableSystem):
|
||||||
# HTTP Server System
|
# HTTP Server System
|
||||||
|
|
||||||
|
|
||||||
import requests, urllib3
|
|
||||||
|
|
||||||
# don't need the warning, bc. ssl verification needs to be disabled explicitly
|
|
||||||
urllib3.disable_warnings(category=urllib3.connectionpool.InsecureRequestWarning)
|
|
||||||
|
|
||||||
|
|
||||||
class HTTPServer(System):
|
class HTTPServer(System):
|
||||||
|
|
||||||
def __init__(self, name, description, url: str, expected_status_code: int = 200, allow_self_signed_cert: bool = False):
|
def __init__(self, name, description, url: str, expected_status_code: int = 200, allow_self_signed_cert: bool = False):
|
||||||
|
|
|
@ -39,6 +39,7 @@ def init_ui(
|
||||||
if t.state_verbose != "":
|
if t.state_verbose != "":
|
||||||
html.pre(t.state_verbose).classes("opacity-50 text-xs text-wrap")
|
html.pre(t.state_verbose).classes("opacity-50 text-xs text-wrap")
|
||||||
actions = t.get_actions()
|
actions = t.get_actions()
|
||||||
|
assert actions != None
|
||||||
if len(actions) > 0:
|
if len(actions) > 0:
|
||||||
if t.description != "" or t.state_verbose != "":
|
if t.description != "" or t.state_verbose != "":
|
||||||
ui.separator().style("margin-top: auto;")
|
ui.separator().style("margin-top: auto;")
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
nicegui~=2.11.1
|
nicegui~=2.11.1
|
||||||
|
requests
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue