123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211 |
- package init
- import (
- "nginx-ui/server/models"
- "nginx-ui/server/modules/settings"
- )
- // 初始化菜单数据
- func ensureRoutes() {
- routes := []models.SettingRoute{
- {
- Id: "NGINX_LAYOUT",
- Path: "nginx/*",
- Index: false,
- Pid: "",
- Uid: 100,
- Roles: "ADMIN",
- Type: "NAV",
- Target: "TAB",
- Title: "Nginx管理",
- Brief: "Nginx在线管理工具",
- NavLink: "/nginx",
- Deleted: false,
- SortNum: 0,
- },
- {
- Id: "LDAP",
- Path: "ldap",
- Index: true,
- Pid: "",
- Uid: 10,
- Roles: "ADMIN",
- Type: "NAV",
- Target: "TAB",
- Title: "LDAP管理",
- Brief: "LDAP用户管理",
- NavLink: "",
- Deleted: false,
- SortNum: 0,
- },
- {
- Id: "LDAPServerUsers",
- Path: "ldap/server/:id",
- Index: false,
- Pid: "",
- Uid: 0,
- Roles: "ADMIN",
- Type: "MENU",
- Target: "TAB",
- Title: "LDAP",
- Brief: "",
- NavLink: "",
- Deleted: false,
- SortNum: 0,
- },
- {
- Id: "LDAP_USERS",
- Path: "user",
- Index: true,
- Pid: "LDAPServerUsers",
- Uid: 0,
- Roles: "ADMIN",
- Type: "MENU",
- Target: "TAB",
- Title: "用户列表",
- Brief: "",
- NavLink: "",
- Deleted: false,
- SortNum: 10,
- },
- {
- Id: "LDAP_ORGANIZE_LIST",
- Path: "organize",
- Index: false,
- Pid: "LDAPServerUsers",
- Uid: 0,
- Roles: "ADMIN",
- Type: "MENU",
- Target: "TAB",
- Title: "组织管理",
- Brief: "",
- NavLink: "",
- Deleted: false,
- SortNum: 0,
- },
- {
- Id: "ROUTE_LIST",
- Path: "routes",
- Index: false,
- Pid: "",
- Uid: 0,
- Roles: "ADMIN",
- Type: "NAV",
- Target: "TAB",
- Title: "菜单配置",
- Brief: "配置系统菜单",
- NavLink: "",
- Deleted: false,
- SortNum: 0,
- },
- {
- Id: "USER_MANAGER",
- Path: "user",
- Index: false,
- Pid: "",
- Uid: 0,
- Roles: "",
- Type: "NAV",
- Target: "TAB",
- Title: "用户管理",
- Brief: "系统用户管理",
- NavLink: "",
- Deleted: false,
- SortNum: 5,
- },
- {
- Id: "USER_LIST",
- Path: "list",
- Index: true,
- Pid: "USER_MANAGER",
- Uid: 0,
- Roles: "",
- Type: "MENU",
- Target: "TAB",
- Title: "用户列表",
- Brief: "用户列表",
- NavLink: "",
- Deleted: false,
- SortNum: 4,
- },
- {
- Id: "USER_ROLE",
- Path: "role",
- Index: false,
- Pid: "USER_MANAGER",
- Uid: 0,
- Roles: "",
- Type: "MENU",
- Target: "TAB",
- Title: "角色管理",
- Brief: "角色管理",
- NavLink: "",
- Deleted: false,
- SortNum: 3,
- },
- {
- Id: "SETTING_ID",
- Path: "settings",
- Index: false,
- Pid: "",
- Uid: 0,
- Roles: "ADMIN",
- Type: "NAV",
- Target: "TAB",
- Title: "系统设置",
- Brief: "系统设置",
- NavLink: "",
- Deleted: false,
- SortNum: 0,
- },
- {
- Id: "USER_LINKS",
- Path: "links",
- Index: false,
- Pid: "",
- Uid: 0,
- Roles: "",
- Type: "NAV",
- Target: "TAB",
- Title: "快捷菜单",
- Brief: "快捷菜单",
- NavLink: "",
- Deleted: false,
- SortNum: 0,
- },
- {
- Id: "QUICK_LINKS",
- Path: "#",
- Index: false,
- Pid: "",
- Uid: 0,
- Roles: "",
- Type: "FOLDER",
- Target: "TAB",
- Title: "快捷链接",
- Brief: "快捷链接",
- NavLink: "",
- Deleted: false,
- SortNum: 0,
- },
- {
- Id: "MODIFY_PASSWORD",
- Path: "/modifyPassword",
- Index: false,
- Pid: "QUICK_LINKS",
- Uid: 0,
- Roles: "",
- Type: "LINK",
- Target: "TAB",
- Title: "修改密码",
- Brief: "修改您的密码",
- NavLink: "",
- Deleted: false,
- SortNum: 0,
- },
- }
- for _, route := range routes {
- settings.Route.InsertWhenNotExist(route)
- }
- }
|