mirror of https://github.com/jetkvm/kvm.git
Compare commits
6 Commits
7d21c597c0
...
d9ae2f8c53
Author | SHA1 | Date |
---|---|---|
|
d9ae2f8c53 | |
|
0cee284561 | |
|
2272247668 | |
|
21e30c60ea | |
|
25e30f6420 | |
|
d84c00af94 |
|
@ -0,0 +1,75 @@
|
||||||
|
name: 'Pull Request'
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- dev
|
||||||
|
paths-ignore:
|
||||||
|
- .gitignore
|
||||||
|
- README.md
|
||||||
|
- LICENSE
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Use Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: v21.1.0
|
||||||
|
cache: 'npm'
|
||||||
|
cache-dependency-path: '**/package-lock.json'
|
||||||
|
|
||||||
|
- name: Cache NPM dependencies
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ~/.npm
|
||||||
|
key: npm-cache-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
npm-cache-${{ runner.os }}-
|
||||||
|
|
||||||
|
- name: Install Dependencies and Build
|
||||||
|
run: |
|
||||||
|
cd ui
|
||||||
|
npm ci
|
||||||
|
# npm run lint # need to clean lint before enabling this
|
||||||
|
npm run build:prod
|
||||||
|
env:
|
||||||
|
CI: true
|
||||||
|
|
||||||
|
- name: Cache Prisma Binary
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ~/.npm/_npx
|
||||||
|
key: prisma-binary-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
|
||||||
|
restore-keys: prisma-binary-${{ runner.os }}-
|
||||||
|
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v4
|
||||||
|
with:
|
||||||
|
go-version: '1.24.0'
|
||||||
|
|
||||||
|
- name: Cache Go modules
|
||||||
|
id: cache-go-mod
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cache/go-build
|
||||||
|
~/go/pkg/mod
|
||||||
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-go-
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: go mod download
|
||||||
|
|
||||||
|
- name: Build Go application
|
||||||
|
env:
|
||||||
|
GOOS: linux
|
||||||
|
GOARCH: arm
|
||||||
|
GOARM: 7
|
||||||
|
VERSION_DEV: ci-build
|
||||||
|
run: |
|
||||||
|
make frontend
|
||||||
|
make build_dev
|
|
@ -4,6 +4,7 @@ linters:
|
||||||
- forbidigo
|
- forbidigo
|
||||||
- misspell
|
- misspell
|
||||||
- whitespace
|
- whitespace
|
||||||
|
- gochecknoinits
|
||||||
settings:
|
settings:
|
||||||
forbidigo:
|
forbidigo:
|
||||||
forbid:
|
forbid:
|
||||||
|
@ -22,6 +23,9 @@ linters:
|
||||||
- linters:
|
- linters:
|
||||||
- errcheck
|
- errcheck
|
||||||
path: _test.go
|
path: _test.go
|
||||||
|
- linters:
|
||||||
|
- gochecknoinits
|
||||||
|
path: internal/logging/sse.go
|
||||||
paths:
|
paths:
|
||||||
- third_party$
|
- third_party$
|
||||||
- builtin$
|
- builtin$
|
||||||
|
|
4
Makefile
4
Makefile
|
@ -2,8 +2,8 @@ BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
|
||||||
BUILDDATE ?= $(shell date -u +%FT%T%z)
|
BUILDDATE ?= $(shell date -u +%FT%T%z)
|
||||||
BUILDTS ?= $(shell date -u +%s)
|
BUILDTS ?= $(shell date -u +%s)
|
||||||
REVISION ?= $(shell git rev-parse HEAD)
|
REVISION ?= $(shell git rev-parse HEAD)
|
||||||
VERSION_DEV := 0.4.1-dev$(shell date +%Y%m%d%H%M)
|
VERSION_DEV := 0.4.2-dev$(shell date +%Y%m%d%H%M)
|
||||||
VERSION := 0.4.0
|
VERSION := 0.4.1
|
||||||
|
|
||||||
PROMETHEUS_TAG := github.com/prometheus/common/version
|
PROMETHEUS_TAG := github.com/prometheus/common/version
|
||||||
KVM_PKG_NAME := github.com/jetkvm/kvm
|
KVM_PKG_NAME := github.com/jetkvm/kvm
|
||||||
|
|
|
@ -370,9 +370,7 @@ func startBacklightTickers() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func initDisplay() {
|
||||||
ensureConfigLoaded()
|
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
waitCtrlClientConnected()
|
waitCtrlClientConnected()
|
||||||
displayLogger.Info().Msg("setting initial display contents")
|
displayLogger.Info().Msg("setting initial display contents")
|
||||||
|
|
|
@ -15,9 +15,7 @@ func rpcGetJigglerState() bool {
|
||||||
return jigglerEnabled
|
return jigglerEnabled
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func initJiggler() {
|
||||||
ensureConfigLoaded()
|
|
||||||
|
|
||||||
go runJiggler()
|
go runJiggler()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
6
main.go
6
main.go
|
@ -75,8 +75,8 @@ func Main() {
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
// initialize usb gadget
|
||||||
initUsbGadget()
|
initUsbGadget()
|
||||||
|
|
||||||
if err := setInitialVirtualMediaState(); err != nil {
|
if err := setInitialVirtualMediaState(); err != nil {
|
||||||
logger.Warn().Err(err).Msg("failed to set initial virtual media state")
|
logger.Warn().Err(err).Msg("failed to set initial virtual media state")
|
||||||
}
|
}
|
||||||
|
@ -84,6 +84,10 @@ func Main() {
|
||||||
if err := initImagesFolder(); err != nil {
|
if err := initImagesFolder(); err != nil {
|
||||||
logger.Warn().Err(err).Msg("failed to init images folder")
|
logger.Warn().Err(err).Msg("failed to init images folder")
|
||||||
}
|
}
|
||||||
|
initJiggler()
|
||||||
|
|
||||||
|
// initialize display
|
||||||
|
initDisplay()
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
time.Sleep(15 * time.Minute)
|
time.Sleep(15 * time.Minute)
|
||||||
|
|
|
@ -674,7 +674,6 @@ export default function WebRTCVideo() {
|
||||||
<div className="grid grow grid-rows-(--grid-bodyFooter) overflow-hidden">
|
<div className="grid grow grid-rows-(--grid-bodyFooter) overflow-hidden">
|
||||||
<div className="relative mx-4 my-2 flex items-center justify-center overflow-hidden">
|
<div className="relative mx-4 my-2 flex items-center justify-center overflow-hidden">
|
||||||
<div className="relative flex h-full w-full items-center justify-center">
|
<div className="relative flex h-full w-full items-center justify-center">
|
||||||
<div className="relative inline-block">
|
|
||||||
{/* In relative mouse mode and under https, we enable the pointer lock, and to do so we need a bar to show the user to click on the video to enable mouse control */}
|
{/* In relative mouse mode and under https, we enable the pointer lock, and to do so we need a bar to show the user to click on the video to enable mouse control */}
|
||||||
<PointerLockBar show={showPointerLockBar} />
|
<PointerLockBar show={showPointerLockBar} />
|
||||||
<video
|
<video
|
||||||
|
@ -688,7 +687,7 @@ export default function WebRTCVideo() {
|
||||||
disablePictureInPicture
|
disablePictureInPicture
|
||||||
controlsList="nofullscreen"
|
controlsList="nofullscreen"
|
||||||
className={cx(
|
className={cx(
|
||||||
"z-30 max-h-full min-h-[384px] max-w-full min-w-[512px] bg-black/50 object-contain transition-all duration-1000",
|
"max-h-full min-h-[384px] max-w-full min-w-[512px] bg-black/50 object-contain transition-all duration-1000",
|
||||||
{
|
{
|
||||||
"cursor-none": settings.isCursorHidden,
|
"cursor-none": settings.isCursorHidden,
|
||||||
"opacity-0":
|
"opacity-0":
|
||||||
|
@ -718,7 +717,6 @@ export default function WebRTCVideo() {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<VirtualKeyboard />
|
<VirtualKeyboard />
|
||||||
|
|
|
@ -11,7 +11,7 @@ import { chars as chars_sv_SE, name as name_sv_SE } from "@/keyboardLayouts/sv_S
|
||||||
import { chars as chars_fr_CH, name as name_fr_CH } from "@/keyboardLayouts/fr_CH"
|
import { chars as chars_fr_CH, name as name_fr_CH } from "@/keyboardLayouts/fr_CH"
|
||||||
import { chars as chars_de_CH, name as name_de_CH } from "@/keyboardLayouts/de_CH"
|
import { chars as chars_de_CH, name as name_de_CH } from "@/keyboardLayouts/de_CH"
|
||||||
|
|
||||||
type KeyInfo = { key: string | number; shift?: boolean, altRight?: boolean }
|
interface KeyInfo { key: string | number; shift?: boolean, altRight?: boolean }
|
||||||
export type KeyCombo = KeyInfo & { deadKey?: boolean, accentKey?: KeyInfo }
|
export type KeyCombo = KeyInfo & { deadKey?: boolean, accentKey?: KeyInfo }
|
||||||
|
|
||||||
export const layouts: Record<string, string> = {
|
export const layouts: Record<string, string> = {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { KeyCombo } from "../keyboardLayouts"
|
import { KeyCombo } from "../keyboardLayouts"
|
||||||
|
|
||||||
import { chars as chars_de_CH } from "./de_CH"
|
import { chars as chars_de_CH } from "./de_CH"
|
||||||
|
|
||||||
export const name = "Français de Suisse";
|
export const name = "Français de Suisse";
|
||||||
|
|
|
@ -25,7 +25,7 @@ export default function SettingsKeyboardRoute() {
|
||||||
if ("error" in resp) return;
|
if ("error" in resp) return;
|
||||||
setKeyboardLayout(resp.result as string);
|
setKeyboardLayout(resp.result as string);
|
||||||
});
|
});
|
||||||
}, []);
|
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
||||||
|
|
||||||
const onKeyboardLayoutChange = useCallback(
|
const onKeyboardLayoutChange = useCallback(
|
||||||
(e: React.ChangeEvent<HTMLSelectElement>) => {
|
(e: React.ChangeEvent<HTMLSelectElement>) => {
|
||||||
|
|
|
@ -20,8 +20,8 @@ import { LinkButton } from "@/components/Button";
|
||||||
import LoadingSpinner from "@/components/LoadingSpinner";
|
import LoadingSpinner from "@/components/LoadingSpinner";
|
||||||
import { useUiStore } from "@/hooks/stores";
|
import { useUiStore } from "@/hooks/stores";
|
||||||
import useKeyboard from "@/hooks/useKeyboard";
|
import useKeyboard from "@/hooks/useKeyboard";
|
||||||
import { FeatureFlag } from "../components/FeatureFlag";
|
|
||||||
|
|
||||||
|
import { FeatureFlag } from "../components/FeatureFlag";
|
||||||
import { cx } from "../cva.config";
|
import { cx } from "../cva.config";
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue