mirror of
https://github.com/StefBuwalda/ProjectIOT.git
synced 2025-10-29 18:59:57 +00:00
deleted files on frontend
This commit is contained in:
@@ -1,33 +0,0 @@
|
||||
from flask import Flask, render_template, redirect, url_for
|
||||
from flask_wtf import FlaskForm
|
||||
from wtforms import StringField, SubmitField, BooleanField
|
||||
from wtforms.validators import DataRequired
|
||||
|
||||
app = Flask(__name__)
|
||||
app.config['SECRET_KEY'] = 'mijngeheimesleutel'
|
||||
|
||||
class GateControlForm(FlaskForm):
|
||||
open_gate = SubmitField('Open Gate')
|
||||
close_gate = SubmitField('Close Gate')
|
||||
debug_mode = BooleanField('Enable Debug Mode')
|
||||
check_camera = SubmitField('Check Camera') # New button to check camera status
|
||||
|
||||
class InputForm(FlaskForm):
|
||||
name = StringField('Name', validators=[DataRequired()])
|
||||
submit = SubmitField('Submit')
|
||||
|
||||
@app.route('/', methods=['GET', 'POST'])
|
||||
def dashboard():
|
||||
gate_status = "Closed"
|
||||
debug_mode = False
|
||||
form = GateControlForm()
|
||||
if form.validate_on_submit():
|
||||
if form.open_gate.data:
|
||||
gate_status = "Open"
|
||||
elif form.close_gate.data:
|
||||
debug_mode = form.debug_mode.data
|
||||
return render_template('dashboard.html', form=form, gate_status=gate_status, debug_mode=debug_mode)
|
||||
return render_template('dashboard.html', form=form, gate_status=gate_status, debug_mode=debug_mode)
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(debug=True)
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,50 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.5/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<title>Admin Dashboard</title>
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.5/dist/js/bootstrap.bundle.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-md-3 col-lg-2 d-md-block bg-dark sidebar collapse">
|
||||
<div class="position-sticky pt-3">
|
||||
<ul class="nav flex-column">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active text-white" href="#">
|
||||
Dashboard
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-white" href="#">
|
||||
Users
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-white" href="#">
|
||||
Reports
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-9 ms-sm-auto col-lg-10 px-md-4">
|
||||
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
|
||||
<h1 class="h2">Admin Dashboard</h1>
|
||||
<div class="btn-toolbar mb-2 mb-md-0">
|
||||
<div class="btn-group me-2">
|
||||
<button type="button" class="btn btn-sm btn-outline-secondary">Share</button>
|
||||
<button type="button" class="btn btn-sm btn-outline-secondary">Export</button>
|
||||
</div>
|
||||
<a href="/logout" class="btn btn-sm btn-danger">Logout</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{%block content%}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.5/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="https://getbootstrap.com/docs/5.3/assets/css/docs.css" rel="stylesheet">
|
||||
<title>Inlog</title>
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.5/dist/js/bootstrap.bundle.min.js"></script>
|
||||
</head>
|
||||
<body class="bg-dark">
|
||||
<div class="container d-flex justify-content-center align-items-center" style="min-height: 100vh;">
|
||||
<div class="card p-4 shadow">
|
||||
<h3 class="text-center mb-4">Admin Login</h3>
|
||||
<form action="{{ url_for('login') }}" method="post">
|
||||
{{ form.csrf_token }}
|
||||
<div class="mb-3">
|
||||
<label for="username" class="form-label">Username</label>
|
||||
<input type="text" class="form-control" id="username" name="username" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="password" class="form-label">Password</label>
|
||||
<input type="password" id="password" class="form-control" name="password" required>
|
||||
<div id="passwordHelpInline" class="form-text">
|
||||
Must be 8-20 characters long.
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3 form-check">
|
||||
<input type="checkbox" class="form-check-input" id="remember" name="remember">
|
||||
<label class="form-check-label" for="remember">Remember me</label>
|
||||
</div>
|
||||
{% if error %}
|
||||
<div class="alert alert-danger">
|
||||
{{ error }}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="d-grid">
|
||||
<button type="submit" class="btn btn-dark">Login</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user