Initial commit (code only without large binaries)

This commit is contained in:
robin
2026-02-15 18:58:44 +08:00
commit 35df75498f
9442 changed files with 1495866 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package settingutils
import (
"github.com/TeaOSLab/EdgeAdmin/internal/web/helpers"
"github.com/TeaOSLab/EdgeCommon/pkg/langs/codes"
"github.com/iwind/TeaGo/actions"
"github.com/iwind/TeaGo/maps"
)
type Helper struct {
helpers.LangHelper
}
func (this *Helper) BeforeAction(actionPtr actions.ActionWrapper) (goNext bool) {
var action = actionPtr.Object()
secondMenuItem := action.Data.GetString("secondMenuItem")
action.Data["leftMenuItems"] = this.createSettingMenu(secondMenuItem, actionPtr)
return true
}
func (this *Helper) createSettingMenu(selectedItem string, actionPtr actions.ActionWrapper) (items []maps.Map) {
return []maps.Map{
{
"name": this.Lang(actionPtr, codes.NS_SettingUser),
"url": "/ns/settings/user",
"isActive": selectedItem == "user",
},
{
"name": this.Lang(actionPtr, codes.NS_SettingAccessLogs),
"url": "/ns/settings/accesslogs",
"isActive": selectedItem == "accessLog",
},
}
}