Files
EdgeAdmin/internal/web/actions/default/clusters/cluster/settings/init.go

80 lines
3.1 KiB
Go
Raw Normal View History

2020-09-06 16:19:34 +08:00
package settings
import (
2020-12-03 11:03:12 +08:00
"github.com/TeaOSLab/EdgeAdmin/internal/configloaders"
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/clusters/cluster/settings/cache"
2022-05-18 21:02:47 +08:00
ddosProtection "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/clusters/cluster/settings/ddos-protection"
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/clusters/cluster/settings/dns"
2021-02-06 17:37:09 +08:00
firewallActions "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/clusters/cluster/settings/firewall-actions"
2022-09-16 18:41:04 +08:00
globalServerConfig "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/clusters/cluster/settings/global-server-config"
2021-02-24 15:01:45 +08:00
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/clusters/cluster/settings/health"
2021-06-27 21:59:06 +08:00
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/clusters/cluster/settings/metrics"
2021-01-11 18:15:53 +08:00
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/clusters/cluster/settings/services"
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/clusters/cluster/settings/waf"
2022-04-01 16:42:08 +08:00
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/clusters/cluster/settings/webp"
2020-09-06 16:19:34 +08:00
clusters "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/clusters/clusterutils"
"github.com/TeaOSLab/EdgeAdmin/internal/web/helpers"
"github.com/iwind/TeaGo"
)
func init() {
TeaGo.BeforeStart(func(server *TeaGo.Server) {
server.
2020-12-03 11:03:12 +08:00
Helper(helpers.NewUserMustAuth(configloaders.AdminModuleCodeNode)).
2020-09-06 16:19:34 +08:00
Helper(clusters.NewClusterHelper()).
Prefix("/clusters/cluster/settings").
2023-06-12 19:46:37 +08:00
Data("teaSubMenu", "cluster").
2020-09-06 16:19:34 +08:00
GetPost("", new(IndexAction)).
// 健康检查
2021-02-24 15:01:45 +08:00
GetPost("/health", new(health.IndexAction)).
GetPost("/health/runPopup", new(health.RunPopupAction)).
Post("/health/checkDomain", new(health.CheckDomainAction)).
// 缓存
GetPost("/cache", new(cache.IndexAction)).
// WAF
GetPost("/waf", new(waf.IndexAction)).
// DNS
2020-12-02 14:25:14 +08:00
Prefix("/clusters/cluster/settings/dns").
GetPost("", new(dns.IndexAction)).
2022-04-18 18:19:30 +08:00
Post("/randomName", new(dns.RandomNameAction)).
2020-12-02 14:25:14 +08:00
2021-01-11 18:15:53 +08:00
// 系统服务设置
Prefix("/clusters/cluster/settings/services").
GetPost("", new(services.IndexAction)).
GetPost("/status", new(services.StatusAction)).
2021-02-06 17:37:09 +08:00
// 防火墙动作
Prefix("/clusters/cluster/settings/firewall-actions").
Get("", new(firewallActions.IndexAction)).
GetPost("/createPopup", new(firewallActions.CreatePopupAction)).
GetPost("/updatePopup", new(firewallActions.UpdatePopupAction)).
Post("/delete", new(firewallActions.DeleteAction)).
2021-06-27 21:59:06 +08:00
// 指标
Prefix("/clusters/cluster/settings/metrics").
Get("", new(metrics.IndexAction)).
GetPost("/createPopup", new(metrics.CreatePopupAction)).
Post("/delete", new(metrics.DeleteAction)).
2022-04-01 16:42:08 +08:00
// WebP
Prefix("/clusters/cluster/settings/webp").
GetPost("", new(webp.IndexAction)).
2022-05-18 21:02:47 +08:00
// DDOS Protection
Prefix("/clusters/cluster/settings/ddos-protection").
GetPost("", new(ddosProtection.IndexAction)).
GetPost("/status", new(ddosProtection.StatusAction)).
2022-09-16 18:41:04 +08:00
// 全局服务配置
Prefix("/clusters/cluster/settings/global-server-config").
GetPost("", new(globalServerConfig.IndexAction)).
2022-05-18 21:02:47 +08:00
//
2020-09-06 16:19:34 +08:00
EndAll()
})
}