前端页面

This commit is contained in:
robin
2026-02-24 11:33:44 +08:00
parent f3af234308
commit 60dc87e0f2
141 changed files with 6845 additions and 133 deletions

View File

@@ -0,0 +1,49 @@
package clusters
import (
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/httpdns/httpdnsutils"
)
type ClusterSettingsAction struct {
actionutils.ParentAction
}
func (this *ClusterSettingsAction) Init() {
this.Nav("httpdns", "cluster", "settings")
}
func (this *ClusterSettingsAction) RunGet(params struct {
ClusterId int64
}) {
httpdnsutils.AddLeftMenu(this.Parent())
cluster := pickCluster(params.ClusterId)
installDir := cluster.GetString("installDir")
if len(installDir) == 0 {
installDir = "/opt/edge-httpdns"
}
this.Data["cluster"] = cluster
this.Data["settings"] = map[string]interface{}{
"region": cluster.GetString("region"),
"gatewayDomain": cluster.GetString("gatewayDomain"),
"cacheTtl": cluster.GetInt("cacheTtl"),
"fallbackTimeout": cluster.GetInt("fallbackTimeout"),
"installDir": installDir,
"isOn": cluster.GetBool("isOn"),
}
this.Show()
}
func (this *ClusterSettingsAction) RunPost(params struct {
ClusterId int64
Name string
Region string
GatewayDomain string
CacheTtl int32
FallbackTimeout int32
InstallDir string
IsOn bool
}) {
// Mock successful save
this.Success()
}