diff --git a/start.py b/render.py similarity index 66% rename from start.py rename to render.py index 8f1b5a0..3846ab0 100644 --- a/start.py +++ b/render.py @@ -9,7 +9,7 @@ def prepare(config): out = f"""
-

{config[0]}

+

{config[0]}

{config[2]}

@@ -22,7 +22,7 @@ html = "" for i in groups: items = os.listdir(f"{os.path.dirname(sys.argv[0])}/services/{i}") html = html + f""" -

{i}

+

{i}

""" @@ -34,6 +34,7 @@ for i in groups: css = open(f"{os.path.dirname(sys.argv[0])}/template/temp.css") html = f""" +

My ok ish dashboard

@@ -42,4 +43,12 @@ html = f""" f = open(f"{os.path.dirname(sys.argv[0])}/render/render.html","w") f.write(html) -exec(load(f"{os.path.dirname(sys.argv[0])}/dash.py")) \ No newline at end of file +port = 1111 +try: + exec(open(f"{os.path.dirname(sys.argv[0])}/run.py").read()) +except OSError as error: + if error.errno == 98: + print(f"recompiled, another service or instance of this server is running on port {port}") + print("if this server is running, it will have the current config") + else: + print(f"unexpected error: '{error}'") \ No newline at end of file diff --git a/render/render.html b/render/render.html index 5512295..ea4073c 100644 --- a/render/render.html +++ b/render/render.html @@ -1,27 +1,35 @@ +

My ok ish dashboard

-

code

+

code

-

proxmox

+

proxmox

-

casos

+

casos

-

firewall

+

firewall

diff --git a/dash.py b/run.py similarity index 98% rename from dash.py rename to run.py index e0e2e2a..34a00d4 100644 --- a/dash.py +++ b/run.py @@ -26,4 +26,4 @@ def run(server_class=HTTPServer, handler_class=SimpleHTTPRequestHandler, port=11 httpd.serve_forever() if __name__ == "__main__": - run() + run(port=port) diff --git a/template/temp.css b/template/temp.css index 14fd1f7..3ab8cb1 100644 --- a/template/temp.css +++ b/template/temp.css @@ -3,23 +3,30 @@ display: grid; grid-template-rows: 1fr; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); -grid-gap: .5vw; +grid-gap: .1vw; +background-color: #35465a9f; +backdrop-filter: blur(10px); +padding: 20px; +margin: 20px; +border-radius: 20px; } body { - background-color: rgb(67, 95, 102); - + background-image: url('https://www.atlasandboots.com/wp-content/uploads/2019/05/ama-dablam2-most-beautiful-mountains-in-the-world.jpg'); + background-size:cover } h1 { - background-color: rgb(58, 69, 77); + background-color: rgba(58, 69, 77, 0.726); color: #CCCCCC; padding: 10px; border-radius: 10px; + backdrop-filter: blur(10px); } a { + size: 200px; font: bold 11px Arial; text-decoration: none; background-color: #EEEEEE;