Documentation ¶
Index ¶
- Constants
- func AllModuleMaps(langCode string) []maps.Map
- func AllowModule(adminId int64, module string) bool
- func CheckAdmin(adminId int64) bool
- func FindAdminFullname(adminId int64) string
- func FindAdminLang(adminId int64) string
- func FindAdminLangForAction(actionPtr actions.ActionWrapper) (langCode langs.LangCode)
- func FindAdminTheme(adminId int64) string
- func LoadAdminUIConfig() (*systemconfigs.AdminUIConfig, error)
- func LoadLogConfig() (*systemconfigs.LogConfig, error)
- func LoadSecurityConfig() (*systemconfigs.SecurityConfig, error)
- func NotifyAdminModuleMappingChange() error
- func ReloadAdminUIConfig() error
- func ShowFinance() bool
- func UpdateAdminTheme(adminId int64, theme string)
- func UpdateAdminUIConfig(uiConfig *systemconfigs.AdminUIConfig) error
- func UpdateLogConfig(logConfig *systemconfigs.LogConfig) error
- func UpdateSecurityConfig(securityConfig *systemconfigs.SecurityConfig) error
- type AdminModuleCode
- type AdminModuleList
Constants ¶
View Source
const ( SecuritySettingName = "adminSecurityConfig" FrameNone = "" FrameDeny = "DENY" FrameSameOrigin = "SAMEORIGIN" )
View Source
const (
LogSettingName = "adminLogConfig"
)
Variables ¶
This section is empty.
Functions ¶
func FindAdminLang ¶ added in v1.2.1
FindAdminLang 查找某个管理员选择的语言
func FindAdminLangForAction ¶ added in v1.2.1
func FindAdminLangForAction(actionPtr actions.ActionWrapper) (langCode langs.LangCode)
func FindAdminTheme ¶ added in v0.2.8
FindAdminTheme 查找某个管理员选择的风格
func LoadAdminUIConfig ¶
func LoadAdminUIConfig() (*systemconfigs.AdminUIConfig, error)
func LoadLogConfig ¶
func LoadLogConfig() (*systemconfigs.LogConfig, error)
func LoadSecurityConfig ¶
func LoadSecurityConfig() (*systemconfigs.SecurityConfig, error)
func NotifyAdminModuleMappingChange ¶
func NotifyAdminModuleMappingChange() error
func ReloadAdminUIConfig ¶ added in v0.5.0
func ReloadAdminUIConfig() error
func UpdateAdminTheme ¶ added in v0.2.8
UpdateAdminTheme 设置某个管理员的风格
func UpdateAdminUIConfig ¶
func UpdateAdminUIConfig(uiConfig *systemconfigs.AdminUIConfig) error
func UpdateLogConfig ¶
func UpdateLogConfig(logConfig *systemconfigs.LogConfig) error
func UpdateSecurityConfig ¶
func UpdateSecurityConfig(securityConfig *systemconfigs.SecurityConfig) error
Types ¶
type AdminModuleCode ¶
type AdminModuleCode = string
const ( AdminModuleCodeDashboard AdminModuleCode = "dashboard" // 看板 AdminModuleCodeServer AdminModuleCode = "server" // 网站 AdminModuleCodeNode AdminModuleCode = "node" // 节点 AdminModuleCodeDNS AdminModuleCode = "dns" // DNS AdminModuleCodeNS AdminModuleCode = "ns" // 域名服务 AdminModuleCodeAdmin AdminModuleCode = "admin" // 系统用户 AdminModuleCodeUser AdminModuleCode = "user" // 平台用户 AdminModuleCodeFinance AdminModuleCode = "finance" // 财务 AdminModuleCodePlan AdminModuleCode = "plan" // 套餐 AdminModuleCodeLog AdminModuleCode = "log" // 日志 AdminModuleCodeSetting AdminModuleCode = "setting" // 设置 AdminModuleCodeTicket AdminModuleCode = "ticket" // 工单 AdminModuleCodeCommon AdminModuleCode = "common" // 只要登录就可以访问的模块 )
func FindFirstAdminModule ¶
func FindFirstAdminModule(adminId int64) (module AdminModuleCode, ok bool)
FindFirstAdminModule 获取管理员第一个可访问模块
type AdminModuleList ¶
type AdminModuleList struct { IsSuper bool Modules []*systemconfigs.AdminModule Fullname string Theme string Lang string }
func (*AdminModuleList) Allow ¶
func (this *AdminModuleList) Allow(module string) bool
Click to show internal directories.
Click to hide internal directories.