Compare commits

...

3 Commits

Author SHA1 Message Date
dependabot[bot] e927fb94e9
Merge 3ce77b727d into 584768bacf 2025-07-10 06:56:11 -07:00
Aveline 584768bacf
chore: remove /device/ui-config.js endpoint (#678) 2025-07-10 12:04:47 +02:00
dependabot[bot] 3ce77b727d
build(deps): bump zustand from 4.5.7 to 5.0.6 in /ui
---
updated-dependencies:
- dependency-name: zustand
  dependency-version: 5.0.6
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-01 18:21:07 +00:00
3 changed files with 72 additions and 30 deletions

82
ui/package-lock.json generated
View File

@ -38,7 +38,7 @@
"tailwind-merge": "^3.3.0", "tailwind-merge": "^3.3.0",
"usehooks-ts": "^3.1.1", "usehooks-ts": "^3.1.1",
"validator": "^13.15.0", "validator": "^13.15.0",
"zustand": "^4.5.2" "zustand": "^5.0.6"
}, },
"devDependencies": { "devDependencies": {
"@eslint/compat": "^1.2.9", "@eslint/compat": "^1.2.9",
@ -1767,6 +1767,66 @@
"node": ">=14.0.0" "node": ">=14.0.0"
} }
}, },
"node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@emnapi/core": {
"version": "1.4.3",
"dev": true,
"inBundle": true,
"license": "MIT",
"optional": true,
"dependencies": {
"@emnapi/wasi-threads": "1.0.2",
"tslib": "^2.4.0"
}
},
"node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@emnapi/runtime": {
"version": "1.4.3",
"dev": true,
"inBundle": true,
"license": "MIT",
"optional": true,
"dependencies": {
"tslib": "^2.4.0"
}
},
"node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@emnapi/wasi-threads": {
"version": "1.0.2",
"dev": true,
"inBundle": true,
"license": "MIT",
"optional": true,
"dependencies": {
"tslib": "^2.4.0"
}
},
"node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@napi-rs/wasm-runtime": {
"version": "0.2.9",
"dev": true,
"inBundle": true,
"license": "MIT",
"optional": true,
"dependencies": {
"@emnapi/core": "^1.4.0",
"@emnapi/runtime": "^1.4.0",
"@tybys/wasm-util": "^0.9.0"
}
},
"node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@tybys/wasm-util": {
"version": "0.9.0",
"dev": true,
"inBundle": true,
"license": "MIT",
"optional": true,
"dependencies": {
"tslib": "^2.4.0"
}
},
"node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/tslib": {
"version": "2.8.0",
"dev": true,
"inBundle": true,
"license": "0BSD",
"optional": true
},
"node_modules/@tailwindcss/oxide-win32-arm64-msvc": { "node_modules/@tailwindcss/oxide-win32-arm64-msvc": {
"version": "4.1.7", "version": "4.1.7",
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.1.7.tgz", "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.1.7.tgz",
@ -7005,20 +7065,17 @@
} }
}, },
"node_modules/zustand": { "node_modules/zustand": {
"version": "4.5.7", "version": "5.0.6",
"resolved": "https://registry.npmjs.org/zustand/-/zustand-4.5.7.tgz", "resolved": "https://registry.npmjs.org/zustand/-/zustand-5.0.6.tgz",
"integrity": "sha512-CHOUy7mu3lbD6o6LJLfllpjkzhHXSBlX8B9+qPddUsIfeF5S/UZ5q0kmCsnRqT1UHFQZchNFDDzMbQsuesHWlw==", "integrity": "sha512-ihAqNeUVhe0MAD+X8M5UzqyZ9k3FFZLBTtqo6JLPwV53cbRB/mJwBI0PxcIgqhBBHlEs8G45OTDTMq3gNcLq3A==",
"license": "MIT",
"dependencies": {
"use-sync-external-store": "^1.2.2"
},
"engines": { "engines": {
"node": ">=12.7.0" "node": ">=12.20.0"
}, },
"peerDependencies": { "peerDependencies": {
"@types/react": ">=16.8", "@types/react": ">=18.0.0",
"immer": ">=9.0.6", "immer": ">=9.0.6",
"react": ">=16.8" "react": ">=18.0.0",
"use-sync-external-store": ">=1.2.0"
}, },
"peerDependenciesMeta": { "peerDependenciesMeta": {
"@types/react": { "@types/react": {
@ -7029,6 +7086,9 @@
}, },
"react": { "react": {
"optional": true "optional": true
},
"use-sync-external-store": {
"optional": true
} }
} }
} }

View File

@ -49,7 +49,7 @@
"tailwind-merge": "^3.3.0", "tailwind-merge": "^3.3.0",
"usehooks-ts": "^3.1.1", "usehooks-ts": "^3.1.1",
"validator": "^13.15.0", "validator": "^13.15.0",
"zustand": "^4.5.2" "zustand": "^5.0.6"
}, },
"devDependencies": { "devDependencies": {
"@eslint/compat": "^1.2.9", "@eslint/compat": "^1.2.9",

18
web.go
View File

@ -97,9 +97,6 @@ func setupRouter() *gin.Engine {
// We use this to determine if the device is setup // We use this to determine if the device is setup
r.GET("/device/status", handleDeviceStatus) r.GET("/device/status", handleDeviceStatus)
// We use this to provide the UI with the device configuration
r.GET("/device/ui-config.js", handleDeviceUIConfig)
// We use this to setup the device in the welcome page // We use this to setup the device in the welcome page
r.POST("/device/setup", handleSetup) r.POST("/device/setup", handleSetup)
@ -694,21 +691,6 @@ func handleCloudState(c *gin.Context) {
c.JSON(http.StatusOK, response) c.JSON(http.StatusOK, response)
} }
func handleDeviceUIConfig(c *gin.Context) {
config, _ := json.Marshal(gin.H{
"CLOUD_API": config.CloudURL,
"DEVICE_VERSION": builtAppVersion,
})
if config == nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": "Failed to marshal config"})
return
}
response := fmt.Sprintf("window.JETKVM_CONFIG = %s;", config)
c.Data(http.StatusOK, "text/javascript; charset=utf-8", []byte(response))
}
func handleSetup(c *gin.Context) { func handleSetup(c *gin.Context) {
// Check if the device is already set up // Check if the device is already set up
if config.LocalAuthMode != "" || config.HashedPassword != "" { if config.LocalAuthMode != "" || config.HashedPassword != "" {