mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 09:01:54 +08:00
new pi-builder
This commit is contained in:
13
os/platforms/v1/Dockerfile.part
Normal file
13
os/platforms/v1/Dockerfile.part
Normal file
@@ -0,0 +1,13 @@
|
||||
RUN pkg-install \
|
||||
kvmd \
|
||||
mjpg-streamer-pikvm \
|
||||
nginx
|
||||
|
||||
COPY stages/pikvm/config.txt /boot/
|
||||
COPY stages/pikvm/99-pikvm.conf /etc/sysctl.d/
|
||||
COPY stages/pikvm/index.html /srv/http/
|
||||
COPY stages/pikvm/kvmd.yaml /etc/
|
||||
COPY stages/pikvm/nginx.conf /etc/nginx/
|
||||
|
||||
RUN systemctl enable kvmd
|
||||
RUN systemctl enable nginx
|
||||
@@ -36,15 +36,31 @@ function onWsMessage(message) {
|
||||
}
|
||||
}
|
||||
|
||||
function onKeyPress(event) {
|
||||
console.log("key pressed: ", event);
|
||||
let e = event || window.event || arguments.callee.caller.arguments[0];
|
||||
// ws.Send("EVENT press " + e.keyCode);
|
||||
}
|
||||
|
||||
function onKeyRelease(event) {
|
||||
console.log("key released: ", event);
|
||||
let e = event || window.event || arguments.callee.caller.arguments[0];
|
||||
// ws.Send("EVENT press " + e.keyCode);
|
||||
}
|
||||
|
||||
ws = new WebSocket("ws://" + location.host + "/kvmd/ws");
|
||||
ws.onmessage = (message) => onWsMessage(message);
|
||||
ws.onerror = (error) => console.error(error);
|
||||
ws.onclose = () => console.log("closed");
|
||||
|
||||
//https://www.codeday.top/2017/05/03/24906.html
|
||||
document.onkeydown = onKeyPress;
|
||||
document.onkeyup = onKeyRelease;
|
||||
</script>
|
||||
|
||||
<body>
|
||||
<div class="screen">
|
||||
<img src="/video/?action=stream" id="stream-image" class="screen-image" alt="" />
|
||||
<img src="/streamer/?action=stream" id="stream-image" class="screen-image" alt="" />
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
set -x
|
||||
|
||||
. ../functions.sh
|
||||
|
||||
|
||||
pkg_install \
|
||||
kvmd \
|
||||
mjpg-streamer-pikvm \
|
||||
nginx
|
||||
|
||||
cp config.txt "$FS/boot/"
|
||||
cp 99-pikvm.conf "$FS/etc/sysctl.d/"
|
||||
cp index.html "$FS/srv/http/"
|
||||
cp kvmd.yaml "$FS/etc/"
|
||||
cp nginx.conf "$FS/etc/nginx/"
|
||||
|
||||
rpi systemctl enable kvmd
|
||||
rpi systemctl enable nginx
|
||||
Reference in New Issue
Block a user