14 Commits

Author SHA1 Message Date
f3f521efe2 style(web_server.py): fix type in index() 2025-06-16 10:45:44 +02:00
feb7a71816 refactor(web_server.py): redirect from / to /panel if logged in 2025-06-16 10:45:08 +02:00
e15f02be05 refactor(web_server.py): render login.html instead of bare form in /login 2025-06-16 10:44:00 +02:00
5031799072 feat(login.html): add basic login page 2025-06-16 10:43:18 +02:00
26fac14802 refactor(stream.html): make logout button pretty and fix name in header 2025-06-16 10:39:45 +02:00
75694f9200 refactor(details.html): make logout button pretty and fix name in header 2025-06-16 10:38:54 +02:00
522c14793a refactor(panel.html): make logout button pretty and fix name in header 2025-06-16 10:38:23 +02:00
9a074f17d8 style(index.html): add newline at end of file 2025-06-16 10:37:13 +02:00
6ec1af2cf7 feat(index.html): add pretty typewriter effect to header on main 2025-06-16 10:36:46 +02:00
ff911bc8bc feat(index.html): add welcome text and a disclaimer 2025-06-16 10:36:14 +02:00
446e5fbc04 feat(index.html): add link to homepage to app name in header 2025-06-16 10:34:52 +02:00
04c46f1e98 refactor(style.css): add barebones stylesheet 2025-06-16 10:32:04 +02:00
2786f39b9b chore(.vscode/launch.json): add launch task for flask app 2025-06-16 10:30:16 +02:00
ad479fe0d7 build(pyproject.toml): rename start script to web 2025-06-16 10:28:56 +02:00
8 changed files with 44 additions and 27 deletions

22
.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,22 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch Flask",
"type": "debugpy",
"request": "launch",
"module": "flask",
"env": {
"FLASK_APP": "judas_server/web/web_server.py",
},
"args": [
"run",
],
"console": "internalConsole",
"justMyCode": true,
}
]
}

View File

@@ -40,19 +40,20 @@ main {
flex-grow: 1;
}
header a{
header a {
text-decoration: none;
color: #eceff4;
}
.button {
padding: 0.5rem 1rem;
border-radius: 0.25rem;
display: inline-block;
padding: 0.5rem 1rem;
background-color: #8fbcbb;
transition: 0.3s ease-in-out;
border: none;
color: #2e3440;
border: none;
border-radius: 0.25rem;
text-decoration: none;
transition: 0.3s ease-in-out;
}
.button:hover {
@@ -60,11 +61,6 @@ header a{
cursor: pointer;
}
.button a {
text-decoration: none;
color: #2e3440;
}
.center{
.center {
text-align: center;
}

View File

@@ -9,8 +9,8 @@
<body>
<div id="wrapper">
<header>
<h1><a href="{{ url_for('panel') }}">judas panel</a></h1>
<p>Welcome, {{ username }}! <a href="{{ url_for('logout') }}">Logout</a></p>
<h1><a href="{{ url_for('index') }}">judas</a></h1>
<p><a class="button" href="{{ url_for('logout') }}">Logout</a></p>
</header>
<main>
<h2>Details for PC ID: {{ pc.id }}</h2>

View File

@@ -13,11 +13,12 @@
{% if logged %}
<p>Welcome, {{ username }}! <a href="{{ url_for('logout') }}">Logout</a></p>
{% else %}
<p class="button"><a href="{{ url_for('login') }}">Login</a></p>
<p><a class="button" href="{{ url_for('login') }}">Login</a></p>
{% endif %}
</header>
<main class="center">
<h2 id="typing-text" style="font-size: 3rem;">Welcome to judas!</h2>
<p>Welcome to</p>
<h2 id="typing-text" style="font-size: 3rem;">judas</h2>
<p>a remote PC fleet management system</p>
<br>
<p style="color: #bf616a;"><strong>Notice:</strong> Please use this system responsibly and in accordance with all applicable laws and organizational policies.</p>
@@ -36,6 +37,7 @@
if (i < txt.length) {
document.getElementById("typing-text").innerHTML += txt.charAt(i);
i++;
var randomDelay = Math.floor(Math.random() * (maxSpeed - minSpeed + 1)) + minSpeed;
setTimeout(typeWriter, randomDelay);
}

View File

@@ -9,11 +9,10 @@
<body>
<div id="wrapper">
<header>
<h1><a href="{{ url_for('panel') }}">judas</a></h1>
<p class="button"><a href="{{ url_for('logout') }}">Logout</a></p>
<h1><a href="{{ url_for('index') }}">judas</a></h1>
<p><a class="button" href="{{ url_for('logout') }}">Logout</a></p>
</header>
<main>
<h2>PCs</h2>
<table border="1">
<thead>
<tr>

View File

@@ -8,8 +8,8 @@
<body>
<div id="wrapper">
<header>
<h1><a href="{{ url_for('panel') }}">judas panel</a></h1>
<p>Welcome, {{ username }}! <a href="{{ url_for('logout') }}">Logout</a></p>
<h1><a href="{{ url_for('index') }}">judas</a></h1>
<p><a class="button" href="{{ url_for('logout') }}">Logout</a></p>
</header>
</div>
</body>

View File

@@ -52,12 +52,10 @@ def load_user(user_id: str) -> User | None:
@app.route("/")
def index() -> str:
def index() -> flask.Response | str:
"""Renders the index page with a link to the login page."""
if flask_login.current_user.is_authenticated:
return flask.render_template(
"index.html", logged=True, username=flask_login.current_user.id
)
return flask.redirect(flask.url_for("panel"))
else:
return flask.render_template(
"index.html", logged=False, login_url=flask.url_for("login")

View File

@@ -11,7 +11,7 @@ readme = "README.md"
license = {text = "GPL-3.0"}
[tool.pdm.scripts]
start = "flask --app judas_server/web/web_server.py run"
web = "flask --app judas_server/web/web_server.py run"
[tool.pdm]
distribution = false