前端页面
This commit is contained in:
28
EdgeAdmin/internal/web/actions/default/httpdns/ech/audit.go
Normal file
28
EdgeAdmin/internal/web/actions/default/httpdns/ech/audit.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package ech
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/httpdns/httpdnsutils"
|
||||
)
|
||||
|
||||
type AuditAction struct {
|
||||
actionutils.ParentAction
|
||||
}
|
||||
|
||||
func (this *AuditAction) Init() {
|
||||
this.Nav("httpdns", "ech", "")
|
||||
}
|
||||
|
||||
func (this *AuditAction) RunGet(params struct{}) {
|
||||
httpdnsutils.AddLeftMenu(this.Parent())
|
||||
this.Data["auditLogs"] = []map[string]interface{}{
|
||||
{
|
||||
"id": 1,
|
||||
"scope": "tenant:1001 -> domain:api.business.com -> region:cn-hz",
|
||||
"operator": "admin",
|
||||
"result": "success",
|
||||
"createdAt": "2026-02-21 10:00:00",
|
||||
},
|
||||
}
|
||||
this.Show()
|
||||
}
|
||||
47
EdgeAdmin/internal/web/actions/default/httpdns/ech/index.go
Normal file
47
EdgeAdmin/internal/web/actions/default/httpdns/ech/index.go
Normal file
@@ -0,0 +1,47 @@
|
||||
package ech
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/httpdns/httpdnsutils"
|
||||
)
|
||||
|
||||
type IndexAction struct {
|
||||
actionutils.ParentAction
|
||||
}
|
||||
|
||||
func (this *IndexAction) Init() {
|
||||
this.Nav("httpdns", "ech", "")
|
||||
}
|
||||
|
||||
func (this *IndexAction) RunGet(params struct{}) {
|
||||
httpdnsutils.AddLeftMenu(this.Parent())
|
||||
this.Data["health"] = map[string]interface{}{
|
||||
"keySyncRate": 0.9995,
|
||||
"decryptFailRate": 0.0001,
|
||||
"isHealthy": true,
|
||||
}
|
||||
|
||||
this.Data["echLogs"] = []map[string]interface{}{
|
||||
{
|
||||
"id": 1024,
|
||||
"version": "ech-v20260221-01",
|
||||
"recordType": "HTTPS(Type65)",
|
||||
"publicKey": "BFCf8h5Qmock_public_key_for_ui_preview_lx9v2k7p0n",
|
||||
"publishTime": "2026-02-21 00:00:00",
|
||||
"syncStatus": "success",
|
||||
"nodesPending": 0,
|
||||
"isCurrent": true,
|
||||
},
|
||||
{
|
||||
"id": 1023,
|
||||
"version": "ech-v20260220-01",
|
||||
"recordType": "TXT",
|
||||
"publicKey": "BE9x3a2Qmock_prev_key_for_ui_preview_vd1n7x5k2c",
|
||||
"publishTime": "2026-02-20 00:00:00",
|
||||
"syncStatus": "success",
|
||||
"nodesPending": 0,
|
||||
"isCurrent": false,
|
||||
},
|
||||
}
|
||||
this.Show()
|
||||
}
|
||||
21
EdgeAdmin/internal/web/actions/default/httpdns/ech/init.go
Normal file
21
EdgeAdmin/internal/web/actions/default/httpdns/ech/init.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package ech
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/configloaders"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/helpers"
|
||||
"github.com/iwind/TeaGo"
|
||||
)
|
||||
|
||||
func init() {
|
||||
TeaGo.BeforeStart(func(server *TeaGo.Server) {
|
||||
server.
|
||||
Helper(helpers.NewUserMustAuth(configloaders.AdminModuleCodeHttpDNS)).
|
||||
Data("teaMenu", "httpdns").
|
||||
Data("teaSubMenu", "ech").
|
||||
Prefix("/httpdns/ech").
|
||||
Get("", new(IndexAction)).
|
||||
Get("/audit", new(AuditAction)).
|
||||
GetPost("/rollbackMfaPopup", new(RollbackMfaPopupAction)).
|
||||
EndAll()
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package ech
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/iwind/TeaGo/actions"
|
||||
)
|
||||
|
||||
type RollbackMfaPopupAction struct {
|
||||
actionutils.ParentAction
|
||||
}
|
||||
|
||||
func (this *RollbackMfaPopupAction) Init() {
|
||||
this.Nav("", "", "")
|
||||
}
|
||||
|
||||
func (this *RollbackMfaPopupAction) RunGet(params struct {
|
||||
LogId int64
|
||||
}) {
|
||||
this.Data["logId"] = params.LogId
|
||||
this.Show()
|
||||
}
|
||||
|
||||
func (this *RollbackMfaPopupAction) RunPost(params struct {
|
||||
LogId int64
|
||||
Reason string
|
||||
OtpCode1 string
|
||||
OtpCode2 string
|
||||
|
||||
Must *actions.Must
|
||||
CSRF *actionutils.CSRF
|
||||
}) {
|
||||
params.Must.Field("reason", params.Reason).Require("please input rollback reason")
|
||||
params.Must.Field("otpCode1", params.OtpCode1).Require("please input first otp code")
|
||||
params.Must.Field("otpCode2", params.OtpCode2).Require("please input second otp code")
|
||||
this.Success()
|
||||
}
|
||||
Reference in New Issue
Block a user