diff --git a/.devcontainer/docker/devcontainer.json b/.devcontainer/docker/devcontainer.json index 6a4e6ae0..7ccca257 100644 --- a/.devcontainer/docker/devcontainer.json +++ b/.devcontainer/docker/devcontainer.json @@ -1,38 +1,41 @@ { - "name": "JetKVM docker devcontainer", - "image": "mcr.microsoft.com/devcontainers/go:1.25-trixie", - "features": { - "ghcr.io/devcontainers/features/node:1": { - // Should match what is defined in ui/package.json - "version": "22.19.0" - } - }, - "mounts": [ - "source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached" - ], - "onCreateCommand": ".devcontainer/install-deps.sh", - "customizations": { - "vscode": { - "extensions": [ - // coding styles - "chrislajoie.vscode-modelines", - "editorconfig.editorconfig", - // GitHub - "GitHub.vscode-pull-request-github", - "github.vscode-github-actions", - // Golang - "golang.go", - // C / C++ - "ms-vscode.cpptools", - "ms-vscode.cpptools-extension-pack", - // CMake / Makefile - "ms-vscode.makefile-tools", - "ms-vscode.cmake-tools", - // Frontend - "esbenp.prettier-vscode", - "dbaeumer.vscode-eslint", - "bradlc.vscode-tailwindcss" - ] - } - } + "name": "JetKVM docker devcontainer", + "image": "mcr.microsoft.com/devcontainers/go:1.25-trixie", + "features": { + "ghcr.io/devcontainers/features/node:1": { + // Should match what is defined in ui/package.json + "version": "22.20.0" + } + }, + "mounts": [ + "source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached" + ], + "onCreateCommand": ".devcontainer/install-deps.sh", + "customizations": { + "vscode": { + "extensions": [ + // coding styles + "chrislajoie.vscode-modelines", + "editorconfig.editorconfig", + // GitHub + "GitHub.vscode-pull-request-github", + "github.vscode-github-actions", + // Golang + "golang.go", + // C / C++ + "ms-vscode.cpptools", + "ms-vscode.cpptools-extension-pack", + // CMake / Makefile + "ms-vscode.makefile-tools", + "ms-vscode.cmake-tools", + // Frontend + "esbenp.prettier-vscode", + "dbaeumer.vscode-eslint", + "bradlc.vscode-tailwindcss", + "codeandstuff.package-json-upgrade", + // Localization + "inlang.vs-code-extension" + ] + } + } } diff --git a/.devcontainer/podman/devcontainer.json b/.devcontainer/podman/devcontainer.json index bba58a31..81f1962c 100644 --- a/.devcontainer/podman/devcontainer.json +++ b/.devcontainer/podman/devcontainer.json @@ -1,19 +1,50 @@ { - "name": "JetKVM podman devcontainer", - "image": "mcr.microsoft.com/devcontainers/go:1.25-trixie", - "features": { - "ghcr.io/devcontainers/features/node:1": { - // Should match what is defined in ui/package.json - "version": "22.19.0" - } - }, - "runArgs": [ - "--userns=keep-id", - "--security-opt=label=disable", - "--security-opt=label=nested" - ], - "containerUser": "vscode", - "containerEnv": { - "HOME": "/home/vscode" - } -} \ No newline at end of file + "name": "JetKVM podman devcontainer", + "image": "mcr.microsoft.com/devcontainers/go:1.25-trixie", + "features": { + "ghcr.io/devcontainers/features/node:1": { + // Should match what is defined in ui/package.json + "version": "22.20.0" + } + }, + "runArgs": [ + "--userns=keep-id", + "--security-opt=label=disable", + "--security-opt=label=nested" + ], + "containerUser": "vscode", + "containerEnv": { + "HOME": "/home/vscode" + }, + "mounts": [ + "source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached" + ], + "onCreateCommand": ".devcontainer/install-deps.sh", + "customizations": { + "vscode": { + "extensions": [ + // coding styles + "chrislajoie.vscode-modelines", + "editorconfig.editorconfig", + // GitHub + "GitHub.vscode-pull-request-github", + "github.vscode-github-actions", + // Golang + "golang.go", + // C / C++ + "ms-vscode.cpptools", + "ms-vscode.cpptools-extension-pack", + // CMake / Makefile + "ms-vscode.makefile-tools", + "ms-vscode.cmake-tools", + // Frontend + "esbenp.prettier-vscode", + "dbaeumer.vscode-eslint", + "bradlc.vscode-tailwindcss", + "codeandstuff.package-json-upgrade", + // Localization + "inlang.vs-code-extension" + ] + } + } +} diff --git a/.gitignore b/.gitignore index 99b7ce95..1691153c 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,6 @@ node_modules # generated during the build process #internal/native/include -#internal/native/lib \ No newline at end of file +#internal/native/lib + +ui/reports \ No newline at end of file diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 00000000..d89bc64c --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,25 @@ +{ + "recommendations": [ + // coding styles + "chrislajoie.vscode-modelines", + "editorconfig.editorconfig", + // GitHub + "GitHub.vscode-pull-request-github", + "github.vscode-github-actions", + // Golang + "golang.go", + // C / C++ + "ms-vscode.cpptools", + "ms-vscode.cpptools-extension-pack", + // CMake / Makefile + "ms-vscode.makefile-tools", + "ms-vscode.cmake-tools", + // Frontend + "esbenp.prettier-vscode", + "dbaeumer.vscode-eslint", + "bradlc.vscode-tailwindcss", + "codeandstuff.package-json-upgrade", + // Localization + "inlang.vs-code-extension" + ] +} \ No newline at end of file diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 964526d6..5c906860 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -97,38 +97,42 @@ tail -f /var/log/jetkvm.log ``` /kvm/ -├── main.go # App entry point -├── config.go # Settings & configuration -├── display.go # Device UI control -├── web.go # API endpoints -├── cmd/ # Command line main -├── internal/ # Internal Go packages -│ ├── confparser/ # Configuration file implementation -│ ├── hidrpc/ # HIDRPC implementation for HID devices (keyboard, mouse, etc.) -│ ├── logging/ # Logging implementation -│ ├── mdns/ # mDNS implementation -│ ├── native/ # CGO / Native code glue layer (on-device hardware) -│ │ ├── cgo/ # C files for the native library (HDMI, Touchscreen, etc.) -│ │ └── eez/ # EEZ Studio Project files (for Touchscreen) -│ ├── network/ # Network implementation -│ ├── timesync/ # Time sync/NTP implementation -│ ├── tzdata/ # Timezone data and generation -│ ├── udhcpc/ # DHCP implementation -│ ├── usbgadget/ # USB gadget -│ ├── utils/ # SSH handling -│ └── websecure/ # TLS certificate management -├── resource/ # netboot iso and other resources -├── scripts/ # Bash shell scripts for building and deploying -└── static/ # (react client build output) -└── ui/ # React frontend - ├── public/ # UI website static images and fonts - └── src/ # Client React UI - ├── assets/ # UI in-page images - ├── components/ # UI components - ├── hooks/ # Hooks (stores, RPC handling, virtual devices) - ├── keyboardLayouts/ # Keyboard layout definitions - ├── providers/ # Feature flags - └── routes/ # Pages (login, settings, etc.) +├── main.go # App entry point +├── config.go # Settings & configuration +├── display.go # Device UI control +├── web.go # API endpoints +├── cmd/ # Command line main +├── internal/ # Internal Go packages +│ ├── confparser/ # Configuration file implementation +│ ├── hidrpc/ # HIDRPC implementation for HID devices (keyboard, mouse, etc.) +│ ├── logging/ # Logging implementation +│ ├── mdns/ # mDNS implementation +│ ├── native/ # CGO / Native code glue layer (on-device hardware) +│ │ ├── cgo/ # C files for the native library (HDMI, Touchscreen, etc.) +│ │ └── eez/ # EEZ Studio Project files (for Touchscreen) +│ ├── network/ # Network implementation +│ ├── timesync/ # Time sync/NTP implementation +│ ├── tzdata/ # Timezone data and generation +│ ├── udhcpc/ # DHCP implementation +│ ├── usbgadget/ # USB gadget +│ ├── utils/ # SSH handling +│ └── websecure/ # TLS certificate management +├── resource/ # netboot iso and other resources +├── scripts/ # Bash shell scripts for building and deploying +└── static/ # (react client build output) +└── ui/ # React frontend + ├── localization/ # Client UI localization (i18n) + │ ├── jetKVM.UI.inlang/ # Settings for inlang + │ └── messages/ # Messages localized + ├── public/ # UI website static images and fonts + └── src/ # Client React UI + ├── assets/ # UI in-page images + ├── components/ # UI components + ├── hooks/ # Hooks (stores, RPC handling, virtual devices) + ├── keyboardLayouts/ # Keyboard layout definitions + │ ├── paraglide/ # (localization compiled messages output) + ├── providers/ # Feature flags + └── routes/ # Pages (login, settings, etc.) ``` **Key files for beginners:** diff --git a/ui/eslint.config.cjs b/ui/eslint.config.cjs index 6e972586..ad4338a3 100644 --- a/ui/eslint.config.cjs +++ b/ui/eslint.config.cjs @@ -9,8 +9,6 @@ const { fixupConfigRules, } = require("@eslint/compat"); -const tsParser = require("@typescript-eslint/parser"); -const reactRefresh = require("eslint-plugin-react-refresh"); const js = require("@eslint/js"); const { @@ -23,6 +21,9 @@ const compat = new FlatCompat({ allConfig: js.configs.all }); +const tsParser = require("@typescript-eslint/parser"); +const reactRefresh = require("eslint-plugin-react-refresh"); + module.exports = defineConfig([{ languageOptions: { globals: { @@ -66,7 +67,7 @@ module.exports = defineConfig([{ groups: ["builtin", "external", "internal", "parent", "sibling"], "newlines-between": "always", }], - + "@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" }], @@ -81,7 +82,10 @@ module.exports = defineConfig([{ map: [ ["@components", "./src/components"], ["@routes", "./src/routes"], + ["@hooks", "./src/hooks"], + ["@providers", "./src/providers"], ["@assets", "./src/assets"], + ["@localizations", "./localization/paraglide"], ["@", "./src"], ], diff --git a/ui/index.html b/ui/index.html index 3c6c5606..77936233 100644 --- a/ui/index.html +++ b/ui/index.html @@ -45,31 +45,39 @@ - + - +
- +