made names more clear and added better error info

This commit is contained in:
ocueye2 2024-08-30 00:39:24 +00:00
parent 28a9f2dda5
commit 4ef33e8534
4 changed files with 45 additions and 21 deletions

View File

@ -9,7 +9,7 @@ def prepare(config):
out = f"""
<div class="item">
<a href="{config[1]}" style='{config[3]}'>
<h2>{config[0]}</h2>
<h3>{config[0]}</h3>
<p>{config[2]}</p>
</a>
</div>
@ -22,7 +22,7 @@ html = ""
for i in groups:
items = os.listdir(f"{os.path.dirname(sys.argv[0])}/services/{i}")
html = html + f"""
<h1>{i}</h1>
<h2>{i}</h2>
<div class="group">
"""
@ -34,6 +34,7 @@ for i in groups:
css = open(f"{os.path.dirname(sys.argv[0])}/template/temp.css")
html = f"""
<h1> My ok ish dashboard </h1>
<style>
{css.read()}
</style>
@ -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"))
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}'")

File diff suppressed because one or more lines are too long

View File

@ -26,4 +26,4 @@ def run(server_class=HTTPServer, handler_class=SimpleHTTPRequestHandler, port=11
httpd.serve_forever()
if __name__ == "__main__":
run()
run(port=port)

View File

@ -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;