2022-06-25 20:52:55 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="">
|
|
|
|
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
2022-07-22 23:14:19 +00:00
|
|
|
<title id="streamName">{{name}}</title>
|
2022-06-25 20:52:55 +00:00
|
|
|
<meta name="author" content="Your Name">
|
2022-07-21 23:21:05 +00:00
|
|
|
<meta name="description" content="{{description}}">
|
2022-06-25 20:52:55 +00:00
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
<link rel="stylesheet" href="">
|
|
|
|
<link rel="icon" type="image/x-icon" href=""/>
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
2022-07-21 05:42:38 +00:00
|
|
|
<header>
|
|
|
|
</header>
|
|
|
|
<main>
|
2022-07-22 23:14:19 +00:00
|
|
|
<h2 id="streamTitle">{{streamTitle}}</h2>
|
|
|
|
<p>Stream online? <span id="streamOnline">{{online}}</span></p>
|
2022-07-21 23:21:05 +00:00
|
|
|
<hr>
|
2022-07-22 23:14:19 +00:00
|
|
|
<p>Current Viewers: <span id="currentViewers">{{viewerCount}}</span></p>
|
|
|
|
<p>Session Max Viewers: <span id="sessionMaxViewerCount">{{sessionMaxViewerCount}}</span></p>
|
|
|
|
<p>Overall Max Viewers: <span id="overallMaxViewerCount">{{overallMaxViewerCount}}</span></p>
|
|
|
|
<hr>
|
|
|
|
<p>Current tags: <span id="tags"></span></p>
|
2022-07-21 05:42:38 +00:00
|
|
|
</main>
|
|
|
|
<footer>
|
|
|
|
</footer>
|
2022-06-25 20:52:55 +00:00
|
|
|
</body>
|
|
|
|
|
2022-07-22 23:15:56 +00:00
|
|
|
<script>
|
|
|
|
async function getEndpoint(url = '') {
|
|
|
|
const response = await fetch(url, {method:'GET'});
|
|
|
|
const data = await response.json();
|
|
|
|
return data;
|
|
|
|
}
|
|
|
|
|
|
|
|
async function uiUpdate() {
|
|
|
|
window.setInterval(async () => {
|
|
|
|
data = await getEndpoint('http://127.0.0.1:5000/api/serverstatus');
|
|
|
|
document.getElementById("streamTitle").innerHTML = data.streamTitle
|
|
|
|
document.getElementById("currentViewers").innerHTML = data.viewerCount
|
|
|
|
document.getElementById("sessionMaxViewerCount").innerHTML = data.sessionMaxViewerCount
|
|
|
|
document.getElementById("overallMaxViewerCount").innerHTML = data.overallMaxViewerCount
|
|
|
|
document.getElementById("tags").innerHTML = data.tags
|
|
|
|
}, 1000)
|
|
|
|
}
|
|
|
|
|
|
|
|
async function updateStreamTitle() {
|
|
|
|
response = await fetch('http://127.0.0.1:5000/api/update/streamtitle',
|
|
|
|
{
|
|
|
|
method:'POST',
|
|
|
|
data:JSON.stringify('a big test')
|
|
|
|
}
|
|
|
|
);
|
|
|
|
const data = await response.json()
|
|
|
|
return data
|
|
|
|
}
|
|
|
|
// uiUpdate()
|
|
|
|
updateStreamTitle()
|
|
|
|
</script>
|
|
|
|
|
2022-06-25 20:52:55 +00:00
|
|
|
</html>
|