Improved login funtion by creating temporary HTML pages and fixing bugs in login

This commit is contained in:
white
2025-01-17 16:58:23 +00:00
parent a7b62ff972
commit e89e5f0fef
13 changed files with 84 additions and 39 deletions

View File

@@ -1,20 +1,5 @@
{% extends "base.html" %}
{% block main_content %}
<h1>Live Stream</h1>
<video id="localVideo" autoplay playsinline controls></video>
<script>
// constant containing the video
const videoElement = document.getElementById('localVideo');
// Request access to the user's camera and microphone
navigator.mediaDevices.getUserMedia({ video: true, audio: true })
.then((stream) => {
// Display the stream locally
videoElement.srcObject = stream;
})
.catch((error) => {
console.error('Error accessing media devices.', error);
});
</script>
<h1>Welcome</h1>
{% endblock %}

19
ui/templates/login.html Normal file
View File

@@ -0,0 +1,19 @@
{% extends "base.html" %}
{% block main_content %}
<form action="" method="post" novalidate>
{{ form.hidden_tag() }}
{{ form.username.label }}
{{ form.username() }}
{% for error in form.username.errors %}
{{ error }}
{% endfor %}
<br />
{{ form.password.label }}
{{ form.password() }}
<br />
{{ form.submit() }}
</form>
{% endblock %}

31
ui/templates/signup.html Normal file
View File

@@ -0,0 +1,31 @@
{% extends "base.html" %}
{% block main_content %}
<form action="" method="post" novalidate>
{{ form.hidden_tag() }}
{{ form.email.label }}
{{ form.email() }}
{% for error in form.email.errors %}
{{ error }}
{% endfor %}
<br />
{{ form.username.label }}
{{ form.username() }}
{% for error in form.username.errors %}
{{ error }}
{% endfor %}
<br />
{{ form.password.label }}
{{ form.password() }}
{% for error in form.password.errors %}
{{ error }}
{% endfor %}
<br />
{{ form.password2.label }}
{{ form.password2() }}
<br />
{{ form.submit() }}
</form>
{% endblock %}