2020-08-21 21:09:42 +08:00
|
|
|
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")
|
2020-10-02 17:22:24 +08:00
|
|
|
tabbar.Add("通用", "", "/servers/components", "", selectedTabbar == "component")
|
2020-08-21 21:09:42 +08:00
|
|
|
actionutils.SetTabbar(action, tabbar)
|
|
|
|
|
}
|