From 7a66e712150baa7ca26331c578e80a10b3cedae1 Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Tue, 30 May 2023 15:30:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=BB=9F=E4=B8=80=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=8B=BC=E5=86=99=E9=94=99=E8=AF=AF=20(#1192?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/api/v1/app.go | 2 +- backend/app/api/v1/app_install.go | 2 +- backend/app/api/v1/backup.go | 4 +- backend/app/api/v1/command.go | 2 +- backend/app/api/v1/compose_template.go | 4 +- backend/app/api/v1/container.go | 8 +- backend/app/api/v1/cronjob.go | 12 +- backend/app/api/v1/database_mysql.go | 8 +- backend/app/api/v1/firewall.go | 2 +- backend/app/api/v1/group.go | 4 +- backend/app/api/v1/host.go | 4 +- backend/app/api/v1/image.go | 6 +- backend/app/api/v1/image_repo.go | 4 +- backend/app/api/v1/nginx.go | 2 +- backend/app/api/v1/snapshot.go | 8 +- backend/app/api/v1/website.go | 32 +- backend/app/api/v1/website_acme_account.go | 2 +- backend/app/api/v1/website_dns_account.go | 2 +- backend/app/api/v1/website_ssl.go | 6 +- backend/app/dto/container.go | 4 +- backend/app/dto/cronjob.go | 2 +- backend/app/service/auth.go | 8 +- backend/app/service/container.go | 10 +- backend/app/service/container_compose.go | 6 +- backend/app/service/container_network.go | 8 +- backend/app/service/container_volume.go | 8 +- backend/app/service/cornjob.go | 4 +- backend/app/service/database_mysql.go | 6 +- backend/app/service/docker.go | 62 ++-- backend/app/service/firewall.go | 20 +- backend/app/service/image_repo.go | 16 +- backend/app/service/snapshot.go | 20 +- backend/app/service/ssh.go | 24 +- backend/app/service/upgrade.go | 4 +- backend/init/hook/hook.go | 7 +- backend/middleware/operation.go | 8 +- cmd/server/docs/docs.go | 300 +++++++++++------- cmd/server/docs/swagger.json | 300 +++++++++++------- cmd/server/docs/swagger.yaml | 274 +++++++++------- .../src/components/confirm-dialog/index.vue | 8 +- frontend/src/global/form-rules.ts | 6 +- frontend/src/global/mimetype.ts | 2 +- frontend/src/lang/modules/en.ts | 41 ++- frontend/src/lang/modules/zh.ts | 30 +- .../views/app-store/detail/install/index.vue | 2 +- .../app-store/installed/detail/index.vue | 2 +- .../src/views/app-store/installed/index.vue | 2 +- .../app-store/installed/upgrade/index.vue | 2 +- .../container/container/create/index.vue | 2 +- .../src/views/container/setting/index.vue | 10 +- .../views/container/volume/create/index.vue | 2 +- frontend/src/views/cronjob/index.vue | 4 +- frontend/src/views/cronjob/record/index.vue | 2 +- .../database/mysql/setting/slow-log/index.vue | 4 +- .../src/views/host/monitor/monitor/index.vue | 8 +- .../website/config/basic/https/index.vue | 2 +- .../config/basic/site-folder/index.vue | 2 +- .../views/website/website/create/index.vue | 2 +- .../views/website/website/default/index.vue | 2 +- 59 files changed, 761 insertions(+), 579 deletions(-) diff --git a/backend/app/api/v1/app.go b/backend/app/api/v1/app.go index e8b49c528..ead89d0d6 100644 --- a/backend/app/api/v1/app.go +++ b/backend/app/api/v1/app.go @@ -138,7 +138,7 @@ func (b *BaseApi) GetAppDetailByID(c *gin.Context) { // @Success 200 {object} model.AppInstall // @Security ApiKeyAuth // @Router /apps/install [post] -// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"name","input_value":"name","isList":false,"db":"app_installs","output_colume":"app_id","output_value":"appId"},{"info":"appId","isList":false,"db":"apps","output_colume":"key","output_value":"appKey"}],"formatZH":"安装应用 [appKey]-[name]","formatEN":"Install app [appKey]-[name]"} +// @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFuntions":[{"input_column":"name","input_value":"name","isList":false,"db":"app_installs","output_column":"app_id","output_value":"appId"},{"info":"appId","isList":false,"db":"apps","output_column":"key","output_value":"appKey"}],"formatZH":"安装应用 [appKey]-[name]","formatEN":"Install app [appKey]-[name]"} func (b *BaseApi) InstallApp(c *gin.Context) { var req request.AppInstallCreate if err := c.ShouldBindJSON(&req); err != nil { diff --git a/backend/app/api/v1/app_install.go b/backend/app/api/v1/app_install.go index 928a80bc9..2abd4f682 100644 --- a/backend/app/api/v1/app_install.go +++ b/backend/app/api/v1/app_install.go @@ -159,7 +159,7 @@ func (b *BaseApi) SyncInstalled(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /apps/installed/op [post] -// @x-panel-log {"bodyKeys":["installId","operate"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"installId","isList":false,"db":"app_installs","output_colume":"app_id","output_value":"appId"},{"input_colume":"id","input_value":"installId","isList":false,"db":"app_installs","output_colume":"name","output_value":"appName"},{"input_colume":"id","input_value":"appId","isList":false,"db":"apps","output_colume":"key","output_value":"appKey"}],"formatZH":"[appKey] 应用 [appName] [operate]","formatEN":"[appKey] App [appName] [operate]"} +// @x-panel-log {"bodyKeys":["installId","operate"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"installId","isList":false,"db":"app_installs","output_column":"app_id","output_value":"appId"},{"input_column":"id","input_value":"installId","isList":false,"db":"app_installs","output_column":"name","output_value":"appName"},{"input_column":"id","input_value":"appId","isList":false,"db":"apps","output_column":"key","output_value":"appKey"}],"formatZH":"[appKey] 应用 [appName] [operate]","formatEN":"[appKey] App [appName] [operate]"} func (b *BaseApi) OperateInstalled(c *gin.Context) { var req request.AppInstalledOperate if err := c.ShouldBindJSON(&req); err != nil { diff --git a/backend/app/api/v1/backup.go b/backend/app/api/v1/backup.go index 620dd09a9..3380e4a36 100644 --- a/backend/app/api/v1/backup.go +++ b/backend/app/api/v1/backup.go @@ -106,7 +106,7 @@ func (b *BaseApi) ListBuckets(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /settings/backup/del [post] -// @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]"} +// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"id","isList":true,"db":"backup_accounts","output_column":"type","output_value":"types"}],"formatZH":"删除备份账号 [types]","formatEN":"delete backup account [types]"} func (b *BaseApi) DeleteBackup(c *gin.Context) { var req dto.OperateByID if err := c.ShouldBindJSON(&req); err != nil { @@ -188,7 +188,7 @@ func (b *BaseApi) DownloadRecord(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @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]"} +// @x-panel-log {"bodyKeys":["ids"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"ids","isList":true,"db":"backup_records","output_column":"file_name","output_value":"files"}],"formatZH":"删除备份记录 [files]","formatEN":"delete backup records [files]"} func (b *BaseApi) DeleteBackupRecord(c *gin.Context) { var req dto.BatchDeleteReq if err := c.ShouldBindJSON(&req); err != nil { diff --git a/backend/app/api/v1/command.go b/backend/app/api/v1/command.go index 1f0f85ffd..023a41cba 100644 --- a/backend/app/api/v1/command.go +++ b/backend/app/api/v1/command.go @@ -85,7 +85,7 @@ func (b *BaseApi) ListCommand(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @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]"} +// @x-panel-log {"bodyKeys":["ids"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"ids","isList":true,"db":"commands","output_column":"name","output_value":"names"}],"formatZH":"删除快捷命令 [names]","formatEN":"delete quick command [names]"} func (b *BaseApi) DeleteCommand(c *gin.Context) { var req dto.BatchDeleteReq if err := c.ShouldBindJSON(&req); err != nil { diff --git a/backend/app/api/v1/compose_template.go b/backend/app/api/v1/compose_template.go index 8ec990f9a..ce7cf8728 100644 --- a/backend/app/api/v1/compose_template.go +++ b/backend/app/api/v1/compose_template.go @@ -87,7 +87,7 @@ func (b *BaseApi) ListComposeTemplate(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /containers/template/del [post] -// @x-panel-log {"bodyKeys":["ids"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"ids","isList":true,"db":"compose_templates","output_colume":"name","output_value":"names"}],"formatZH":"删除 compose 模版 [names]","formatEN":"delete compose template [names]"} +// @x-panel-log {"bodyKeys":["ids"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"ids","isList":true,"db":"compose_templates","output_column":"name","output_value":"names"}],"formatZH":"删除 compose 模版 [names]","formatEN":"delete compose template [names]"} func (b *BaseApi) DeleteComposeTemplate(c *gin.Context) { var req dto.BatchDeleteReq if err := c.ShouldBindJSON(&req); err != nil { @@ -114,7 +114,7 @@ func (b *BaseApi) DeleteComposeTemplate(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /containers/template/update [post] -// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"compose_templates","output_colume":"name","output_value":"name"}],"formatZH":"更新 compose 模版 [name]","formatEN":"update compose template information [name]"} +// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"id","isList":false,"db":"compose_templates","output_column":"name","output_value":"name"}],"formatZH":"更新 compose 模版 [name]","formatEN":"update compose template information [name]"} func (b *BaseApi) UpdateComposeTemplate(c *gin.Context) { var req dto.ComposeTemplateUpdate if err := c.ShouldBindJSON(&req); err != nil { diff --git a/backend/app/api/v1/container.go b/backend/app/api/v1/container.go index 25581f255..a9ad4ac69 100644 --- a/backend/app/api/v1/container.go +++ b/backend/app/api/v1/container.go @@ -395,13 +395,13 @@ func (b *BaseApi) DeleteNetwork(c *gin.Context) { // @Summary Create network // @Description 创建容器网络 // @Accept json -// @Param request body dto.NetworkCreat true "request" +// @Param request body dto.NetworkCreate true "request" // @Success 200 // @Security ApiKeyAuth // @Router /containers/network [post] // @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"创建容器网络 name","formatEN":"create container network [name]"} func (b *BaseApi) CreateNetwork(c *gin.Context) { - var req dto.NetworkCreat + var req dto.NetworkCreate if err := c.ShouldBindJSON(&req); err != nil { helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err) return @@ -498,13 +498,13 @@ func (b *BaseApi) DeleteVolume(c *gin.Context) { // @Summary Create volume // @Description 创建容器存储卷 // @Accept json -// @Param request body dto.VolumeCreat true "request" +// @Param request body dto.VolumeCreate true "request" // @Success 200 // @Security ApiKeyAuth // @Router /containers/volume [post] // @x-panel-log {"bodyKeys":["name"],"paramKeys":[],"BeforeFuntions":[],"formatZH":"创建容器存储卷 [name]","formatEN":"create container volume [name]"} func (b *BaseApi) CreateVolume(c *gin.Context) { - var req dto.VolumeCreat + var req dto.VolumeCreate if err := c.ShouldBindJSON(&req); err != nil { helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err) return diff --git a/backend/app/api/v1/cronjob.go b/backend/app/api/v1/cronjob.go index 4ef0081cf..5ba8a2cf4 100644 --- a/backend/app/api/v1/cronjob.go +++ b/backend/app/api/v1/cronjob.go @@ -102,7 +102,7 @@ func (b *BaseApi) SearchJobRecords(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /cronjobs/records/clean [post] -// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"cronjobs","output_colume":"name","output_value":"name"}],"formatZH":"清空计划任务记录 [name]","formatEN":"clean cronjob [name] records"} +// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"id","isList":false,"db":"cronjobs","output_column":"name","output_value":"name"}],"formatZH":"清空计划任务记录 [name]","formatEN":"clean cronjob [name] records"} func (b *BaseApi) CleanRecord(c *gin.Context) { var req dto.CronjobClean if err := c.ShouldBindJSON(&req); err != nil { @@ -126,7 +126,7 @@ func (b *BaseApi) CleanRecord(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /cronjobs/del [post] -// @x-panel-log {"bodyKeys":["ids"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"ids","isList":true,"db":"cronjobs","output_colume":"name","output_value":"names"}],"formatZH":"删除计划任务 [names]","formatEN":"delete cronjob [names]"} +// @x-panel-log {"bodyKeys":["ids"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"ids","isList":true,"db":"cronjobs","output_column":"name","output_value":"names"}],"formatZH":"删除计划任务 [names]","formatEN":"delete cronjob [names]"} func (b *BaseApi) DeleteCronjob(c *gin.Context) { var req dto.CronjobBatchDelete if err := c.ShouldBindJSON(&req); err != nil { @@ -153,7 +153,7 @@ func (b *BaseApi) DeleteCronjob(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /cronjobs/update [post] -// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"cronjobs","output_colume":"name","output_value":"name"}],"formatZH":"更新计划任务 [name]","formatEN":"update cronjob [name]"} +// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"id","isList":false,"db":"cronjobs","output_column":"name","output_value":"name"}],"formatZH":"更新计划任务 [name]","formatEN":"update cronjob [name]"} func (b *BaseApi) UpdateCronjob(c *gin.Context) { var req dto.CronjobUpdate if err := c.ShouldBindJSON(&req); err != nil { @@ -180,7 +180,7 @@ func (b *BaseApi) UpdateCronjob(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /cronjobs/status [post] -// @x-panel-log {"bodyKeys":["id","status"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"cronjobs","output_colume":"name","output_value":"name"}],"formatZH":"修改计划任务 [name] 状态为 [status]","formatEN":"change the status of cronjob [name] to [status]."} +// @x-panel-log {"bodyKeys":["id","status"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"id","isList":false,"db":"cronjobs","output_column":"name","output_value":"name"}],"formatZH":"修改计划任务 [name] 状态为 [status]","formatEN":"change the status of cronjob [name] to [status]."} func (b *BaseApi) UpdateCronjobStatus(c *gin.Context) { var req dto.CronjobUpdateStatus if err := c.ShouldBindJSON(&req); err != nil { @@ -207,7 +207,7 @@ func (b *BaseApi) UpdateCronjobStatus(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /cronjobs/download [post] -// @x-panel-log {"bodyKeys":["recordID"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"recordID","isList":false,"db":"job_records","output_colume":"file","output_value":"file"}],"formatZH":"下载计划任务记录 [file]","formatEN":"download the cronjob record [file]"} +// @x-panel-log {"bodyKeys":["recordID"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"recordID","isList":false,"db":"job_records","output_column":"file","output_value":"file"}],"formatZH":"下载计划任务记录 [file]","formatEN":"download the cronjob record [file]"} func (b *BaseApi) TargetDownload(c *gin.Context) { var req dto.CronjobDownload if err := c.ShouldBindJSON(&req); err != nil { @@ -235,7 +235,7 @@ func (b *BaseApi) TargetDownload(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /cronjobs/handle [post] -// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"cronjobs","output_colume":"name","output_value":"name"}],"formatZH":"手动执行计划任务 [name]","formatEN":"manually execute the cronjob [name]"} +// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"id","isList":false,"db":"cronjobs","output_column":"name","output_value":"name"}],"formatZH":"手动执行计划任务 [name]","formatEN":"manually execute the cronjob [name]"} func (b *BaseApi) HandleOnce(c *gin.Context) { var req dto.OperateByID if err := c.ShouldBindJSON(&req); err != nil { diff --git a/backend/app/api/v1/database_mysql.go b/backend/app/api/v1/database_mysql.go index 3f8e1fe9a..d26b4f6ad 100644 --- a/backend/app/api/v1/database_mysql.go +++ b/backend/app/api/v1/database_mysql.go @@ -54,7 +54,7 @@ func (b *BaseApi) CreateMysql(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /databases/description/update [post] -// @x-panel-log {"bodyKeys":["id","description"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"database_mysqls","output_colume":"name","output_value":"name"}],"formatZH":"mysql 数据库 [name] 描述信息修改 [description]","formatEN":"The description of the mysql database [name] is modified => [description]"} +// @x-panel-log {"bodyKeys":["id","description"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"id","isList":false,"db":"database_mysqls","output_column":"name","output_value":"name"}],"formatZH":"mysql 数据库 [name] 描述信息修改 [description]","formatEN":"The description of the mysql database [name] is modified => [description]"} func (b *BaseApi) UpdateMysqlDescription(c *gin.Context) { var req dto.UpdateDescription if err := c.ShouldBindJSON(&req); err != nil { @@ -80,7 +80,7 @@ func (b *BaseApi) UpdateMysqlDescription(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /databases/change/password [post] -// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"database_mysqls","output_colume":"name","output_value":"name"}],"formatZH":"更新数据库 [name] 密码","formatEN":"Update database [name] password"} +// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"id","isList":false,"db":"database_mysqls","output_column":"name","output_value":"name"}],"formatZH":"更新数据库 [name] 密码","formatEN":"Update database [name] password"} func (b *BaseApi) ChangeMysqlPassword(c *gin.Context) { var req dto.ChangeDBInfo if err := c.ShouldBindJSON(&req); err != nil { @@ -115,7 +115,7 @@ func (b *BaseApi) ChangeMysqlPassword(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /databases/change/access [post] -// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"database_mysqls","output_colume":"name","output_value":"name"}],"formatZH":"更新数据库 [name] 访问权限","formatEN":"Update database [name] access"} +// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"id","isList":false,"db":"database_mysqls","output_column":"name","output_value":"name"}],"formatZH":"更新数据库 [name] 访问权限","formatEN":"Update database [name] access"} func (b *BaseApi) ChangeMysqlAccess(c *gin.Context) { var req dto.ChangeDBInfo if err := c.ShouldBindJSON(&req); err != nil { @@ -264,7 +264,7 @@ func (b *BaseApi) DeleteCheckMysql(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /databases/del [post] -// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"database_mysqls","output_colume":"name","output_value":"name"}],"formatZH":"删除 mysql 数据库 [name]","formatEN":"delete mysql database [name]"} +// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"id","isList":false,"db":"database_mysqls","output_column":"name","output_value":"name"}],"formatZH":"删除 mysql 数据库 [name]","formatEN":"delete mysql database [name]"} func (b *BaseApi) DeleteMysql(c *gin.Context) { var req dto.MysqlDBDelete if err := c.ShouldBindJSON(&req); err != nil { diff --git a/backend/app/api/v1/firewall.go b/backend/app/api/v1/firewall.go index 1479170f3..fef5c12f0 100644 --- a/backend/app/api/v1/firewall.go +++ b/backend/app/api/v1/firewall.go @@ -149,7 +149,7 @@ func (b *BaseApi) BatchOperateRule(c *gin.Context) { helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err) return } - if err := firewallService.BacthOperateRule(req); err != nil { + if err := firewallService.BatchOperateRule(req); err != nil { helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err) return } diff --git a/backend/app/api/v1/group.go b/backend/app/api/v1/group.go index 42a89135c..62c2a6033 100644 --- a/backend/app/api/v1/group.go +++ b/backend/app/api/v1/group.go @@ -42,7 +42,7 @@ func (b *BaseApi) CreateGroup(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /groups/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"},{"input_colume":"id","input_value":"id","isList":false,"db":"groups","output_colume":"type","output_value":"type"}],"formatZH":"删除组 [type][name]","formatEN":"delete group [type][name]"} +// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"id","isList":false,"db":"groups","output_column":"name","output_value":"name"},{"input_column":"id","input_value":"id","isList":false,"db":"groups","output_column":"type","output_value":"type"}],"formatZH":"删除组 [type][name]","formatEN":"delete group [type][name]"} func (b *BaseApi) DeleteGroup(c *gin.Context) { var req dto.OperateByID if err := c.ShouldBindJSON(&req); err != nil { @@ -92,7 +92,7 @@ func (b *BaseApi) UpdateGroup(c *gin.Context) { // @Description 查询系统组 // @Accept json // @Param request body dto.GroupSearch true "request" -// @Success 200 {anrry} dto.GroupInfo +// @Success 200 {array} dto.GroupInfo // @Security ApiKeyAuth // @Router /groups/search [post] func (b *BaseApi) ListGroup(c *gin.Context) { diff --git a/backend/app/api/v1/host.go b/backend/app/api/v1/host.go index 3dc2a0aba..a36aa7094 100644 --- a/backend/app/api/v1/host.go +++ b/backend/app/api/v1/host.go @@ -183,7 +183,7 @@ func (b *BaseApi) GetHostInfo(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /hosts/del [post] -// @x-panel-log {"bodyKeys":["ids"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"ids","isList":true,"db":"hosts","output_colume":"addr","output_value":"addrs"}],"formatZH":"删除主机 [addrs]","formatEN":"delete host [addrs]"} +// @x-panel-log {"bodyKeys":["ids"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"ids","isList":true,"db":"hosts","output_column":"addr","output_value":"addrs"}],"formatZH":"删除主机 [addrs]","formatEN":"delete host [addrs]"} func (b *BaseApi) DeleteHost(c *gin.Context) { var req dto.BatchDeleteReq if err := c.ShouldBindJSON(&req); err != nil { @@ -269,7 +269,7 @@ func (b *BaseApi) UpdateHost(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /hosts/update/group [post] -// @x-panel-log {"bodyKeys":["id","group"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"hosts","output_colume":"addr","output_value":"addr"}],"formatZH":"切换主机[addr]分组 => [group]","formatEN":"change host [addr] group => [group]"} +// @x-panel-log {"bodyKeys":["id","group"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"id","isList":false,"db":"hosts","output_column":"addr","output_value":"addr"}],"formatZH":"切换主机[addr]分组 => [group]","formatEN":"change host [addr] group => [group]"} func (b *BaseApi) UpdateHostGroup(c *gin.Context) { var req dto.ChangeHostGroup if err := c.ShouldBindJSON(&req); err != nil { diff --git a/backend/app/api/v1/image.go b/backend/app/api/v1/image.go index bb1bcf017..b55b76d08 100644 --- a/backend/app/api/v1/image.go +++ b/backend/app/api/v1/image.go @@ -93,7 +93,7 @@ func (b *BaseApi) ImageBuild(c *gin.Context) { // @Success 200 {string} log // @Security ApiKeyAuth // @Router /containers/image/pull [post] -// @x-panel-log {"bodyKeys":["repoID","imageName"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"repoID","isList":false,"db":"image_repos","output_colume":"name","output_value":"reponame"}],"formatZH":"镜像拉取 [reponame][imageName]","formatEN":"image pull [reponame][imageName]"} +// @x-panel-log {"bodyKeys":["repoID","imageName"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"repoID","isList":false,"db":"image_repos","output_column":"name","output_value":"reponame"}],"formatZH":"镜像拉取 [reponame][imageName]","formatEN":"image pull [reponame][imageName]"} func (b *BaseApi) ImagePull(c *gin.Context) { var req dto.ImagePull if err := c.ShouldBindJSON(&req); err != nil { @@ -122,7 +122,7 @@ func (b *BaseApi) ImagePull(c *gin.Context) { // @Success 200 {string} log // @Security ApiKeyAuth // @Router /containers/image/push [post] -// @x-panel-log {"bodyKeys":["repoID","tagName","name"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"repoID","isList":false,"db":"image_repos","output_colume":"name","output_value":"reponame"}],"formatZH":"[tagName] 推送到 [reponame][name]","formatEN":"push [tagName] to [reponame][name]"} +// @x-panel-log {"bodyKeys":["repoID","tagName","name"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"repoID","isList":false,"db":"image_repos","output_column":"name","output_value":"reponame"}],"formatZH":"[tagName] 推送到 [reponame][name]","formatEN":"push [tagName] to [reponame][name]"} func (b *BaseApi) ImagePush(c *gin.Context) { var req dto.ImagePush if err := c.ShouldBindJSON(&req); err != nil { @@ -207,7 +207,7 @@ func (b *BaseApi) ImageSave(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /containers/image/tag [post] -// @x-panel-log {"bodyKeys":["repoID","targetName"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"repoID","isList":false,"db":"image_repos","output_colume":"name","output_value":"reponame"}],"formatZH":"tag 镜像 [reponame][targetName]","formatEN":"tag image [reponame][targetName]"} +// @x-panel-log {"bodyKeys":["repoID","targetName"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"repoID","isList":false,"db":"image_repos","output_column":"name","output_value":"reponame"}],"formatZH":"tag 镜像 [reponame][targetName]","formatEN":"tag image [reponame][targetName]"} func (b *BaseApi) ImageTag(c *gin.Context) { var req dto.ImageTag if err := c.ShouldBindJSON(&req); err != nil { diff --git a/backend/app/api/v1/image_repo.go b/backend/app/api/v1/image_repo.go index 448668b67..76cd598ca 100644 --- a/backend/app/api/v1/image_repo.go +++ b/backend/app/api/v1/image_repo.go @@ -119,7 +119,7 @@ func (b *BaseApi) CreateRepo(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /containers/repo/del [post] -// @x-panel-log {"bodyKeys":["ids"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"ids","isList":true,"db":"image_repos","output_colume":"name","output_value":"names"}],"formatZH":"删除镜像仓库 [names]","formatEN":"delete image repo [names]"} +// @x-panel-log {"bodyKeys":["ids"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"ids","isList":true,"db":"image_repos","output_column":"name","output_value":"names"}],"formatZH":"删除镜像仓库 [names]","formatEN":"delete image repo [names]"} func (b *BaseApi) DeleteRepo(c *gin.Context) { var req dto.ImageRepoDelete if err := c.ShouldBindJSON(&req); err != nil { @@ -147,7 +147,7 @@ func (b *BaseApi) DeleteRepo(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /containers/repo/update [post] -// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"id","isList":false,"db":"image_repos","output_colume":"name","output_value":"name"}],"formatZH":"更新镜像仓库 [name]","formatEN":"update image repo information [name]"} +// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"id","isList":false,"db":"image_repos","output_column":"name","output_value":"name"}],"formatZH":"更新镜像仓库 [name]","formatEN":"update image repo information [name]"} func (b *BaseApi) UpdateRepo(c *gin.Context) { var req dto.ImageRepoUpdate if err := c.ShouldBindJSON(&req); err != nil { diff --git a/backend/app/api/v1/nginx.go b/backend/app/api/v1/nginx.go index 2ab222e1f..a646702bc 100644 --- a/backend/app/api/v1/nginx.go +++ b/backend/app/api/v1/nginx.go @@ -53,7 +53,7 @@ func (b *BaseApi) GetNginxConfigByScope(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /openResty/update [post] -// @x-panel-log {"bodyKeys":["websiteId"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"websiteId","isList":false,"db":"websites","output_colume":"primary_domain","output_value":"domain"}],"formatZH":"更新 nginx 配置 [domain]","formatEN":"Update nginx conf [domain]"} +// @x-panel-log {"bodyKeys":["websiteId"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"websiteId","isList":false,"db":"websites","output_column":"primary_domain","output_value":"domain"}],"formatZH":"更新 nginx 配置 [domain]","formatEN":"Update nginx conf [domain]"} func (b *BaseApi) UpdateNginxConfigByScope(c *gin.Context) { var req request.NginxConfigUpdate if err := c.ShouldBindJSON(&req); err != nil { diff --git a/backend/app/api/v1/snapshot.go b/backend/app/api/v1/snapshot.go index 40aaaf513..bc3b5edb2 100644 --- a/backend/app/api/v1/snapshot.go +++ b/backend/app/api/v1/snapshot.go @@ -68,7 +68,7 @@ func (b *BaseApi) ImportSnapshot(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /settings/snapshot/description/update [post] -// @x-panel-log {"bodyKeys":["id","description"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"snapshots","output_colume":"name","output_value":"name"}],"formatZH":"快照 [name] 描述信息修改 [description]","formatEN":"The description of the snapshot [name] is modified => [description]"} +// @x-panel-log {"bodyKeys":["id","description"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"id","isList":false,"db":"snapshots","output_column":"name","output_value":"name"}],"formatZH":"快照 [name] 描述信息修改 [description]","formatEN":"The description of the snapshot [name] is modified => [description]"} func (b *BaseApi) UpdateSnapDescription(c *gin.Context) { var req dto.UpdateDescription if err := c.ShouldBindJSON(&req); err != nil { @@ -119,7 +119,7 @@ func (b *BaseApi) SearchSnapshot(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /settings/snapshot/recover [post] -// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"snapshots","output_colume":"name","output_value":"name"}],"formatZH":"从系统快照 [name] 恢复","formatEN":"Recover from system backup [name]"} +// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"id","isList":false,"db":"snapshots","output_column":"name","output_value":"name"}],"formatZH":"从系统快照 [name] 恢复","formatEN":"Recover from system backup [name]"} func (b *BaseApi) RecoverSnapshot(c *gin.Context) { var req dto.SnapshotRecover if err := c.ShouldBindJSON(&req); err != nil { @@ -146,7 +146,7 @@ func (b *BaseApi) RecoverSnapshot(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /settings/snapshot/rollback [post] -// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"snapshots","output_colume":"name","output_value":"name"}],"formatZH":"从系统快照 [name] 回滚","formatEN":"Rollback from system backup [name]"} +// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"id","isList":false,"db":"snapshots","output_column":"name","output_value":"name"}],"formatZH":"从系统快照 [name] 回滚","formatEN":"Rollback from system backup [name]"} func (b *BaseApi) RollbackSnapshot(c *gin.Context) { var req dto.SnapshotRecover if err := c.ShouldBindJSON(&req); err != nil { @@ -173,7 +173,7 @@ func (b *BaseApi) RollbackSnapshot(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /settings/snapshot/del [post] -// @x-panel-log {"bodyKeys":["ids"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"ids","isList":true,"db":"snapshots","output_colume":"name","output_value":"name"}],"formatZH":"删除系统快照 [name]","formatEN":"Delete system backup [name]"} +// @x-panel-log {"bodyKeys":["ids"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"ids","isList":true,"db":"snapshots","output_column":"name","output_value":"name"}],"formatZH":"删除系统快照 [name]","formatEN":"Delete system backup [name]"} func (b *BaseApi) DeleteSnapshot(c *gin.Context) { var req dto.BatchDeleteReq if err := c.ShouldBindJSON(&req); err != nil { diff --git a/backend/app/api/v1/website.go b/backend/app/api/v1/website.go index 8be758283..d6918996d 100644 --- a/backend/app/api/v1/website.go +++ b/backend/app/api/v1/website.go @@ -95,7 +95,7 @@ func (b *BaseApi) CreateWebsite(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /websites/operate [post] -// @x-panel-log {"bodyKeys":["id", "operate"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"websites","output_colume":"primary_domain","output_value":"domain"}],"formatZH":"[operate] 网站 [domain]","formatEN":"[operate] website [domain]"} +// @x-panel-log {"bodyKeys":["id", "operate"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"id","isList":false,"db":"websites","output_column":"primary_domain","output_value":"domain"}],"formatZH":"[operate] 网站 [domain]","formatEN":"[operate] website [domain]"} func (b *BaseApi) OpWebsite(c *gin.Context) { var req request.WebsiteOp if err := c.ShouldBindJSON(&req); err != nil { @@ -118,7 +118,7 @@ func (b *BaseApi) OpWebsite(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /websites/del [post] -// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"websites","output_colume":"primary_domain","output_value":"domain"}],"formatZH":"删除网站 [domain]","formatEN":"Delete website [domain]"} +// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"id","isList":false,"db":"websites","output_column":"primary_domain","output_value":"domain"}],"formatZH":"删除网站 [domain]","formatEN":"Delete website [domain]"} func (b *BaseApi) DeleteWebsite(c *gin.Context) { var req request.WebsiteDelete if err := c.ShouldBindJSON(&req); err != nil { @@ -232,7 +232,7 @@ func (b *BaseApi) GetWebDomains(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /websites/domains/del [post] -// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"website_domains","output_colume":"domain","output_value":"domain"}],"formatZH":"删除域名 [domain]","formatEN":"Delete domain [domain]"} +// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"id","isList":false,"db":"website_domains","output_column":"domain","output_value":"domain"}],"formatZH":"删除域名 [domain]","formatEN":"Delete domain [domain]"} func (b *BaseApi) DeleteWebDomain(c *gin.Context) { var req request.WebsiteDomainDelete if err := c.ShouldBindJSON(&req); err != nil { @@ -300,7 +300,7 @@ func (b *BaseApi) GetNginxConfig(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /websites/config/update [post] -// @x-panel-log {"bodyKeys":["websiteId"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"websiteId","isList":false,"db":"websites","output_colume":"primary_domain","output_value":"domain"}],"formatZH":"nginx 配置修改 [domain]","formatEN":"Nginx conf update [domain]"} +// @x-panel-log {"bodyKeys":["websiteId"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"websiteId","isList":false,"db":"websites","output_column":"primary_domain","output_value":"domain"}],"formatZH":"nginx 配置修改 [domain]","formatEN":"Nginx conf update [domain]"} func (b *BaseApi) UpdateNginxConfig(c *gin.Context) { var req request.NginxConfigUpdate if err := c.ShouldBindJSON(&req); err != nil { @@ -344,7 +344,7 @@ func (b *BaseApi) GetHTTPSConfig(c *gin.Context) { // @Success 200 {object} response.WebsiteHTTPS // @Security ApiKeyAuth // @Router /websites/:id/https [post] -// @x-panel-log {"bodyKeys":["websiteId"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"websiteId","isList":false,"db":"websites","output_colume":"primary_domain","output_value":"domain"}],"formatZH":"更新网站 [domain] https 配置","formatEN":"Update website https [domain] conf"} +// @x-panel-log {"bodyKeys":["websiteId"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"websiteId","isList":false,"db":"websites","output_column":"primary_domain","output_value":"domain"}],"formatZH":"更新网站 [domain] https 配置","formatEN":"Update website https [domain] conf"} func (b *BaseApi) UpdateHTTPSConfig(c *gin.Context) { var req request.WebsiteHTTPSOp if err := c.ShouldBindJSON(&req); err != nil { @@ -414,7 +414,7 @@ func (b *BaseApi) GetWebsiteWafConfig(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /websites/waf/update [post] -// @x-panel-log {"bodyKeys":["websiteId"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"websiteId","isList":false,"db":"websites","output_colume":"primary_domain","output_value":"domain"}],"formatZH":"WAF 配置修改 [domain]","formatEN":"WAF conf update [domain]"} +// @x-panel-log {"bodyKeys":["websiteId"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"websiteId","isList":false,"db":"websites","output_column":"primary_domain","output_value":"domain"}],"formatZH":"WAF 配置修改 [domain]","formatEN":"WAF conf update [domain]"} func (b *BaseApi) UpdateWebsiteWafConfig(c *gin.Context) { var req request.WebsiteWafUpdate if err := c.ShouldBindJSON(&req); err != nil { @@ -436,7 +436,7 @@ func (b *BaseApi) UpdateWebsiteWafConfig(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /websites/nginx/update [post] -// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"websites","output_colume":"primary_domain","output_value":"domain"}],"formatZH":"[domain] Nginx 配置修改","formatEN":"[domain] Nginx conf update"} +// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"id","isList":false,"db":"websites","output_column":"primary_domain","output_value":"domain"}],"formatZH":"[domain] Nginx 配置修改","formatEN":"[domain] Nginx conf update"} func (b *BaseApi) UpdateWebsiteNginxConfig(c *gin.Context) { var req request.WebsiteNginxUpdate if err := c.ShouldBindJSON(&req); err != nil { @@ -458,7 +458,7 @@ func (b *BaseApi) UpdateWebsiteNginxConfig(c *gin.Context) { // @Success 200 {object} response.WebsiteLog // @Security ApiKeyAuth // @Router /websites/log [post] -// @x-panel-log {"bodyKeys":["id", "operate"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"websites","output_colume":"primary_domain","output_value":"domain"}],"formatZH":"[domain][operate] 日志","formatEN":"[domain][operate] logs"} +// @x-panel-log {"bodyKeys":["id", "operate"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"id","isList":false,"db":"websites","output_column":"primary_domain","output_value":"domain"}],"formatZH":"[domain][operate] 日志","formatEN":"[domain][operate] logs"} func (b *BaseApi) OpWebsiteLog(c *gin.Context) { var req request.WebsiteLogReq if err := c.ShouldBindJSON(&req); err != nil { @@ -481,7 +481,7 @@ func (b *BaseApi) OpWebsiteLog(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /websites/default/server [post] -// @x-panel-log {"bodyKeys":["id", "operate"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"websites","output_colume":"primary_domain","output_value":"domain"}],"formatZH":"修改默认 server => [domain]","formatEN":"Change default server => [domain]"} +// @x-panel-log {"bodyKeys":["id", "operate"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"id","isList":false,"db":"websites","output_column":"primary_domain","output_value":"domain"}],"formatZH":"修改默认 server => [domain]","formatEN":"Change default server => [domain]"} func (b *BaseApi) ChangeDefaultServer(c *gin.Context) { var req request.WebsiteDefaultUpdate if err := c.ShouldBindJSON(&req); err != nil { @@ -525,7 +525,7 @@ func (b *BaseApi) GetWebsitePHPConfig(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /websites/php/config [post] -// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"websites","output_colume":"primary_domain","output_value":"domain"}],"formatZH":"[domain] PHP 配置修改","formatEN":"[domain] PHP conf update"} +// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"id","isList":false,"db":"websites","output_column":"primary_domain","output_value":"domain"}],"formatZH":"[domain] PHP 配置修改","formatEN":"[domain] PHP conf update"} func (b *BaseApi) UpdateWebsitePHPConfig(c *gin.Context) { var req request.WebsitePHPConfigUpdate if err := c.ShouldBindJSON(&req); err != nil { @@ -547,7 +547,7 @@ func (b *BaseApi) UpdateWebsitePHPConfig(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /websites/php/update [post] -// @x-panel-log {"bodyKeys":["websiteId"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"websiteId","isList":false,"db":"websites","output_colume":"primary_domain","output_value":"domain"}],"formatZH":"php 配置修改 [domain]","formatEN":"Nginx conf update [domain]"} +// @x-panel-log {"bodyKeys":["websiteId"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"websiteId","isList":false,"db":"websites","output_column":"primary_domain","output_value":"domain"}],"formatZH":"php 配置修改 [domain]","formatEN":"Nginx conf update [domain]"} func (b *BaseApi) UpdatePHPFile(c *gin.Context) { var req request.WebsitePHPFileUpdate if err := c.ShouldBindJSON(&req); err != nil { @@ -591,7 +591,7 @@ func (b *BaseApi) GetRewriteConfig(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /websites/rewrite/update [post] -// @x-panel-log {"bodyKeys":["websiteID"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"websiteID","isList":false,"db":"websites","output_colume":"primary_domain","output_value":"domain"}],"formatZH":"伪静态配置修改 [domain]","formatEN":"Nginx conf rewrite update [domain]"} +// @x-panel-log {"bodyKeys":["websiteID"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"websiteID","isList":false,"db":"websites","output_column":"primary_domain","output_value":"domain"}],"formatZH":"伪静态配置修改 [domain]","formatEN":"Nginx conf rewrite update [domain]"} func (b *BaseApi) UpdateRewriteConfig(c *gin.Context) { var req request.NginxRewriteUpdate if err := c.ShouldBindJSON(&req); err != nil { @@ -613,7 +613,7 @@ func (b *BaseApi) UpdateRewriteConfig(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /websites/dir/update [post] -// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"websites","output_colume":"primary_domain","output_value":"domain"}],"formatZH":"更新网站 [domain] 目录","formatEN":"Update domain [domain] dir"} +// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"id","isList":false,"db":"websites","output_column":"primary_domain","output_value":"domain"}],"formatZH":"更新网站 [domain] 目录","formatEN":"Update domain [domain] dir"} func (b *BaseApi) UpdateSiteDir(c *gin.Context) { var req request.WebsiteUpdateDir if err := c.ShouldBindJSON(&req); err != nil { @@ -635,7 +635,7 @@ func (b *BaseApi) UpdateSiteDir(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /websites/dir/permission [post] -// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"websites","output_colume":"primary_domain","output_value":"domain"}],"formatZH":"更新网站 [domain] 目录权限","formatEN":"Update domain [domain] dir permission"} +// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"id","isList":false,"db":"websites","output_column":"primary_domain","output_value":"domain"}],"formatZH":"更新网站 [domain] 目录权限","formatEN":"Update domain [domain] dir permission"} func (b *BaseApi) UpdateSiteDirPermission(c *gin.Context) { var req request.WebsiteUpdateDirPermission if err := c.ShouldBindJSON(&req); err != nil { @@ -679,7 +679,7 @@ func (b *BaseApi) GetProxyConfig(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /websites/proxies/update [post] -// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"websites","output_colume":"primary_domain","output_value":"domain"}],"formatZH":"修改网站 [domain] 反向代理配置 ","formatEN":"Update domain [domain] proxy config"} +// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"id","isList":false,"db":"websites","output_column":"primary_domain","output_value":"domain"}],"formatZH":"修改网站 [domain] 反向代理配置 ","formatEN":"Update domain [domain] proxy config"} func (b *BaseApi) UpdateProxyConfig(c *gin.Context) { var req request.WebsiteProxyConfig if err := c.ShouldBindJSON(&req); err != nil { @@ -702,7 +702,7 @@ func (b *BaseApi) UpdateProxyConfig(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /websites/proxy/file [post] -// @x-panel-log {"bodyKeys":["websiteID"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"websiteID","isList":false,"db":"websites","output_colume":"primary_domain","output_value":"domain"}],"formatZH":"更新反向代理文件 [domain]","formatEN":"Nginx conf proxy file update [domain]"} +// @x-panel-log {"bodyKeys":["websiteID"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"websiteID","isList":false,"db":"websites","output_column":"primary_domain","output_value":"domain"}],"formatZH":"更新反向代理文件 [domain]","formatEN":"Nginx conf proxy file update [domain]"} func (b *BaseApi) UpdateProxyConfigFile(c *gin.Context) { var req request.NginxProxyUpdate if err := c.ShouldBindJSON(&req); err != nil { diff --git a/backend/app/api/v1/website_acme_account.go b/backend/app/api/v1/website_acme_account.go index bd0c801d7..5b66b52e8 100644 --- a/backend/app/api/v1/website_acme_account.go +++ b/backend/app/api/v1/website_acme_account.go @@ -64,7 +64,7 @@ func (b *BaseApi) CreateWebsiteAcmeAccount(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /websites/acme/del [post] -// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"website_acme_accounts","output_colume":"email","output_value":"email"}],"formatZH":"删除网站 acme [email]","formatEN":"Delete website acme [email]"} +// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"id","isList":false,"db":"website_acme_accounts","output_column":"email","output_value":"email"}],"formatZH":"删除网站 acme [email]","formatEN":"Delete website acme [email]"} func (b *BaseApi) DeleteWebsiteAcmeAccount(c *gin.Context) { var req request.WebsiteResourceReq if err := c.ShouldBindJSON(&req); err != nil { diff --git a/backend/app/api/v1/website_dns_account.go b/backend/app/api/v1/website_dns_account.go index b6a843f1f..79bc8578d 100644 --- a/backend/app/api/v1/website_dns_account.go +++ b/backend/app/api/v1/website_dns_account.go @@ -85,7 +85,7 @@ func (b *BaseApi) UpdateWebsiteDnsAccount(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /websites/dns/del [post] -// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"website_dns_accounts","output_colume":"name","output_value":"name"}],"formatZH":"删除网站 dns [name]","formatEN":"Delete website dns [name]"} +// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"id","isList":false,"db":"website_dns_accounts","output_column":"name","output_value":"name"}],"formatZH":"删除网站 dns [name]","formatEN":"Delete website dns [name]"} func (b *BaseApi) DeleteWebsiteDnsAccount(c *gin.Context) { var req request.WebsiteResourceReq if err := c.ShouldBindJSON(&req); err != nil { diff --git a/backend/app/api/v1/website_ssl.go b/backend/app/api/v1/website_ssl.go index ca8f4e4b8..cd8d72490 100644 --- a/backend/app/api/v1/website_ssl.go +++ b/backend/app/api/v1/website_ssl.go @@ -75,7 +75,7 @@ func (b *BaseApi) CreateWebsiteSSL(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /websites/ssl/renew [post] -// @x-panel-log {"bodyKeys":["SSLId"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"SSLId","isList":false,"db":"website_ssls","output_colume":"primary_domain","output_value":"domain"}],"formatZH":"重置 ssl [domain]","formatEN":"Renew ssl [domain]"} +// @x-panel-log {"bodyKeys":["SSLId"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"SSLId","isList":false,"db":"website_ssls","output_column":"primary_domain","output_value":"domain"}],"formatZH":"重置 ssl [domain]","formatEN":"Renew ssl [domain]"} func (b *BaseApi) RenewWebsiteSSL(c *gin.Context) { var req request.WebsiteSSLRenew if err := c.ShouldBindJSON(&req); err != nil { @@ -119,7 +119,7 @@ func (b *BaseApi) GetDNSResolve(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /websites/ssl/del [post] -// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"website_ssls","output_colume":"primary_domain","output_value":"domain"}],"formatZH":"删除 ssl [domain]","formatEN":"Delete ssl [domain]"} +// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"id","isList":false,"db":"website_ssls","output_column":"primary_domain","output_value":"domain"}],"formatZH":"删除 ssl [domain]","formatEN":"Delete ssl [domain]"} func (b *BaseApi) DeleteWebsiteSSL(c *gin.Context) { var req request.WebsiteResourceReq if err := c.ShouldBindJSON(&req); err != nil { @@ -185,7 +185,7 @@ func (b *BaseApi) GetWebsiteSSLById(c *gin.Context) { // @Success 200 // @Security ApiKeyAuth // @Router /websites/ssl/update [post] -// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_colume":"id","input_value":"id","isList":false,"db":"website_ssls","output_colume":"primary_domain","output_value":"domain"}],"formatZH":"更新证书设置 [domain]","formatEN":"Update ssl config [domain]"} +// @x-panel-log {"bodyKeys":["id"],"paramKeys":[],"BeforeFuntions":[{"input_column":"id","input_value":"id","isList":false,"db":"website_ssls","output_column":"primary_domain","output_value":"domain"}],"formatZH":"更新证书设置 [domain]","formatEN":"Update ssl config [domain]"} func (b *BaseApi) UpdateWebsiteSSL(c *gin.Context) { var req request.WebsiteSSLUpdate if err := c.ShouldBindJSON(&req); err != nil { diff --git a/backend/app/dto/container.go b/backend/app/dto/container.go index 01e7f2ffc..c77a3f8dd 100644 --- a/backend/app/dto/container.go +++ b/backend/app/dto/container.go @@ -101,7 +101,7 @@ type Network struct { CreatedAt time.Time `json:"createdAt"` Attachable bool `json:"attachable"` } -type NetworkCreat struct { +type NetworkCreate struct { Name string `json:"name"` Driver string `json:"driver"` Options []string `json:"options"` @@ -118,7 +118,7 @@ type Volume struct { Mountpoint string `json:"mountpoint"` CreatedAt time.Time `json:"createdAt"` } -type VolumeCreat struct { +type VolumeCreate struct { Name string `json:"name"` Driver string `json:"driver"` Options []string `json:"options"` diff --git a/backend/app/dto/cronjob.go b/backend/app/dto/cronjob.go index 45d755f7f..e94c3c4f5 100644 --- a/backend/app/dto/cronjob.go +++ b/backend/app/dto/cronjob.go @@ -86,7 +86,7 @@ type CronjobInfo struct { TargetDirID int `json:"targetDirID"` RetainCopies int `json:"retainCopies"` - LastRecrodTime string `json:"lastRecrodTime"` + LastRecordTime string `json:"lastRecordTime"` Status string `json:"status"` } diff --git a/backend/app/service/auth.go b/backend/app/service/auth.go index 0e5563aea..6842124cd 100644 --- a/backend/app/service/auth.go +++ b/backend/app/service/auth.go @@ -33,11 +33,11 @@ func (u *AuthService) Login(c *gin.Context, info dto.Login) (*dto.UserLoginInfo, if err != nil { return nil, errors.WithMessage(constant.ErrRecordNotFound, err.Error()) } - passwrodSetting, err := settingRepo.Get(settingRepo.WithByKey("Password")) + passwordSetting, err := settingRepo.Get(settingRepo.WithByKey("Password")) if err != nil { return nil, errors.WithMessage(constant.ErrRecordNotFound, err.Error()) } - pass, err := encrypt.StringDecrypt(passwrodSetting.Value) + pass, err := encrypt.StringDecrypt(passwordSetting.Value) if err != nil { return nil, constant.ErrAuth } @@ -60,11 +60,11 @@ func (u *AuthService) MFALogin(c *gin.Context, info dto.MFALogin) (*dto.UserLogi if err != nil { return nil, errors.WithMessage(constant.ErrRecordNotFound, err.Error()) } - passwrodSetting, err := settingRepo.Get(settingRepo.WithByKey("Password")) + passwordSetting, err := settingRepo.Get(settingRepo.WithByKey("Password")) if err != nil { return nil, errors.WithMessage(constant.ErrRecordNotFound, err.Error()) } - pass, err := encrypt.StringDecrypt(passwrodSetting.Value) + pass, err := encrypt.StringDecrypt(passwordSetting.Value) if err != nil { return nil, err } diff --git a/backend/app/service/container.go b/backend/app/service/container.go index bce66e555..9909cb58a 100644 --- a/backend/app/service/container.go +++ b/backend/app/service/container.go @@ -46,9 +46,9 @@ type IContainerService interface { ContainerStats(id string) (*dto.ContainterStats, error) Inspect(req dto.InspectReq) (string, error) DeleteNetwork(req dto.BatchDelete) error - CreateNetwork(req dto.NetworkCreat) error + CreateNetwork(req dto.NetworkCreate) error DeleteVolume(req dto.BatchDelete) error - CreateVolume(req dto.VolumeCreat) error + CreateVolume(req dto.VolumeCreate) error TestCompose(req dto.ComposeCreate) (bool, error) ComposeUpdate(req dto.ComposeUpdate) error Prune(req dto.ContainerPrune) (dto.ContainerPruneReport, error) @@ -78,11 +78,11 @@ func (u *ContainerService) Page(req dto.PageContainer) (int64, interface{}, erro return 0, nil, err } if len(req.Name) != 0 { - lenth, count := len(list), 0 - for count < lenth { + length, count := len(list), 0 + for count < length { if !strings.Contains(list[count].Names[0][1:], req.Name) { list = append(list[:count], list[(count+1):]...) - lenth-- + length-- } else { count++ } diff --git a/backend/app/service/container_compose.go b/backend/app/service/container_compose.go index 300a237d9..b40469d63 100644 --- a/backend/app/service/container_compose.go +++ b/backend/app/service/container_compose.go @@ -101,11 +101,11 @@ func (u *ContainerService) PageCompose(req dto.SearchWithPage) (int64, interface records = append(records, value) } if len(req.Info) != 0 { - lenth, count := len(records), 0 - for count < lenth { + length, count := len(records), 0 + for count < length { if !strings.Contains(records[count].Name, req.Info) { records = append(records[:count], records[(count+1):]...) - lenth-- + length-- } else { count++ } diff --git a/backend/app/service/container_network.go b/backend/app/service/container_network.go index adaac59c3..46932e0ac 100644 --- a/backend/app/service/container_network.go +++ b/backend/app/service/container_network.go @@ -24,11 +24,11 @@ func (u *ContainerService) PageNetwork(req dto.SearchWithPage) (int64, interface return 0, nil, err } if len(req.Info) != 0 { - lenth, count := len(list), 0 - for count < lenth { + length, count := len(list), 0 + for count < length { if !strings.Contains(list[count].Name, req.Info) { list = append(list[:count], list[(count+1):]...) - lenth-- + length-- } else { count++ } @@ -90,7 +90,7 @@ func (u *ContainerService) DeleteNetwork(req dto.BatchDelete) error { } return nil } -func (u *ContainerService) CreateNetwork(req dto.NetworkCreat) error { +func (u *ContainerService) CreateNetwork(req dto.NetworkCreate) error { client, err := docker.NewDockerClient() if err != nil { return err diff --git a/backend/app/service/container_volume.go b/backend/app/service/container_volume.go index fb8193482..ebc51cc45 100644 --- a/backend/app/service/container_volume.go +++ b/backend/app/service/container_volume.go @@ -24,11 +24,11 @@ func (u *ContainerService) PageVolume(req dto.SearchWithPage) (int64, interface{ return 0, nil, err } if len(req.Info) != 0 { - lenth, count := len(list.Volumes), 0 - for count < lenth { + length, count := len(list.Volumes), 0 + for count < length { if !strings.Contains(list.Volumes[count].Name, req.Info) { list.Volumes = append(list.Volumes[:count], list.Volumes[(count+1):]...) - lenth-- + length-- } else { count++ } @@ -103,7 +103,7 @@ func (u *ContainerService) DeleteVolume(req dto.BatchDelete) error { } return nil } -func (u *ContainerService) CreateVolume(req dto.VolumeCreat) error { +func (u *ContainerService) CreateVolume(req dto.VolumeCreate) error { client, err := docker.NewDockerClient() if err != nil { return err diff --git a/backend/app/service/cornjob.go b/backend/app/service/cornjob.go index 669c73bf9..2b6bde169 100644 --- a/backend/app/service/cornjob.go +++ b/backend/app/service/cornjob.go @@ -53,9 +53,9 @@ func (u *CronjobService) SearchWithPage(search dto.SearchWithPage) (int64, inter } record, _ := cronjobRepo.RecordFirst(cronjob.ID) if record.ID != 0 { - item.LastRecrodTime = record.StartTime.Format("2006-01-02 15:04:05") + item.LastRecordTime = record.StartTime.Format("2006-01-02 15:04:05") } else { - item.LastRecrodTime = "-" + item.LastRecordTime = "-" } dtoCronjobs = append(dtoCronjobs, item) } diff --git a/backend/app/service/database_mysql.go b/backend/app/service/database_mysql.go index 80120b6df..b7a532394 100644 --- a/backend/app/service/database_mysql.go +++ b/backend/app/service/database_mysql.go @@ -33,7 +33,7 @@ type IMysqlService interface { Create(ctx context.Context, req dto.MysqlDBCreate) (*model.DatabaseMysql, error) ChangeAccess(info dto.ChangeDBInfo) error ChangePassword(info dto.ChangeDBInfo) error - UpdateVariables(updatas []dto.MysqlVariablesUpdate) error + UpdateVariables(updates []dto.MysqlVariablesUpdate) error UpdateConfByFile(info dto.MysqlConfUpdateByFile) error UpdateDescription(req dto.UpdateDescription) error DeleteCheck(id uint) ([]string, error) @@ -331,7 +331,7 @@ func (u *MysqlService) UpdateConfByFile(info dto.MysqlConfUpdateByFile) error { return nil } -func (u *MysqlService) UpdateVariables(updatas []dto.MysqlVariablesUpdate) error { +func (u *MysqlService) UpdateVariables(updates []dto.MysqlVariablesUpdate) error { app, err := appInstallRepo.LoadBaseInfo("mysql", "") if err != nil { return err @@ -346,7 +346,7 @@ func (u *MysqlService) UpdateVariables(updatas []dto.MysqlVariablesUpdate) error files = strings.Split(string(lineBytes), "\n") group := "[mysqld]" - for _, info := range updatas { + for _, info := range updates { if app.Version != "5.7.39" { if info.Param == "query_cache_size" { continue diff --git a/backend/app/service/docker.go b/backend/app/service/docker.go index 1953f4ead..a05b24e93 100644 --- a/backend/app/service/docker.go +++ b/backend/app/service/docker.go @@ -88,11 +88,11 @@ func (u *DockerService) LoadDockerConf() *dto.DaemonJsonConf { return &data } var conf daemonJsonItem - deamonMap := make(map[string]interface{}) - if err := json.Unmarshal(file, &deamonMap); err != nil { + daemonMap := make(map[string]interface{}) + if err := json.Unmarshal(file, &daemonMap); err != nil { return &data } - arr, err := json.Marshal(deamonMap) + arr, err := json.Marshal(daemonMap) if err != nil { return &data } @@ -100,7 +100,7 @@ func (u *DockerService) LoadDockerConf() *dto.DaemonJsonConf { fmt.Println(err) return &data } - if _, ok := deamonMap["iptables"]; !ok { + if _, ok := daemonMap["iptables"]; !ok { conf.IPTables = true } data.CgroupDriver = "cgroupfs" @@ -131,40 +131,40 @@ func (u *DockerService) UpdateConf(req dto.SettingUpdate) error { if err != nil { return err } - deamonMap := make(map[string]interface{}) - _ = json.Unmarshal(file, &deamonMap) + daemonMap := make(map[string]interface{}) + _ = json.Unmarshal(file, &daemonMap) switch req.Key { case "Registries": if len(req.Value) == 0 { - delete(deamonMap, "insecure-registries") + delete(daemonMap, "insecure-registries") } else { - deamonMap["insecure-registries"] = strings.Split(req.Value, ",") + daemonMap["insecure-registries"] = strings.Split(req.Value, ",") } case "Mirrors": if len(req.Value) == 0 { - delete(deamonMap, "registry-mirrors") + delete(daemonMap, "registry-mirrors") } else { - deamonMap["registry-mirrors"] = strings.Split(req.Value, ",") + daemonMap["registry-mirrors"] = strings.Split(req.Value, ",") } case "LogOption": if req.Value == "disable" { - delete(deamonMap, "log-opts") + delete(daemonMap, "log-opts") } case "LiveRestore": if req.Value == "disable" { - delete(deamonMap, "live-restore") + delete(daemonMap, "live-restore") } else { - deamonMap["live-restore"] = true + daemonMap["live-restore"] = true } case "IPtables": if req.Value == "enable" { - delete(deamonMap, "iptables") + delete(daemonMap, "iptables") } else { - deamonMap["iptables"] = false + daemonMap["iptables"] = false } case "Dirver": - if opts, ok := deamonMap["exec-opts"]; ok { + if opts, ok := daemonMap["exec-opts"]; ok { if optsValue, isArray := opts.([]interface{}); isArray { for i := 0; i < len(optsValue); i++ { if opt, isStr := optsValue[i].(string); isStr { @@ -177,15 +177,15 @@ func (u *DockerService) UpdateConf(req dto.SettingUpdate) error { } } else { if req.Value == "systemd" { - deamonMap["exec-opts"] = []string{"native.cgroupdriver=systemd"} + daemonMap["exec-opts"] = []string{"native.cgroupdriver=systemd"} } } } - if len(deamonMap) == 0 { + if len(daemonMap) == 0 { _ = os.Remove(constant.DaemonJsonPath) return nil } - newJson, err := json.MarshalIndent(deamonMap, "", "\t") + newJson, err := json.MarshalIndent(daemonMap, "", "\t") if err != nil { return err } @@ -212,15 +212,15 @@ func (u *DockerService) UpdateLogOption(req dto.LogOption) error { if err != nil { return err } - deamonMap := make(map[string]interface{}) - _ = json.Unmarshal(file, &deamonMap) + daemonMap := make(map[string]interface{}) + _ = json.Unmarshal(file, &daemonMap) - changeLogOption(deamonMap, req.LogMaxFile, req.LogMaxSize) - if len(deamonMap) == 0 { + changeLogOption(daemonMap, req.LogMaxFile, req.LogMaxSize) + if len(daemonMap) == 0 { _ = os.Remove(constant.DaemonJsonPath) return nil } - newJson, err := json.MarshalIndent(deamonMap, "", "\t") + newJson, err := json.MarshalIndent(daemonMap, "", "\t") if err != nil { return err } @@ -274,10 +274,10 @@ func (u *DockerService) OperateDocker(req dto.DockerOperation) error { return nil } -func changeLogOption(deamonMap map[string]interface{}, logMaxFile, logMaxSize string) { - if opts, ok := deamonMap["log-opts"]; ok { +func changeLogOption(daemonMap map[string]interface{}, logMaxFile, logMaxSize string) { + if opts, ok := daemonMap["log-opts"]; ok { if len(logMaxFile) != 0 || len(logMaxSize) != 0 { - deamonMap["log-driver"] = "json-file" + daemonMap["log-driver"] = "json-file" } optsMap, isMap := opts.(map[string]interface{}) if isMap { @@ -292,7 +292,7 @@ func changeLogOption(deamonMap map[string]interface{}, logMaxFile, logMaxSize st delete(optsMap, "max-size") } if len(optsMap) == 0 { - delete(deamonMap, "log-opts") + delete(daemonMap, "log-opts") } } else { optsMap := make(map[string]interface{}) @@ -303,12 +303,12 @@ func changeLogOption(deamonMap map[string]interface{}, logMaxFile, logMaxSize st optsMap["max-size"] = logMaxSize } if len(optsMap) != 0 { - deamonMap["log-opts"] = optsMap + daemonMap["log-opts"] = optsMap } } } else { if len(logMaxFile) != 0 || len(logMaxSize) != 0 { - deamonMap["log-driver"] = "json-file" + daemonMap["log-driver"] = "json-file" } optsMap := make(map[string]interface{}) if len(logMaxFile) != 0 { @@ -318,7 +318,7 @@ func changeLogOption(deamonMap map[string]interface{}, logMaxFile, logMaxSize st optsMap["max-size"] = logMaxSize } if len(optsMap) != 0 { - deamonMap["log-opts"] = optsMap + daemonMap["log-opts"] = optsMap } } } diff --git a/backend/app/service/firewall.go b/backend/app/service/firewall.go index e9d6a0c18..600f132d1 100644 --- a/backend/app/service/firewall.go +++ b/backend/app/service/firewall.go @@ -27,7 +27,7 @@ type IFirewallService interface { OperateAddressRule(req dto.AddrRuleOperate, reload bool) error UpdatePortRule(req dto.PortRuleUpdate) error UpdateAddrRule(req dto.AddrRuleUpdate) error - BacthOperateRule(req dto.BatchRuleOperate) error + BatchOperateRule(req dto.BatchRuleOperate) error } func NewIFirewallService() IFirewallService { @@ -276,7 +276,7 @@ func (u *FirewallService) UpdateAddrRule(req dto.AddrRuleUpdate) error { return client.Reload() } -func (u *FirewallService) BacthOperateRule(req dto.BatchRuleOperate) error { +func (u *FirewallService) BatchOperateRule(req dto.BatchRuleOperate) error { client, err := firewall.NewFirewallClient() if err != nil { return err @@ -368,11 +368,9 @@ func (u *FirewallService) pingStatus() string { if _, err := os.Stat("/etc/sysctl.conf"); err != nil { return constant.StatusNone } - commond := "cat /etc/sysctl.conf | grep net/ipv4/icmp_echo_ignore_all= " - if cmd.HasNoPasswordSudo() { - commond = "sudo cat /etc/sysctl.conf | grep net/ipv4/icmp_echo_ignore_all= " - } - stdout, _ := cmd.Exec(commond) + sudo := cmd.SudoHandleCmd() + command := fmt.Sprintf("%s cat /etc/sysctl.conf | grep net/ipv4/icmp_echo_ignore_all= ", sudo) + stdout, _ := cmd.Exec(command) if stdout == "net/ipv4/icmp_echo_ignore_all=1\n" { return constant.StatusEnable } @@ -408,11 +406,9 @@ func (u *FirewallService) updatePingStatus(enable string) error { return err } - commond := "sysctl -p" - if cmd.HasNoPasswordSudo() { - commond = "sudo sysctl -p" - } - stdout, err := cmd.Exec(commond) + sudo := cmd.SudoHandleCmd() + command := fmt.Sprintf("%s sysctl -p", sudo) + stdout, err := cmd.Exec(command) if err != nil { return fmt.Errorf("update ping status failed, err: %v", stdout) } diff --git a/backend/app/service/image_repo.go b/backend/app/service/image_repo.go index 5083644ea..26c50bf11 100644 --- a/backend/app/service/image_repo.go +++ b/backend/app/service/image_repo.go @@ -87,12 +87,12 @@ func (u *ImageRepoService) Create(req dto.ImageRepoCreate) error { return errors.New(string(stdout)) } ticker := time.NewTicker(3 * time.Second) - ctx, cancle := context.WithTimeout(context.Background(), time.Second*20) + ctx, cancel := context.WithTimeout(context.Background(), time.Second*20) if err := func() error { for range ticker.C { select { case <-ctx.Done(): - cancle() + cancel() return errors.New("the docker service cannot be restarted") default: stdout, err := cmd.Exec("systemctl is-active docker") @@ -194,16 +194,16 @@ func (u *ImageRepoService) handleRegistries(newHost, delHost, handle string) err _, _ = os.Create(constant.DaemonJsonPath) } - deamonMap := make(map[string]interface{}) + daemonMap := make(map[string]interface{}) file, err := os.ReadFile(constant.DaemonJsonPath) if err != nil { return err } - if err := json.Unmarshal(file, &deamonMap); err != nil { + if err := json.Unmarshal(file, &daemonMap); err != nil { return err } - iRegistries := deamonMap["insecure-registries"] + iRegistries := daemonMap["insecure-registries"] registries, _ := iRegistries.([]interface{}) switch handle { case "create": @@ -223,11 +223,11 @@ func (u *ImageRepoService) handleRegistries(newHost, delHost, handle string) err } } if len(registries) == 0 { - delete(deamonMap, "insecure-registries") + delete(daemonMap, "insecure-registries") } else { - deamonMap["insecure-registries"] = registries + daemonMap["insecure-registries"] = registries } - newJson, err := json.MarshalIndent(deamonMap, "", "\t") + newJson, err := json.MarshalIndent(daemonMap, "", "\t") if err != nil { return err } diff --git a/backend/app/service/snapshot.go b/backend/app/service/snapshot.go index 41e8523aa..1844d9ad1 100644 --- a/backend/app/service/snapshot.go +++ b/backend/app/service/snapshot.go @@ -93,7 +93,7 @@ func (u *SnapshotService) UpdateDescription(req dto.UpdateDescription) error { type SnapshotJson struct { OldBaseDir string `json:"oldBaseDir"` OldDockerDataDir string `json:"oldDockerDataDir"` - OldBackupDataDir string `json:"oldDackupDataDir"` + OldBackupDataDir string `json:"oldBackupDataDir"` OldPanelDataDir string `json:"oldPanelDataDir"` BaseDir string `json:"baseDir"` @@ -113,7 +113,7 @@ func (u *SnapshotService) SnapshotCreate(req dto.SnapshotCreate) error { if err != nil { return err } - backupAccont, err := NewIBackupService().NewClient(&backup) + backupAccount, err := NewIBackupService().NewClient(&backup) if err != nil { return err } @@ -202,7 +202,7 @@ func (u *SnapshotService) SnapshotCreate(req dto.SnapshotCreate) error { global.LOG.Infof("start to upload snapshot to %s, please wait", backup.Type) _ = snapshotRepo.Update(snap.ID, map[string]interface{}{"status": constant.StatusUploading}) localPath := fmt.Sprintf("%s/system/1panel_%s_%s.tar.gz", localDir, versionItem.Value, timeNow) - if ok, err := backupAccont.Upload(localPath, fmt.Sprintf("system_snapshot/1panel_%s_%s.tar.gz", versionItem.Value, timeNow)); err != nil || !ok { + if ok, err := backupAccount.Upload(localPath, fmt.Sprintf("system_snapshot/1panel_%s_%s.tar.gz", versionItem.Value, timeNow)); err != nil || !ok { _ = snapshotRepo.Update(snap.ID, map[string]interface{}{"status": constant.StatusFailed, "message": err.Error()}) global.LOG.Errorf("upload snapshot to %s failed, err: %v", backup.Type, err) return @@ -796,15 +796,15 @@ func (u *SnapshotService) updateLiveRestore(enabled bool) error { if err != nil { return err } - deamonMap := make(map[string]interface{}) - _ = json.Unmarshal(file, &deamonMap) + daemonMap := make(map[string]interface{}) + _ = json.Unmarshal(file, &daemonMap) if !enabled { - delete(deamonMap, "live-restore") + delete(daemonMap, "live-restore") } else { - deamonMap["live-restore"] = enabled + daemonMap["live-restore"] = enabled } - newJson, err := json.MarshalIndent(deamonMap, "", "\t") + newJson, err := json.MarshalIndent(daemonMap, "", "\t") if err != nil { return err } @@ -818,8 +818,8 @@ func (u *SnapshotService) updateLiveRestore(enabled bool) error { } ticker := time.NewTicker(3 * time.Second) - ctx, cancle := context.WithTimeout(context.Background(), time.Second*30) - defer cancle() + ctx, cancel := context.WithTimeout(context.Background(), time.Second*30) + defer cancel() for range ticker.C { select { case <-ctx.Done(): diff --git a/backend/app/service/ssh.go b/backend/app/service/ssh.go index 3676911e4..af6e3fb78 100644 --- a/backend/app/service/ssh.go +++ b/backend/app/service/ssh.go @@ -46,11 +46,7 @@ func (u *SSHService) GetSSHInfo() (*dto.SSHInfo, error) { PermitRootLogin: "yes", UseDNS: "yes", } - sudo := "" - hasSudo := cmd.HasNoPasswordSudo() - if hasSudo { - sudo = "sudo" - } + sudo := cmd.SudoHandleCmd() stdout, err := cmd.Execf("%s systemctl status sshd", sudo) if err != nil { return &data, nil @@ -95,11 +91,7 @@ func (u *SSHService) GetSSHInfo() (*dto.SSHInfo, error) { func (u *SSHService) OperateSSH(operation string) error { if operation == "start" || operation == "stop" || operation == "restart" { - sudo := "" - hasSudo := cmd.HasNoPasswordSudo() - if hasSudo { - sudo = "sudo" - } + sudo := cmd.SudoHandleCmd() stdout, err := cmd.Execf("%s systemctl %s sshd", sudo, operation) if err != nil { return fmt.Errorf("%s sshd failed, stdout: %s, err: %v", operation, stdout, err) @@ -127,11 +119,7 @@ func (u *SSHService) Update(key, value string) error { if _, err = file.WriteString(strings.Join(newFiles, "\n")); err != nil { return err } - sudo := "" - hasSudo := cmd.HasNoPasswordSudo() - if hasSudo { - sudo = "sudo" - } + sudo := cmd.SudoHandleCmd() if key == "Port" { stdout, _ := cmd.Execf("%s getenforce", sudo) if stdout == "Enforcing\n" { @@ -151,11 +139,7 @@ func (u *SSHService) UpdateByFile(value string) error { if _, err = file.WriteString(value); err != nil { return err } - sudo := "" - hasSudo := cmd.HasNoPasswordSudo() - if hasSudo { - sudo = "sudo" - } + sudo := cmd.SudoHandleCmd() _, _ = cmd.Execf("%s systemctl restart sshd", sudo) return nil } diff --git a/backend/app/service/upgrade.go b/backend/app/service/upgrade.go index 1e2264b4c..2f0e1e346 100644 --- a/backend/app/service/upgrade.go +++ b/backend/app/service/upgrade.go @@ -67,7 +67,7 @@ func (u *UpgradeService) SearchUpgrade() (*dto.UpgradeInfo, error) { notes, err := u.loadReleaseNotes(fmt.Sprintf("%s/%s/%s/release/1panel-%s-release-notes", global.CONF.System.RepoUrl, global.CONF.System.Mode, itemVersion, itemVersion)) if err != nil { - return nil, fmt.Errorf("load relase-notes of version %s failed, err: %v", latestVersion, err) + return nil, fmt.Errorf("load releases-notes of version %s failed, err: %v", latestVersion, err) } upgrade.ReleaseNote = notes return &upgrade, nil @@ -76,7 +76,7 @@ func (u *UpgradeService) SearchUpgrade() (*dto.UpgradeInfo, error) { func (u *UpgradeService) LoadNotes(req dto.Upgrade) (string, error) { notes, err := u.loadReleaseNotes(fmt.Sprintf("%s/%s/%s/release/1panel-%s-release-notes", global.CONF.System.RepoUrl, global.CONF.System.Mode, req.Version, req.Version)) if err != nil { - return "", fmt.Errorf("load relase-notes of version %s failed, err: %v", req.Version, err) + return "", fmt.Errorf("load releases-notes of version %s failed, err: %v", req.Version, err) } return notes, nil } diff --git a/backend/init/hook/hook.go b/backend/init/hook/hook.go index 012cc6eca..96eecd5d4 100644 --- a/backend/init/hook/hook.go +++ b/backend/init/hook/hook.go @@ -57,10 +57,7 @@ func Init() { global.LOG.Fatalf("init entrance before start failed, err: %v", err) } - if cmd.HasNoPasswordSudo() { - _, _ = cmd.Exec("sudo sed -i '/CHANGE_USER_INFO=true/d' /usr/local/bin/1pctl") - } else { - _, _ = cmd.Exec("sed -i '/CHANGE_USER_INFO=true/d' /usr/local/bin/1pctl") - } + sudo := cmd.SudoHandleCmd() + _, _ = cmd.Execf("%s sed -i '/CHANGE_USER_INFO=true/d' /usr/local/bin/1pctl", sudo) } } diff --git a/backend/middleware/operation.go b/backend/middleware/operation.go index 7ed07b2ea..3be2cf389 100644 --- a/backend/middleware/operation.go +++ b/backend/middleware/operation.go @@ -96,10 +96,10 @@ func OperationLog() gin.HandlerFunc { if funcs.InputValue == key { var names []string if funcs.IsList { - sql := fmt.Sprintf("SELECT %s FROM %s where %s in (?);", funcs.OutputColume, funcs.DB, funcs.InputColume) + sql := fmt.Sprintf("SELECT %s FROM %s where %s in (?);", funcs.OutputColumn, funcs.DB, funcs.InputColumn) _ = global.DB.Raw(sql, value).Scan(&names) } else { - _ = global.DB.Raw(fmt.Sprintf("select %s from %s where %s = ?;", funcs.OutputColume, funcs.DB, funcs.InputColume), value).Scan(&names) + _ = global.DB.Raw(fmt.Sprintf("select %s from %s where %s = ?;", funcs.OutputColumn, funcs.DB, funcs.InputColumn), value).Scan(&names) } formatMap[funcs.OutputValue] = strings.Join(names, ",") break @@ -177,11 +177,11 @@ type operationJson struct { FormatEN string `json:"formatEN"` } type functionInfo struct { - InputColume string `json:"input_colume"` + InputColumn string `json:"input_column"` InputValue string `json:"input_value"` IsList bool `json:"isList"` DB string `json:"db"` - OutputColume string `json:"output_colume"` + OutputColumn string `json:"output_column"` OutputValue string `json:"output_value"` } diff --git a/cmd/server/docs/docs.go b/cmd/server/docs/docs.go index 6f2aa9557..fde7fefd1 100644 --- a/cmd/server/docs/docs.go +++ b/cmd/server/docs/docs.go @@ -201,17 +201,17 @@ var doc = `{ "BeforeFuntions": [ { "db": "app_installs", - "input_colume": "name", + "input_column": "name", "input_value": "name", "isList": false, - "output_colume": "app_id", + "output_column": "app_id", "output_value": "appId" }, { "db": "apps", "info": "appId", "isList": false, - "output_colume": "key", + "output_column": "key", "output_value": "appKey" } ], @@ -463,26 +463,26 @@ var doc = `{ "BeforeFuntions": [ { "db": "app_installs", - "input_colume": "id", + "input_column": "id", "input_value": "installId", "isList": false, - "output_colume": "app_id", + "output_column": "app_id", "output_value": "appId" }, { "db": "app_installs", - "input_colume": "id", + "input_column": "id", "input_value": "installId", "isList": false, - "output_colume": "name", + "output_column": "name", "output_value": "appName" }, { "db": "apps", - "input_colume": "id", + "input_column": "id", "input_value": "appId", "isList": false, - "output_colume": "key", + "output_column": "key", "output_value": "appKey" } ], @@ -1531,10 +1531,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "image_repos", - "input_colume": "id", + "input_column": "id", "input_value": "repoID", "isList": false, - "output_colume": "name", + "output_column": "name", "output_value": "reponame" } ], @@ -1586,10 +1586,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "image_repos", - "input_colume": "id", + "input_column": "id", "input_value": "repoID", "isList": false, - "output_colume": "name", + "output_column": "name", "output_value": "reponame" } ], @@ -1764,10 +1764,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "image_repos", - "input_colume": "id", + "input_column": "id", "input_value": "repoID", "isList": false, - "output_colume": "name", + "output_column": "name", "output_value": "reponame" } ], @@ -1839,7 +1839,7 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.NetworkCreat" + "$ref": "#/definitions/dto.NetworkCreate" } } ], @@ -2135,10 +2135,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "image_repos", - "input_colume": "id", + "input_column": "id", "input_value": "ids", "isList": true, - "output_colume": "name", + "output_column": "name", "output_value": "names" } ], @@ -2267,7 +2267,7 @@ var doc = `{ "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "name", + "output_column": "name", "output_value": "name" } ], @@ -2486,10 +2486,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "compose_templates", - "input_colume": "id", + "input_column": "id", "input_value": "ids", "isList": true, - "output_colume": "name", + "output_column": "name", "output_value": "names" } ], @@ -2576,10 +2576,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "compose_templates", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "name", + "output_column": "name", "output_value": "name" } ], @@ -2614,7 +2614,7 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.VolumeCreat" + "$ref": "#/definitions/dto.VolumeCreate" } } ], @@ -2830,10 +2830,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "cronjobs", - "input_colume": "id", + "input_column": "id", "input_value": "ids", "isList": true, - "output_colume": "name", + "output_column": "name", "output_value": "names" } ], @@ -2881,10 +2881,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "job_records", - "input_colume": "id", + "input_column": "id", "input_value": "recordID", "isList": false, - "output_colume": "file", + "output_column": "file", "output_value": "file" } ], @@ -2932,10 +2932,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "cronjobs", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "name", + "output_column": "name", "output_value": "name" } ], @@ -2983,10 +2983,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "cronjobs", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "name", + "output_column": "name", "output_value": "name" } ], @@ -3106,10 +3106,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "cronjobs", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "name", + "output_column": "name", "output_value": "name" } ], @@ -3158,10 +3158,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "cronjobs", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "name", + "output_column": "name", "output_value": "name" } ], @@ -3355,10 +3355,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "database_mysqls", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "name", + "output_column": "name", "output_value": "name" } ], @@ -3406,10 +3406,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "database_mysqls", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "name", + "output_column": "name", "output_value": "name" } ], @@ -3497,10 +3497,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "database_mysqls", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "name", + "output_column": "name", "output_value": "name" } ], @@ -3584,10 +3584,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "database_mysqls", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "name", + "output_column": "name", "output_value": "name" } ], @@ -4167,6 +4167,48 @@ var doc = `{ } } }, + "/files/chunkdownload": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "分片下载下载文件", + "consumes": [ + "application/json" + ], + "tags": [ + "File" + ], + "summary": "Chunk Download file", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.FileDownload" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "name" + ], + "formatEN": "Download file [name]", + "formatZH": "下载文件 [name]", + "paramKeys": [] + } + } + }, "/files/chunkupload": { "post": { "security": [ @@ -5010,18 +5052,18 @@ var doc = `{ "BeforeFuntions": [ { "db": "groups", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "name", + "output_column": "name", "output_value": "name" }, { "db": "groups", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "type", + "output_column": "type", "output_value": "type" } ], @@ -5064,7 +5106,10 @@ var doc = `{ "200": { "description": "OK", "schema": { - "type": "anrry" + "type": "array", + "items": { + "$ref": "#/definitions/dto.GroupInfo" + } } } } @@ -5540,10 +5585,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "commands", - "input_colume": "id", + "input_column": "id", "input_value": "ids", "isList": true, - "output_colume": "name", + "output_column": "name", "output_value": "names" } ], @@ -5669,10 +5714,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "hosts", - "input_colume": "id", + "input_column": "id", "input_value": "ids", "isList": true, - "output_colume": "addr", + "output_column": "addr", "output_value": "addrs" } ], @@ -6190,10 +6235,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "hosts", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "addr", + "output_column": "addr", "output_value": "addr" } ], @@ -6479,10 +6524,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "websites", - "input_colume": "id", + "input_column": "id", "input_value": "websiteId", "isList": false, - "output_colume": "primary_domain", + "output_column": "primary_domain", "output_value": "domain" } ], @@ -6806,10 +6851,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "backup_accounts", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": true, - "output_colume": "type", + "output_column": "type", "output_value": "types" } ], @@ -6857,10 +6902,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "backup_records", - "input_colume": "id", + "input_column": "id", "input_value": "ids", "isList": true, - "output_colume": "file_name", + "output_column": "file_name", "output_value": "files" } ], @@ -7524,10 +7569,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "snapshots", - "input_colume": "id", + "input_column": "id", "input_value": "ids", "isList": true, - "output_colume": "name", + "output_column": "name", "output_value": "name" } ], @@ -7575,10 +7620,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "snapshots", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "name", + "output_column": "name", "output_value": "name" } ], @@ -7670,10 +7715,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "snapshots", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "name", + "output_column": "name", "output_value": "name" } ], @@ -7721,10 +7766,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "snapshots", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "name", + "output_column": "name", "output_value": "name" } ], @@ -8197,10 +8242,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "websites", - "input_colume": "id", + "input_column": "id", "input_value": "websiteId", "isList": false, - "output_colume": "primary_domain", + "output_column": "primary_domain", "output_value": "domain" } ], @@ -8293,10 +8338,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "website_acme_accounts", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "email", + "output_column": "email", "output_value": "email" } ], @@ -8518,10 +8563,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "websites", - "input_colume": "id", + "input_column": "id", "input_value": "websiteId", "isList": false, - "output_colume": "primary_domain", + "output_column": "primary_domain", "output_value": "domain" } ], @@ -8569,10 +8614,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "websites", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "primary_domain", + "output_column": "primary_domain", "output_value": "domain" } ], @@ -8621,10 +8666,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "websites", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "primary_domain", + "output_column": "primary_domain", "output_value": "domain" } ], @@ -8672,10 +8717,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "websites", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "primary_domain", + "output_column": "primary_domain", "output_value": "domain" } ], @@ -8723,10 +8768,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "websites", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "primary_domain", + "output_column": "primary_domain", "output_value": "domain" } ], @@ -8816,10 +8861,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "website_dns_accounts", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "name", + "output_column": "name", "output_value": "name" } ], @@ -9024,10 +9069,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "website_domains", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "domain", + "output_column": "domain", "output_value": "domain" } ], @@ -9166,10 +9211,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "websites", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "primary_domain", + "output_column": "primary_domain", "output_value": "domain" } ], @@ -9218,10 +9263,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "websites", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "primary_domain", + "output_column": "primary_domain", "output_value": "domain" } ], @@ -9269,10 +9314,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "websites", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "primary_domain", + "output_column": "primary_domain", "output_value": "domain" } ], @@ -9343,10 +9388,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "websites", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "primary_domain", + "output_column": "primary_domain", "output_value": "domain" } ], @@ -9428,10 +9473,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "websites", - "input_colume": "id", + "input_column": "id", "input_value": "websiteId", "isList": false, - "output_colume": "primary_domain", + "output_column": "primary_domain", "output_value": "domain" } ], @@ -9512,10 +9557,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "websites", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "primary_domain", + "output_column": "primary_domain", "output_value": "domain" } ], @@ -9563,10 +9608,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "websites", - "input_colume": "id", + "input_column": "id", "input_value": "websiteID", "isList": false, - "output_colume": "primary_domain", + "output_column": "primary_domain", "output_value": "domain" } ], @@ -9647,10 +9692,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "websites", - "input_colume": "id", + "input_column": "id", "input_value": "websiteID", "isList": false, - "output_colume": "primary_domain", + "output_column": "primary_domain", "output_value": "domain" } ], @@ -9810,10 +9855,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "website_ssls", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "primary_domain", + "output_column": "primary_domain", "output_value": "domain" } ], @@ -9861,10 +9906,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "website_ssls", - "input_colume": "id", + "input_column": "id", "input_value": "SSLId", "isList": false, - "output_colume": "primary_domain", + "output_column": "primary_domain", "output_value": "domain" } ], @@ -9981,10 +10026,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "website_ssls", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "primary_domain", + "output_column": "primary_domain", "output_value": "domain" } ], @@ -10141,10 +10186,10 @@ var doc = `{ "BeforeFuntions": [ { "db": "websites", - "input_colume": "id", + "input_column": "id", "input_value": "websiteId", "isList": false, - "output_colume": "primary_domain", + "output_column": "primary_domain", "output_value": "domain" } ], @@ -11282,6 +11327,23 @@ var doc = `{ } } }, + "dto.GroupInfo": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "isDefault": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, "dto.GroupSearch": { "type": "object", "required": [ @@ -11910,7 +11972,7 @@ var doc = `{ "value": {} } }, - "dto.NetworkCreat": { + "dto.NetworkCreate": { "type": "object", "properties": { "driver": { @@ -12765,7 +12827,7 @@ var doc = `{ } } }, - "dto.VolumeCreat": { + "dto.VolumeCreate": { "type": "object", "properties": { "driver": { @@ -13028,6 +13090,9 @@ var doc = `{ "model.Website": { "type": "object", "properties": { + "IPV6": { + "type": "boolean" + }, "accessLog": { "type": "boolean" }, @@ -14052,6 +14117,9 @@ var doc = `{ "webSiteGroupID" ], "properties": { + "IPV6": { + "type": "boolean" + }, "alias": { "type": "string" }, @@ -14571,6 +14639,9 @@ var doc = `{ "webSiteGroupID" ], "properties": { + "IPV6": { + "type": "boolean" + }, "expireDate": { "type": "string" }, @@ -15002,6 +15073,9 @@ var doc = `{ "response.WebsiteDTO": { "type": "object", "properties": { + "IPV6": { + "type": "boolean" + }, "accessLog": { "type": "boolean" }, diff --git a/cmd/server/docs/swagger.json b/cmd/server/docs/swagger.json index 42442843b..e1a17b870 100644 --- a/cmd/server/docs/swagger.json +++ b/cmd/server/docs/swagger.json @@ -187,17 +187,17 @@ "BeforeFuntions": [ { "db": "app_installs", - "input_colume": "name", + "input_column": "name", "input_value": "name", "isList": false, - "output_colume": "app_id", + "output_column": "app_id", "output_value": "appId" }, { "db": "apps", "info": "appId", "isList": false, - "output_colume": "key", + "output_column": "key", "output_value": "appKey" } ], @@ -449,26 +449,26 @@ "BeforeFuntions": [ { "db": "app_installs", - "input_colume": "id", + "input_column": "id", "input_value": "installId", "isList": false, - "output_colume": "app_id", + "output_column": "app_id", "output_value": "appId" }, { "db": "app_installs", - "input_colume": "id", + "input_column": "id", "input_value": "installId", "isList": false, - "output_colume": "name", + "output_column": "name", "output_value": "appName" }, { "db": "apps", - "input_colume": "id", + "input_column": "id", "input_value": "appId", "isList": false, - "output_colume": "key", + "output_column": "key", "output_value": "appKey" } ], @@ -1517,10 +1517,10 @@ "BeforeFuntions": [ { "db": "image_repos", - "input_colume": "id", + "input_column": "id", "input_value": "repoID", "isList": false, - "output_colume": "name", + "output_column": "name", "output_value": "reponame" } ], @@ -1572,10 +1572,10 @@ "BeforeFuntions": [ { "db": "image_repos", - "input_colume": "id", + "input_column": "id", "input_value": "repoID", "isList": false, - "output_colume": "name", + "output_column": "name", "output_value": "reponame" } ], @@ -1750,10 +1750,10 @@ "BeforeFuntions": [ { "db": "image_repos", - "input_colume": "id", + "input_column": "id", "input_value": "repoID", "isList": false, - "output_colume": "name", + "output_column": "name", "output_value": "reponame" } ], @@ -1825,7 +1825,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.NetworkCreat" + "$ref": "#/definitions/dto.NetworkCreate" } } ], @@ -2121,10 +2121,10 @@ "BeforeFuntions": [ { "db": "image_repos", - "input_colume": "id", + "input_column": "id", "input_value": "ids", "isList": true, - "output_colume": "name", + "output_column": "name", "output_value": "names" } ], @@ -2253,7 +2253,7 @@ "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "name", + "output_column": "name", "output_value": "name" } ], @@ -2472,10 +2472,10 @@ "BeforeFuntions": [ { "db": "compose_templates", - "input_colume": "id", + "input_column": "id", "input_value": "ids", "isList": true, - "output_colume": "name", + "output_column": "name", "output_value": "names" } ], @@ -2562,10 +2562,10 @@ "BeforeFuntions": [ { "db": "compose_templates", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "name", + "output_column": "name", "output_value": "name" } ], @@ -2600,7 +2600,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.VolumeCreat" + "$ref": "#/definitions/dto.VolumeCreate" } } ], @@ -2816,10 +2816,10 @@ "BeforeFuntions": [ { "db": "cronjobs", - "input_colume": "id", + "input_column": "id", "input_value": "ids", "isList": true, - "output_colume": "name", + "output_column": "name", "output_value": "names" } ], @@ -2867,10 +2867,10 @@ "BeforeFuntions": [ { "db": "job_records", - "input_colume": "id", + "input_column": "id", "input_value": "recordID", "isList": false, - "output_colume": "file", + "output_column": "file", "output_value": "file" } ], @@ -2918,10 +2918,10 @@ "BeforeFuntions": [ { "db": "cronjobs", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "name", + "output_column": "name", "output_value": "name" } ], @@ -2969,10 +2969,10 @@ "BeforeFuntions": [ { "db": "cronjobs", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "name", + "output_column": "name", "output_value": "name" } ], @@ -3092,10 +3092,10 @@ "BeforeFuntions": [ { "db": "cronjobs", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "name", + "output_column": "name", "output_value": "name" } ], @@ -3144,10 +3144,10 @@ "BeforeFuntions": [ { "db": "cronjobs", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "name", + "output_column": "name", "output_value": "name" } ], @@ -3341,10 +3341,10 @@ "BeforeFuntions": [ { "db": "database_mysqls", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "name", + "output_column": "name", "output_value": "name" } ], @@ -3392,10 +3392,10 @@ "BeforeFuntions": [ { "db": "database_mysqls", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "name", + "output_column": "name", "output_value": "name" } ], @@ -3483,10 +3483,10 @@ "BeforeFuntions": [ { "db": "database_mysqls", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "name", + "output_column": "name", "output_value": "name" } ], @@ -3570,10 +3570,10 @@ "BeforeFuntions": [ { "db": "database_mysqls", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "name", + "output_column": "name", "output_value": "name" } ], @@ -4153,6 +4153,48 @@ } } }, + "/files/chunkdownload": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "分片下载下载文件", + "consumes": [ + "application/json" + ], + "tags": [ + "File" + ], + "summary": "Chunk Download file", + "parameters": [ + { + "description": "request", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.FileDownload" + } + } + ], + "responses": { + "200": { + "description": "" + } + }, + "x-panel-log": { + "BeforeFuntions": [], + "bodyKeys": [ + "name" + ], + "formatEN": "Download file [name]", + "formatZH": "下载文件 [name]", + "paramKeys": [] + } + } + }, "/files/chunkupload": { "post": { "security": [ @@ -4996,18 +5038,18 @@ "BeforeFuntions": [ { "db": "groups", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "name", + "output_column": "name", "output_value": "name" }, { "db": "groups", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "type", + "output_column": "type", "output_value": "type" } ], @@ -5050,7 +5092,10 @@ "200": { "description": "OK", "schema": { - "type": "anrry" + "type": "array", + "items": { + "$ref": "#/definitions/dto.GroupInfo" + } } } } @@ -5526,10 +5571,10 @@ "BeforeFuntions": [ { "db": "commands", - "input_colume": "id", + "input_column": "id", "input_value": "ids", "isList": true, - "output_colume": "name", + "output_column": "name", "output_value": "names" } ], @@ -5655,10 +5700,10 @@ "BeforeFuntions": [ { "db": "hosts", - "input_colume": "id", + "input_column": "id", "input_value": "ids", "isList": true, - "output_colume": "addr", + "output_column": "addr", "output_value": "addrs" } ], @@ -6176,10 +6221,10 @@ "BeforeFuntions": [ { "db": "hosts", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "addr", + "output_column": "addr", "output_value": "addr" } ], @@ -6465,10 +6510,10 @@ "BeforeFuntions": [ { "db": "websites", - "input_colume": "id", + "input_column": "id", "input_value": "websiteId", "isList": false, - "output_colume": "primary_domain", + "output_column": "primary_domain", "output_value": "domain" } ], @@ -6792,10 +6837,10 @@ "BeforeFuntions": [ { "db": "backup_accounts", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": true, - "output_colume": "type", + "output_column": "type", "output_value": "types" } ], @@ -6843,10 +6888,10 @@ "BeforeFuntions": [ { "db": "backup_records", - "input_colume": "id", + "input_column": "id", "input_value": "ids", "isList": true, - "output_colume": "file_name", + "output_column": "file_name", "output_value": "files" } ], @@ -7510,10 +7555,10 @@ "BeforeFuntions": [ { "db": "snapshots", - "input_colume": "id", + "input_column": "id", "input_value": "ids", "isList": true, - "output_colume": "name", + "output_column": "name", "output_value": "name" } ], @@ -7561,10 +7606,10 @@ "BeforeFuntions": [ { "db": "snapshots", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "name", + "output_column": "name", "output_value": "name" } ], @@ -7656,10 +7701,10 @@ "BeforeFuntions": [ { "db": "snapshots", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "name", + "output_column": "name", "output_value": "name" } ], @@ -7707,10 +7752,10 @@ "BeforeFuntions": [ { "db": "snapshots", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "name", + "output_column": "name", "output_value": "name" } ], @@ -8183,10 +8228,10 @@ "BeforeFuntions": [ { "db": "websites", - "input_colume": "id", + "input_column": "id", "input_value": "websiteId", "isList": false, - "output_colume": "primary_domain", + "output_column": "primary_domain", "output_value": "domain" } ], @@ -8279,10 +8324,10 @@ "BeforeFuntions": [ { "db": "website_acme_accounts", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "email", + "output_column": "email", "output_value": "email" } ], @@ -8504,10 +8549,10 @@ "BeforeFuntions": [ { "db": "websites", - "input_colume": "id", + "input_column": "id", "input_value": "websiteId", "isList": false, - "output_colume": "primary_domain", + "output_column": "primary_domain", "output_value": "domain" } ], @@ -8555,10 +8600,10 @@ "BeforeFuntions": [ { "db": "websites", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "primary_domain", + "output_column": "primary_domain", "output_value": "domain" } ], @@ -8607,10 +8652,10 @@ "BeforeFuntions": [ { "db": "websites", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "primary_domain", + "output_column": "primary_domain", "output_value": "domain" } ], @@ -8658,10 +8703,10 @@ "BeforeFuntions": [ { "db": "websites", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "primary_domain", + "output_column": "primary_domain", "output_value": "domain" } ], @@ -8709,10 +8754,10 @@ "BeforeFuntions": [ { "db": "websites", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "primary_domain", + "output_column": "primary_domain", "output_value": "domain" } ], @@ -8802,10 +8847,10 @@ "BeforeFuntions": [ { "db": "website_dns_accounts", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "name", + "output_column": "name", "output_value": "name" } ], @@ -9010,10 +9055,10 @@ "BeforeFuntions": [ { "db": "website_domains", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "domain", + "output_column": "domain", "output_value": "domain" } ], @@ -9152,10 +9197,10 @@ "BeforeFuntions": [ { "db": "websites", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "primary_domain", + "output_column": "primary_domain", "output_value": "domain" } ], @@ -9204,10 +9249,10 @@ "BeforeFuntions": [ { "db": "websites", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "primary_domain", + "output_column": "primary_domain", "output_value": "domain" } ], @@ -9255,10 +9300,10 @@ "BeforeFuntions": [ { "db": "websites", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "primary_domain", + "output_column": "primary_domain", "output_value": "domain" } ], @@ -9329,10 +9374,10 @@ "BeforeFuntions": [ { "db": "websites", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "primary_domain", + "output_column": "primary_domain", "output_value": "domain" } ], @@ -9414,10 +9459,10 @@ "BeforeFuntions": [ { "db": "websites", - "input_colume": "id", + "input_column": "id", "input_value": "websiteId", "isList": false, - "output_colume": "primary_domain", + "output_column": "primary_domain", "output_value": "domain" } ], @@ -9498,10 +9543,10 @@ "BeforeFuntions": [ { "db": "websites", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "primary_domain", + "output_column": "primary_domain", "output_value": "domain" } ], @@ -9549,10 +9594,10 @@ "BeforeFuntions": [ { "db": "websites", - "input_colume": "id", + "input_column": "id", "input_value": "websiteID", "isList": false, - "output_colume": "primary_domain", + "output_column": "primary_domain", "output_value": "domain" } ], @@ -9633,10 +9678,10 @@ "BeforeFuntions": [ { "db": "websites", - "input_colume": "id", + "input_column": "id", "input_value": "websiteID", "isList": false, - "output_colume": "primary_domain", + "output_column": "primary_domain", "output_value": "domain" } ], @@ -9796,10 +9841,10 @@ "BeforeFuntions": [ { "db": "website_ssls", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "primary_domain", + "output_column": "primary_domain", "output_value": "domain" } ], @@ -9847,10 +9892,10 @@ "BeforeFuntions": [ { "db": "website_ssls", - "input_colume": "id", + "input_column": "id", "input_value": "SSLId", "isList": false, - "output_colume": "primary_domain", + "output_column": "primary_domain", "output_value": "domain" } ], @@ -9967,10 +10012,10 @@ "BeforeFuntions": [ { "db": "website_ssls", - "input_colume": "id", + "input_column": "id", "input_value": "id", "isList": false, - "output_colume": "primary_domain", + "output_column": "primary_domain", "output_value": "domain" } ], @@ -10127,10 +10172,10 @@ "BeforeFuntions": [ { "db": "websites", - "input_colume": "id", + "input_column": "id", "input_value": "websiteId", "isList": false, - "output_colume": "primary_domain", + "output_column": "primary_domain", "output_value": "domain" } ], @@ -11268,6 +11313,23 @@ } } }, + "dto.GroupInfo": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "isDefault": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, "dto.GroupSearch": { "type": "object", "required": [ @@ -11896,7 +11958,7 @@ "value": {} } }, - "dto.NetworkCreat": { + "dto.NetworkCreate": { "type": "object", "properties": { "driver": { @@ -12751,7 +12813,7 @@ } } }, - "dto.VolumeCreat": { + "dto.VolumeCreate": { "type": "object", "properties": { "driver": { @@ -13014,6 +13076,9 @@ "model.Website": { "type": "object", "properties": { + "IPV6": { + "type": "boolean" + }, "accessLog": { "type": "boolean" }, @@ -14038,6 +14103,9 @@ "webSiteGroupID" ], "properties": { + "IPV6": { + "type": "boolean" + }, "alias": { "type": "string" }, @@ -14557,6 +14625,9 @@ "webSiteGroupID" ], "properties": { + "IPV6": { + "type": "boolean" + }, "expireDate": { "type": "string" }, @@ -14988,6 +15059,9 @@ "response.WebsiteDTO": { "type": "object", "properties": { + "IPV6": { + "type": "boolean" + }, "accessLog": { "type": "boolean" }, diff --git a/cmd/server/docs/swagger.yaml b/cmd/server/docs/swagger.yaml index aefffd2f2..551e260cf 100644 --- a/cmd/server/docs/swagger.yaml +++ b/cmd/server/docs/swagger.yaml @@ -758,6 +758,17 @@ definitions: - name - type type: object + dto.GroupInfo: + properties: + id: + type: integer + isDefault: + type: boolean + name: + type: string + type: + type: string + type: object dto.GroupSearch: properties: type: @@ -1177,7 +1188,7 @@ definitions: type: string value: {} type: object - dto.NetworkCreat: + dto.NetworkCreate: properties: driver: type: string @@ -1745,7 +1756,7 @@ definitions: token: type: string type: object - dto.VolumeCreat: + dto.VolumeCreate: properties: driver: type: string @@ -1918,6 +1929,8 @@ definitions: type: object model.Website: properties: + IPV6: + type: boolean accessLog: type: boolean alias: @@ -2598,6 +2611,8 @@ definitions: type: object request.WebsiteCreate: properties: + IPV6: + type: boolean alias: type: string appID: @@ -2950,6 +2965,8 @@ definitions: type: object request.WebsiteUpdate: properties: + IPV6: + type: boolean expireDate: type: string id: @@ -3240,6 +3257,8 @@ definitions: type: object response.WebsiteDTO: properties: + IPV6: + type: boolean accessLog: type: boolean accessLogPath: @@ -3465,15 +3484,15 @@ paths: x-panel-log: BeforeFuntions: - db: app_installs - input_colume: name + input_column: name input_value: name isList: false - output_colume: app_id + output_column: app_id output_value: appId - db: apps info: appId isList: false - output_colume: key + output_column: key output_value: appKey bodyKeys: - name @@ -3629,22 +3648,22 @@ paths: x-panel-log: BeforeFuntions: - db: app_installs - input_colume: id + input_column: id input_value: installId isList: false - output_colume: app_id + output_column: app_id output_value: appId - db: app_installs - input_colume: id + input_column: id input_value: installId isList: false - output_colume: name + output_column: name output_value: appName - db: apps - input_colume: id + input_column: id input_value: appId isList: false - output_colume: key + output_column: key output_value: appKey bodyKeys: - installId @@ -4310,10 +4329,10 @@ paths: x-panel-log: BeforeFuntions: - db: image_repos - input_colume: id + input_column: id input_value: repoID isList: false - output_colume: name + output_column: name output_value: reponame bodyKeys: - repoID @@ -4346,10 +4365,10 @@ paths: x-panel-log: BeforeFuntions: - db: image_repos - input_colume: id + input_column: id input_value: repoID isList: false - output_colume: name + output_column: name output_value: reponame bodyKeys: - repoID @@ -4461,10 +4480,10 @@ paths: x-panel-log: BeforeFuntions: - db: image_repos - input_colume: id + input_column: id input_value: repoID isList: false - output_colume: name + output_column: name output_value: reponame bodyKeys: - repoID @@ -4505,7 +4524,7 @@ paths: name: request required: true schema: - $ref: '#/definitions/dto.NetworkCreat' + $ref: '#/definitions/dto.NetworkCreate' responses: "200": description: "" @@ -4698,10 +4717,10 @@ paths: x-panel-log: BeforeFuntions: - db: image_repos - input_colume: id + input_column: id input_value: ids isList: true - output_colume: name + output_column: name output_value: names bodyKeys: - ids @@ -4782,7 +4801,7 @@ paths: input_column: id input_value: id isList: false - output_colume: name + output_column: name output_value: name bodyKeys: - id @@ -4918,10 +4937,10 @@ paths: x-panel-log: BeforeFuntions: - db: compose_templates - input_colume: id + input_column: id input_value: ids isList: true - output_colume: name + output_column: name output_value: names bodyKeys: - ids @@ -4975,10 +4994,10 @@ paths: x-panel-log: BeforeFuntions: - db: compose_templates - input_colume: id + input_column: id input_value: id isList: false - output_colume: name + output_column: name output_value: name bodyKeys: - id @@ -4996,7 +5015,7 @@ paths: name: request required: true schema: - $ref: '#/definitions/dto.VolumeCreat' + $ref: '#/definitions/dto.VolumeCreate' responses: "200": description: "" @@ -5137,10 +5156,10 @@ paths: x-panel-log: BeforeFuntions: - db: cronjobs - input_colume: id + input_column: id input_value: ids isList: true - output_colume: name + output_column: name output_value: names bodyKeys: - ids @@ -5170,10 +5189,10 @@ paths: x-panel-log: BeforeFuntions: - db: job_records - input_colume: id + input_column: id input_value: recordID isList: false - output_colume: file + output_column: file output_value: file bodyKeys: - recordID @@ -5203,10 +5222,10 @@ paths: x-panel-log: BeforeFuntions: - db: cronjobs - input_colume: id + input_column: id input_value: id isList: false - output_colume: name + output_column: name output_value: name bodyKeys: - id @@ -5236,10 +5255,10 @@ paths: x-panel-log: BeforeFuntions: - db: cronjobs - input_colume: id + input_column: id input_value: id isList: false - output_colume: name + output_column: name output_value: name bodyKeys: - id @@ -5313,10 +5332,10 @@ paths: x-panel-log: BeforeFuntions: - db: cronjobs - input_colume: id + input_column: id input_value: id isList: false - output_colume: name + output_column: name output_value: name bodyKeys: - id @@ -5347,10 +5366,10 @@ paths: x-panel-log: BeforeFuntions: - db: cronjobs - input_colume: id + input_column: id input_value: id isList: false - output_colume: name + output_column: name output_value: name bodyKeys: - id @@ -5472,10 +5491,10 @@ paths: x-panel-log: BeforeFuntions: - db: database_mysqls - input_colume: id + input_column: id input_value: id isList: false - output_colume: name + output_column: name output_value: name bodyKeys: - id @@ -5505,10 +5524,10 @@ paths: x-panel-log: BeforeFuntions: - db: database_mysqls - input_colume: id + input_column: id input_value: id isList: false - output_colume: name + output_column: name output_value: name bodyKeys: - id @@ -5564,10 +5583,10 @@ paths: x-panel-log: BeforeFuntions: - db: database_mysqls - input_colume: id + input_column: id input_value: id isList: false - output_colume: name + output_column: name output_value: name bodyKeys: - id @@ -5619,10 +5638,10 @@ paths: x-panel-log: BeforeFuntions: - db: database_mysqls - input_colume: id + input_column: id input_value: id isList: false - output_colume: name + output_column: name output_value: name bodyKeys: - id @@ -5985,6 +6004,33 @@ paths: formatEN: Check whether file [path] exists formatZH: 检测文件 [path] 是否存在 paramKeys: [] + /files/chunkdownload: + post: + consumes: + - application/json + description: 分片下载下载文件 + parameters: + - description: request + in: body + name: request + required: true + schema: + $ref: '#/definitions/request.FileDownload' + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Chunk Download file + tags: + - File + x-panel-log: + BeforeFuntions: [] + bodyKeys: + - name + formatEN: Download file [name] + formatZH: 下载文件 [name] + paramKeys: [] /files/chunkupload: post: description: 分片上传文件 @@ -6525,16 +6571,16 @@ paths: x-panel-log: BeforeFuntions: - db: groups - input_colume: id + input_column: id input_value: id isList: false - output_colume: name + output_column: name output_value: name - db: groups - input_colume: id + input_column: id input_value: id isList: false - output_colume: type + output_column: type output_value: type bodyKeys: - id @@ -6557,7 +6603,9 @@ paths: "200": description: OK schema: - type: anrry + items: + $ref: '#/definitions/dto.GroupInfo' + type: array security: - ApiKeyAuth: [] summary: List groups @@ -6863,10 +6911,10 @@ paths: x-panel-log: BeforeFuntions: - db: commands - input_colume: id + input_column: id input_value: ids isList: true - output_colume: name + output_column: name output_value: names bodyKeys: - ids @@ -6945,10 +6993,10 @@ paths: x-panel-log: BeforeFuntions: - db: hosts - input_colume: id + input_column: id input_value: ids isList: true - output_colume: addr + output_column: addr output_value: addrs bodyKeys: - ids @@ -7271,10 +7319,10 @@ paths: x-panel-log: BeforeFuntions: - db: hosts - input_colume: id + input_column: id input_value: id isList: false - output_colume: addr + output_column: addr output_value: addr bodyKeys: - id @@ -7452,10 +7500,10 @@ paths: x-panel-log: BeforeFuntions: - db: websites - input_colume: id + input_column: id input_value: websiteId isList: false - output_colume: primary_domain + output_column: primary_domain output_value: domain bodyKeys: - websiteId @@ -7661,10 +7709,10 @@ paths: x-panel-log: BeforeFuntions: - db: backup_accounts - input_colume: id + input_column: id input_value: id isList: true - output_colume: type + output_column: type output_value: types bodyKeys: - id @@ -7694,10 +7742,10 @@ paths: x-panel-log: BeforeFuntions: - db: backup_records - input_colume: id + input_column: id input_value: ids isList: true - output_colume: file_name + output_column: file_name output_value: files bodyKeys: - ids @@ -8118,10 +8166,10 @@ paths: x-panel-log: BeforeFuntions: - db: snapshots - input_colume: id + input_column: id input_value: ids isList: true - output_colume: name + output_column: name output_value: name bodyKeys: - ids @@ -8151,10 +8199,10 @@ paths: x-panel-log: BeforeFuntions: - db: snapshots - input_colume: id + input_column: id input_value: id isList: false - output_colume: name + output_column: name output_value: name bodyKeys: - id @@ -8213,10 +8261,10 @@ paths: x-panel-log: BeforeFuntions: - db: snapshots - input_colume: id + input_column: id input_value: id isList: false - output_colume: name + output_column: name output_value: name bodyKeys: - id @@ -8246,10 +8294,10 @@ paths: x-panel-log: BeforeFuntions: - db: snapshots - input_colume: id + input_column: id input_value: id isList: false - output_colume: name + output_column: name output_value: name bodyKeys: - id @@ -8546,10 +8594,10 @@ paths: x-panel-log: BeforeFuntions: - db: websites - input_colume: id + input_column: id input_value: websiteId isList: false - output_colume: primary_domain + output_column: primary_domain output_value: domain bodyKeys: - websiteId @@ -8608,10 +8656,10 @@ paths: x-panel-log: BeforeFuntions: - db: website_acme_accounts - input_colume: id + input_column: id input_value: id isList: false - output_colume: email + output_column: email output_value: email bodyKeys: - id @@ -8747,10 +8795,10 @@ paths: x-panel-log: BeforeFuntions: - db: websites - input_colume: id + input_column: id input_value: websiteId isList: false - output_colume: primary_domain + output_column: primary_domain output_value: domain bodyKeys: - websiteId @@ -8780,10 +8828,10 @@ paths: x-panel-log: BeforeFuntions: - db: websites - input_colume: id + input_column: id input_value: id isList: false - output_colume: primary_domain + output_column: primary_domain output_value: domain bodyKeys: - id @@ -8814,10 +8862,10 @@ paths: x-panel-log: BeforeFuntions: - db: websites - input_colume: id + input_column: id input_value: id isList: false - output_colume: primary_domain + output_column: primary_domain output_value: domain bodyKeys: - id @@ -8847,10 +8895,10 @@ paths: x-panel-log: BeforeFuntions: - db: websites - input_colume: id + input_column: id input_value: id isList: false - output_colume: primary_domain + output_column: primary_domain output_value: domain bodyKeys: - id @@ -8880,10 +8928,10 @@ paths: x-panel-log: BeforeFuntions: - db: websites - input_colume: id + input_column: id input_value: id isList: false - output_colume: primary_domain + output_column: primary_domain output_value: domain bodyKeys: - id @@ -8940,10 +8988,10 @@ paths: x-panel-log: BeforeFuntions: - db: website_dns_accounts - input_colume: id + input_column: id input_value: id isList: false - output_colume: name + output_column: name output_value: name bodyKeys: - id @@ -9072,10 +9120,10 @@ paths: x-panel-log: BeforeFuntions: - db: website_domains - input_colume: id + input_column: id input_value: id isList: false - output_colume: domain + output_column: domain output_value: domain bodyKeys: - id @@ -9160,10 +9208,10 @@ paths: x-panel-log: BeforeFuntions: - db: websites - input_colume: id + input_column: id input_value: id isList: false - output_colume: primary_domain + output_column: primary_domain output_value: domain bodyKeys: - id @@ -9194,10 +9242,10 @@ paths: x-panel-log: BeforeFuntions: - db: websites - input_colume: id + input_column: id input_value: id isList: false - output_colume: primary_domain + output_column: primary_domain output_value: domain bodyKeys: - id @@ -9227,10 +9275,10 @@ paths: x-panel-log: BeforeFuntions: - db: websites - input_colume: id + input_column: id input_value: id isList: false - output_colume: primary_domain + output_column: primary_domain output_value: domain bodyKeys: - id @@ -9274,10 +9322,10 @@ paths: x-panel-log: BeforeFuntions: - db: websites - input_colume: id + input_column: id input_value: id isList: false - output_colume: primary_domain + output_column: primary_domain output_value: domain bodyKeys: - id @@ -9328,10 +9376,10 @@ paths: x-panel-log: BeforeFuntions: - db: websites - input_colume: id + input_column: id input_value: websiteId isList: false - output_colume: primary_domain + output_column: primary_domain output_value: domain bodyKeys: - websiteId @@ -9381,10 +9429,10 @@ paths: x-panel-log: BeforeFuntions: - db: websites - input_colume: id + input_column: id input_value: id isList: false - output_colume: primary_domain + output_column: primary_domain output_value: domain bodyKeys: - id @@ -9414,10 +9462,10 @@ paths: x-panel-log: BeforeFuntions: - db: websites - input_colume: id + input_column: id input_value: websiteID isList: false - output_colume: primary_domain + output_column: primary_domain output_value: domain bodyKeys: - websiteID @@ -9467,10 +9515,10 @@ paths: x-panel-log: BeforeFuntions: - db: websites - input_colume: id + input_column: id input_value: websiteID isList: false - output_colume: primary_domain + output_column: primary_domain output_value: domain bodyKeys: - websiteID @@ -9570,10 +9618,10 @@ paths: x-panel-log: BeforeFuntions: - db: website_ssls - input_colume: id + input_column: id input_value: id isList: false - output_colume: primary_domain + output_column: primary_domain output_value: domain bodyKeys: - id @@ -9603,10 +9651,10 @@ paths: x-panel-log: BeforeFuntions: - db: website_ssls - input_colume: id + input_column: id input_value: SSLId isList: false - output_colume: primary_domain + output_column: primary_domain output_value: domain bodyKeys: - SSLId @@ -9678,10 +9726,10 @@ paths: x-panel-log: BeforeFuntions: - db: website_ssls - input_colume: id + input_column: id input_value: id isList: false - output_colume: primary_domain + output_column: primary_domain output_value: domain bodyKeys: - id @@ -9779,10 +9827,10 @@ paths: x-panel-log: BeforeFuntions: - db: websites - input_colume: id + input_column: id input_value: websiteId isList: false - output_colume: primary_domain + output_column: primary_domain output_value: domain bodyKeys: - websiteId diff --git a/frontend/src/components/confirm-dialog/index.vue b/frontend/src/components/confirm-dialog/index.vue index e9650b721..92338d8d6 100644 --- a/frontend/src/components/confirm-dialog/index.vue +++ b/frontend/src/components/confirm-dialog/index.vue @@ -15,7 +15,7 @@ diff --git a/frontend/src/views/container/volume/create/index.vue b/frontend/src/views/container/volume/create/index.vue index 66903462e..0515ef355 100644 --- a/frontend/src/views/container/volume/create/index.vue +++ b/frontend/src/views/container/volume/create/index.vue @@ -40,7 +40,7 @@ diff --git a/frontend/src/views/cronjob/index.vue b/frontend/src/views/cronjob/index.vue index 6a2274044..517d2d591 100644 --- a/frontend/src/views/cronjob/index.vue +++ b/frontend/src/views/cronjob/index.vue @@ -101,9 +101,9 @@ - + diff --git a/frontend/src/views/cronjob/record/index.vue b/frontend/src/views/cronjob/record/index.vue index eeafd6244..732916c9b 100644 --- a/frontend/src/views/cronjob/record/index.vue +++ b/frontend/src/views/cronjob/record/index.vue @@ -385,7 +385,7 @@ const shortcuts = [ }, }, { - text: i18n.global.t('monitor.yestoday'), + text: i18n.global.t('monitor.yesterday'), value: () => { const itemDate = new Date(new Date().getTime() - 3600 * 1000 * 24 * 1); const end = new Date(itemDate.setHours(23, 59, 59, 999)); diff --git a/frontend/src/views/database/mysql/setting/slow-log/index.vue b/frontend/src/views/database/mysql/setting/slow-log/index.vue index 3f3595ef2..69191d54a 100644 --- a/frontend/src/views/database/mysql/setting/slow-log/index.vue +++ b/frontend/src/views/database/mysql/setting/slow-log/index.vue @@ -43,7 +43,7 @@ />
- +