mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2026-01-06 20:15:48 +08:00
调整界面
This commit is contained in:
15
internal/web/actions/default/settings/backup/index.go
Normal file
15
internal/web/actions/default/settings/backup/index.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package backup
|
||||
|
||||
import "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
|
||||
type IndexAction struct {
|
||||
actionutils.ParentAction
|
||||
}
|
||||
|
||||
func (this *IndexAction) Init() {
|
||||
this.Nav("", "", "")
|
||||
}
|
||||
|
||||
func (this *IndexAction) RunGet(params struct{}) {
|
||||
this.Show()
|
||||
}
|
||||
18
internal/web/actions/default/settings/backup/init.go
Normal file
18
internal/web/actions/default/settings/backup/init.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package backup
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/settings/settingutils"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/helpers"
|
||||
"github.com/iwind/TeaGo"
|
||||
)
|
||||
|
||||
func init() {
|
||||
TeaGo.BeforeStart(func(server *TeaGo.Server) {
|
||||
server.
|
||||
Helper(helpers.NewUserMustAuth()).
|
||||
Helper(settingutils.NewHelper("backup")).
|
||||
Prefix("/settings/backup").
|
||||
Get("", new(IndexAction)).
|
||||
EndAll()
|
||||
})
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package settings
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/settings/settingutils"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/helpers"
|
||||
"github.com/iwind/TeaGo"
|
||||
)
|
||||
@@ -10,6 +11,7 @@ func init() {
|
||||
server.
|
||||
Helper(helpers.NewUserMustAuth()).
|
||||
Helper(NewHelper()).
|
||||
Helper(settingutils.NewHelper("console")).
|
||||
Prefix("/settings").
|
||||
Get("", new(IndexAction)).
|
||||
EndAll()
|
||||
|
||||
15
internal/web/actions/default/settings/login/index.go
Normal file
15
internal/web/actions/default/settings/login/index.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package login
|
||||
|
||||
import "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
|
||||
type IndexAction struct {
|
||||
actionutils.ParentAction
|
||||
}
|
||||
|
||||
func (this *IndexAction) Init() {
|
||||
this.Nav("", "", "")
|
||||
}
|
||||
|
||||
func (this *IndexAction) RunGet(params struct{}) {
|
||||
this.Show()
|
||||
}
|
||||
18
internal/web/actions/default/settings/login/init.go
Normal file
18
internal/web/actions/default/settings/login/init.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package login
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/settings/settingutils"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/helpers"
|
||||
"github.com/iwind/TeaGo"
|
||||
)
|
||||
|
||||
func init() {
|
||||
TeaGo.BeforeStart(func(server *TeaGo.Server) {
|
||||
server.
|
||||
Helper(helpers.NewUserMustAuth()).
|
||||
Helper(settingutils.NewHelper("login")).
|
||||
Prefix("/settings/login").
|
||||
Get("", new(IndexAction)).
|
||||
EndAll()
|
||||
})
|
||||
}
|
||||
15
internal/web/actions/default/settings/profile/index.go
Normal file
15
internal/web/actions/default/settings/profile/index.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package profile
|
||||
|
||||
import "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
|
||||
type IndexAction struct {
|
||||
actionutils.ParentAction
|
||||
}
|
||||
|
||||
func (this *IndexAction) Init() {
|
||||
this.Nav("", "", "")
|
||||
}
|
||||
|
||||
func (this *IndexAction) RunGet(params struct{}) {
|
||||
this.Show()
|
||||
}
|
||||
18
internal/web/actions/default/settings/profile/init.go
Normal file
18
internal/web/actions/default/settings/profile/init.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package profile
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/settings/settingutils"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/helpers"
|
||||
"github.com/iwind/TeaGo"
|
||||
)
|
||||
|
||||
func init() {
|
||||
TeaGo.BeforeStart(func(server *TeaGo.Server) {
|
||||
server.
|
||||
Helper(helpers.NewUserMustAuth()).
|
||||
Helper(settingutils.NewHelper("profile")).
|
||||
Prefix("/settings/profile").
|
||||
Get("", new(IndexAction)).
|
||||
EndAll()
|
||||
})
|
||||
}
|
||||
15
internal/web/actions/default/settings/security/index.go
Normal file
15
internal/web/actions/default/settings/security/index.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package security
|
||||
|
||||
import "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
|
||||
type IndexAction struct {
|
||||
actionutils.ParentAction
|
||||
}
|
||||
|
||||
func (this *IndexAction) Init() {
|
||||
this.Nav("", "", "")
|
||||
}
|
||||
|
||||
func (this *IndexAction) RunGet(params struct{}) {
|
||||
this.Show()
|
||||
}
|
||||
18
internal/web/actions/default/settings/security/init.go
Normal file
18
internal/web/actions/default/settings/security/init.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package security
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/settings/settingutils"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/helpers"
|
||||
"github.com/iwind/TeaGo"
|
||||
)
|
||||
|
||||
func init() {
|
||||
TeaGo.BeforeStart(func(server *TeaGo.Server) {
|
||||
server.
|
||||
Helper(helpers.NewUserMustAuth()).
|
||||
Helper(settingutils.NewHelper("security")).
|
||||
Prefix("/settings/security").
|
||||
Get("", new(IndexAction)).
|
||||
EndAll()
|
||||
})
|
||||
}
|
||||
39
internal/web/actions/default/settings/settingutils/utils.go
Normal file
39
internal/web/actions/default/settings/settingutils/utils.go
Normal file
@@ -0,0 +1,39 @@
|
||||
package settingutils
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/iwind/TeaGo/actions"
|
||||
)
|
||||
|
||||
type Helper struct {
|
||||
tab string
|
||||
}
|
||||
|
||||
func NewHelper(tab string) *Helper {
|
||||
return &Helper{
|
||||
tab: tab,
|
||||
}
|
||||
}
|
||||
|
||||
func (this *Helper) BeforeAction(actionPtr actions.ActionWrapper) (goNext bool) {
|
||||
goNext = true
|
||||
|
||||
action := actionPtr.Object()
|
||||
|
||||
// 左侧菜单
|
||||
action.Data["teaMenu"] = "settings"
|
||||
|
||||
// 标签栏
|
||||
tabbar := actionutils.NewTabbar()
|
||||
tabbar.Add("管理界面", "", "/settings", "", this.tab == "console")
|
||||
tabbar.Add("安全设置", "", "/settings/security", "", this.tab == "security")
|
||||
tabbar.Add("API节点", "", "/api", "exchange", this.tab == "api")
|
||||
tabbar.Add("日志数据库节点", "", "/db", "database", this.tab == "db")
|
||||
tabbar.Add("备份", "", "/settings/backup", "", this.tab == "backup")
|
||||
tabbar.Add("个人资料", "", "/settings/profile", "", this.tab == "profile")
|
||||
tabbar.Add("登录设置", "", "/settings/login", "", this.tab == "login")
|
||||
tabbar.Add("检查版本更新", "", "/settings/upgrade", "", this.tab == "upgrade")
|
||||
actionutils.SetTabbar(actionPtr, tabbar)
|
||||
|
||||
return
|
||||
}
|
||||
15
internal/web/actions/default/settings/upgrade/index.go
Normal file
15
internal/web/actions/default/settings/upgrade/index.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package upgrade
|
||||
|
||||
import "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
|
||||
type IndexAction struct {
|
||||
actionutils.ParentAction
|
||||
}
|
||||
|
||||
func (this *IndexAction) Init() {
|
||||
this.Nav("", "", "")
|
||||
}
|
||||
|
||||
func (this *IndexAction) RunGet(params struct{}) {
|
||||
this.Show()
|
||||
}
|
||||
18
internal/web/actions/default/settings/upgrade/init.go
Normal file
18
internal/web/actions/default/settings/upgrade/init.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package upgrade
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/settings/settingutils"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/helpers"
|
||||
"github.com/iwind/TeaGo"
|
||||
)
|
||||
|
||||
func init() {
|
||||
TeaGo.BeforeStart(func(server *TeaGo.Server) {
|
||||
server.
|
||||
Helper(helpers.NewUserMustAuth()).
|
||||
Helper(settingutils.NewHelper("upgrade")).
|
||||
Prefix("/settings/upgrade").
|
||||
Get("", new(IndexAction)).
|
||||
EndAll()
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user