mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-03 04:10:27 +08:00
25 lines
582 B
Go
25 lines
582 B
Go
package components
|
|
|
|
import (
|
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
|
"github.com/iwind/TeaGo/actions"
|
|
)
|
|
|
|
type Helper struct {
|
|
}
|
|
|
|
func NewHelper() *Helper {
|
|
return &Helper{}
|
|
}
|
|
|
|
func (this *Helper) BeforeAction(action *actions.ActionObject) {
|
|
action.Data["teaMenu"] = "servers"
|
|
|
|
selectedTabbar, _ := action.Data["mainTab"]
|
|
|
|
tabbar := actionutils.NewTabbar()
|
|
tabbar.Add("服务", "", "/servers", "", selectedTabbar == "server")
|
|
tabbar.Add("通用", "", "/servers/components", "", selectedTabbar == "component")
|
|
actionutils.SetTabbar(action, tabbar)
|
|
}
|