2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 13:47:15 +08:00

feat: 移除工具箱和跑分应用

This commit is contained in:
2025-05-19 00:09:29 +08:00
parent d43090b84f
commit bc4fcfe6ed
11 changed files with 155 additions and 163 deletions

View File

@@ -42,6 +42,8 @@ type Http struct {
monitor *service.MonitorService
setting *service.SettingService
systemctl *service.SystemctlService
toolboxSystem *service.ToolboxSystemService
toolboxBenchmark *service.ToolboxBenchmarkService
apps *apploader.Loader
}
@@ -73,6 +75,8 @@ func NewHttp(
monitor *service.MonitorService,
setting *service.SettingService,
systemctl *service.SystemctlService,
toolboxSystem *service.ToolboxSystemService,
toolboxBenchmark *service.ToolboxBenchmarkService,
apps *apploader.Loader,
) *Http {
return &Http{
@@ -103,6 +107,8 @@ func NewHttp(
monitor: monitor,
setting: setting,
systemctl: systemctl,
toolboxSystem: toolboxSystem,
toolboxBenchmark: toolboxBenchmark,
apps: apps,
}
}
@@ -381,6 +387,26 @@ func (route *Http) Register(r *chi.Mux) {
r.Post("/stop", route.systemctl.Stop)
})
r.Route("/toolbox_system", func(r chi.Router) {
r.Get("/dns", route.toolboxSystem.GetDNS)
r.Post("/dns", route.toolboxSystem.UpdateDNS)
r.Get("/swap", route.toolboxSystem.GetSWAP)
r.Post("/swap", route.toolboxSystem.UpdateSWAP)
r.Get("/timezone", route.toolboxSystem.GetTimezone)
r.Post("/timezone", route.toolboxSystem.UpdateTimezone)
r.Post("/time", route.toolboxSystem.UpdateTime)
r.Post("/sync_time", route.toolboxSystem.SyncTime)
r.Get("/hostname", route.toolboxSystem.GetHostname)
r.Post("/hostname", route.toolboxSystem.UpdateHostname)
r.Get("/hosts", route.toolboxSystem.GetHosts)
r.Post("/hosts", route.toolboxSystem.UpdateHosts)
r.Post("/root_password", route.toolboxSystem.UpdateRootPassword)
})
r.Route("/toolbox_benchmark", func(r chi.Router) {
r.Post("/test", route.toolboxBenchmark.Test)
})
r.Route("/apps", func(r chi.Router) {
route.apps.Register(r)
})