diff options
Diffstat (limited to 'os/platforms/v1')
-rw-r--r-- | os/platforms/v1/Dockerfile.part | 13 | ||||
-rw-r--r-- | os/platforms/v1/index.html | 18 | ||||
-rwxr-xr-x | os/platforms/v1/run.sh | 20 |
3 files changed, 30 insertions, 21 deletions
diff --git a/os/platforms/v1/Dockerfile.part b/os/platforms/v1/Dockerfile.part new file mode 100644 index 00000000..c525b8e7 --- /dev/null +++ b/os/platforms/v1/Dockerfile.part @@ -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 diff --git a/os/platforms/v1/index.html b/os/platforms/v1/index.html index 399d2e89..87281e88 100644 --- a/os/platforms/v1/index.html +++ b/os/platforms/v1/index.html @@ -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> diff --git a/os/platforms/v1/run.sh b/os/platforms/v1/run.sh deleted file mode 100755 index 4dbc17a0..00000000 --- a/os/platforms/v1/run.sh +++ /dev/null @@ -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 |