diff --git a/backend/app/api/v1/backup.go b/backend/app/api/v1/backup.go index c54b57c2a..e3da49673 100644 --- a/backend/app/api/v1/backup.go +++ b/backend/app/api/v1/backup.go @@ -104,9 +104,9 @@ func (b *BaseApi) ListBuckets(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @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]"} +// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","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 + var req dto.OperateByID if err := c.ShouldBindJSON(&req); err != nil { helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err) return @@ -116,7 +116,7 @@ func (b *BaseApi) DeleteBackup(c *gin.Context) { return } - if err := backupService.BatchDelete(req.Ids); err != nil { + if err := backupService.Delete(req.ID); err != nil { helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err) return } diff --git a/backend/app/repo/cronjob.go b/backend/app/repo/cronjob.go index 97630e955..29f42b545 100644 --- a/backend/app/repo/cronjob.go +++ b/backend/app/repo/cronjob.go @@ -20,6 +20,7 @@ type ICronjobRepo interface { Page(limit, offset int, opts ...DBOption) (int64, []model.Cronjob, error) Create(cronjob *model.Cronjob) error WithByJobID(id int) DBOption + WithByBackupID(id uint) DBOption WithByRecordDropID(id int) DBOption Save(id uint, cronjob model.Cronjob) error Update(id uint, vars map[string]interface{}) error @@ -114,6 +115,12 @@ func (c *CronjobRepo) WithByJobID(id int) DBOption { } } +func (c *CronjobRepo) WithByBackupID(id uint) DBOption { + return func(g *gorm.DB) *gorm.DB { + return g.Where("target_dir_id = ?", id) + } +} + func (c *CronjobRepo) WithByRecordDropID(id int) DBOption { return func(g *gorm.DB) *gorm.DB { return g.Where("id < ?", id) diff --git a/backend/app/service/backup.go b/backend/app/service/backup.go index 556a77107..3daa3be36 100644 --- a/backend/app/service/backup.go +++ b/backend/app/service/backup.go @@ -9,6 +9,7 @@ import ( "github.com/1Panel-dev/1Panel/backend/app/dto" "github.com/1Panel-dev/1Panel/backend/app/model" + "github.com/1Panel-dev/1Panel/backend/buserr" "github.com/1Panel-dev/1Panel/backend/constant" "github.com/1Panel-dev/1Panel/backend/global" "github.com/1Panel-dev/1Panel/backend/utils/cloud_storage" @@ -26,7 +27,7 @@ type IBackupService interface { Create(backupDto dto.BackupOperate) error GetBuckets(backupDto dto.ForBuckets) ([]interface{}, error) Update(ireq dto.BackupOperate) error - BatchDelete(ids []uint) error + Delete(id uint) error BatchDeleteRecord(ids []uint) error NewClient(backup *model.BackupAccount) (cloud_storage.CloudStorageClient, error) @@ -159,8 +160,12 @@ func (u *BackupService) GetBuckets(backupDto dto.ForBuckets) ([]interface{}, err return client.ListBuckets() } -func (u *BackupService) BatchDelete(ids []uint) error { - return backupRepo.Delete(commonRepo.WithIdsIn(ids)) +func (u *BackupService) Delete(id uint) error { + cronjobs, _ := cronjobRepo.List(cronjobRepo.WithByBackupID(id)) + if len(cronjobs) != 0 { + return buserr.New(constant.ErrBackupInUsed) + } + return backupRepo.Delete(commonRepo.WithByID(id)) } func (u *BackupService) BatchDeleteRecord(ids []uint) error { diff --git a/backend/constant/errs.go b/backend/constant/errs.go index 8758a4a12..de3736d02 100644 --- a/backend/constant/errs.go +++ b/backend/constant/errs.go @@ -114,3 +114,7 @@ var ( ErrImageExist = "ErrImageExist" ErrDelWithWebsite = "ErrDelWithWebsite" ) + +var ( + ErrBackupInUsed = "ErrBackupInUsed" +) diff --git a/backend/i18n/lang/en.yaml b/backend/i18n/lang/en.yaml index 9f080bd43..96da38a07 100644 --- a/backend/i18n/lang/en.yaml +++ b/backend/i18n/lang/en.yaml @@ -67,4 +67,7 @@ ErrDirNotFound: "The build folder does not exist! Please check file integrity! ErrFileNotExist: "{{ .detail }} file does not exist! Please check source file integrity!" ErrImageBuildErr: "Image build failed" ErrImageExist: "Image is already exist!" -ErrDelWithWebsite: "The operating environment has been associated with a website and cannot be deleted" \ No newline at end of file +ErrDelWithWebsite: "The operating environment has been associated with a website and cannot be deleted" + +#setting +ErrBackupInUsed: "The backup account is already being used in a cronjob and cannot be deleted." \ No newline at end of file diff --git a/backend/i18n/lang/zh.yaml b/backend/i18n/lang/zh.yaml index d3a769b6e..1fce0f5dc 100644 --- a/backend/i18n/lang/zh.yaml +++ b/backend/i18n/lang/zh.yaml @@ -67,4 +67,7 @@ ErrDirNotFound: "build 文件夹不存在!请检查文件完整性!" ErrFileNotExist: "{{ .detail }} 文件不存在!请检查源文件完整性!" ErrImageBuildErr: "镜像 build 失败" ErrImageExist: "镜像已存在!" -ErrDelWithWebsite: "运行环境已经关联网站,无法删除" \ No newline at end of file +ErrDelWithWebsite: "运行环境已经关联网站,无法删除" + +#setting +ErrBackupInUsed: "该备份账号已在计划任务中使用,无法删除" diff --git a/cmd/server/docs/docs.go b/cmd/server/docs/docs.go index 7c13fc071..656872a20 100644 --- a/cmd/server/docs/docs.go +++ b/cmd/server/docs/docs.go @@ -1,10 +1,17 @@ -// Package docs GENERATED BY SWAG; DO NOT EDIT +// Package docs GENERATED BY THE COMMAND ABOVE; DO NOT EDIT // This file was generated by swaggo/swag package docs -import "github.com/swaggo/swag" +import ( + "bytes" + "encoding/json" + "strings" + "text/template" -const docTemplate = `{ + "github.com/swaggo/swag" +) + +var doc = `{ "schemes": {{ marshal .Schemes }}, "swagger": "2.0", "info": { @@ -69,7 +76,7 @@ const docTemplate = `{ "summary": "Get app list update", "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -449,7 +456,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -551,7 +558,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -593,7 +600,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -637,7 +644,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -656,7 +663,7 @@ const docTemplate = `{ "summary": "Sync app installed", "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -696,7 +703,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -749,7 +756,7 @@ const docTemplate = `{ "summary": "Sync app list", "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -787,7 +794,7 @@ const docTemplate = `{ "summary": "Check System isDemo", "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -815,7 +822,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -865,7 +872,7 @@ const docTemplate = `{ "summary": "User logout", "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -910,7 +917,7 @@ const docTemplate = `{ "summary": "Check is First login", "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -943,7 +950,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -986,7 +993,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1028,7 +1035,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1107,7 +1114,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1149,7 +1156,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1241,7 +1248,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1281,7 +1288,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1321,7 +1328,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1458,7 +1465,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1611,7 +1618,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1653,7 +1660,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1736,7 +1743,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1824,7 +1831,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1866,7 +1873,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1947,7 +1954,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2017,7 +2024,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2062,7 +2069,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2155,7 +2162,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -2191,7 +2198,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2371,7 +2378,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2413,7 +2420,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2503,7 +2510,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2554,7 +2561,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2596,7 +2603,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2714,7 +2721,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2757,7 +2764,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2808,7 +2815,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2859,7 +2866,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2910,7 +2917,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3033,7 +3040,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3085,7 +3092,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3218,7 +3225,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3282,7 +3289,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3333,7 +3340,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3384,7 +3391,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3424,7 +3431,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3511,7 +3518,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3657,7 +3664,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3697,7 +3704,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3737,7 +3744,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3799,7 +3806,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3963,7 +3970,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4003,7 +4010,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4045,7 +4052,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4087,7 +4094,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4124,7 +4131,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -4157,7 +4164,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4244,7 +4251,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4286,7 +4293,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4328,7 +4335,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4370,7 +4377,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4457,7 +4464,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4500,7 +4507,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4543,7 +4550,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4586,7 +4593,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4664,7 +4671,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4737,7 +4744,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4815,7 +4822,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4859,7 +4866,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4902,7 +4909,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4997,7 +5004,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5040,7 +5047,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5137,7 +5144,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5180,7 +5187,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5267,7 +5274,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5309,7 +5316,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5382,7 +5389,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -5460,7 +5467,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5539,7 +5546,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -5572,7 +5579,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -5675,7 +5682,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -5744,7 +5751,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5787,7 +5794,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5978,7 +5985,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6076,7 +6083,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6127,7 +6134,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6167,7 +6174,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -6200,7 +6207,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6242,7 +6249,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -6275,7 +6282,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6317,7 +6324,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6359,7 +6366,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6403,7 +6410,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6411,14 +6418,14 @@ const docTemplate = `{ { "db": "backup_accounts", "input_colume": "id", - "input_value": "ids", + "input_value": "id", "isList": true, "output_colume": "type", "output_value": "types" } ], "bodyKeys": [ - "ids" + "id" ], "formatEN": "delete backup account [types]", "formatZH": "删除备份账号 [types]", @@ -6454,7 +6461,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6505,7 +6512,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6548,7 +6555,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -6581,7 +6588,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6626,7 +6633,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6763,7 +6770,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6827,7 +6834,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6889,7 +6896,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6915,7 +6922,7 @@ const docTemplate = `{ "summary": "Clean monitor datas", "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6955,7 +6962,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6995,7 +7002,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7045,7 +7052,7 @@ const docTemplate = `{ "summary": "Load system available status", "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -7078,7 +7085,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7121,7 +7128,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7172,7 +7179,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7224,7 +7231,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7267,7 +7274,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7318,7 +7325,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7434,7 +7441,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7477,7 +7484,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } } }, @@ -7508,7 +7515,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7550,7 +7557,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7791,7 +7798,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7950,7 +7957,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8001,7 +8008,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8053,7 +8060,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8104,7 +8111,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8146,7 +8153,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8233,7 +8240,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8354,7 +8361,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8482,7 +8489,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8533,7 +8540,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8607,7 +8614,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8692,7 +8699,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8743,7 +8750,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -8776,7 +8783,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8906,7 +8913,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -8939,7 +8946,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8990,7 +8997,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -9077,7 +9084,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -9110,7 +9117,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -9159,7 +9166,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -9192,7 +9199,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -9270,7 +9277,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -10989,21 +10996,6 @@ const docTemplate = `{ } } }, - "dto.NginxKey": { - "type": "string", - "enum": [ - "index", - "limit-conn", - "ssl", - "http-per" - ], - "x-enum-varnames": [ - "Index", - "LimitConn", - "SSL", - "HttpPer" - ] - }, "dto.OperateByID": { "type": "object", "required": [ @@ -12487,7 +12479,7 @@ const docTemplate = `{ }, "params": {}, "scope": { - "$ref": "#/definitions/dto.NginxKey" + "type": "string" }, "websiteId": { "type": "integer" @@ -12535,7 +12527,7 @@ const docTemplate = `{ ], "properties": { "scope": { - "$ref": "#/definitions/dto.NginxKey" + "type": "string" }, "websiteId": { "type": "integer" @@ -13629,18 +13621,56 @@ const docTemplate = `{ } }` +type swaggerInfo struct { + Version string + Host string + BasePath string + Schemes []string + Title string + Description string +} + // SwaggerInfo holds exported Swagger Info so clients can modify it -var SwaggerInfo = &swag.Spec{ - Version: "1.0", - Host: "localhost", - BasePath: "/api/v1", - Schemes: []string{}, - Title: "1Panel", - Description: "开源Linux面板", - InfoInstanceName: "swagger", - SwaggerTemplate: docTemplate, +var SwaggerInfo = swaggerInfo{ + Version: "1.0", + Host: "localhost", + BasePath: "/api/v1", + Schemes: []string{}, + Title: "1Panel", + Description: "开源Linux面板", +} + +type s struct{} + +func (s *s) ReadDoc() string { + sInfo := SwaggerInfo + sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1) + + t, err := template.New("swagger_info").Funcs(template.FuncMap{ + "marshal": func(v interface{}) string { + a, _ := json.Marshal(v) + return string(a) + }, + "escape": func(v interface{}) string { + // escape tabs + str := strings.Replace(v.(string), "\t", "\\t", -1) + // replace " with \", and if that results in \\", replace that with \\\" + str = strings.Replace(str, "\"", "\\\"", -1) + return strings.Replace(str, "\\\\\"", "\\\\\\\"", -1) + }, + }).Parse(doc) + if err != nil { + return doc + } + + var tpl bytes.Buffer + if err := t.Execute(&tpl, sInfo); err != nil { + return doc + } + + return tpl.String() } func init() { - swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) + swag.Register("swagger", &s{}) } diff --git a/cmd/server/docs/swagger.json b/cmd/server/docs/swagger.json index cf3223cc6..c84c03611 100644 --- a/cmd/server/docs/swagger.json +++ b/cmd/server/docs/swagger.json @@ -62,7 +62,7 @@ "summary": "Get app list update", "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -442,7 +442,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -544,7 +544,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -586,7 +586,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -630,7 +630,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -649,7 +649,7 @@ "summary": "Sync app installed", "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -689,7 +689,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -742,7 +742,7 @@ "summary": "Sync app list", "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -780,7 +780,7 @@ "summary": "Check System isDemo", "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -808,7 +808,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -858,7 +858,7 @@ "summary": "User logout", "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -903,7 +903,7 @@ "summary": "Check is First login", "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -936,7 +936,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -979,7 +979,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1021,7 +1021,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1100,7 +1100,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1142,7 +1142,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1234,7 +1234,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1274,7 +1274,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1314,7 +1314,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1451,7 +1451,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1604,7 +1604,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1646,7 +1646,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1729,7 +1729,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1817,7 +1817,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1859,7 +1859,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -1940,7 +1940,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2010,7 +2010,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2055,7 +2055,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2148,7 +2148,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -2184,7 +2184,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2364,7 +2364,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2406,7 +2406,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2496,7 +2496,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2547,7 +2547,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2589,7 +2589,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2707,7 +2707,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2750,7 +2750,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2801,7 +2801,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2852,7 +2852,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -2903,7 +2903,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3026,7 +3026,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3078,7 +3078,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3211,7 +3211,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3275,7 +3275,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3326,7 +3326,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3377,7 +3377,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3417,7 +3417,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3504,7 +3504,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3650,7 +3650,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3690,7 +3690,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3730,7 +3730,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3792,7 +3792,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3956,7 +3956,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -3996,7 +3996,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4038,7 +4038,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4080,7 +4080,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4117,7 +4117,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -4150,7 +4150,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4237,7 +4237,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4279,7 +4279,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4321,7 +4321,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4363,7 +4363,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4450,7 +4450,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4493,7 +4493,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4536,7 +4536,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4579,7 +4579,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4657,7 +4657,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4730,7 +4730,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4808,7 +4808,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4852,7 +4852,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4895,7 +4895,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -4990,7 +4990,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5033,7 +5033,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5130,7 +5130,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5173,7 +5173,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5260,7 +5260,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5302,7 +5302,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5375,7 +5375,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -5453,7 +5453,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5532,7 +5532,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -5565,7 +5565,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -5668,7 +5668,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -5737,7 +5737,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5780,7 +5780,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -5971,7 +5971,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6069,7 +6069,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6120,7 +6120,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6160,7 +6160,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -6193,7 +6193,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6235,7 +6235,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -6268,7 +6268,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6310,7 +6310,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6352,7 +6352,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6396,7 +6396,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6404,14 +6404,14 @@ { "db": "backup_accounts", "input_colume": "id", - "input_value": "ids", + "input_value": "id", "isList": true, "output_colume": "type", "output_value": "types" } ], "bodyKeys": [ - "ids" + "id" ], "formatEN": "delete backup account [types]", "formatZH": "删除备份账号 [types]", @@ -6447,7 +6447,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6498,7 +6498,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6541,7 +6541,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -6574,7 +6574,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6619,7 +6619,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6756,7 +6756,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6820,7 +6820,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6882,7 +6882,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6908,7 +6908,7 @@ "summary": "Clean monitor datas", "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6948,7 +6948,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -6988,7 +6988,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7038,7 +7038,7 @@ "summary": "Load system available status", "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -7071,7 +7071,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7114,7 +7114,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7165,7 +7165,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7217,7 +7217,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7260,7 +7260,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7311,7 +7311,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7427,7 +7427,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7470,7 +7470,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } } }, @@ -7501,7 +7501,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7543,7 +7543,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7784,7 +7784,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7943,7 +7943,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -7994,7 +7994,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8046,7 +8046,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8097,7 +8097,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8139,7 +8139,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8226,7 +8226,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8347,7 +8347,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8475,7 +8475,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8526,7 +8526,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8600,7 +8600,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8685,7 +8685,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8736,7 +8736,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -8769,7 +8769,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8899,7 +8899,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -8932,7 +8932,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -8983,7 +8983,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -9070,7 +9070,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -9103,7 +9103,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -9152,7 +9152,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } } } @@ -9185,7 +9185,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -9263,7 +9263,7 @@ ], "responses": { "200": { - "description": "OK" + "description": "" } }, "x-panel-log": { @@ -10982,21 +10982,6 @@ } } }, - "dto.NginxKey": { - "type": "string", - "enum": [ - "index", - "limit-conn", - "ssl", - "http-per" - ], - "x-enum-varnames": [ - "Index", - "LimitConn", - "SSL", - "HttpPer" - ] - }, "dto.OperateByID": { "type": "object", "required": [ @@ -12480,7 +12465,7 @@ }, "params": {}, "scope": { - "$ref": "#/definitions/dto.NginxKey" + "type": "string" }, "websiteId": { "type": "integer" @@ -12528,7 +12513,7 @@ ], "properties": { "scope": { - "$ref": "#/definitions/dto.NginxKey" + "type": "string" }, "websiteId": { "type": "integer" diff --git a/cmd/server/docs/swagger.yaml b/cmd/server/docs/swagger.yaml index 1870f8838..b1af7abc2 100644 --- a/cmd/server/docs/swagger.yaml +++ b/cmd/server/docs/swagger.yaml @@ -1135,18 +1135,6 @@ definitions: subnet: type: string type: object - dto.NginxKey: - enum: - - index - - limit-conn - - ssl - - http-per - type: string - x-enum-varnames: - - Index - - LimitConn - - SSL - - HttpPer dto.OperateByID: properties: id: @@ -2131,7 +2119,7 @@ definitions: type: string params: {} scope: - $ref: '#/definitions/dto.NginxKey' + type: string websiteId: type: integer required: @@ -2163,7 +2151,7 @@ definitions: request.NginxScopeReq: properties: scope: - $ref: '#/definitions/dto.NginxKey' + type: string websiteId: type: integer required: @@ -2928,7 +2916,7 @@ paths: description: 获取应用更新版本 responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Get app list update @@ -3166,7 +3154,7 @@ paths: $ref: '#/definitions/request.AppInstalledOperate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Operate installed app @@ -3233,7 +3221,7 @@ paths: $ref: '#/definitions/request.AppInstalledUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Change app params @@ -3260,7 +3248,7 @@ paths: $ref: '#/definitions/request.PortUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Change app port @@ -3289,7 +3277,7 @@ paths: $ref: '#/definitions/request.AppInstalledSearch' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: List app installed @@ -3300,7 +3288,7 @@ paths: description: 同步已安装应用列表 responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Sync app installed @@ -3326,7 +3314,7 @@ paths: $ref: '#/definitions/request.AppSearch' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: List apps @@ -3358,7 +3346,7 @@ paths: description: 同步应用列表 responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Sync app list @@ -3386,7 +3374,7 @@ paths: description: 判断是否为demo环境 responses: "200": - description: OK + description: "" summary: Check System isDemo tags: - Auth @@ -3404,7 +3392,7 @@ paths: $ref: '#/definitions/dto.InitUser' responses: "200": - description: OK + description: "" summary: Init user tags: - Auth @@ -3433,7 +3421,7 @@ paths: description: 用户登出 responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: User logout @@ -3464,7 +3452,7 @@ paths: description: 判断是否为首次登录 responses: "200": - description: OK + description: "" summary: Check is First login tags: - Auth @@ -3482,7 +3470,7 @@ paths: $ref: '#/definitions/dto.ContainerCreate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Create container @@ -3510,7 +3498,7 @@ paths: $ref: '#/definitions/dto.ComposeCreate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Create compose @@ -3537,7 +3525,7 @@ paths: $ref: '#/definitions/dto.ComposeOperation' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Operate compose @@ -3587,7 +3575,7 @@ paths: $ref: '#/definitions/dto.ComposeCreate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Test compose @@ -3614,7 +3602,7 @@ paths: $ref: '#/definitions/dto.ComposeUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update compose @@ -3671,7 +3659,7 @@ paths: $ref: '#/definitions/dto.DaemonJsonConf' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update docker daemon.json @@ -3697,7 +3685,7 @@ paths: $ref: '#/definitions/dto.DaemonJsonUpdateByFile' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update docker daemon.json by upload file @@ -3723,7 +3711,7 @@ paths: $ref: '#/definitions/dto.DockerOperation' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Operate docker @@ -3809,7 +3797,7 @@ paths: $ref: '#/definitions/dto.ImageLoad' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Load image @@ -3909,7 +3897,7 @@ paths: $ref: '#/definitions/dto.BatchDelete' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Delete image @@ -3936,7 +3924,7 @@ paths: $ref: '#/definitions/dto.ImageSave' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Save image @@ -3989,7 +3977,7 @@ paths: $ref: '#/definitions/dto.ImageTag' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Tag image @@ -4045,7 +4033,7 @@ paths: $ref: '#/definitions/dto.NetworkCreat' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Create network @@ -4072,7 +4060,7 @@ paths: $ref: '#/definitions/dto.BatchDelete' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Delete network @@ -4123,7 +4111,7 @@ paths: $ref: '#/definitions/dto.ContainerOperation' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Operate Container @@ -4168,7 +4156,7 @@ paths: - application/json responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Create image repo @@ -4197,7 +4185,7 @@ paths: - application/json responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Delete image repo @@ -4256,7 +4244,7 @@ paths: - application/json responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Load repo status @@ -4278,7 +4266,7 @@ paths: - application/json responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update image repo @@ -4390,7 +4378,7 @@ paths: $ref: '#/definitions/dto.ComposeTemplateCreate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Create compose template @@ -4417,7 +4405,7 @@ paths: $ref: '#/definitions/dto.BatchDelete' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Delete compose template @@ -4474,7 +4462,7 @@ paths: $ref: '#/definitions/dto.ComposeTemplateUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update compose template @@ -4507,7 +4495,7 @@ paths: $ref: '#/definitions/dto.VolumeCreat' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Create volume @@ -4534,7 +4522,7 @@ paths: $ref: '#/definitions/dto.BatchDelete' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Delete volume @@ -4608,7 +4596,7 @@ paths: $ref: '#/definitions/dto.CronjobCreate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Create cronjob @@ -4636,7 +4624,7 @@ paths: $ref: '#/definitions/dto.CronjobBatchDelete' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Delete cronjob @@ -4669,7 +4657,7 @@ paths: $ref: '#/definitions/dto.CronjobDownload' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Download cronjob records @@ -4702,7 +4690,7 @@ paths: $ref: '#/definitions/dto.OperateByID' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Handle cronjob once @@ -4735,7 +4723,7 @@ paths: $ref: '#/definitions/dto.CronjobClean' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Clean job records @@ -4812,7 +4800,7 @@ paths: $ref: '#/definitions/dto.CronjobUpdateStatus' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update cronjob status @@ -4846,7 +4834,7 @@ paths: $ref: '#/definitions/dto.CronjobUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update cronjob @@ -4931,7 +4919,7 @@ paths: $ref: '#/definitions/dto.MysqlDBCreate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Create mysql database @@ -4971,7 +4959,7 @@ paths: $ref: '#/definitions/dto.ChangeDBInfo' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Change mysql access @@ -5004,7 +4992,7 @@ paths: $ref: '#/definitions/dto.ChangeDBInfo' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Change mysql password @@ -5037,7 +5025,7 @@ paths: $ref: '#/definitions/dto.MysqlConfUpdateByFile' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update mysql conf by upload file @@ -5063,7 +5051,7 @@ paths: $ref: '#/definitions/dto.MysqlDBDelete' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Delete mysql database @@ -5118,7 +5106,7 @@ paths: $ref: '#/definitions/dto.UpdateDescription' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update mysql database description @@ -5209,7 +5197,7 @@ paths: $ref: '#/definitions/dto.RedisConfUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update redis conf @@ -5235,7 +5223,7 @@ paths: $ref: '#/definitions/dto.RedisConfUpdateByFile' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update redis conf by file @@ -5261,7 +5249,7 @@ paths: $ref: '#/definitions/dto.ChangeDBInfo' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Change redis password @@ -5300,7 +5288,7 @@ paths: $ref: '#/definitions/dto.RedisConfPersistenceUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update redis persistence conf @@ -5400,7 +5388,7 @@ paths: $ref: '#/definitions/dto.MysqlVariablesUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update mysql variables @@ -5426,7 +5414,7 @@ paths: $ref: '#/definitions/request.FileCreate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Create file @@ -5453,7 +5441,7 @@ paths: $ref: '#/definitions/request.FileBatchDelete' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Batch delete file @@ -5480,7 +5468,7 @@ paths: $ref: '#/definitions/request.FilePathCheck' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Check file exist @@ -5504,7 +5492,7 @@ paths: type: file responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: ChunkUpload file @@ -5524,7 +5512,7 @@ paths: $ref: '#/definitions/request.FileCompress' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Compress file @@ -5580,7 +5568,7 @@ paths: $ref: '#/definitions/request.FileDeCompress' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Decompress file @@ -5607,7 +5595,7 @@ paths: $ref: '#/definitions/request.FileDelete' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Delete file @@ -5634,7 +5622,7 @@ paths: $ref: '#/definitions/request.FileDownload' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Download file @@ -5661,7 +5649,7 @@ paths: $ref: '#/definitions/dto.FilePath' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Download file with path @@ -5717,7 +5705,7 @@ paths: $ref: '#/definitions/request.FileCreate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Change file mode @@ -5745,7 +5733,7 @@ paths: $ref: '#/definitions/request.FileMove' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Move file @@ -5773,7 +5761,7 @@ paths: $ref: '#/definitions/request.FileRename' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Change file name @@ -5801,7 +5789,7 @@ paths: $ref: '#/definitions/request.FileEdit' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update file content @@ -5850,7 +5838,7 @@ paths: $ref: '#/definitions/request.DirSizeReq' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Load file size @@ -5896,7 +5884,7 @@ paths: type: file responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Upload file @@ -5945,7 +5933,7 @@ paths: $ref: '#/definitions/request.FileWget' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Wget file @@ -5974,7 +5962,7 @@ paths: $ref: '#/definitions/dto.GroupCreate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Create group @@ -6002,7 +5990,7 @@ paths: $ref: '#/definitions/dto.OperateByID' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Delete group @@ -6063,7 +6051,7 @@ paths: $ref: '#/definitions/dto.GroupUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update group @@ -6091,7 +6079,7 @@ paths: $ref: '#/definitions/dto.HostOperate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Create host @@ -6152,7 +6140,7 @@ paths: $ref: '#/definitions/dto.CommandOperate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Create command @@ -6180,7 +6168,7 @@ paths: $ref: '#/definitions/dto.BatchDeleteReq' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Delete command @@ -6235,7 +6223,7 @@ paths: $ref: '#/definitions/dto.CommandOperate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update command @@ -6262,7 +6250,7 @@ paths: $ref: '#/definitions/dto.BatchDeleteReq' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Delete host @@ -6308,7 +6296,7 @@ paths: $ref: '#/definitions/dto.BatchRuleOperate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Create group @@ -6357,7 +6345,7 @@ paths: $ref: '#/definitions/dto.PortRuleOperate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Create group @@ -6407,7 +6395,7 @@ paths: $ref: '#/definitions/dto.AddrRuleUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Create group @@ -6427,7 +6415,7 @@ paths: $ref: '#/definitions/dto.PortRuleUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Create group @@ -6490,7 +6478,7 @@ paths: $ref: '#/definitions/dto.HostConnTest' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Test host conn by info @@ -6532,7 +6520,7 @@ paths: $ref: '#/definitions/dto.HostOperate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update host @@ -6560,7 +6548,7 @@ paths: $ref: '#/definitions/dto.ChangeHostGroup' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update host group @@ -6680,7 +6668,7 @@ paths: $ref: '#/definitions/request.NginxConfigFileUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update OpenResty conf by upload file @@ -6741,7 +6729,7 @@ paths: $ref: '#/definitions/request.NginxConfigUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update OpenResty conf @@ -6774,7 +6762,7 @@ paths: $ref: '#/definitions/request.RuntimeCreate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Create runtime @@ -6800,7 +6788,7 @@ paths: type: string responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Get runtime @@ -6820,7 +6808,7 @@ paths: $ref: '#/definitions/request.RuntimeDelete' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Delete runtime @@ -6847,7 +6835,7 @@ paths: $ref: '#/definitions/request.RuntimeSearch' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: List runtimes @@ -6867,7 +6855,7 @@ paths: $ref: '#/definitions/request.RuntimeUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update runtime @@ -6894,7 +6882,7 @@ paths: $ref: '#/definitions/dto.BackupOperate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Create backup account @@ -6921,7 +6909,7 @@ paths: $ref: '#/definitions/dto.CommonBackup' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Backup system data @@ -6950,7 +6938,7 @@ paths: $ref: '#/definitions/dto.BatchDeleteReq' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Delete backup account @@ -6960,12 +6948,12 @@ paths: BeforeFuntions: - db: backup_accounts input_colume: id - input_value: ids + input_value: id isList: true output_colume: type output_value: types bodyKeys: - - ids + - id formatEN: delete backup account [types] formatZH: 删除备份账号 [types] paramKeys: [] @@ -6983,7 +6971,7 @@ paths: $ref: '#/definitions/dto.BatchDeleteReq' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Delete backup record @@ -7016,7 +7004,7 @@ paths: $ref: '#/definitions/dto.DownloadRecord' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Download backup record @@ -7044,7 +7032,7 @@ paths: $ref: '#/definitions/dto.RecordSearch' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Page backup records @@ -7064,7 +7052,7 @@ paths: $ref: '#/definitions/dto.CommonRecover' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Recover system data @@ -7094,7 +7082,7 @@ paths: $ref: '#/definitions/dto.CommonRecover' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Recover system data by upload @@ -7180,7 +7168,7 @@ paths: $ref: '#/definitions/dto.BackupOperate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update backup account @@ -7220,7 +7208,7 @@ paths: $ref: '#/definitions/dto.PasswordUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Reset system password expired @@ -7259,7 +7247,7 @@ paths: $ref: '#/definitions/dto.MfaCredential' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Bind mfa @@ -7276,7 +7264,7 @@ paths: description: 清空监控数据 responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Clean monitor datas @@ -7302,7 +7290,7 @@ paths: $ref: '#/definitions/dto.PasswordUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update system password @@ -7328,7 +7316,7 @@ paths: $ref: '#/definitions/dto.PortUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update system port @@ -7359,7 +7347,7 @@ paths: description: 获取系统可用状态 responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Load system available status @@ -7379,7 +7367,7 @@ paths: $ref: '#/definitions/dto.SnapshotCreate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Create system snapshot @@ -7407,7 +7395,7 @@ paths: $ref: '#/definitions/dto.BatchDeleteReq' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Delete system backup @@ -7440,7 +7428,7 @@ paths: $ref: '#/definitions/dto.UpdateDescription' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update snapshot description @@ -7474,7 +7462,7 @@ paths: $ref: '#/definitions/dto.SnapshotImport' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Import system snapshot @@ -7502,7 +7490,7 @@ paths: $ref: '#/definitions/dto.SnapshotRecover' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Recover system backup @@ -7535,7 +7523,7 @@ paths: $ref: '#/definitions/dto.SnapshotRecover' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Rollback system backup @@ -7609,7 +7597,7 @@ paths: $ref: '#/definitions/dto.SettingUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update system setting @@ -7637,7 +7625,7 @@ paths: $ref: '#/definitions/dto.Upgrade' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Load release notes by version @@ -7656,7 +7644,7 @@ paths: $ref: '#/definitions/dto.Upgrade' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Upgrade @@ -7683,7 +7671,7 @@ paths: $ref: '#/definitions/request.WebsiteCreate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Create website @@ -7836,7 +7824,7 @@ paths: $ref: '#/definitions/request.WebsiteResourceReq' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Delete website acme account @@ -7935,7 +7923,7 @@ paths: $ref: '#/definitions/request.NginxConfigUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update nginx conf @@ -7968,7 +7956,7 @@ paths: $ref: '#/definitions/request.WebsiteDefaultUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Change default server @@ -8002,7 +7990,7 @@ paths: $ref: '#/definitions/request.WebsiteDelete' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Delete website @@ -8035,7 +8023,7 @@ paths: $ref: '#/definitions/request.WebsiteDnsAccountCreate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Create website dns account @@ -8062,7 +8050,7 @@ paths: $ref: '#/definitions/request.WebsiteResourceReq' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Delete website dns account @@ -8117,7 +8105,7 @@ paths: $ref: '#/definitions/request.WebsiteDnsAccountUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update website dns account @@ -8194,7 +8182,7 @@ paths: $ref: '#/definitions/request.WebsiteDomainDelete' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Delete website domain @@ -8276,7 +8264,7 @@ paths: $ref: '#/definitions/request.WebsiteNginxUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update website nginx conf @@ -8309,7 +8297,7 @@ paths: $ref: '#/definitions/request.WebsiteOp' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Operate website @@ -8356,7 +8344,7 @@ paths: $ref: '#/definitions/request.WebsitePHPConfigUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update website php conf @@ -8410,7 +8398,7 @@ paths: $ref: '#/definitions/request.WebsitePHPFileUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update php conf @@ -8443,7 +8431,7 @@ paths: $ref: '#/definitions/request.NginxRewriteReq' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Get rewrite conf @@ -8463,7 +8451,7 @@ paths: $ref: '#/definitions/request.NginxRewriteUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update rewrite conf @@ -8546,7 +8534,7 @@ paths: type: integer responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Search website ssl by id @@ -8566,7 +8554,7 @@ paths: $ref: '#/definitions/request.WebsiteResourceReq' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Delete website ssl @@ -8599,7 +8587,7 @@ paths: $ref: '#/definitions/request.WebsiteSSLRenew' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Reset website ssl @@ -8654,7 +8642,7 @@ paths: $ref: '#/definitions/request.WebsiteSSLSearch' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Page website ssl @@ -8674,7 +8662,7 @@ paths: $ref: '#/definitions/request.WebsiteSSLUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update ssl @@ -8706,7 +8694,7 @@ paths: type: integer responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Search website ssl by website id @@ -8726,7 +8714,7 @@ paths: $ref: '#/definitions/request.WebsiteUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update website @@ -8775,7 +8763,7 @@ paths: $ref: '#/definitions/request.WebsiteWafUpdate' responses: "200": - description: OK + description: "" security: - ApiKeyAuth: [] summary: Update website waf conf diff --git a/frontend/src/api/modules/setting.ts b/frontend/src/api/modules/setting.ts index 7f902eb81..b8a2ccbcc 100644 --- a/frontend/src/api/modules/setting.ts +++ b/frontend/src/api/modules/setting.ts @@ -98,7 +98,7 @@ export const editBackup = (params: Backup.BackupOperate) => { } return http.post(`/settings/backup/update`, reqest); }; -export const deleteBackup = (params: { ids: number[] }) => { +export const deleteBackup = (params: { id: number }) => { return http.post(`/settings/backup/del`, params); }; export const listBucket = (params: Backup.ForBucket) => { diff --git a/frontend/src/views/setting/backup-account/index.vue b/frontend/src/views/setting/backup-account/index.vue index 066237b5a..7bc9b004b 100644 --- a/frontend/src/views/setting/backup-account/index.vue +++ b/frontend/src/views/setting/backup-account/index.vue @@ -50,7 +50,7 @@ > {{ $t('commons.button.edit') }} - + {{ $t('commons.button.delete') }} @@ -88,7 +88,7 @@ > {{ $t('commons.button.edit') }} - + {{ $t('commons.button.delete') }} @@ -126,7 +126,7 @@ > {{ $t('commons.button.edit') }} - + {{ $t('commons.button.delete') }} @@ -161,7 +161,7 @@ > {{ $t('commons.button.edit') }} - + {{ $t('commons.button.delete') }} @@ -199,7 +199,7 @@ > {{ $t('commons.button.edit') }} - + {{ $t('commons.button.delete') }} @@ -235,7 +235,7 @@ > {{ $t('commons.button.edit') }} - + {{ $t('commons.button.delete') }} @@ -401,10 +401,8 @@ const search = async () => { } }; -const onBatchDelete = async (row: Backup.BackupInfo | null) => { - let ids: Array = []; - ids.push(row.id); - await useDeleteData(deleteBackup, { ids: ids }, 'commons.msg.delete'); +const onDelete = async (row: Backup.BackupInfo) => { + await useDeleteData(deleteBackup, { id: row.id }, 'commons.msg.delete'); search(); };