From 920b5b9452aeb4a68b7c7338ab193c45b6ea1c75 Mon Sep 17 00:00:00 2001 From: ssongliu Date: Mon, 13 Feb 2023 17:13:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=AF=B7=E6=B1=82=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E5=89=8D=E7=AB=AF=E7=9B=AE=E5=BD=95=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/api/v1/backup.go | 18 +- backend/app/api/v1/command.go | 10 +- backend/app/api/v1/group.go | 30 +- backend/app/service/group.go | 13 - backend/init/router/router.go | 3 - backend/router/entry.go | 3 - backend/router/ro_backup.go | 29 - backend/router/ro_command.go | 25 - backend/router/ro_group.go | 25 - backend/router/ro_host.go | 11 + backend/router/ro_setting.go | 12 + cmd/server/docs/docs.go | 1489 ++++++++--------- cmd/server/docs/swagger.json | 1489 ++++++++--------- cmd/server/docs/swagger.yaml | 946 +++++------ frontend/src/api/modules/backup.ts | 37 - frontend/src/api/modules/command.ts | 23 - frontend/src/api/modules/group.ts | 18 - frontend/src/api/modules/host.ts | 40 +- frontend/src/api/modules/setting.ts | 30 + .../src/views/host/terminal/command/index.vue | 2 +- .../src/views/host/terminal/host/index.vue | 16 +- .../views/host/terminal/terminal/index.vue | 2 +- frontend/src/views/log/operation/index.vue | 3 - .../views/setting/backup-account/index.vue | 2 +- .../setting/backup-account/operate/index.vue | 2 +- 25 files changed, 2025 insertions(+), 2253 deletions(-) delete mode 100644 backend/router/ro_backup.go delete mode 100644 backend/router/ro_command.go delete mode 100644 backend/router/ro_group.go delete mode 100644 frontend/src/api/modules/backup.ts delete mode 100644 frontend/src/api/modules/command.ts delete mode 100644 frontend/src/api/modules/group.ts diff --git a/backend/app/api/v1/backup.go b/backend/app/api/v1/backup.go index 9d5383960..9dde87c47 100644 --- a/backend/app/api/v1/backup.go +++ b/backend/app/api/v1/backup.go @@ -15,7 +15,7 @@ import ( // @Param request body dto.BackupOperate true "request" // @Success 200 // @Security ApiKeyAuth -// @Router /backups [post] +// @Router /settings/backup [post] // @x-panel-log {"bodyKeys":["type"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"创建备份账号 [type]","formatEN":"create backup account [type]"} func (b *BaseApi) CreateBackup(c *gin.Context) { var req dto.BackupOperate @@ -41,7 +41,7 @@ func (b *BaseApi) CreateBackup(c *gin.Context) { // @Param request body dto.ForBuckets true "request" // @Success 200 {anrry} string // @Security ApiKeyAuth -// @Router /backups/search [post] +// @Router /settings/backup/search [post] func (b *BaseApi) ListBuckets(c *gin.Context) { var req dto.ForBuckets if err := c.ShouldBindJSON(&req); err != nil { @@ -67,7 +67,7 @@ func (b *BaseApi) ListBuckets(c *gin.Context) { // @Param request body dto.BatchDeleteReq true "request" // @Success 200 // @Security ApiKeyAuth -// @Router /backups/del [post] +// @Router /settings/backup/del [post] // @x-panel-log {"bodyKeys":["ids"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"ids","isList":true,"db":"backup_accounts","output_colume":"type","output_value":"types"}],"formatZH":"删除备份账号 [types]","formatEN":"delete backup account [types]"} func (b *BaseApi) DeleteBackup(c *gin.Context) { var req dto.BatchDeleteReq @@ -94,7 +94,7 @@ func (b *BaseApi) DeleteBackup(c *gin.Context) { // @Param request body dto.RecordSearch true "request" // @Success 200 // @Security ApiKeyAuth -// @Router /backups/record/search [post] +// @Router /settings/backup/record/search [post] func (b *BaseApi) SearchBackupRecords(c *gin.Context) { var req dto.RecordSearch if err := c.ShouldBindJSON(&req); err != nil { @@ -121,7 +121,7 @@ func (b *BaseApi) SearchBackupRecords(c *gin.Context) { // @Param request body dto.DownloadRecord true "request" // @Success 200 // @Security ApiKeyAuth -// @Router /backups/record/download [post] +// @Router /settings/backup/record/download [post] // @x-panel-log {"bodyKeys":["source","fileName"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"下载备份记录 [source][fileName]","formatEN":"download backup records [source][fileName]"} func (b *BaseApi) DownloadRecord(c *gin.Context) { var req dto.DownloadRecord @@ -149,7 +149,7 @@ func (b *BaseApi) DownloadRecord(c *gin.Context) { // @Param request body dto.BatchDeleteReq true "request" // @Success 200 // @Security ApiKeyAuth -// @Router /backups/record/del [post] +// @Router /settings/backup/record/del [post] // @x-panel-log {"bodyKeys":["ids"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"ids","isList":true,"db":"backup_records","output_colume":"file_name","output_value":"files"}],"formatZH":"删除备份记录 [files]","formatEN":"delete backup records [files]"} func (b *BaseApi) DeleteBackupRecord(c *gin.Context) { var req dto.BatchDeleteReq @@ -176,7 +176,7 @@ func (b *BaseApi) DeleteBackupRecord(c *gin.Context) { // @Param request body dto.BackupOperate true "request" // @Success 200 // @Security ApiKeyAuth -// @Router /backups/update [post] +// @Router /settings/backup/update [post] // @x-panel-log {"bodyKeys":["type"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"更新备份账号 [types]","formatEN":"update backup account [types]"} func (b *BaseApi) UpdateBackup(c *gin.Context) { var req dto.BackupOperate @@ -200,7 +200,7 @@ func (b *BaseApi) UpdateBackup(c *gin.Context) { // @Description 获取备份账号列表 // @Success 200 {anrry} dto.BackupInfo // @Security ApiKeyAuth -// @Router /backups/search [get] +// @Router /settings/backup/search [get] func (b *BaseApi) ListBackup(c *gin.Context) { data, err := backupService.List() if err != nil { @@ -218,7 +218,7 @@ func (b *BaseApi) ListBackup(c *gin.Context) { // @Param request body dto.BackupSearchFile true "request" // @Success 200 {anrry} string // @Security ApiKeyAuth -// @Router /backups/search/files [post] +// @Router /settings/backup/search/files [post] func (b *BaseApi) LoadFilesFromBackup(c *gin.Context) { var req dto.BackupSearchFile if err := c.ShouldBindJSON(&req); err != nil { diff --git a/backend/app/api/v1/command.go b/backend/app/api/v1/command.go index 615408a9f..1f0f85ffd 100644 --- a/backend/app/api/v1/command.go +++ b/backend/app/api/v1/command.go @@ -15,7 +15,7 @@ import ( // @Param request body dto.CommandOperate true "request" // @Success 200 // @Security ApiKeyAuth -// @Router /commands [post] +// @Router /hosts/command [post] // @x-panel-log {"bodyKeys":["name","command"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"创建快捷命令 [name][command]","formatEN":"create quick command [name][command]"} func (b *BaseApi) CreateCommand(c *gin.Context) { var req dto.CommandOperate @@ -41,7 +41,7 @@ func (b *BaseApi) CreateCommand(c *gin.Context) { // @Param request body dto.SearchWithPage true "request" // @Success 200 {object} dto.PageResult // @Security ApiKeyAuth -// @Router /commands/search [post] +// @Router /hosts/command/search [post] func (b *BaseApi) SearchCommand(c *gin.Context) { var req dto.SearchWithPage if err := c.ShouldBindJSON(&req); err != nil { @@ -66,7 +66,7 @@ func (b *BaseApi) SearchCommand(c *gin.Context) { // @Description 获取快速命令列表 // @Success 200 {object} dto.CommandInfo // @Security ApiKeyAuth -// @Router /commands [get] +// @Router /hosts/command [get] func (b *BaseApi) ListCommand(c *gin.Context) { list, err := commandService.List() if err != nil { @@ -84,7 +84,7 @@ func (b *BaseApi) ListCommand(c *gin.Context) { // @Param request body dto.BatchDeleteReq true "request" // @Success 200 // @Security ApiKeyAuth -// @Router /commands/del [post] +// @Router /hosts/command/del [post] // @x-panel-log {"bodyKeys":["ids"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"ids","isList":true,"db":"commands","output_colume":"name","output_value":"names"}],"formatZH":"删除快捷命令 [names]","formatEN":"delete quick command [names]"} func (b *BaseApi) DeleteCommand(c *gin.Context) { var req dto.BatchDeleteReq @@ -111,7 +111,7 @@ func (b *BaseApi) DeleteCommand(c *gin.Context) { // @Param request body dto.CommandOperate true "request" // @Success 200 // @Security ApiKeyAuth -// @Router /commands/update [post] +// @Router /hosts/command/update [post] // @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"更新快捷命令 [name]","formatEN":"update quick command [name]"} func (b *BaseApi) UpdateCommand(c *gin.Context) { var req dto.CommandOperate diff --git a/backend/app/api/v1/group.go b/backend/app/api/v1/group.go index 8463d6287..0964269d5 100644 --- a/backend/app/api/v1/group.go +++ b/backend/app/api/v1/group.go @@ -15,7 +15,7 @@ import ( // @Param request body dto.GroupOperate true "request" // @Success 200 // @Security ApiKeyAuth -// @Router /groups [post] +// @Router /hosts/group [post] // @x-panel-log {"bodyKeys":["name","type"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"创建组 [name][type]","formatEN":"create group [name][type]"} func (b *BaseApi) CreateGroup(c *gin.Context) { var req dto.GroupOperate @@ -41,7 +41,7 @@ func (b *BaseApi) CreateGroup(c *gin.Context) { // @Param request body dto.OperateByID true "request" // @Success 200 // @Security ApiKeyAuth -// @Router /groups/del [post] +// @Router /hosts/group/del [post] // @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"groups","output_colume":"name","output_value":"name"}],"formatZH":"删除组 [name]","formatEN":"delete group [name]"} func (b *BaseApi) DeleteGroup(c *gin.Context) { var req dto.OperateByID @@ -68,7 +68,7 @@ func (b *BaseApi) DeleteGroup(c *gin.Context) { // @Param request body dto.GroupOperate true "request" // @Success 200 // @Security ApiKeyAuth -// @Router /groups/update [post] +// @Router /hosts/group/update [post] // @x-panel-log {"bodyKeys":["name","type"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"更新组 [name][type]","formatEN":"update group [name][type]"} func (b *BaseApi) UpdateGroup(c *gin.Context) { var req dto.GroupOperate @@ -88,28 +88,6 @@ func (b *BaseApi) UpdateGroup(c *gin.Context) { helper.SuccessWithData(c, nil) } -// @Tags System Group -// @Summary Search group info by id -// @Description 查询系统组 -// @Accept json -// @Param id path integer true "request" -// @Success 200 {object} dto.GroupInfo -// @Security ApiKeyAuth -// @Router /groups/:id [get] -func (b *BaseApi) GetGroupInfo(c *gin.Context) { - id, err := helper.GetParamID(c) - if err != nil { - helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err) - return - } - group, err := groupService.GetGroupInfo(id) - if err != nil { - helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err) - return - } - helper.SuccessWithData(c, group) -} - // @Tags System Group // @Summary List groups // @Description 查询系统组 @@ -117,7 +95,7 @@ func (b *BaseApi) GetGroupInfo(c *gin.Context) { // @Param request body dto.GroupSearch true "request" // @Success 200 {anrry} dto.GroupInfo // @Security ApiKeyAuth -// @Router /groups/search [post] +// @Router /hosts/group/search [post] func (b *BaseApi) ListGroup(c *gin.Context) { var req dto.GroupSearch if err := c.ShouldBindJSON(&req); err != nil { diff --git a/backend/app/service/group.go b/backend/app/service/group.go index 36bc72476..41ba9f2a4 100644 --- a/backend/app/service/group.go +++ b/backend/app/service/group.go @@ -10,7 +10,6 @@ import ( type GroupService struct{} type IGroupService interface { - GetGroupInfo(id uint) (*dto.GroupInfo, error) List(req dto.GroupSearch) ([]dto.GroupInfo, error) Create(groupDto dto.GroupOperate) error Update(id uint, name string) error @@ -21,18 +20,6 @@ func NewIGroupService() IGroupService { return &GroupService{} } -func (u *GroupService) GetGroupInfo(id uint) (*dto.GroupInfo, error) { - group, err := groupRepo.Get(commonRepo.WithByID(id)) - if err != nil { - return nil, constant.ErrRecordNotFound - } - var dtoGroup dto.GroupInfo - if err := copier.Copy(&dtoGroup, &group); err != nil { - return nil, errors.WithMessage(constant.ErrStructTransform, err.Error()) - } - return &dtoGroup, err -} - func (u *GroupService) List(req dto.GroupSearch) ([]dto.GroupInfo, error) { groups, err := groupRepo.GetList(groupRepo.WithByType(req.Type)) if err != nil { diff --git a/backend/init/router/router.go b/backend/init/router/router.go index 883e4e1cb..01f6c1310 100644 --- a/backend/init/router/router.go +++ b/backend/init/router/router.go @@ -73,10 +73,7 @@ func Routers() *gin.Engine { systemRouter.InitBaseRouter(PrivateGroup) systemRouter.InitDashboardRouter(PrivateGroup) systemRouter.InitHostRouter(PrivateGroup) - systemRouter.InitBackupRouter(PrivateGroup) - systemRouter.InitGroupRouter(PrivateGroup) systemRouter.InitContainerRouter(PrivateGroup) - systemRouter.InitCommandRouter(PrivateGroup) systemRouter.InitTerminalRouter(PrivateGroup) systemRouter.InitMonitorRouter(PrivateGroup) systemRouter.InitLogRouter(PrivateGroup) diff --git a/backend/router/entry.go b/backend/router/entry.go index 292926f2a..07febf122 100644 --- a/backend/router/entry.go +++ b/backend/router/entry.go @@ -4,10 +4,7 @@ type RouterGroup struct { BaseRouter DashboardRouter HostRouter - BackupRouter - GroupRouter ContainerRouter - CommandRouter MonitorRouter LogRouter FileRouter diff --git a/backend/router/ro_backup.go b/backend/router/ro_backup.go deleted file mode 100644 index a430de353..000000000 --- a/backend/router/ro_backup.go +++ /dev/null @@ -1,29 +0,0 @@ -package router - -import ( - v1 "github.com/1Panel-dev/1Panel/backend/app/api/v1" - "github.com/1Panel-dev/1Panel/backend/middleware" - - "github.com/gin-gonic/gin" -) - -type BackupRouter struct{} - -func (s *BackupRouter) InitBackupRouter(Router *gin.RouterGroup) { - baRouter := Router.Group("backups"). - Use(middleware.JwtAuth()). - Use(middleware.SessionAuth()). - Use(middleware.PasswordExpired()) - baseApi := v1.ApiGroupApp.BaseApi - { - baRouter.GET("/search", baseApi.ListBackup) - baRouter.POST("/search/files", baseApi.LoadFilesFromBackup) - baRouter.POST("/buckets", baseApi.ListBuckets) - baRouter.POST("", baseApi.CreateBackup) - baRouter.POST("/del", baseApi.DeleteBackup) - baRouter.POST("/update", baseApi.UpdateBackup) - baRouter.POST("/record/search", baseApi.SearchBackupRecords) - baRouter.POST("/record/download", baseApi.DownloadRecord) - baRouter.POST("/record/del", baseApi.DeleteBackupRecord) - } -} diff --git a/backend/router/ro_command.go b/backend/router/ro_command.go deleted file mode 100644 index 07681ef25..000000000 --- a/backend/router/ro_command.go +++ /dev/null @@ -1,25 +0,0 @@ -package router - -import ( - v1 "github.com/1Panel-dev/1Panel/backend/app/api/v1" - "github.com/1Panel-dev/1Panel/backend/middleware" - - "github.com/gin-gonic/gin" -) - -type CommandRouter struct{} - -func (s *CommandRouter) InitCommandRouter(Router *gin.RouterGroup) { - cmdRouter := Router.Group("commands"). - Use(middleware.JwtAuth()). - Use(middleware.SessionAuth()). - Use(middleware.PasswordExpired()) - baseApi := v1.ApiGroupApp.BaseApi - { - cmdRouter.GET("", baseApi.ListCommand) - cmdRouter.POST("", baseApi.CreateCommand) - cmdRouter.POST("/del", baseApi.DeleteCommand) - cmdRouter.POST("/search", baseApi.SearchCommand) - cmdRouter.POST("/update", baseApi.UpdateCommand) - } -} diff --git a/backend/router/ro_group.go b/backend/router/ro_group.go deleted file mode 100644 index 809a9fd82..000000000 --- a/backend/router/ro_group.go +++ /dev/null @@ -1,25 +0,0 @@ -package router - -import ( - v1 "github.com/1Panel-dev/1Panel/backend/app/api/v1" - "github.com/1Panel-dev/1Panel/backend/middleware" - - "github.com/gin-gonic/gin" -) - -type GroupRouter struct{} - -func (s *GroupRouter) InitGroupRouter(Router *gin.RouterGroup) { - groupRouter := Router.Group("groups"). - Use(middleware.JwtAuth()). - Use(middleware.SessionAuth()). - Use(middleware.PasswordExpired()) - baseApi := v1.ApiGroupApp.BaseApi - { - groupRouter.POST("", baseApi.CreateGroup) - groupRouter.POST("/del", baseApi.DeleteGroup) - groupRouter.POST("/update", baseApi.UpdateGroup) - groupRouter.POST("/search", baseApi.ListGroup) - groupRouter.GET(":id", baseApi.GetGroupInfo) - } -} diff --git a/backend/router/ro_host.go b/backend/router/ro_host.go index a6258ef17..065d6f54c 100644 --- a/backend/router/ro_host.go +++ b/backend/router/ro_host.go @@ -23,5 +23,16 @@ func (s *HostRouter) InitHostRouter(Router *gin.RouterGroup) { hostRouter.POST("/test/byinfo", baseApi.TestByInfo) hostRouter.POST("/test/byid/:id", baseApi.TestByID) hostRouter.GET(":id", baseApi.GetHostInfo) + + hostRouter.POST("/group", baseApi.CreateGroup) + hostRouter.POST("/group/del", baseApi.DeleteGroup) + hostRouter.POST("/group/update", baseApi.UpdateGroup) + hostRouter.POST("/group/search", baseApi.ListGroup) + + hostRouter.GET("/command", baseApi.ListCommand) + hostRouter.POST("/command", baseApi.CreateCommand) + hostRouter.POST("/command/del", baseApi.DeleteCommand) + hostRouter.POST("/command/search", baseApi.SearchCommand) + hostRouter.POST("/command/update", baseApi.UpdateCommand) } } diff --git a/backend/router/ro_setting.go b/backend/router/ro_setting.go index 1d7bc2284..7d4f7e33f 100644 --- a/backend/router/ro_setting.go +++ b/backend/router/ro_setting.go @@ -25,6 +25,7 @@ func (s *SettingRouter) InitSettingRouter(Router *gin.RouterGroup) { settingRouter.POST("/monitor/clean", baseApi.CleanMonitor) settingRouter.GET("/mfa", baseApi.GetMFA) settingRouter.POST("/mfa/bind", baseApi.MFABind) + settingRouter.POST("/snapshot", baseApi.CreateSnapshot) settingRouter.POST("/snapshot/search", baseApi.SearchSnapshot) settingRouter.POST("/snapshot/import", baseApi.ImportSnapshot) @@ -32,6 +33,17 @@ func (s *SettingRouter) InitSettingRouter(Router *gin.RouterGroup) { settingRouter.POST("/snapshot/recover", baseApi.RecoverSnapshot) settingRouter.POST("/snapshot/rollback", baseApi.RollbackSnapshot) settingRouter.POST("/snapshot/description/update", baseApi.UpdateSnapDescription) + + settingRouter.GET("/backup/search", baseApi.ListBackup) + settingRouter.POST("/backup/search/files", baseApi.LoadFilesFromBackup) + settingRouter.POST("/backup/buckets", baseApi.ListBuckets) + settingRouter.POST("/backup", baseApi.CreateBackup) + settingRouter.POST("/backup/del", baseApi.DeleteBackup) + settingRouter.POST("/backup/update", baseApi.UpdateBackup) + settingRouter.POST("/backup/record/search", baseApi.SearchBackupRecords) + settingRouter.POST("/backup/record/download", baseApi.DownloadRecord) + settingRouter.POST("/backup/record/del", baseApi.DeleteBackupRecord) + settingRouter.POST("/upgrade", baseApi.Upgrade) settingRouter.GET("/upgrade", baseApi.GetUpgradeInfo) settingRouter.GET("/basedir", baseApi.LoadBaseDir) diff --git a/cmd/server/docs/docs.go b/cmd/server/docs/docs.go index dd587aaff..433f26680 100644 --- a/cmd/server/docs/docs.go +++ b/cmd/server/docs/docs.go @@ -893,552 +893,6 @@ var doc = `{ } } }, - "/backups": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "创建备份账号", - "consumes": [ - "application/json" - ], - "tags": [ - "Backup Account" - ], - "summary": "Create backup account", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.BackupOperate" - } - } - ], - "responses": { - "200": { - "description": "" - } - }, - "x-panel-log": { - "BeforeFuntions": [], - "bodyKeys": [ - "type" - ], - "formatEN": "create backup account [type]", - "formatZH": "创建备份账号 [type]", - "paramKeys": [] - } - } - }, - "/backups/del": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "删除备份账号", - "consumes": [ - "application/json" - ], - "tags": [ - "Backup Account" - ], - "summary": "Delete backup account", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.BatchDeleteReq" - } - } - ], - "responses": { - "200": { - "description": "" - } - }, - "x-panel-log": { - "BeforeFuntions": [ - { - "db": "backup_accounts", - "input_colume": "id", - "input_value": "ids", - "isList": true, - "output_colume": "type", - "output_value": "types" - } - ], - "bodyKeys": [ - "ids" - ], - "formatEN": "delete backup account [types]", - "formatZH": "删除备份账号 [types]", - "paramKeys": [] - } - } - }, - "/backups/record/del": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "删除备份记录", - "consumes": [ - "application/json" - ], - "tags": [ - "Backup Account" - ], - "summary": "Delete backup record", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.BatchDeleteReq" - } - } - ], - "responses": { - "200": { - "description": "" - } - }, - "x-panel-log": { - "BeforeFuntions": [ - { - "db": "backup_records", - "input_colume": "id", - "input_value": "ids", - "isList": true, - "output_colume": "file_name", - "output_value": "files" - } - ], - "bodyKeys": [ - "ids" - ], - "formatEN": "delete backup records [files]", - "formatZH": "删除备份记录 [files]", - "paramKeys": [] - } - } - }, - "/backups/record/download": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "下载备份记录", - "consumes": [ - "application/json" - ], - "tags": [ - "Backup Account" - ], - "summary": "Download backup record", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.DownloadRecord" - } - } - ], - "responses": { - "200": { - "description": "" - } - }, - "x-panel-log": { - "BeforeFuntions": [], - "bodyKeys": [ - "source", - "fileName" - ], - "formatEN": "download backup records [source][fileName]", - "formatZH": "下载备份记录 [source][fileName]", - "paramKeys": [] - } - } - }, - "/backups/record/search": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取备份记录列表分页", - "consumes": [ - "application/json" - ], - "tags": [ - "Backup Account" - ], - "summary": "Page backup records", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.RecordSearch" - } - } - ], - "responses": { - "200": { - "description": "" - } - } - } - }, - "/backups/search": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取备份账号列表", - "tags": [ - "Backup Account" - ], - "summary": "List backup accounts", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "anrry" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取 bucket 列表", - "consumes": [ - "application/json" - ], - "tags": [ - "Backup Account" - ], - "summary": "List buckets", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.ForBuckets" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "anrry" - } - } - } - } - }, - "/backups/search/files": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取备份账号内文件列表", - "consumes": [ - "application/json" - ], - "tags": [ - "Backup Account" - ], - "summary": "List files from backup accounts", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.BackupSearchFile" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "anrry" - } - } - } - } - }, - "/backups/update": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "更新备份账号信息", - "consumes": [ - "application/json" - ], - "tags": [ - "Backup Account" - ], - "summary": "Update backup account", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.BackupOperate" - } - } - ], - "responses": { - "200": { - "description": "" - } - }, - "x-panel-log": { - "BeforeFuntions": [], - "bodyKeys": [ - "type" - ], - "formatEN": "update backup account [types]", - "formatZH": "更新备份账号 [types]", - "paramKeys": [] - } - } - }, - "/commands": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取快速命令列表", - "tags": [ - "Command" - ], - "summary": "List commands", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.CommandInfo" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "创建快速命令", - "consumes": [ - "application/json" - ], - "tags": [ - "Command" - ], - "summary": "Create command", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.CommandOperate" - } - } - ], - "responses": { - "200": { - "description": "" - } - }, - "x-panel-log": { - "BeforeFuntions": [], - "bodyKeys": [ - "name", - "command" - ], - "formatEN": "create quick command [name][command]", - "formatZH": "创建快捷命令 [name][command]", - "paramKeys": [] - } - } - }, - "/commands/del": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "删除快速命令", - "consumes": [ - "application/json" - ], - "tags": [ - "Command" - ], - "summary": "Delete command", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.BatchDeleteReq" - } - } - ], - "responses": { - "200": { - "description": "" - } - }, - "x-panel-log": { - "BeforeFuntions": [ - { - "db": "commands", - "input_colume": "id", - "input_value": "ids", - "isList": true, - "output_colume": "name", - "output_value": "names" - } - ], - "bodyKeys": [ - "ids" - ], - "formatEN": "delete quick command [names]", - "formatZH": "删除快捷命令 [names]", - "paramKeys": [] - } - } - }, - "/commands/search": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取快速命令列表分页", - "consumes": [ - "application/json" - ], - "tags": [ - "Command" - ], - "summary": "Page commands", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.SearchWithPage" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.PageResult" - } - } - } - } - }, - "/commands/update": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "更新快速命令", - "consumes": [ - "application/json" - ], - "tags": [ - "Command" - ], - "summary": "Update command", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.CommandOperate" - } - } - ], - "responses": { - "200": { - "description": "" - } - }, - "x-panel-log": { - "BeforeFuntions": [], - "bodyKeys": [ - "name" - ], - "formatEN": "update quick command [name]", - "formatZH": "更新快捷命令 [name]", - "paramKeys": [] - } - } - }, "/containers": { "post": { "security": [ @@ -5265,213 +4719,6 @@ var doc = `{ } } }, - "/groups": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "创建系统组", - "consumes": [ - "application/json" - ], - "tags": [ - "System Group" - ], - "summary": "Create group", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.GroupOperate" - } - } - ], - "responses": { - "200": { - "description": "" - } - }, - "x-panel-log": { - "BeforeFuntions": [], - "bodyKeys": [ - "name", - "type" - ], - "formatEN": "create group [name][type]", - "formatZH": "创建组 [name][type]", - "paramKeys": [] - } - } - }, - "/groups/:id": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "查询系统组", - "consumes": [ - "application/json" - ], - "tags": [ - "System Group" - ], - "summary": "Search group info by id", - "parameters": [ - { - "type": "integer", - "description": "request", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.GroupInfo" - } - } - } - } - }, - "/groups/del": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "删除系统组", - "consumes": [ - "application/json" - ], - "tags": [ - "System Group" - ], - "summary": "Delete group", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.OperateByID" - } - } - ], - "responses": { - "200": { - "description": "" - } - }, - "x-panel-log": { - "BeforeFuntions": [ - { - "db": "groups", - "input_colume": "id", - "input_value": "id", - "isList": false, - "output_colume": "name", - "output_value": "name" - } - ], - "bodyKeys": [ - "id" - ], - "formatEN": "delete group [name]", - "formatZH": "删除组 [name]", - "paramKeys": [] - } - } - }, - "/groups/search": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "查询系统组", - "consumes": [ - "application/json" - ], - "tags": [ - "System Group" - ], - "summary": "List groups", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.GroupSearch" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "anrry" - } - } - } - } - }, - "/groups/update": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "更新系统组", - "consumes": [ - "application/json" - ], - "tags": [ - "System Group" - ], - "summary": "Update group", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.GroupOperate" - } - } - ], - "responses": { - "200": { - "description": "" - } - }, - "x-panel-log": { - "BeforeFuntions": [], - "bodyKeys": [ - "name", - "type" - ], - "formatEN": "update group [name][type]", - "formatZH": "更新组 [name][type]", - "paramKeys": [] - } - } - }, "/hosts": { "post": { "security": [ @@ -5549,6 +4796,198 @@ var doc = `{ } } }, + "/hosts/command": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取快速命令列表", + "tags": [ + "Command" + ], + "summary": "List commands", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.CommandInfo" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "创建快速命令", + "consumes": [ + "application/json" + ], + "tags": [ + "Command" + ], + "summary": "Create command", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.CommandOperate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "name", + "command" + ], + "formatEN": "create quick command [name][command]", + "formatZH": "创建快捷命令 [name][command]", + "paramKeys": [] + } + } + }, + "/hosts/command/del": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "删除快速命令", + "consumes": [ + "application/json" + ], + "tags": [ + "Command" + ], + "summary": "Delete command", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.BatchDeleteReq" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "commands", + "input_colume": "id", + "input_value": "ids", + "isList": true, + "output_colume": "name", + "output_value": "names" + } + ], + "bodyKeys": [ + "ids" + ], + "formatEN": "delete quick command [names]", + "formatZH": "删除快捷命令 [names]", + "paramKeys": [] + } + } + }, + "/hosts/command/search": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取快速命令列表分页", + "consumes": [ + "application/json" + ], + "tags": [ + "Command" + ], + "summary": "Page commands", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.SearchWithPage" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.PageResult" + } + } + } + } + }, + "/hosts/command/update": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "更新快速命令", + "consumes": [ + "application/json" + ], + "tags": [ + "Command" + ], + "summary": "Update command", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.CommandOperate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "name" + ], + "formatEN": "update quick command [name]", + "formatZH": "更新快捷命令 [name]", + "paramKeys": [] + } + } + }, "/hosts/del": { "post": { "security": [ @@ -5600,6 +5039,179 @@ var doc = `{ } } }, + "/hosts/group": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "创建系统组", + "consumes": [ + "application/json" + ], + "tags": [ + "System Group" + ], + "summary": "Create group", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.GroupOperate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "name", + "type" + ], + "formatEN": "create group [name][type]", + "formatZH": "创建组 [name][type]", + "paramKeys": [] + } + } + }, + "/hosts/group/del": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "删除系统组", + "consumes": [ + "application/json" + ], + "tags": [ + "System Group" + ], + "summary": "Delete group", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.OperateByID" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "groups", + "input_colume": "id", + "input_value": "id", + "isList": false, + "output_colume": "name", + "output_value": "name" + } + ], + "bodyKeys": [ + "id" + ], + "formatEN": "delete group [name]", + "formatZH": "删除组 [name]", + "paramKeys": [] + } + } + }, + "/hosts/group/search": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "查询系统组", + "consumes": [ + "application/json" + ], + "tags": [ + "System Group" + ], + "summary": "List groups", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.GroupSearch" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "anrry" + } + } + } + } + }, + "/hosts/group/update": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "更新系统组", + "consumes": [ + "application/json" + ], + "tags": [ + "System Group" + ], + "summary": "Update group", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.GroupOperate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "name", + "type" + ], + "formatEN": "update group [name][type]", + "formatZH": "更新组 [name][type]", + "paramKeys": [] + } + } + }, "/hosts/search": { "post": { "security": [ @@ -6034,6 +5646,360 @@ var doc = `{ } } }, + "/settings/backup": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "创建备份账号", + "consumes": [ + "application/json" + ], + "tags": [ + "Backup Account" + ], + "summary": "Create backup account", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.BackupOperate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "type" + ], + "formatEN": "create backup account [type]", + "formatZH": "创建备份账号 [type]", + "paramKeys": [] + } + } + }, + "/settings/backup/del": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "删除备份账号", + "consumes": [ + "application/json" + ], + "tags": [ + "Backup Account" + ], + "summary": "Delete backup account", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.BatchDeleteReq" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "backup_accounts", + "input_colume": "id", + "input_value": "ids", + "isList": true, + "output_colume": "type", + "output_value": "types" + } + ], + "bodyKeys": [ + "ids" + ], + "formatEN": "delete backup account [types]", + "formatZH": "删除备份账号 [types]", + "paramKeys": [] + } + } + }, + "/settings/backup/record/del": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "删除备份记录", + "consumes": [ + "application/json" + ], + "tags": [ + "Backup Account" + ], + "summary": "Delete backup record", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.BatchDeleteReq" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "backup_records", + "input_colume": "id", + "input_value": "ids", + "isList": true, + "output_colume": "file_name", + "output_value": "files" + } + ], + "bodyKeys": [ + "ids" + ], + "formatEN": "delete backup records [files]", + "formatZH": "删除备份记录 [files]", + "paramKeys": [] + } + } + }, + "/settings/backup/record/download": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "下载备份记录", + "consumes": [ + "application/json" + ], + "tags": [ + "Backup Account" + ], + "summary": "Download backup record", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.DownloadRecord" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "source", + "fileName" + ], + "formatEN": "download backup records [source][fileName]", + "formatZH": "下载备份记录 [source][fileName]", + "paramKeys": [] + } + } + }, + "/settings/backup/record/search": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取备份记录列表分页", + "consumes": [ + "application/json" + ], + "tags": [ + "Backup Account" + ], + "summary": "Page backup records", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.RecordSearch" + } + } + ], + "responses": { + "200": { + "description": "" + } + } + } + }, + "/settings/backup/search": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取备份账号列表", + "tags": [ + "Backup Account" + ], + "summary": "List backup accounts", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "anrry" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取 bucket 列表", + "consumes": [ + "application/json" + ], + "tags": [ + "Backup Account" + ], + "summary": "List buckets", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ForBuckets" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "anrry" + } + } + } + } + }, + "/settings/backup/search/files": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取备份账号内文件列表", + "consumes": [ + "application/json" + ], + "tags": [ + "Backup Account" + ], + "summary": "List files from backup accounts", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.BackupSearchFile" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "anrry" + } + } + } + } + }, + "/settings/backup/update": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "更新备份账号信息", + "consumes": [ + "application/json" + ], + "tags": [ + "Backup Account" + ], + "summary": "Update backup account", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.BackupOperate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "type" + ], + "formatEN": "update backup account [types]", + "formatZH": "更新备份账号 [types]", + "paramKeys": [] + } + } + }, "/settings/basedir": { "get": { "security": [ @@ -9412,20 +9378,6 @@ var doc = `{ } } }, - "dto.GroupInfo": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "type": { - "type": "string" - } - } - }, "dto.GroupOperate": { "type": "object", "required": [ @@ -10477,6 +10429,9 @@ var doc = `{ "dto.SettingInfo": { "type": "object", "properties": { + "appStoreVersion": { + "type": "string" + }, "complexityVerification": { "type": "string" }, diff --git a/cmd/server/docs/swagger.json b/cmd/server/docs/swagger.json index 524887830..04c710710 100644 --- a/cmd/server/docs/swagger.json +++ b/cmd/server/docs/swagger.json @@ -879,552 +879,6 @@ } } }, - "/backups": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "创建备份账号", - "consumes": [ - "application/json" - ], - "tags": [ - "Backup Account" - ], - "summary": "Create backup account", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.BackupOperate" - } - } - ], - "responses": { - "200": { - "description": "" - } - }, - "x-panel-log": { - "BeforeFuntions": [], - "bodyKeys": [ - "type" - ], - "formatEN": "create backup account [type]", - "formatZH": "创建备份账号 [type]", - "paramKeys": [] - } - } - }, - "/backups/del": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "删除备份账号", - "consumes": [ - "application/json" - ], - "tags": [ - "Backup Account" - ], - "summary": "Delete backup account", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.BatchDeleteReq" - } - } - ], - "responses": { - "200": { - "description": "" - } - }, - "x-panel-log": { - "BeforeFuntions": [ - { - "db": "backup_accounts", - "input_colume": "id", - "input_value": "ids", - "isList": true, - "output_colume": "type", - "output_value": "types" - } - ], - "bodyKeys": [ - "ids" - ], - "formatEN": "delete backup account [types]", - "formatZH": "删除备份账号 [types]", - "paramKeys": [] - } - } - }, - "/backups/record/del": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "删除备份记录", - "consumes": [ - "application/json" - ], - "tags": [ - "Backup Account" - ], - "summary": "Delete backup record", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.BatchDeleteReq" - } - } - ], - "responses": { - "200": { - "description": "" - } - }, - "x-panel-log": { - "BeforeFuntions": [ - { - "db": "backup_records", - "input_colume": "id", - "input_value": "ids", - "isList": true, - "output_colume": "file_name", - "output_value": "files" - } - ], - "bodyKeys": [ - "ids" - ], - "formatEN": "delete backup records [files]", - "formatZH": "删除备份记录 [files]", - "paramKeys": [] - } - } - }, - "/backups/record/download": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "下载备份记录", - "consumes": [ - "application/json" - ], - "tags": [ - "Backup Account" - ], - "summary": "Download backup record", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.DownloadRecord" - } - } - ], - "responses": { - "200": { - "description": "" - } - }, - "x-panel-log": { - "BeforeFuntions": [], - "bodyKeys": [ - "source", - "fileName" - ], - "formatEN": "download backup records [source][fileName]", - "formatZH": "下载备份记录 [source][fileName]", - "paramKeys": [] - } - } - }, - "/backups/record/search": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取备份记录列表分页", - "consumes": [ - "application/json" - ], - "tags": [ - "Backup Account" - ], - "summary": "Page backup records", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.RecordSearch" - } - } - ], - "responses": { - "200": { - "description": "" - } - } - } - }, - "/backups/search": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取备份账号列表", - "tags": [ - "Backup Account" - ], - "summary": "List backup accounts", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "anrry" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取 bucket 列表", - "consumes": [ - "application/json" - ], - "tags": [ - "Backup Account" - ], - "summary": "List buckets", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.ForBuckets" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "anrry" - } - } - } - } - }, - "/backups/search/files": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取备份账号内文件列表", - "consumes": [ - "application/json" - ], - "tags": [ - "Backup Account" - ], - "summary": "List files from backup accounts", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.BackupSearchFile" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "anrry" - } - } - } - } - }, - "/backups/update": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "更新备份账号信息", - "consumes": [ - "application/json" - ], - "tags": [ - "Backup Account" - ], - "summary": "Update backup account", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.BackupOperate" - } - } - ], - "responses": { - "200": { - "description": "" - } - }, - "x-panel-log": { - "BeforeFuntions": [], - "bodyKeys": [ - "type" - ], - "formatEN": "update backup account [types]", - "formatZH": "更新备份账号 [types]", - "paramKeys": [] - } - } - }, - "/commands": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取快速命令列表", - "tags": [ - "Command" - ], - "summary": "List commands", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.CommandInfo" - } - } - } - }, - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "创建快速命令", - "consumes": [ - "application/json" - ], - "tags": [ - "Command" - ], - "summary": "Create command", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.CommandOperate" - } - } - ], - "responses": { - "200": { - "description": "" - } - }, - "x-panel-log": { - "BeforeFuntions": [], - "bodyKeys": [ - "name", - "command" - ], - "formatEN": "create quick command [name][command]", - "formatZH": "创建快捷命令 [name][command]", - "paramKeys": [] - } - } - }, - "/commands/del": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "删除快速命令", - "consumes": [ - "application/json" - ], - "tags": [ - "Command" - ], - "summary": "Delete command", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.BatchDeleteReq" - } - } - ], - "responses": { - "200": { - "description": "" - } - }, - "x-panel-log": { - "BeforeFuntions": [ - { - "db": "commands", - "input_colume": "id", - "input_value": "ids", - "isList": true, - "output_colume": "name", - "output_value": "names" - } - ], - "bodyKeys": [ - "ids" - ], - "formatEN": "delete quick command [names]", - "formatZH": "删除快捷命令 [names]", - "paramKeys": [] - } - } - }, - "/commands/search": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "获取快速命令列表分页", - "consumes": [ - "application/json" - ], - "tags": [ - "Command" - ], - "summary": "Page commands", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.SearchWithPage" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.PageResult" - } - } - } - } - }, - "/commands/update": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "更新快速命令", - "consumes": [ - "application/json" - ], - "tags": [ - "Command" - ], - "summary": "Update command", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.CommandOperate" - } - } - ], - "responses": { - "200": { - "description": "" - } - }, - "x-panel-log": { - "BeforeFuntions": [], - "bodyKeys": [ - "name" - ], - "formatEN": "update quick command [name]", - "formatZH": "更新快捷命令 [name]", - "paramKeys": [] - } - } - }, "/containers": { "post": { "security": [ @@ -5251,213 +4705,6 @@ } } }, - "/groups": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "创建系统组", - "consumes": [ - "application/json" - ], - "tags": [ - "System Group" - ], - "summary": "Create group", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.GroupOperate" - } - } - ], - "responses": { - "200": { - "description": "" - } - }, - "x-panel-log": { - "BeforeFuntions": [], - "bodyKeys": [ - "name", - "type" - ], - "formatEN": "create group [name][type]", - "formatZH": "创建组 [name][type]", - "paramKeys": [] - } - } - }, - "/groups/:id": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "查询系统组", - "consumes": [ - "application/json" - ], - "tags": [ - "System Group" - ], - "summary": "Search group info by id", - "parameters": [ - { - "type": "integer", - "description": "request", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.GroupInfo" - } - } - } - } - }, - "/groups/del": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "删除系统组", - "consumes": [ - "application/json" - ], - "tags": [ - "System Group" - ], - "summary": "Delete group", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.OperateByID" - } - } - ], - "responses": { - "200": { - "description": "" - } - }, - "x-panel-log": { - "BeforeFuntions": [ - { - "db": "groups", - "input_colume": "id", - "input_value": "id", - "isList": false, - "output_colume": "name", - "output_value": "name" - } - ], - "bodyKeys": [ - "id" - ], - "formatEN": "delete group [name]", - "formatZH": "删除组 [name]", - "paramKeys": [] - } - } - }, - "/groups/search": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "查询系统组", - "consumes": [ - "application/json" - ], - "tags": [ - "System Group" - ], - "summary": "List groups", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.GroupSearch" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "anrry" - } - } - } - } - }, - "/groups/update": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "description": "更新系统组", - "consumes": [ - "application/json" - ], - "tags": [ - "System Group" - ], - "summary": "Update group", - "parameters": [ - { - "description": "request", - "name": "request", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.GroupOperate" - } - } - ], - "responses": { - "200": { - "description": "" - } - }, - "x-panel-log": { - "BeforeFuntions": [], - "bodyKeys": [ - "name", - "type" - ], - "formatEN": "update group [name][type]", - "formatZH": "更新组 [name][type]", - "paramKeys": [] - } - } - }, "/hosts": { "post": { "security": [ @@ -5535,6 +4782,198 @@ } } }, + "/hosts/command": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取快速命令列表", + "tags": [ + "Command" + ], + "summary": "List commands", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.CommandInfo" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "创建快速命令", + "consumes": [ + "application/json" + ], + "tags": [ + "Command" + ], + "summary": "Create command", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.CommandOperate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "name", + "command" + ], + "formatEN": "create quick command [name][command]", + "formatZH": "创建快捷命令 [name][command]", + "paramKeys": [] + } + } + }, + "/hosts/command/del": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "删除快速命令", + "consumes": [ + "application/json" + ], + "tags": [ + "Command" + ], + "summary": "Delete command", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.BatchDeleteReq" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "commands", + "input_colume": "id", + "input_value": "ids", + "isList": true, + "output_colume": "name", + "output_value": "names" + } + ], + "bodyKeys": [ + "ids" + ], + "formatEN": "delete quick command [names]", + "formatZH": "删除快捷命令 [names]", + "paramKeys": [] + } + } + }, + "/hosts/command/search": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取快速命令列表分页", + "consumes": [ + "application/json" + ], + "tags": [ + "Command" + ], + "summary": "Page commands", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.SearchWithPage" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.PageResult" + } + } + } + } + }, + "/hosts/command/update": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "更新快速命令", + "consumes": [ + "application/json" + ], + "tags": [ + "Command" + ], + "summary": "Update command", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.CommandOperate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "name" + ], + "formatEN": "update quick command [name]", + "formatZH": "更新快捷命令 [name]", + "paramKeys": [] + } + } + }, "/hosts/del": { "post": { "security": [ @@ -5586,6 +5025,179 @@ } } }, + "/hosts/group": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "创建系统组", + "consumes": [ + "application/json" + ], + "tags": [ + "System Group" + ], + "summary": "Create group", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.GroupOperate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "name", + "type" + ], + "formatEN": "create group [name][type]", + "formatZH": "创建组 [name][type]", + "paramKeys": [] + } + } + }, + "/hosts/group/del": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "删除系统组", + "consumes": [ + "application/json" + ], + "tags": [ + "System Group" + ], + "summary": "Delete group", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.OperateByID" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "groups", + "input_colume": "id", + "input_value": "id", + "isList": false, + "output_colume": "name", + "output_value": "name" + } + ], + "bodyKeys": [ + "id" + ], + "formatEN": "delete group [name]", + "formatZH": "删除组 [name]", + "paramKeys": [] + } + } + }, + "/hosts/group/search": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "查询系统组", + "consumes": [ + "application/json" + ], + "tags": [ + "System Group" + ], + "summary": "List groups", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.GroupSearch" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "anrry" + } + } + } + } + }, + "/hosts/group/update": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "更新系统组", + "consumes": [ + "application/json" + ], + "tags": [ + "System Group" + ], + "summary": "Update group", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.GroupOperate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "name", + "type" + ], + "formatEN": "update group [name][type]", + "formatZH": "更新组 [name][type]", + "paramKeys": [] + } + } + }, "/hosts/search": { "post": { "security": [ @@ -6020,6 +5632,360 @@ } } }, + "/settings/backup": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "创建备份账号", + "consumes": [ + "application/json" + ], + "tags": [ + "Backup Account" + ], + "summary": "Create backup account", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.BackupOperate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "type" + ], + "formatEN": "create backup account [type]", + "formatZH": "创建备份账号 [type]", + "paramKeys": [] + } + } + }, + "/settings/backup/del": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "删除备份账号", + "consumes": [ + "application/json" + ], + "tags": [ + "Backup Account" + ], + "summary": "Delete backup account", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.BatchDeleteReq" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "backup_accounts", + "input_colume": "id", + "input_value": "ids", + "isList": true, + "output_colume": "type", + "output_value": "types" + } + ], + "bodyKeys": [ + "ids" + ], + "formatEN": "delete backup account [types]", + "formatZH": "删除备份账号 [types]", + "paramKeys": [] + } + } + }, + "/settings/backup/record/del": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "删除备份记录", + "consumes": [ + "application/json" + ], + "tags": [ + "Backup Account" + ], + "summary": "Delete backup record", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.BatchDeleteReq" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [ + { + "db": "backup_records", + "input_colume": "id", + "input_value": "ids", + "isList": true, + "output_colume": "file_name", + "output_value": "files" + } + ], + "bodyKeys": [ + "ids" + ], + "formatEN": "delete backup records [files]", + "formatZH": "删除备份记录 [files]", + "paramKeys": [] + } + } + }, + "/settings/backup/record/download": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "下载备份记录", + "consumes": [ + "application/json" + ], + "tags": [ + "Backup Account" + ], + "summary": "Download backup record", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.DownloadRecord" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "source", + "fileName" + ], + "formatEN": "download backup records [source][fileName]", + "formatZH": "下载备份记录 [source][fileName]", + "paramKeys": [] + } + } + }, + "/settings/backup/record/search": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取备份记录列表分页", + "consumes": [ + "application/json" + ], + "tags": [ + "Backup Account" + ], + "summary": "Page backup records", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.RecordSearch" + } + } + ], + "responses": { + "200": { + "description": "" + } + } + } + }, + "/settings/backup/search": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取备份账号列表", + "tags": [ + "Backup Account" + ], + "summary": "List backup accounts", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "anrry" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取 bucket 列表", + "consumes": [ + "application/json" + ], + "tags": [ + "Backup Account" + ], + "summary": "List buckets", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ForBuckets" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "anrry" + } + } + } + } + }, + "/settings/backup/search/files": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取备份账号内文件列表", + "consumes": [ + "application/json" + ], + "tags": [ + "Backup Account" + ], + "summary": "List files from backup accounts", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.BackupSearchFile" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "anrry" + } + } + } + } + }, + "/settings/backup/update": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "更新备份账号信息", + "consumes": [ + "application/json" + ], + "tags": [ + "Backup Account" + ], + "summary": "Update backup account", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.BackupOperate" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "type" + ], + "formatEN": "update backup account [types]", + "formatZH": "更新备份账号 [types]", + "paramKeys": [] + } + } + }, "/settings/basedir": { "get": { "security": [ @@ -9398,20 +9364,6 @@ } } }, - "dto.GroupInfo": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "type": { - "type": "string" - } - } - }, "dto.GroupOperate": { "type": "object", "required": [ @@ -10463,6 +10415,9 @@ "dto.SettingInfo": { "type": "object", "properties": { + "appStoreVersion": { + "type": "string" + }, "complexityVerification": { "type": "string" }, diff --git a/cmd/server/docs/swagger.yaml b/cmd/server/docs/swagger.yaml index 26b8d5874..e91f3ac8b 100644 --- a/cmd/server/docs/swagger.yaml +++ b/cmd/server/docs/swagger.yaml @@ -574,15 +574,6 @@ definitions: - type - vars type: object - dto.GroupInfo: - properties: - id: - type: integer - name: - type: string - type: - type: string - type: object dto.GroupOperate: properties: id: @@ -1284,6 +1275,8 @@ definitions: type: object dto.SettingInfo: properties: + appStoreVersion: + type: string complexityVerification: type: string dingVars: @@ -3201,352 +3194,6 @@ paths: summary: Check is First login tags: - Auth - /backups: - post: - consumes: - - application/json - description: 创建备份账号 - parameters: - - description: request - in: body - name: request - required: true - schema: - $ref: '#/definitions/dto.BackupOperate' - responses: - "200": - description: "" - security: - - ApiKeyAuth: [] - summary: Create backup account - tags: - - Backup Account - x-panel-log: - BeforeFuntions: [] - bodyKeys: - - type - formatEN: create backup account [type] - formatZH: 创建备份账号 [type] - paramKeys: [] - /backups/del: - post: - consumes: - - application/json - description: 删除备份账号 - parameters: - - description: request - in: body - name: request - required: true - schema: - $ref: '#/definitions/dto.BatchDeleteReq' - responses: - "200": - description: "" - security: - - ApiKeyAuth: [] - summary: Delete backup account - tags: - - Backup Account - x-panel-log: - BeforeFuntions: - - db: backup_accounts - input_colume: id - input_value: ids - isList: true - output_colume: type - output_value: types - bodyKeys: - - ids - formatEN: delete backup account [types] - formatZH: 删除备份账号 [types] - paramKeys: [] - /backups/record/del: - post: - consumes: - - application/json - description: 删除备份记录 - parameters: - - description: request - in: body - name: request - required: true - schema: - $ref: '#/definitions/dto.BatchDeleteReq' - responses: - "200": - description: "" - security: - - ApiKeyAuth: [] - summary: Delete backup record - tags: - - Backup Account - x-panel-log: - BeforeFuntions: - - db: backup_records - input_colume: id - input_value: ids - isList: true - output_colume: file_name - output_value: files - bodyKeys: - - ids - formatEN: delete backup records [files] - formatZH: 删除备份记录 [files] - paramKeys: [] - /backups/record/download: - post: - consumes: - - application/json - description: 下载备份记录 - parameters: - - description: request - in: body - name: request - required: true - schema: - $ref: '#/definitions/dto.DownloadRecord' - responses: - "200": - description: "" - security: - - ApiKeyAuth: [] - summary: Download backup record - tags: - - Backup Account - x-panel-log: - BeforeFuntions: [] - bodyKeys: - - source - - fileName - formatEN: download backup records [source][fileName] - formatZH: 下载备份记录 [source][fileName] - paramKeys: [] - /backups/record/search: - post: - consumes: - - application/json - description: 获取备份记录列表分页 - parameters: - - description: request - in: body - name: request - required: true - schema: - $ref: '#/definitions/dto.RecordSearch' - responses: - "200": - description: "" - security: - - ApiKeyAuth: [] - summary: Page backup records - tags: - - Backup Account - /backups/search: - get: - description: 获取备份账号列表 - responses: - "200": - description: OK - schema: - type: anrry - security: - - ApiKeyAuth: [] - summary: List backup accounts - tags: - - Backup Account - post: - consumes: - - application/json - description: 获取 bucket 列表 - parameters: - - description: request - in: body - name: request - required: true - schema: - $ref: '#/definitions/dto.ForBuckets' - responses: - "200": - description: OK - schema: - type: anrry - security: - - ApiKeyAuth: [] - summary: List buckets - tags: - - Backup Account - /backups/search/files: - post: - consumes: - - application/json - description: 获取备份账号内文件列表 - parameters: - - description: request - in: body - name: request - required: true - schema: - $ref: '#/definitions/dto.BackupSearchFile' - responses: - "200": - description: OK - schema: - type: anrry - security: - - ApiKeyAuth: [] - summary: List files from backup accounts - tags: - - Backup Account - /backups/update: - post: - consumes: - - application/json - description: 更新备份账号信息 - parameters: - - description: request - in: body - name: request - required: true - schema: - $ref: '#/definitions/dto.BackupOperate' - responses: - "200": - description: "" - security: - - ApiKeyAuth: [] - summary: Update backup account - tags: - - Backup Account - x-panel-log: - BeforeFuntions: [] - bodyKeys: - - type - formatEN: update backup account [types] - formatZH: 更新备份账号 [types] - paramKeys: [] - /commands: - get: - description: 获取快速命令列表 - responses: - "200": - description: OK - schema: - $ref: '#/definitions/dto.CommandInfo' - security: - - ApiKeyAuth: [] - summary: List commands - tags: - - Command - post: - consumes: - - application/json - description: 创建快速命令 - parameters: - - description: request - in: body - name: request - required: true - schema: - $ref: '#/definitions/dto.CommandOperate' - responses: - "200": - description: "" - security: - - ApiKeyAuth: [] - summary: Create command - tags: - - Command - x-panel-log: - BeforeFuntions: [] - bodyKeys: - - name - - command - formatEN: create quick command [name][command] - formatZH: 创建快捷命令 [name][command] - paramKeys: [] - /commands/del: - post: - consumes: - - application/json - description: 删除快速命令 - parameters: - - description: request - in: body - name: request - required: true - schema: - $ref: '#/definitions/dto.BatchDeleteReq' - responses: - "200": - description: "" - security: - - ApiKeyAuth: [] - summary: Delete command - tags: - - Command - x-panel-log: - BeforeFuntions: - - db: commands - input_colume: id - input_value: ids - isList: true - output_colume: name - output_value: names - bodyKeys: - - ids - formatEN: delete quick command [names] - formatZH: 删除快捷命令 [names] - paramKeys: [] - /commands/search: - post: - consumes: - - application/json - description: 获取快速命令列表分页 - parameters: - - description: request - in: body - name: request - required: true - schema: - $ref: '#/definitions/dto.SearchWithPage' - responses: - "200": - description: OK - schema: - $ref: '#/definitions/dto.PageResult' - security: - - ApiKeyAuth: [] - summary: Page commands - tags: - - Command - /commands/update: - post: - consumes: - - application/json - description: 更新快速命令 - parameters: - - description: request - in: body - name: request - required: true - schema: - $ref: '#/definitions/dto.CommandOperate' - responses: - "200": - description: "" - security: - - ApiKeyAuth: [] - summary: Update command - tags: - - Command - x-panel-log: - BeforeFuntions: [] - bodyKeys: - - name - formatEN: update quick command [name] - formatZH: 更新快捷命令 [name] - paramKeys: [] /containers: post: consumes: @@ -5987,138 +5634,6 @@ paths: formatEN: Download url => [path]/[name] formatZH: 下载 url => [path]/[name] paramKeys: [] - /groups: - post: - consumes: - - application/json - description: 创建系统组 - parameters: - - description: request - in: body - name: request - required: true - schema: - $ref: '#/definitions/dto.GroupOperate' - responses: - "200": - description: "" - security: - - ApiKeyAuth: [] - summary: Create group - tags: - - System Group - x-panel-log: - BeforeFuntions: [] - bodyKeys: - - name - - type - formatEN: create group [name][type] - formatZH: 创建组 [name][type] - paramKeys: [] - /groups/:id: - get: - consumes: - - application/json - description: 查询系统组 - parameters: - - description: request - in: path - name: id - required: true - type: integer - responses: - "200": - description: OK - schema: - $ref: '#/definitions/dto.GroupInfo' - security: - - ApiKeyAuth: [] - summary: Search group info by id - tags: - - System Group - /groups/del: - post: - consumes: - - application/json - description: 删除系统组 - parameters: - - description: request - in: body - name: request - required: true - schema: - $ref: '#/definitions/dto.OperateByID' - responses: - "200": - description: "" - security: - - ApiKeyAuth: [] - summary: Delete group - tags: - - System Group - x-panel-log: - BeforeFuntions: - - db: groups - input_colume: id - input_value: id - isList: false - output_colume: name - output_value: name - bodyKeys: - - id - formatEN: delete group [name] - formatZH: 删除组 [name] - paramKeys: [] - /groups/search: - post: - consumes: - - application/json - description: 查询系统组 - parameters: - - description: request - in: body - name: request - required: true - schema: - $ref: '#/definitions/dto.GroupSearch' - responses: - "200": - description: OK - schema: - type: anrry - security: - - ApiKeyAuth: [] - summary: List groups - tags: - - System Group - /groups/update: - post: - consumes: - - application/json - description: 更新系统组 - parameters: - - description: request - in: body - name: request - required: true - schema: - $ref: '#/definitions/dto.GroupOperate' - responses: - "200": - description: "" - security: - - ApiKeyAuth: [] - summary: Update group - tags: - - System Group - x-panel-log: - BeforeFuntions: [] - bodyKeys: - - name - - type - formatEN: update group [name][type] - formatZH: 更新组 [name][type] - paramKeys: [] /hosts: post: consumes: @@ -6168,6 +5683,128 @@ paths: summary: Load host info tags: - Host + /hosts/command: + get: + description: 获取快速命令列表 + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.CommandInfo' + security: + - ApiKeyAuth: [] + summary: List commands + tags: + - Command + post: + consumes: + - application/json + description: 创建快速命令 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.CommandOperate' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Create command + tags: + - Command + x-panel-log: + BeforeFuntions: [] + bodyKeys: + - name + - command + formatEN: create quick command [name][command] + formatZH: 创建快捷命令 [name][command] + paramKeys: [] + /hosts/command/del: + post: + consumes: + - application/json + description: 删除快速命令 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.BatchDeleteReq' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Delete command + tags: + - Command + x-panel-log: + BeforeFuntions: + - db: commands + input_colume: id + input_value: ids + isList: true + output_colume: name + output_value: names + bodyKeys: + - ids + formatEN: delete quick command [names] + formatZH: 删除快捷命令 [names] + paramKeys: [] + /hosts/command/search: + post: + consumes: + - application/json + description: 获取快速命令列表分页 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.SearchWithPage' + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.PageResult' + security: + - ApiKeyAuth: [] + summary: Page commands + tags: + - Command + /hosts/command/update: + post: + consumes: + - application/json + description: 更新快速命令 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.CommandOperate' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Update command + tags: + - Command + x-panel-log: + BeforeFuntions: [] + bodyKeys: + - name + formatEN: update quick command [name] + formatZH: 更新快捷命令 [name] + paramKeys: [] /hosts/del: post: consumes: @@ -6201,6 +5838,117 @@ paths: formatEN: delete host [addr] formatZH: 删除主机 [addr] paramKeys: [] + /hosts/group: + post: + consumes: + - application/json + description: 创建系统组 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.GroupOperate' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Create group + tags: + - System Group + x-panel-log: + BeforeFuntions: [] + bodyKeys: + - name + - type + formatEN: create group [name][type] + formatZH: 创建组 [name][type] + paramKeys: [] + /hosts/group/del: + post: + consumes: + - application/json + description: 删除系统组 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.OperateByID' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Delete group + tags: + - System Group + x-panel-log: + BeforeFuntions: + - db: groups + input_colume: id + input_value: id + isList: false + output_colume: name + output_value: name + bodyKeys: + - id + formatEN: delete group [name] + formatZH: 删除组 [name] + paramKeys: [] + /hosts/group/search: + post: + consumes: + - application/json + description: 查询系统组 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.GroupSearch' + responses: + "200": + description: OK + schema: + type: anrry + security: + - ApiKeyAuth: [] + summary: List groups + tags: + - System Group + /hosts/group/update: + post: + consumes: + - application/json + description: 更新系统组 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.GroupOperate' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Update group + tags: + - System Group + x-panel-log: + BeforeFuntions: [] + bodyKeys: + - name + - type + formatEN: update group [name][type] + formatZH: 更新组 [name][type] + paramKeys: [] /hosts/search: post: consumes: @@ -6472,6 +6220,230 @@ paths: formatEN: Update nginx conf [domain] formatZH: 更新 nginx 配置 [domain] paramKeys: [] + /settings/backup: + post: + consumes: + - application/json + description: 创建备份账号 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.BackupOperate' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Create backup account + tags: + - Backup Account + x-panel-log: + BeforeFuntions: [] + bodyKeys: + - type + formatEN: create backup account [type] + formatZH: 创建备份账号 [type] + paramKeys: [] + /settings/backup/del: + post: + consumes: + - application/json + description: 删除备份账号 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.BatchDeleteReq' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Delete backup account + tags: + - Backup Account + x-panel-log: + BeforeFuntions: + - db: backup_accounts + input_colume: id + input_value: ids + isList: true + output_colume: type + output_value: types + bodyKeys: + - ids + formatEN: delete backup account [types] + formatZH: 删除备份账号 [types] + paramKeys: [] + /settings/backup/record/del: + post: + consumes: + - application/json + description: 删除备份记录 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.BatchDeleteReq' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Delete backup record + tags: + - Backup Account + x-panel-log: + BeforeFuntions: + - db: backup_records + input_colume: id + input_value: ids + isList: true + output_colume: file_name + output_value: files + bodyKeys: + - ids + formatEN: delete backup records [files] + formatZH: 删除备份记录 [files] + paramKeys: [] + /settings/backup/record/download: + post: + consumes: + - application/json + description: 下载备份记录 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.DownloadRecord' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Download backup record + tags: + - Backup Account + x-panel-log: + BeforeFuntions: [] + bodyKeys: + - source + - fileName + formatEN: download backup records [source][fileName] + formatZH: 下载备份记录 [source][fileName] + paramKeys: [] + /settings/backup/record/search: + post: + consumes: + - application/json + description: 获取备份记录列表分页 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.RecordSearch' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Page backup records + tags: + - Backup Account + /settings/backup/search: + get: + description: 获取备份账号列表 + responses: + "200": + description: OK + schema: + type: anrry + security: + - ApiKeyAuth: [] + summary: List backup accounts + tags: + - Backup Account + post: + consumes: + - application/json + description: 获取 bucket 列表 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.ForBuckets' + responses: + "200": + description: OK + schema: + type: anrry + security: + - ApiKeyAuth: [] + summary: List buckets + tags: + - Backup Account + /settings/backup/search/files: + post: + consumes: + - application/json + description: 获取备份账号内文件列表 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.BackupSearchFile' + responses: + "200": + description: OK + schema: + type: anrry + security: + - ApiKeyAuth: [] + summary: List files from backup accounts + tags: + - Backup Account + /settings/backup/update: + post: + consumes: + - application/json + description: 更新备份账号信息 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/dto.BackupOperate' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Update backup account + tags: + - Backup Account + x-panel-log: + BeforeFuntions: [] + bodyKeys: + - type + formatEN: update backup account [types] + formatZH: 更新备份账号 [types] + paramKeys: [] /settings/basedir: get: description: 获取安装根目录 diff --git a/frontend/src/api/modules/backup.ts b/frontend/src/api/modules/backup.ts deleted file mode 100644 index 046f335d0..000000000 --- a/frontend/src/api/modules/backup.ts +++ /dev/null @@ -1,37 +0,0 @@ -import http from '@/api'; -import { Backup } from '../interface/backup'; -import { ResPage } from '../interface'; - -export const getBackupList = () => { - return http.get>(`/backups/search`); -}; - -export const getFilesFromBackup = (type: string) => { - return http.post>(`/backups/search/files`, { type: type }); -}; - -export const addBackup = (params: Backup.BackupOperate) => { - return http.post(`/backups`, params); -}; - -export const editBackup = (params: Backup.BackupOperate) => { - return http.post(`/backups/update`, params); -}; - -export const deleteBackup = (params: { ids: number[] }) => { - return http.post(`/backups/del`, params); -}; - -export const downloadBackupRecord = (params: Backup.RecordDownload) => { - return http.download(`/backups/record/download`, params, { responseType: 'blob' }); -}; -export const deleteBackupRecord = (params: { ids: number[] }) => { - return http.post(`/backups/record/del`, params); -}; -export const searchBackupRecords = (params: Backup.SearchBackupRecord) => { - return http.post>(`/backups/record/search`, params); -}; - -export const listBucket = (params: Backup.ForBucket) => { - return http.post(`/backups/buckets`, params); -}; diff --git a/frontend/src/api/modules/command.ts b/frontend/src/api/modules/command.ts deleted file mode 100644 index 8daf10dc1..000000000 --- a/frontend/src/api/modules/command.ts +++ /dev/null @@ -1,23 +0,0 @@ -import http from '@/api'; -import { ResPage } from '../interface'; -import { Command } from '../interface/command'; - -export const getCommandList = () => { - return http.get>(`/commands`, {}); -}; - -export const getCommandPage = (params: Command.CommandSearch) => { - return http.post>(`/commands/search`, params); -}; - -export const addCommand = (params: Command.CommandOperate) => { - return http.post(`/commands`, params); -}; - -export const editCommand = (params: Command.CommandOperate) => { - return http.post(`/commands/update`, params); -}; - -export const deleteCommand = (params: { ids: number[] }) => { - return http.post(`/commands/del`, params); -}; diff --git a/frontend/src/api/modules/group.ts b/frontend/src/api/modules/group.ts deleted file mode 100644 index 87a6cef25..000000000 --- a/frontend/src/api/modules/group.ts +++ /dev/null @@ -1,18 +0,0 @@ -import http from '@/api'; -import { Group } from '../interface/group'; - -export const getGroupList = (params: Group.GroupSearch) => { - return http.post>(`/groups/search`, params); -}; - -export const addGroup = (params: Group.GroupOperate) => { - return http.post(`/groups`, params); -}; - -export const editGroup = (params: Group.GroupOperate) => { - return http.post(`/groups/update`, params); -}; - -export const deleteGroup = (id: number) => { - return http.post(`/groups/del`, { id: id }); -}; diff --git a/frontend/src/api/modules/host.ts b/frontend/src/api/modules/host.ts index 5f649ad49..219dade4f 100644 --- a/frontend/src/api/modules/host.ts +++ b/frontend/src/api/modules/host.ts @@ -1,30 +1,58 @@ import http from '@/api'; +import { ResPage } from '../interface'; +import { Command } from '../interface/command'; +import { Group } from '../interface/group'; import { Host } from '../interface/host'; export const getHostTree = (params: Host.ReqSearch) => { return http.post>(`/hosts/search`, params); }; - export const getHostInfo = (id: number) => { return http.get(`/hosts/` + id); }; - export const addHost = (params: Host.HostOperate) => { return http.post(`/hosts`, params); }; - export const testByInfo = (params: Host.HostConnTest) => { return http.post(`/hosts/test/byinfo`, params); }; - export const testByID = (id: number) => { return http.post(`/hosts/test/byid/${id}`); }; - export const editHost = (params: Host.HostOperate) => { return http.post(`/hosts/update`, params); }; - export const deleteHost = (id: number) => { return http.post(`/hosts/del`, { id: id }); }; + +// group +export const getGroupList = (params: Group.GroupSearch) => { + return http.post>(`/hosts/group/search`, params); +}; +export const addGroup = (params: Group.GroupOperate) => { + return http.post(`/hosts/group`, params); +}; +export const editGroup = (params: Group.GroupOperate) => { + return http.post(`/hosts/group/update`, params); +}; +export const deleteGroup = (id: number) => { + return http.post(`/hosts/group/del`, { id: id }); +}; + +// command +export const getCommandList = () => { + return http.get>(`/hosts/command`, {}); +}; +export const getCommandPage = (params: Command.CommandSearch) => { + return http.post>(`/hosts/command/search`, params); +}; +export const addCommand = (params: Command.CommandOperate) => { + return http.post(`/hosts/command`, params); +}; +export const editCommand = (params: Command.CommandOperate) => { + return http.post(`/hosts/command/update`, params); +}; +export const deleteCommand = (params: { ids: number[] }) => { + return http.post(`/hosts/command/del`, params); +}; diff --git a/frontend/src/api/modules/setting.ts b/frontend/src/api/modules/setting.ts index 112b58919..21adf0ae2 100644 --- a/frontend/src/api/modules/setting.ts +++ b/frontend/src/api/modules/setting.ts @@ -1,5 +1,6 @@ import http from '@/api'; import { ResPage, SearchWithPage, DescriptionUpdate } from '../interface'; +import { Backup } from '../interface/backup'; import { Setting } from '../interface/setting'; export const getSettingInfo = () => { @@ -49,6 +50,35 @@ export const loadBaseDir = () => { return http.get(`/settings/basedir`); }; +// backup +export const getBackupList = () => { + return http.get>(`/settings/backup/search`); +}; +export const getFilesFromBackup = (type: string) => { + return http.post>(`/settings/backup/search/files`, { type: type }); +}; +export const addBackup = (params: Backup.BackupOperate) => { + return http.post(`/settings/backup`, params); +}; +export const editBackup = (params: Backup.BackupOperate) => { + return http.post(`/settings/backup/update`, params); +}; +export const deleteBackup = (params: { ids: number[] }) => { + return http.post(`/settings/backup/del`, params); +}; +export const downloadBackupRecord = (params: Backup.RecordDownload) => { + return http.download(`/settings/backup/record/download`, params, { responseType: 'blob' }); +}; +export const deleteBackupRecord = (params: { ids: number[] }) => { + return http.post(`/settings/backup/record/del`, params); +}; +export const searchBackupRecords = (params: Backup.SearchBackupRecord) => { + return http.post>(`/settings/backup/record/search`, params); +}; +export const listBucket = (params: Backup.ForBucket) => { + return http.post(`/settings/backup/buckets`, params); +}; + // snapshot export const snapshotCreate = (param: Setting.SnapshotCreate) => { return http.post(`/settings/snapshot`, param); diff --git a/frontend/src/views/host/terminal/command/index.vue b/frontend/src/views/host/terminal/command/index.vue index f8e3e473f..91e696b9b 100644 --- a/frontend/src/views/host/terminal/command/index.vue +++ b/frontend/src/views/host/terminal/command/index.vue @@ -69,7 +69,7 @@ import LayoutContent from '@/layout/layout-content.vue'; import ComplexTable from '@/components/complex-table/index.vue'; import { Command } from '@/api/interface/command'; -import { addCommand, editCommand, deleteCommand, getCommandPage } from '@/api/modules/command'; +import { addCommand, editCommand, deleteCommand, getCommandPage } from '@/api/modules/host'; import { reactive, ref } from 'vue'; import { useDeleteData } from '@/hooks/use-delete-data'; import type { ElForm } from 'element-plus'; diff --git a/frontend/src/views/host/terminal/host/index.vue b/frontend/src/views/host/terminal/host/index.vue index 31e02638b..3eeb4c3d3 100644 --- a/frontend/src/views/host/terminal/host/index.vue +++ b/frontend/src/views/host/terminal/host/index.vue @@ -156,8 +156,18 @@ import type { ElForm } from 'element-plus'; import { Rules } from '@/global/form-rules'; import { Host } from '@/api/interface/host'; import { Group } from '@/api/interface/group'; -import { getHostTree, getHostInfo, addHost, editHost, deleteHost, testByInfo } from '@/api/modules/host'; -import { getGroupList, addGroup, editGroup, deleteGroup } from '@/api/modules/group'; +import { + getHostTree, + getHostInfo, + addHost, + editHost, + deleteHost, + testByInfo, + getGroupList, + addGroup, + editGroup, + deleteGroup, +} from '@/api/modules/host'; import { useDeleteData } from '@/hooks/use-delete-data'; import { ElMessage } from 'element-plus'; import i18n from '@/lang'; @@ -309,7 +319,7 @@ const onDelete = async (node: Node, data: Tree) => { return; } if (node.level === 1) { - await useDeleteData(deleteGroup, data.id - 10000, i18n.global.t('terminal.groupDeleteHelper')); + await useDeleteData(deleteGroup, data.id - 10000, 'terminal.groupDeleteHelper'); loadGroups(); } else { await useDeleteData(deleteHost, data.id, 'commons.msg.delete'); diff --git a/frontend/src/views/host/terminal/terminal/index.vue b/frontend/src/views/host/terminal/terminal/index.vue index 35b1ae90a..308fe2d9e 100644 --- a/frontend/src/views/host/terminal/terminal/index.vue +++ b/frontend/src/views/host/terminal/terminal/index.vue @@ -119,7 +119,7 @@ import screenfull from 'screenfull'; import i18n from '@/lang'; import { Host } from '@/api/interface/host'; import { getHostTree, testByID } from '@/api/modules/host'; -import { getCommandList } from '@/api/modules/command'; +import { getCommandList } from '@/api/modules/host'; import { GlobalStore } from '@/store'; const dialogRef = ref(); diff --git a/frontend/src/views/log/operation/index.vue b/frontend/src/views/log/operation/index.vue index 8860955ac..3c0a5e298 100644 --- a/frontend/src/views/log/operation/index.vue +++ b/frontend/src/views/log/operation/index.vue @@ -35,11 +35,8 @@ - - - diff --git a/frontend/src/views/setting/backup-account/index.vue b/frontend/src/views/setting/backup-account/index.vue index d0f367d25..838ebc15c 100644 --- a/frontend/src/views/setting/backup-account/index.vue +++ b/frontend/src/views/setting/backup-account/index.vue @@ -237,7 +237,7 @@ import { dateFormatSimple, dateFormat } from '@/utils/util'; import { onMounted, ref } from 'vue'; import LayoutContent from '@/layout/layout-content.vue'; -import { getBackupList, deleteBackup } from '@/api/modules/backup'; +import { getBackupList, deleteBackup } from '@/api/modules/setting'; import DialogOperate from '@/views/setting/backup-account/operate/index.vue'; import { Backup } from '@/api/interface/backup'; import { ElForm } from 'element-plus'; diff --git a/frontend/src/views/setting/backup-account/operate/index.vue b/frontend/src/views/setting/backup-account/operate/index.vue index 74652103d..dadd06a0b 100644 --- a/frontend/src/views/setting/backup-account/operate/index.vue +++ b/frontend/src/views/setting/backup-account/operate/index.vue @@ -135,7 +135,7 @@ import i18n from '@/lang'; import { ElForm, ElMessage } from 'element-plus'; import { Backup } from '@/api/interface/backup'; import DrawerHeader from '@/components/drawer-header/index.vue'; -import { addBackup, editBackup, listBucket } from '@/api/modules/backup'; +import { addBackup, editBackup, listBucket } from '@/api/modules/setting'; import { deepCopy } from '@/utils/util'; const loading = ref(false);