mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 17:20:30 +08:00
51 lines
1.0 KiB
HTML
51 lines
1.0 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<title>π-kvm</title>
|
|
<style>
|
|
body {
|
|
text-align: center;
|
|
}
|
|
.screen, .screen * {
|
|
box-sizing: border-box;
|
|
}
|
|
.screen {
|
|
display: inline-block;
|
|
background-color: #e5e5f5;
|
|
font-family: Arial, Tahoma, Verdana, sans;
|
|
font-size: 10pt;
|
|
text-align: center;
|
|
padding: 1em;
|
|
text-align: left;
|
|
}
|
|
.screen .screen-image {
|
|
width: 720px;
|
|
height: 576px;
|
|
border: 1px solid #77d;
|
|
display: inline-block;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<script>
|
|
function onWsMessage(message) {
|
|
console.log(message.data);
|
|
if (message.data == "EVENT mjpg_streamer started") {
|
|
document.getElementById("stream-image").src = "/video/?action=stream&time=" + new Date().getTime();
|
|
}
|
|
}
|
|
|
|
ws = new WebSocket("ws://" + location.host + "/kvm/ws");
|
|
ws.onmessage = (message) => onWsMessage(message);
|
|
ws.onerror = (error) => console.error(error);
|
|
ws.onclose = () => console.log("closed");
|
|
</script>
|
|
|
|
<body>
|
|
<div class="screen">
|
|
<img src="/video/?action=stream" id="stream-image" class="screen-image" alt="" />
|
|
</div>
|
|
</body>
|
|
</html>
|