4 Commits

3 changed files with 12 additions and 13 deletions

View File

@@ -15,7 +15,7 @@
<main>
<div class="button-container">
<p><a href="{{ url_for('panel') }}" class="link">Back to Panel</a></p>
<h2>Details for PC ID: {{ pc.id }}</h2>
<h2>{{ pc.id }}</h2>
<p><a href="{{ url_for('stream', pc_id=pc.id) }}" class="link">View Stream</a></p>
</div>
<table class="center-table details-table">

View File

@@ -11,7 +11,7 @@
<header>
<h1><a href="{{ url_for('index') }}">judas</a></h1>
{% if logged %}
<p>Welcome, {{ username }}! <a href="{{ url_for('logout') }}">Logout</a></p>
<p><a class="button" href="{{ url_for('logout') }}">Logout</a></p>
{% else %}
<p><a class="button" href="{{ url_for('login') }}">Login</a></p>
{% endif %}
@@ -22,10 +22,12 @@
<h2 id="typing-text" style="font-size: 3rem;">judas</h2>
<p>a remote PC fleet management system</p>
</div>
<div>
<p style="color: #bf616a;"><strong>Notice:</strong> Please use this system responsibly and in accordance with all applicable laws and organizational policies.</p>
{% if logged %}
<p><a class="button" href="{{ url_for('panel') }}">Go to panel</a></p>
{% else %}
<p>Please <a href="{{ url_for('login')}}" class="link">log in</a> to manage your remote PCs.</p>
</div>
{% endif %}
</main>
</div>
<script>

View File

@@ -49,7 +49,7 @@ PC_DETAILS = {
"id": "PC7",
"status": "offline",
"last_seen": "2023-10-01 11:00:00",
}
},
}
@@ -79,11 +79,8 @@ def load_user(user_id: str) -> User | None:
@app.route("/")
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.redirect(flask.url_for("panel"))
else:
return flask.render_template(
"index.html", logged=False, login_url=flask.url_for("login")
"index.html", logged=flask_login.current_user.is_authenticated
)