64 Star 391 Fork 127

admpub/nging

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
navigate.go 19.06 KB
一键复制 编辑 原始数据 按行查看 历史
admpub 提交于 2020-03-11 22:35 . update
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883
/*
Nging is a toolbox for webmasters
Copyright (C) 2018-present Wenhui Shen <swh@admpub.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package manager
import (
"github.com/admpub/nging/application/cmd/event"
_ "github.com/admpub/nging/application/handler/caddy"
_ "github.com/admpub/nging/application/handler/cloud"
_ "github.com/admpub/nging/application/handler/collector"
_ "github.com/admpub/nging/application/handler/database"
_ "github.com/admpub/nging/application/handler/download"
_ "github.com/admpub/nging/application/handler/frp"
_ "github.com/admpub/nging/application/handler/ftp"
_ "github.com/admpub/nging/application/handler/server"
_ "github.com/admpub/nging/application/handler/task"
_ "github.com/admpub/nging/application/handler/term"
"github.com/admpub/nging/application/registry/navigate"
)
var LeftNavigate = &navigate.List{
{
DisplayOnMenu: true,
Name: `网站管理`,
Action: `caddy`,
Icon: `sitemap`,
Children: &navigate.List{
{
DisplayOnMenu: false,
Name: `Caddy日志`,
Action: `log_show`,
},
{
DisplayOnMenu: true,
Name: `网站列表`,
Action: `vhost`,
},
{
DisplayOnMenu: true,
Name: `添加网站`,
Action: `vhost_add`,
Icon: `plus`,
},
{
DisplayOnMenu: false,
Name: `重启Caddy`,
Action: `restart`,
Icon: ``,
},
{
DisplayOnMenu: false,
Name: `停止Caddy`,
Action: `stop`,
Icon: ``,
},
{
DisplayOnMenu: false,
Name: `查看网站日志`,
Action: `vhost_log`,
},
{
DisplayOnMenu: false,
Name: `查看网站动态`,
Action: `log`,
},
{
DisplayOnMenu: false,
Name: `配置表单`,
Action: `addon_form`,
Icon: ``,
},
{
DisplayOnMenu: false,
Name: `修改网站`,
Action: `vhost_edit`,
Icon: ``,
},
{
DisplayOnMenu: false,
Name: `删除网站`,
Action: `vhost_delete`,
Icon: ``,
},
{
DisplayOnMenu: false,
Name: `管理网站文件`,
Action: `vhost_file`,
Icon: ``,
},
{
DisplayOnMenu: false,
Name: `生成Caddyfile`,
Action: `vhost_build`,
Icon: ``,
},
{
DisplayOnMenu: true,
Name: `分组管理`,
Action: `group`,
},
{
DisplayOnMenu: true,
Name: `添加分组`,
Action: `group_add`,
Icon: `plus`,
},
{
DisplayOnMenu: false,
Name: `修改分组`,
Action: `group_edit`,
Icon: ``,
},
{
DisplayOnMenu: false,
Name: `删除分组`,
Action: `group_delete`,
Icon: ``,
},
},
},
{
DisplayOnMenu: true,
Name: `服务器`,
Action: `server`,
Icon: `desktop`,
Children: &navigate.List{
{
DisplayOnMenu: true,
Name: `服务器信息`,
Action: `sysinfo`,
},
{
DisplayOnMenu: true,
Name: `网络端口`,
Action: `netstat`,
},
{
DisplayOnMenu: true,
Name: `执行命令`,
Action: `cmd`,
},
//指令集
{
DisplayOnMenu: true,
Name: `指令集`,
Action: `command`,
},
{
DisplayOnMenu: false,
Name: `添加指令`,
Action: `command_add`,
},
{
DisplayOnMenu: false,
Name: `修改指令`,
Action: `command_edit`,
},
{
DisplayOnMenu: false,
Name: `删除指令`,
Action: `command_delete`,
},
{
DisplayOnMenu: true,
Name: `服务管理`,
Action: `service`,
},
{
DisplayOnMenu: true,
Name: `hosts文件`,
Action: `hosts`,
},
{
DisplayOnMenu: false,
Name: `查看Nging日志`,
Action: `log`,
},
{
DisplayOnMenu: false,
Name: `查看进程详情`,
Action: `process/:pid`,
},
{
DisplayOnMenu: false,
Name: `杀死进程`,
Action: `procskill/:pid`,
},
{
DisplayOnMenu: false,
Name: `命令对话`,
Action: `cmdSend/*`,
},
{
DisplayOnMenu: false,
Name: `发送命令`,
Action: `cmdSendWS`,
},
{
DisplayOnMenu: true,
Name: `进程值守`,
Action: `daemon_index`,
},
{
DisplayOnMenu: false,
Name: `进程值守日志`,
Action: `daemon_log`,
},
{
DisplayOnMenu: false,
Name: `添加值守配置`,
Action: `daemon_add`,
},
{
DisplayOnMenu: false,
Name: `修改值守配置`,
Action: `daemon_edit`,
},
{
DisplayOnMenu: false,
Name: `删除值守配置`,
Action: `daemon_delete`,
},
},
},
{
DisplayOnMenu: true,
Name: `FTP账号`,
Action: `ftp`,
Icon: `users`,
Children: &navigate.List{
{
DisplayOnMenu: true,
Name: `账号管理`,
Action: `account`,
},
{
DisplayOnMenu: true,
Name: `添加账号`,
Action: `account_add`,
Icon: `plus`,
},
{
DisplayOnMenu: true,
Name: `用户组`,
Action: `group`,
},
{
DisplayOnMenu: true,
Name: `添加用户组`,
Action: `group_add`,
Icon: `plus`,
},
{
DisplayOnMenu: false,
Name: `修改账号`,
Action: `account_edit`,
Icon: ``,
},
{
DisplayOnMenu: false,
Name: `删除账号`,
Action: `account_delete`,
Icon: ``,
},
{
DisplayOnMenu: false,
Name: `修改分组`,
Action: `group_edit`,
Icon: ``,
},
{
DisplayOnMenu: false,
Name: `删除分组`,
Action: `group_delete`,
Icon: ``,
},
{
DisplayOnMenu: false,
Name: `重启FTP服务`,
Action: `restart`,
Icon: ``,
},
{
DisplayOnMenu: false,
Name: `关闭FTP服务`,
Action: `stop`,
Icon: ``,
},
{
DisplayOnMenu: false,
Name: `查看FTP动态`,
Action: `log`,
Icon: ``,
},
},
},
{
DisplayOnMenu: true,
Name: `数据采集`,
Action: `collector`,
Icon: `truck`,
Children: &navigate.List{
{
DisplayOnMenu: true,
Name: `规则管理`,
Action: `rule`,
},
{
DisplayOnMenu: true,
Name: `新建规则`,
Action: `rule_add`,
Icon: `plus`,
},
{
DisplayOnMenu: true,
Name: `历史记录`,
Action: `history`,
},
{
DisplayOnMenu: false,
Name: `查看历史内容`,
Action: `history_view`,
},
{
DisplayOnMenu: false,
Name: `删除历史记录`,
Action: `history_delete`,
},
{
DisplayOnMenu: true,
Name: `数据导出`,
Action: `export`,
},
{
DisplayOnMenu: false,
Name: `添加导出规则`,
Action: `export_add`,
},
{
DisplayOnMenu: false,
Name: `修改导出规则`,
Action: `export_edit`,
},
{
DisplayOnMenu: false,
Name: `删除导出规则`,
Action: `export_delete`,
},
{
DisplayOnMenu: false,
Name: `导出日志管理`,
Action: `export_log`,
},
{
DisplayOnMenu: false,
Name: `查看导出日志`,
Action: `export_log_view/:id`,
},
{
DisplayOnMenu: false,
Name: `删除导出日志`,
Action: `export_log_delete`,
},
{
DisplayOnMenu: false,
Name: `更改导出日志状态`,
Action: `export_edit_status`,
},
{
DisplayOnMenu: true,
Name: `分组管理`,
Action: `group`,
},
{
DisplayOnMenu: true,
Name: `添加分组`,
Action: `group_add`,
Icon: `plus`,
},
{
DisplayOnMenu: false,
Name: `修改规则`,
Action: `rule_edit`,
Icon: ``,
},
{
DisplayOnMenu: false,
Name: `删除规则`,
Action: `rule_delete`,
Icon: ``,
},
{
DisplayOnMenu: false,
Name: `规则测试`,
Action: `rule_collect`,
Icon: ``,
},
{
DisplayOnMenu: false,
Name: `修改分组`,
Action: `group_edit`,
Icon: ``,
},
{
DisplayOnMenu: false,
Name: `删除分组`,
Action: `group_delete`,
Icon: ``,
},
{
DisplayOnMenu: false,
Name: `测试正则表达式`,
Action: `regexp_test`,
Icon: ``,
},
},
},
{
DisplayOnMenu: true,
Name: `计划任务`,
Action: `task`,
Icon: `clock-o`,
Children: &navigate.List{
{
DisplayOnMenu: true,
Name: `任务管理`,
Action: `index`,
},
{
DisplayOnMenu: true,
Name: `新建任务`,
Action: `add`,
Icon: `plus`,
},
{
DisplayOnMenu: true,
Name: `分组管理`,
Action: `group`,
},
{
DisplayOnMenu: true,
Name: `添加分组`,
Action: `group_add`,
Icon: `plus`,
},
{
DisplayOnMenu: true,
Name: `测试邮件`,
Action: `email_test`,
},
{
DisplayOnMenu: false,
Name: `修改任务`,
Action: `edit`,
},
{
DisplayOnMenu: false,
Name: `删除任务`,
Action: `delete`,
},
{
DisplayOnMenu: false,
Name: `启动任务`,
Action: `start`,
},
{
DisplayOnMenu: false,
Name: `暂停任务`,
Action: `pause`,
},
{
DisplayOnMenu: false,
Name: `立即执行任务`,
Action: `run`,
},
{
DisplayOnMenu: false,
Name: `退出任务`,
Action: `exit`,
},
{
DisplayOnMenu: false,
Name: `启动历史任务`,
Action: `start_history`,
},
{
DisplayOnMenu: false,
Name: `修改分组`,
Action: `group_edit`,
},
{
DisplayOnMenu: false,
Name: `删除分组`,
Action: `group_delete`,
},
{
DisplayOnMenu: false,
Name: `日志列表`,
Action: `log`,
},
{
DisplayOnMenu: false,
Name: `日志详情`,
Action: `log_view/:id`,
},
{
DisplayOnMenu: false,
Name: `删除日志`,
Action: `log_delete`,
},
},
},
{
DisplayOnMenu: true,
Name: `离线下载`,
Action: `download`,
Icon: `download`,
Children: &navigate.List{
{
DisplayOnMenu: true,
Name: `下载管理`,
Action: `index.html`,
},
{
DisplayOnMenu: true,
Name: `文件管理`,
Action: `file`,
},
{
DisplayOnMenu: false,
Name: `总进度信息`,
Action: `progress.json`,
},
{
DisplayOnMenu: false,
Name: `添加任务`,
Action: `add_task`,
},
{
DisplayOnMenu: false,
Name: `删除任务`,
Action: `remove_task`,
},
{
DisplayOnMenu: false,
Name: `启动任务`,
Action: `start_task`,
},
{
DisplayOnMenu: false,
Name: `停止任务`,
Action: `stop_task`,
},
{
DisplayOnMenu: false,
Name: `启动所有任务`,
Action: `start_all_task`,
},
{
DisplayOnMenu: false,
Name: `停止所有任务`,
Action: `stop_all_task`,
},
{
DisplayOnMenu: false,
Name: `单个文件进度信息`,
Action: `progress/*`,
},
},
},
{
DisplayOnMenu: true,
Name: `云服务`,
Action: `cloud`,
Icon: `cloud`,
Children: &navigate.List{
{
DisplayOnMenu: true,
Name: `云存储账号`,
Action: `storage`,
},
{
DisplayOnMenu: true,
Name: `添加账号`,
Action: `storage_add`,
Icon: `plus`,
},
{
DisplayOnMenu: false,
Name: `修改账号`,
Action: `storage_edit`,
},
{
DisplayOnMenu: false,
Name: `删除账号`,
Action: `storage_delete`,
},
{
DisplayOnMenu: false,
Name: `云存储文件管理`,
Action: `storage_file`,
},
},
},
{
DisplayOnMenu: true,
Name: `数据库`,
Action: `db`,
Icon: `table`,
Children: &navigate.List{
{
DisplayOnMenu: true,
Name: `数据库账号`,
Action: `account`,
},
{
DisplayOnMenu: true,
Name: `添加账号`,
Action: `account_add`,
Icon: `plus`,
},
{
DisplayOnMenu: false,
Name: `修改账号`,
Action: `account_edit`,
},
{
DisplayOnMenu: false,
Name: `删除账号`,
Action: `account_delete`,
},
{
DisplayOnMenu: true,
Name: `连接数据库`,
Action: ``,
},
{
DisplayOnMenu: true,
Name: `表结构同步`,
Action: `schema_sync`,
},
{
DisplayOnMenu: false,
Name: `新增同步方案`,
Action: `schema_sync_add`,
},
{
DisplayOnMenu: false,
Name: `修改同步方案`,
Action: `schema_sync_edit`,
},
{
DisplayOnMenu: false,
Name: `删除同步方案`,
Action: `schema_sync_delete`,
},
{
DisplayOnMenu: false,
Name: `预览表结构差异`,
Action: `schema_sync_preview`,
},
{
DisplayOnMenu: false,
Name: `执行表结构同步`,
Action: `schema_sync_run`,
},
{
DisplayOnMenu: false,
Name: `表结构同步日志列表`,
Action: `schema_sync_log/:id`,
},
{
DisplayOnMenu: false,
Name: `表结构同步日志详情`,
Action: `schema_sync_log_view/:id`,
},
{
DisplayOnMenu: false,
Name: `删除表结构同步日志`,
Action: `schema_sync_log_delete`,
},
},
},
{
DisplayOnMenu: true,
Name: `内网穿透`,
Action: `frp`,
Icon: `road`,
Children: &navigate.List{
{
DisplayOnMenu: true,
Name: `服务端配置`,
Action: `server_index`,
},
{
DisplayOnMenu: false,
Name: `查看服务端日志`,
Action: `server_log`,
},
{
DisplayOnMenu: false,
Name: `添加服务端配置`,
Action: `server_add`,
},
{
DisplayOnMenu: false,
Name: `修改服务端配置`,
Action: `server_edit`,
},
{
DisplayOnMenu: false,
Name: `删除服务端配置`,
Action: `server_delete`,
},
{
DisplayOnMenu: true,
Name: `客户端配置`,
Action: `client_index`,
},
{
DisplayOnMenu: false,
Name: `查看客户端日志`,
Action: `client_log`,
},
{
DisplayOnMenu: false,
Name: `添加客户端配置`,
Action: `client_add`,
},
{
DisplayOnMenu: false,
Name: `修改客户端配置`,
Action: `client_edit`,
},
{
DisplayOnMenu: false,
Name: `删除客户端配置`,
Action: `client_delete`,
},
{
DisplayOnMenu: true,
Name: `分组管理`,
Action: `group_index`,
},
{
DisplayOnMenu: false,
Name: `添加分组`,
Action: `group_add`,
},
{
DisplayOnMenu: false,
Name: `修改分组`,
Action: `group_edit`,
},
{
DisplayOnMenu: false,
Name: `删除分组`,
Action: `group_delete`,
},
{
DisplayOnMenu: true,
Name: `统计图表`,
Action: `dashboard`,
Target: `_blank`,
},
{
DisplayOnMenu: false,
Name: `重启服务端`,
Action: `server_restart`,
},
{
DisplayOnMenu: false,
Name: `关闭服务端`,
Action: `server_stop`,
},
{
DisplayOnMenu: false,
Name: `重启客户端`,
Action: `client_restart`,
},
{
DisplayOnMenu: false,
Name: `关闭客户端`,
Action: `client_stop`,
},
{
DisplayOnMenu: false,
Name: `配置表单`,
Action: `addon_form`,
},
},
},
{
DisplayOnMenu: true,
Name: `SSH管理`,
Action: `term`,
Icon: `terminal`,
Children: &navigate.List{
{
DisplayOnMenu: true,
Name: `账号管理`,
Action: `account`,
},
{
DisplayOnMenu: true,
Name: `添加账号`,
Action: `account_add`,
Icon: `plus`,
},
{
DisplayOnMenu: true,
Name: `分组管理`,
Action: `group`,
},
{
DisplayOnMenu: true,
Name: `添加分组`,
Action: `group_add`,
Icon: `plus`,
},
{
DisplayOnMenu: false,
Name: `修改账号`,
Action: `account_edit`,
Icon: ``,
},
{
DisplayOnMenu: false,
Name: `删除账号`,
Action: `account_delete`,
Icon: ``,
},
{
DisplayOnMenu: false,
Name: `修改分组`,
Action: `group_edit`,
Icon: ``,
},
{
DisplayOnMenu: false,
Name: `删除分组`,
Action: `group_delete`,
Icon: ``,
},
{
DisplayOnMenu: false,
Name: `SSH操作`,
Action: `client`,
Icon: ``,
},
{
DisplayOnMenu: false,
Name: `SFTP操作`,
Action: `sftp`,
Icon: ``,
},
},
},
}
var Project = navigate.NewProject(`Nging`, `nging`, `/index`, navigate.LeftNavigate)
func init() {
event.SupportManager = true
navigate.LeftNavigate.Add(0, *LeftNavigate...)
navigate.ProjectAdd(2, Project)
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/admpub/nging.git
git@gitee.com:admpub/nging.git
admpub
nging
nging
v2.2.3

搜索帮助