2020-07-22 22:19:39 +08:00
|
|
|
package servers
|
|
|
|
|
|
2020-07-29 19:34:54 +08:00
|
|
|
import (
|
2020-08-21 12:32:16 +08:00
|
|
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
2020-07-29 19:34:54 +08:00
|
|
|
"github.com/iwind/TeaGo/actions"
|
|
|
|
|
)
|
2020-07-22 22:19:39 +08:00
|
|
|
|
|
|
|
|
type Helper struct {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func NewHelper() *Helper {
|
|
|
|
|
return &Helper{}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (this *Helper) BeforeAction(action *actions.ActionObject) {
|
|
|
|
|
action.Data["teaMenu"] = "servers"
|
2020-08-21 12:32:16 +08:00
|
|
|
|
|
|
|
|
selectedTabbar, _ := action.Data["mainTab"]
|
|
|
|
|
|
|
|
|
|
tabbar := actionutils.NewTabbar()
|
2020-08-21 21:09:42 +08:00
|
|
|
tabbar.Add("服务", "", "/servers", "", selectedTabbar == "server")
|
|
|
|
|
tabbar.Add("组件", "", "/servers/components", "", selectedTabbar == "component")
|
2020-08-21 12:32:16 +08:00
|
|
|
actionutils.SetTabbar(action, tabbar)
|
2020-07-22 22:19:39 +08:00
|
|
|
}
|