Reorganised the webservers (temp for now) and docker-compose.yml now works
This commit is contained in:
21
web_server/ui/static/checkout.js
Normal file
21
web_server/ui/static/checkout.js
Normal file
@@ -0,0 +1,21 @@
|
||||
const stripe = Stripe("pk_test_51QikGlGk6yuk3uA8MT3uQrPMpUqJlKzkxfbrfrd34yXolWSbJYEFWm674s2aUydZyjjS0W2oByEJTV0LXMs1pWTk002ioHxQl6");
|
||||
|
||||
initialize();
|
||||
|
||||
// Create a Checkout Session
|
||||
async function initialize() {
|
||||
const fetchClientSecret = async () => {
|
||||
const response = await fetch("/create-checkout-session", {
|
||||
method: "POST",
|
||||
});
|
||||
const { clientSecret } = await response.json();
|
||||
return clientSecret;
|
||||
};
|
||||
|
||||
const checkout = await stripe.initEmbeddedCheckout({
|
||||
fetchClientSecret,
|
||||
});
|
||||
|
||||
// Mount Checkout
|
||||
checkout.mount('#checkout');
|
||||
}
|
||||
0
web_server/ui/static/styles.css
Normal file
0
web_server/ui/static/styles.css
Normal file
14
web_server/ui/templates/base.html
Normal file
14
web_server/ui/templates/base.html
Normal file
@@ -0,0 +1,14 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Live Stream</title>
|
||||
{% block header_config %}
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
{% block main_content %}
|
||||
{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
15
web_server/ui/templates/checkout.html
Normal file
15
web_server/ui/templates/checkout.html
Normal file
@@ -0,0 +1,15 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block header_config %}
|
||||
<link rel="stylesheet" href="style.css" />
|
||||
<script src="https://js.stripe.com/v3/"></script>
|
||||
<script src="{{ url_for('static', filename='checkout.js') }}" defer></script>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block main_content %}
|
||||
<!-- Display a payment form -->
|
||||
<div id="checkout">
|
||||
<!-- Checkout will insert the payment form here -->
|
||||
</div>
|
||||
{% endblock %}
|
||||
5
web_server/ui/templates/index.html
Normal file
5
web_server/ui/templates/index.html
Normal file
@@ -0,0 +1,5 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block main_content %}
|
||||
<h1>Welcome</h1>
|
||||
{% endblock %}
|
||||
19
web_server/ui/templates/login.html
Normal file
19
web_server/ui/templates/login.html
Normal 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
web_server/ui/templates/signup.html
Normal file
31
web_server/ui/templates/signup.html
Normal 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 %}
|
||||
19
web_server/ui/templates/video.html
Normal file
19
web_server/ui/templates/video.html
Normal file
@@ -0,0 +1,19 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block main_content %}
|
||||
<link href="http://vjs.zencdn.net/6.2.8/video-js.css" rel="stylesheet">
|
||||
<body>
|
||||
<video id="player" class="video-js vjs-default-skin" controls preload>
|
||||
<source src="/hls/stream.m3u8" type="application/x-mpegURL">
|
||||
</video>
|
||||
<script src="http://vjs.zencdn.net/6.2.8/video.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/videojs-contrib-hls/5.4.0/videojs-contrib-hls.min.js"></script>
|
||||
<script>
|
||||
var player = videojs('player', {width: 1280, height: 720});
|
||||
player.play();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user