Compare commits
1 Commits
f3f521efe2
...
d983ab0f8b
| Author | SHA1 | Date | |
|---|---|---|---|
| d983ab0f8b |
22
.vscode/launch.json
vendored
22
.vscode/launch.json
vendored
@@ -1,22 +0,0 @@
|
||||
{
|
||||
// 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,
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -18,7 +18,7 @@ input {
|
||||
border-radius: 0.25rem;
|
||||
padding: 0.25rem;
|
||||
}
|
||||
|
||||
|
||||
#wrapper {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -40,20 +40,19 @@ main {
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
header a {
|
||||
header a{
|
||||
text-decoration: none;
|
||||
color: #eceff4;
|
||||
}
|
||||
|
||||
.button {
|
||||
display: inline-block;
|
||||
padding: 0.5rem 1rem;
|
||||
background-color: #8fbcbb;
|
||||
color: #2e3440;
|
||||
border: none;
|
||||
border-radius: 0.25rem;
|
||||
text-decoration: none;
|
||||
display: inline-block;
|
||||
background-color: #8fbcbb;
|
||||
transition: 0.3s ease-in-out;
|
||||
border: none;
|
||||
color: #2e3440;
|
||||
}
|
||||
|
||||
.button:hover {
|
||||
@@ -61,6 +60,11 @@ header a {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.center {
|
||||
.button a {
|
||||
text-decoration: none;
|
||||
color: #2e3440;
|
||||
}
|
||||
|
||||
.center{
|
||||
text-align: center;
|
||||
}
|
||||
@@ -9,8 +9,8 @@
|
||||
<body>
|
||||
<div id="wrapper">
|
||||
<header>
|
||||
<h1><a href="{{ url_for('index') }}">judas</a></h1>
|
||||
<p><a class="button" href="{{ url_for('logout') }}">Logout</a></p>
|
||||
<h1><a href="{{ url_for('panel') }}">judas panel</a></h1>
|
||||
<p>Welcome, {{ username }}! <a href="{{ url_for('logout') }}">Logout</a></p>
|
||||
</header>
|
||||
<main>
|
||||
<h2>Details for PC ID: {{ pc.id }}</h2>
|
||||
|
||||
@@ -13,12 +13,11 @@
|
||||
{% if logged %}
|
||||
<p>Welcome, {{ username }}! <a href="{{ url_for('logout') }}">Logout</a></p>
|
||||
{% else %}
|
||||
<p><a class="button" href="{{ url_for('login') }}">Login</a></p>
|
||||
<p class="button"><a href="{{ url_for('login') }}">Login</a></p>
|
||||
{% endif %}
|
||||
</header>
|
||||
<main class="center">
|
||||
<p>Welcome to</p>
|
||||
<h2 id="typing-text" style="font-size: 3rem;">judas</h2>
|
||||
<h2 id="typing-text" style="font-size: 3rem;">Welcome to 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>
|
||||
@@ -37,7 +36,6 @@
|
||||
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);
|
||||
}
|
||||
@@ -46,4 +44,4 @@
|
||||
typeWriter();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
@@ -9,10 +9,11 @@
|
||||
<body>
|
||||
<div id="wrapper">
|
||||
<header>
|
||||
<h1><a href="{{ url_for('index') }}">judas</a></h1>
|
||||
<p><a class="button" href="{{ url_for('logout') }}">Logout</a></p>
|
||||
<h1><a href="{{ url_for('panel') }}">judas</a></h1>
|
||||
<p class="button"><a href="{{ url_for('logout') }}">Logout</a></p>
|
||||
</header>
|
||||
<main>
|
||||
<h2>PCs</h2>
|
||||
<table border="1">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
<body>
|
||||
<div id="wrapper">
|
||||
<header>
|
||||
<h1><a href="{{ url_for('index') }}">judas</a></h1>
|
||||
<p><a class="button" href="{{ url_for('logout') }}">Logout</a></p>
|
||||
<h1><a href="{{ url_for('panel') }}">judas panel</a></h1>
|
||||
<p>Welcome, {{ username }}! <a href="{{ url_for('logout') }}">Logout</a></p>
|
||||
</header>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -52,10 +52,12 @@ def load_user(user_id: str) -> User | None:
|
||||
|
||||
|
||||
@app.route("/")
|
||||
def index() -> flask.Response | str:
|
||||
def index() -> str:
|
||||
"""Renders the index page with a link to the login page."""
|
||||
if flask_login.current_user.is_authenticated:
|
||||
return flask.redirect(flask.url_for("panel"))
|
||||
return flask.render_template(
|
||||
"index.html", logged=True, username=flask_login.current_user.id
|
||||
)
|
||||
else:
|
||||
return flask.render_template(
|
||||
"index.html", logged=False, login_url=flask.url_for("login")
|
||||
|
||||
@@ -11,7 +11,7 @@ readme = "README.md"
|
||||
license = {text = "GPL-3.0"}
|
||||
|
||||
[tool.pdm.scripts]
|
||||
web = "flask --app judas_server/web/web_server.py run"
|
||||
start = "flask --app judas_server/web/web_server.py run"
|
||||
|
||||
[tool.pdm]
|
||||
distribution = false
|
||||
|
||||
Reference in New Issue
Block a user