refactor(server): remove unused context and managementasset references

- Dropped unused `context` and `managementasset` imports from `main.go`.
- Removed logic for management control panel asset synchronization, including `EnsureLatestManagementHTML`.
- Simplified server initialization by eliminating related control panel functionality.
This commit is contained in:
Luis Pater
2025-10-01 03:44:30 +08:00
parent 41975c9e2b
commit 6629cadb87

View File

@@ -4,7 +4,6 @@
package main package main
import ( import (
"context"
"flag" "flag"
"fmt" "fmt"
"os" "os"
@@ -14,7 +13,6 @@ import (
"github.com/router-for-me/CLIProxyAPI/v6/internal/cmd" "github.com/router-for-me/CLIProxyAPI/v6/internal/cmd"
"github.com/router-for-me/CLIProxyAPI/v6/internal/config" "github.com/router-for-me/CLIProxyAPI/v6/internal/config"
"github.com/router-for-me/CLIProxyAPI/v6/internal/logging" "github.com/router-for-me/CLIProxyAPI/v6/internal/logging"
"github.com/router-for-me/CLIProxyAPI/v6/internal/managementasset"
_ "github.com/router-for-me/CLIProxyAPI/v6/internal/translator" _ "github.com/router-for-me/CLIProxyAPI/v6/internal/translator"
"github.com/router-for-me/CLIProxyAPI/v6/internal/usage" "github.com/router-for-me/CLIProxyAPI/v6/internal/usage"
"github.com/router-for-me/CLIProxyAPI/v6/internal/util" "github.com/router-for-me/CLIProxyAPI/v6/internal/util"
@@ -116,13 +114,6 @@ func main() {
} }
usage.SetStatisticsEnabled(cfg.UsageStatisticsEnabled) usage.SetStatisticsEnabled(cfg.UsageStatisticsEnabled)
staticDir := managementasset.StaticDir(configFilePath)
if !cfg.RemoteManagement.DisableControlPanel {
go managementasset.EnsureLatestManagementHTML(context.Background(), staticDir)
} else {
log.Debug("management control panel disabled; skip asset sync")
}
if err = logging.ConfigureLogOutput(cfg.LoggingToFile); err != nil { if err = logging.ConfigureLogOutput(cfg.LoggingToFile); err != nil {
log.Fatalf("failed to configure log output: %v", err) log.Fatalf("failed to configure log output: %v", err)
} }