From 584768bacfdc4b990f648272ab42007056206026 Mon Sep 17 00:00:00 2001 From: Aveline <352441+ym@users.noreply.github.com> Date: Thu, 10 Jul 2025 12:04:47 +0200 Subject: [PATCH] chore: remove /device/ui-config.js endpoint (#678) --- web.go | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/web.go b/web.go index 059915c..21e17e7 100644 --- a/web.go +++ b/web.go @@ -97,9 +97,6 @@ func setupRouter() *gin.Engine { // We use this to determine if the device is setup 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 r.POST("/device/setup", handleSetup) @@ -694,21 +691,6 @@ func handleCloudState(c *gin.Context) { 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) { // Check if the device is already set up if config.LocalAuthMode != "" || config.HashedPassword != "" {