From 66aeb38419dc8d7f4e8b3bfe07cf00204213c21b Mon Sep 17 00:00:00 2001 From: ChengPlay <31820853+zhengkunwang223@users.noreply.github.com> Date: Fri, 18 Apr 2025 15:44:28 +0800 Subject: [PATCH] feat: Ignore application upgrades to bypass all subsequent versions (#8418) Refs https://github.com/1Panel-dev/1Panel/issues/6978 --- agent/app/api/v2/ai.go | 6 +- agent/app/api/v2/app.go | 22 +---- agent/app/api/v2/app_ignore_upgrade.go | 66 +++++++++++++ agent/app/api/v2/app_install.go | 31 +------ agent/app/api/v2/backup.go | 22 ++--- agent/app/api/v2/clam.go | 16 ++-- agent/app/api/v2/compose_template.go | 6 +- agent/app/api/v2/container.go | 30 +++--- agent/app/api/v2/cronjob.go | 12 +-- agent/app/api/v2/dashboard.go | 4 +- agent/app/api/v2/database.go | 6 +- agent/app/api/v2/database_common.go | 2 +- agent/app/api/v2/database_mysql.go | 16 ++-- agent/app/api/v2/database_postgresql.go | 14 +-- agent/app/api/v2/database_redis.go | 8 +- agent/app/api/v2/device.go | 12 +-- agent/app/api/v2/docker.go | 10 +- agent/app/api/v2/entry.go | 5 +- agent/app/api/v2/fail2ban.go | 8 +- agent/app/api/v2/favorite.go | 2 +- agent/app/api/v2/file.go | 22 ++--- agent/app/api/v2/firewall.go | 16 ++-- agent/app/api/v2/ftp.go | 10 +- agent/app/api/v2/group.go | 6 +- agent/app/api/v2/health.go | 2 +- agent/app/api/v2/helper/helper.go | 2 +- agent/app/api/v2/host_tool.go | 6 +- agent/app/api/v2/image.go | 12 +-- agent/app/api/v2/image_repo.go | 8 +- agent/app/api/v2/monitor.go | 4 +- agent/app/api/v2/nginx.go | 8 +- agent/app/api/v2/php_extensions.go | 6 +- agent/app/api/v2/process.go | 2 +- agent/app/api/v2/recycle_bin.go | 4 +- agent/app/api/v2/runtime.go | 22 ++--- agent/app/api/v2/setting.go | 4 +- agent/app/api/v2/snapshot.go | 14 +-- agent/app/api/v2/ssh.go | 8 +- agent/app/api/v2/website.go | 58 ++++++------ agent/app/api/v2/website_acme_account.go | 2 +- agent/app/api/v2/website_ca.go | 4 +- agent/app/api/v2/website_dns_account.go | 6 +- agent/app/api/v2/website_domain.go | 4 +- agent/app/api/v2/website_ssl.go | 8 +- agent/app/dto/request/app_ignore_upgrade.go | 7 ++ agent/app/dto/request/common.go | 5 + agent/app/dto/response/app_ignore_upgrade.go | 10 ++ agent/app/model/app_detail.go | 1 - agent/app/model/app_ignore_upgrade.go | 8 ++ agent/app/repo/app_ignore_upgrade.go | 41 ++++++++ agent/app/repo/app_install_resource.go | 2 +- agent/app/service/app.go | 22 ----- agent/app/service/app_ingore_upgrade.go | 76 +++++++++++++++ agent/app/service/app_install.go | 13 +-- agent/app/service/app_utils.go | 7 +- agent/app/service/entry.go | 1 + agent/app/service/nginx_utils.go | 7 +- agent/i18n/lang/zh.yaml | 1 + agent/init/migration/migrate.go | 1 + agent/init/migration/migrations/init.go | 11 +++ agent/router/ro_app.go | 7 +- core/app/api/v2/auth.go | 2 +- core/app/api/v2/backup.go | 2 +- frontend/src/api/interface/app.ts | 14 ++- frontend/src/api/modules/app.ts | 6 +- frontend/src/api/modules/website.ts | 2 +- frontend/src/global/mimetype.ts | 20 ++++ frontend/src/lang/modules/en.ts | 7 ++ frontend/src/lang/modules/ja.ts | 7 ++ frontend/src/lang/modules/ko.ts | 7 ++ frontend/src/lang/modules/ms.ts | 7 ++ frontend/src/lang/modules/pt-br.ts | 7 ++ frontend/src/lang/modules/ru.ts | 7 ++ frontend/src/lang/modules/zh-Hant.ts | 7 ++ frontend/src/lang/modules/zh.ts | 7 ++ .../installed/ignore/create/index.vue | 93 +++++++++++++++++++ .../app-store/installed/ignore/index.vue | 11 ++- .../src/views/app-store/installed/index.vue | 11 ++- .../app-store/installed/upgrade/index.vue | 16 +++- .../src/views/website/ssl/create/index.vue | 2 +- 80 files changed, 684 insertions(+), 307 deletions(-) create mode 100644 agent/app/api/v2/app_ignore_upgrade.go create mode 100644 agent/app/dto/request/app_ignore_upgrade.go create mode 100644 agent/app/dto/request/common.go create mode 100644 agent/app/dto/response/app_ignore_upgrade.go create mode 100644 agent/app/model/app_ignore_upgrade.go create mode 100644 agent/app/repo/app_ignore_upgrade.go create mode 100644 agent/app/service/app_ingore_upgrade.go create mode 100644 frontend/src/views/app-store/installed/ignore/create/index.vue diff --git a/agent/app/api/v2/ai.go b/agent/app/api/v2/ai.go index cccf13d43..8b24a0a93 100644 --- a/agent/app/api/v2/ai.go +++ b/agent/app/api/v2/ai.go @@ -160,7 +160,7 @@ func (b *BaseApi) DeleteOllamaModel(c *gin.Context) { return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags AI @@ -211,7 +211,7 @@ func (b *BaseApi) BindDomain(c *gin.Context) { helper.BadRequest(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags AI @@ -252,5 +252,5 @@ func (b *BaseApi) UpdateBindDomain(c *gin.Context) { helper.BadRequest(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } diff --git a/agent/app/api/v2/app.go b/agent/app/api/v2/app.go index 7f1cf22fe..cfdf7fb50 100644 --- a/agent/app/api/v2/app.go +++ b/agent/app/api/v2/app.go @@ -58,7 +58,7 @@ func (b *BaseApi) SyncApp(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags App @@ -74,7 +74,7 @@ func (b *BaseApi) SyncLocalApp(c *gin.Context) { return } go appService.SyncAppListFromLocal(req.TaskID) - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags App @@ -147,22 +147,6 @@ func (b *BaseApi) GetAppDetailByID(c *gin.Context) { helper.SuccessWithData(c, appDetailDTO) } -// @Tags App -// @Summary Get Ignore App -// @Accept json -// @Success 200 {array} response.IgnoredApp -// @Security ApiKeyAuth -// @Security Timestamp -// @Router /apps/ignored [get] -func (b *BaseApi) GetIgnoredApp(c *gin.Context) { - res, err := appService.GetIgnoredApp() - if err != nil { - helper.InternalServer(c, err) - return - } - helper.SuccessWithData(c, res) -} - // @Tags App // @Summary Install app // @Accept json @@ -227,7 +211,7 @@ func (b *BaseApi) UpdateAppstoreConfig(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags App diff --git a/agent/app/api/v2/app_ignore_upgrade.go b/agent/app/api/v2/app_ignore_upgrade.go new file mode 100644 index 000000000..48073a401 --- /dev/null +++ b/agent/app/api/v2/app_ignore_upgrade.go @@ -0,0 +1,66 @@ +package v2 + +import ( + "github.com/1Panel-dev/1Panel/agent/app/api/v2/helper" + "github.com/1Panel-dev/1Panel/agent/app/dto/request" + "github.com/gin-gonic/gin" +) + +// @Tags App +// @Summary List Upgrade Ignored App +// @Accept json +// @Success 200 {array} model.AppIgnoreUpgrade +// @Security ApiKeyAuth +// @Security Timestamp +// @Router /apps/ignored/detail [get] +func (b *BaseApi) ListAppIgnored(c *gin.Context) { + res, err := appIgnoreUpgradeService.List() + if err != nil { + helper.InternalServer(c, err) + return + } + helper.SuccessWithData(c, res) +} + +// @Tags App +// @Summary Ignore Upgrade App +// @Accept json +// @Param request body request.AppIgnoreUpgradeReq true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Security Timestamp +// @Router /apps/installed/ignore [post] +// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"忽略应用升级","formatEN":"Ignore application upgrade"} +func (b *BaseApi) IgnoreAppUpgrade(c *gin.Context) { + var req request.AppIgnoreUpgradeReq + if err := helper.CheckBindAndValidate(&req, c); err != nil { + return + } + if err := appIgnoreUpgradeService.CreateAppIgnore(req); err != nil { + helper.InternalServer(c, err) + return + } + helper.Success(c) +} + +// 写一个去掉忽略的接口 +// @Tags App +// @Summary Cancel Ignore Upgrade App +// @Accept json +// @Param request body request.ReqWithID true "request" +// @Success 200 +// @Security ApiKeyAuth +// @Security Timestamp +// @Router /apps/ignored/cancel [post] +// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"取消忽略应用升级","formatEN":"Cancel ignore application upgrade"} +func (b *BaseApi) CancelIgnoreAppUpgrade(c *gin.Context) { + var req request.ReqWithID + if err := helper.CheckBindAndValidate(&req, c); err != nil { + return + } + if err := appIgnoreUpgradeService.Delete(req); err != nil { + helper.InternalServer(c, err) + return + } + helper.Success(c) +} diff --git a/agent/app/api/v2/app_install.go b/agent/app/api/v2/app_install.go index c694f481f..534c48f78 100644 --- a/agent/app/api/v2/app_install.go +++ b/agent/app/api/v2/app_install.go @@ -158,7 +158,7 @@ func (b *BaseApi) SyncInstalled(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags App @@ -179,7 +179,7 @@ func (b *BaseApi) OperateInstalled(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags App @@ -239,7 +239,7 @@ func (b *BaseApi) ChangeAppPort(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags App @@ -304,28 +304,7 @@ func (b *BaseApi) UpdateInstalled(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) -} - -// @Tags App -// @Summary ignore App Update -// @Accept json -// @Param request body request.AppInstalledIgnoreUpgrade true "request" -// @Success 200 -// @Security ApiKeyAuth -// @Security Timestamp -// @Router /apps/installed/ignore [post] -// @x-panel-log {"bodyKeys":["installId"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"忽略应用 [installId] 版本升级","formatEN":"Application param update [installId]"} -func (b *BaseApi) IgnoreUpgrade(c *gin.Context) { - var req request.AppInstalledIgnoreUpgrade - if err := helper.CheckBindAndValidate(&req, c); err != nil { - return - } - if err := appInstallService.IgnoreUpgrade(req); err != nil { - helper.InternalServer(c, err) - return - } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags App @@ -346,5 +325,5 @@ func (b *BaseApi) UpdateAppConfig(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } diff --git a/agent/app/api/v2/backup.go b/agent/app/api/v2/backup.go index 0b41177fa..c7db39c17 100644 --- a/agent/app/api/v2/backup.go +++ b/agent/app/api/v2/backup.go @@ -22,7 +22,7 @@ func (b *BaseApi) CheckBackupUsed(c *gin.Context) { return } - helper.SuccessWithOutData(c) + helper.Success(c) } func (b *BaseApi) SyncBackupAccount(c *gin.Context) { @@ -36,7 +36,7 @@ func (b *BaseApi) SyncBackupAccount(c *gin.Context) { return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Backup Account @@ -58,7 +58,7 @@ func (b *BaseApi) CreateBackup(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Backup Account @@ -78,7 +78,7 @@ func (b *BaseApi) RefreshToken(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Backup Account @@ -122,7 +122,7 @@ func (b *BaseApi) DeleteBackup(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Backup Account @@ -144,7 +144,7 @@ func (b *BaseApi) UpdateBackup(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Backup Account @@ -321,7 +321,7 @@ func (b *BaseApi) UpdateRecordDescription(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Backup Account @@ -343,7 +343,7 @@ func (b *BaseApi) DeleteBackupRecord(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Backup Account @@ -406,7 +406,7 @@ func (b *BaseApi) Backup(c *gin.Context) { return } } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Backup Account @@ -461,7 +461,7 @@ func (b *BaseApi) Recover(c *gin.Context) { return } } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Backup Account @@ -501,5 +501,5 @@ func (b *BaseApi) RecoverByUpload(c *gin.Context) { return } } - helper.SuccessWithOutData(c) + helper.Success(c) } diff --git a/agent/app/api/v2/clam.go b/agent/app/api/v2/clam.go index f15783b3a..4d478e3bf 100644 --- a/agent/app/api/v2/clam.go +++ b/agent/app/api/v2/clam.go @@ -25,7 +25,7 @@ func (b *BaseApi) CreateClam(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Clam @@ -47,7 +47,7 @@ func (b *BaseApi) UpdateClam(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Clam @@ -69,7 +69,7 @@ func (b *BaseApi) UpdateClamStatus(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Clam @@ -135,7 +135,7 @@ func (b *BaseApi) OperateClam(c *gin.Context) { return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Clam @@ -157,7 +157,7 @@ func (b *BaseApi) CleanClamRecord(c *gin.Context) { return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Clam @@ -249,7 +249,7 @@ func (b *BaseApi) UpdateFile(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Clam @@ -271,7 +271,7 @@ func (b *BaseApi) DeleteClam(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Clam @@ -293,5 +293,5 @@ func (b *BaseApi) HandleClamScan(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } diff --git a/agent/app/api/v2/compose_template.go b/agent/app/api/v2/compose_template.go index f3265af1a..fb747dfe6 100644 --- a/agent/app/api/v2/compose_template.go +++ b/agent/app/api/v2/compose_template.go @@ -25,7 +25,7 @@ func (b *BaseApi) CreateComposeTemplate(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Container Compose-template @@ -91,7 +91,7 @@ func (b *BaseApi) DeleteComposeTemplate(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Container Compose-template @@ -116,5 +116,5 @@ func (b *BaseApi) UpdateComposeTemplate(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } diff --git a/agent/app/api/v2/container.go b/agent/app/api/v2/container.go index 68717a83d..802d4a5e6 100644 --- a/agent/app/api/v2/container.go +++ b/agent/app/api/v2/container.go @@ -136,7 +136,7 @@ func (b *BaseApi) CreateCompose(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Container Compose @@ -158,7 +158,7 @@ func (b *BaseApi) OperatorCompose(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Container @@ -180,7 +180,7 @@ func (b *BaseApi) ContainerUpdate(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Container @@ -252,7 +252,7 @@ func (b *BaseApi) ContainerCreate(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Container @@ -273,7 +273,7 @@ func (b *BaseApi) ContainerCreateByCommand(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Container @@ -295,7 +295,7 @@ func (b *BaseApi) ContainerUpgrade(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Container @@ -340,7 +340,7 @@ func (b *BaseApi) CleanContainerLog(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Container @@ -362,7 +362,7 @@ func (b *BaseApi) ContainerRename(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Container @@ -383,7 +383,7 @@ func (b *BaseApi) ContainerCommit(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Container @@ -405,7 +405,7 @@ func (b *BaseApi) ContainerOperation(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Container @@ -526,7 +526,7 @@ func (b *BaseApi) DeleteNetwork(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Container Network @@ -548,7 +548,7 @@ func (b *BaseApi) CreateNetwork(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Container Volume @@ -613,7 +613,7 @@ func (b *BaseApi) DeleteVolume(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Container Volume @@ -635,7 +635,7 @@ func (b *BaseApi) CreateVolume(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Container Compose @@ -657,7 +657,7 @@ func (b *BaseApi) ComposeUpdate(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Container diff --git a/agent/app/api/v2/cronjob.go b/agent/app/api/v2/cronjob.go index e18db07c8..0549694d4 100644 --- a/agent/app/api/v2/cronjob.go +++ b/agent/app/api/v2/cronjob.go @@ -28,7 +28,7 @@ func (b *BaseApi) CreateCronjob(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Cronjob @@ -168,7 +168,7 @@ func (b *BaseApi) CleanRecord(c *gin.Context) { return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Cronjob @@ -190,7 +190,7 @@ func (b *BaseApi) DeleteCronjob(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Cronjob @@ -212,7 +212,7 @@ func (b *BaseApi) UpdateCronjob(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Cronjob @@ -234,7 +234,7 @@ func (b *BaseApi) UpdateCronjobStatus(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Cronjob @@ -280,5 +280,5 @@ func (b *BaseApi) HandleOnce(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } diff --git a/agent/app/api/v2/dashboard.go b/agent/app/api/v2/dashboard.go index f94fe537e..adfc353ed 100644 --- a/agent/app/api/v2/dashboard.go +++ b/agent/app/api/v2/dashboard.go @@ -80,7 +80,7 @@ func (b *BaseApi) UpdateAppLauncher(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Dashboard @@ -165,5 +165,5 @@ func (b *BaseApi) SystemRestart(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } diff --git a/agent/app/api/v2/database.go b/agent/app/api/v2/database.go index edb849cd7..4a9207b28 100644 --- a/agent/app/api/v2/database.go +++ b/agent/app/api/v2/database.go @@ -35,7 +35,7 @@ func (b *BaseApi) CreateDatabase(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Database @@ -194,7 +194,7 @@ func (b *BaseApi) DeleteDatabase(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Database @@ -224,5 +224,5 @@ func (b *BaseApi) UpdateDatabase(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } diff --git a/agent/app/api/v2/database_common.go b/agent/app/api/v2/database_common.go index 8ae18a62b..4cc565896 100644 --- a/agent/app/api/v2/database_common.go +++ b/agent/app/api/v2/database_common.go @@ -70,5 +70,5 @@ func (b *BaseApi) UpdateDBConfByFile(c *gin.Context) { return } - helper.SuccessWithOutData(c) + helper.Success(c) } diff --git a/agent/app/api/v2/database_mysql.go b/agent/app/api/v2/database_mysql.go index 8ecf83f75..cbd5abcee 100644 --- a/agent/app/api/v2/database_mysql.go +++ b/agent/app/api/v2/database_mysql.go @@ -37,7 +37,7 @@ func (b *BaseApi) CreateMysql(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Database Mysql @@ -68,7 +68,7 @@ func (b *BaseApi) BindUser(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Database Mysql @@ -90,7 +90,7 @@ func (b *BaseApi) UpdateMysqlDescription(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Database Mysql @@ -121,7 +121,7 @@ func (b *BaseApi) ChangeMysqlPassword(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Database Mysql @@ -143,7 +143,7 @@ func (b *BaseApi) ChangeMysqlAccess(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Database Mysql @@ -165,7 +165,7 @@ func (b *BaseApi) UpdateMysqlVariables(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Database Mysql @@ -230,7 +230,7 @@ func (b *BaseApi) LoadDBFromRemote(c *gin.Context) { return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Database Mysql @@ -277,7 +277,7 @@ func (b *BaseApi) DeleteMysql(c *gin.Context) { return } tx.Commit() - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Database Mysql diff --git a/agent/app/api/v2/database_postgresql.go b/agent/app/api/v2/database_postgresql.go index 5926a850c..7e50733ed 100644 --- a/agent/app/api/v2/database_postgresql.go +++ b/agent/app/api/v2/database_postgresql.go @@ -37,7 +37,7 @@ func (b *BaseApi) CreatePostgresql(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Database Postgresql @@ -59,7 +59,7 @@ func (b *BaseApi) BindPostgresqlUser(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Database Postgresql @@ -81,7 +81,7 @@ func (b *BaseApi) UpdatePostgresqlDescription(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Database Postgresql @@ -103,7 +103,7 @@ func (b *BaseApi) ChangePostgresqlPrivileges(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Database Postgresql @@ -134,7 +134,7 @@ func (b *BaseApi) ChangePostgresqlPassword(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Database Postgresql @@ -182,7 +182,7 @@ func (b *BaseApi) LoadPostgresqlDBFromRemote(c *gin.Context) { return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Database Postgresql @@ -228,5 +228,5 @@ func (b *BaseApi) DeletePostgresql(c *gin.Context) { return } tx.Commit() - helper.SuccessWithOutData(c) + helper.Success(c) } diff --git a/agent/app/api/v2/database_redis.go b/agent/app/api/v2/database_redis.go index ac1d47b51..415a11844 100644 --- a/agent/app/api/v2/database_redis.go +++ b/agent/app/api/v2/database_redis.go @@ -90,7 +90,7 @@ func (b *BaseApi) InstallCli(c *gin.Context) { return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Database Redis @@ -112,7 +112,7 @@ func (b *BaseApi) UpdateRedisConf(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Database Redis @@ -143,7 +143,7 @@ func (b *BaseApi) ChangeRedisPassword(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Database Redis @@ -165,5 +165,5 @@ func (b *BaseApi) UpdateRedisPersistenceConf(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } diff --git a/agent/app/api/v2/device.go b/agent/app/api/v2/device.go index 4a1e81f78..6f8197ff0 100644 --- a/agent/app/api/v2/device.go +++ b/agent/app/api/v2/device.go @@ -82,7 +82,7 @@ func (b *BaseApi) UpdateDeviceByFile(c *gin.Context) { return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Device @@ -120,7 +120,7 @@ func (b *BaseApi) UpdateDeviceConf(c *gin.Context) { return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Device @@ -141,7 +141,7 @@ func (b *BaseApi) UpdateDeviceHost(c *gin.Context) { return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Device @@ -170,7 +170,7 @@ func (b *BaseApi) UpdateDevicePasswd(c *gin.Context) { return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Device @@ -192,7 +192,7 @@ func (b *BaseApi) UpdateDeviceSwap(c *gin.Context) { return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Device @@ -246,5 +246,5 @@ func (b *BaseApi) SystemClean(c *gin.Context) { deviceService.Clean(req) - helper.SuccessWithOutData(c) + helper.Success(c) } diff --git a/agent/app/api/v2/docker.go b/agent/app/api/v2/docker.go index 0acbcb7bf..a612136ed 100644 --- a/agent/app/api/v2/docker.go +++ b/agent/app/api/v2/docker.go @@ -77,7 +77,7 @@ func (b *BaseApi) UpdateDaemonJson(c *gin.Context) { return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Container Docker @@ -100,7 +100,7 @@ func (b *BaseApi) UpdateLogOption(c *gin.Context) { return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Container Docker @@ -123,7 +123,7 @@ func (b *BaseApi) UpdateIpv6Option(c *gin.Context) { return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Container Docker @@ -146,7 +146,7 @@ func (b *BaseApi) UpdateDaemonJsonByFile(c *gin.Context) { return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Container Docker @@ -169,5 +169,5 @@ func (b *BaseApi) OperateDocker(c *gin.Context) { return } - helper.SuccessWithOutData(c) + helper.Success(c) } diff --git a/agent/app/api/v2/entry.go b/agent/app/api/v2/entry.go index f6a100e26..03aeb34eb 100644 --- a/agent/app/api/v2/entry.go +++ b/agent/app/api/v2/entry.go @@ -13,8 +13,9 @@ type BaseApi struct{} var ( dashboardService = service.NewIDashboardService() - appService = service.NewIAppService() - appInstallService = service.NewIAppInstalledService() + appService = service.NewIAppService() + appInstallService = service.NewIAppInstalledService() + appIgnoreUpgradeService = service.NewIAppIgnoreUpgradeService() aiToolService = service.NewIAIToolService() diff --git a/agent/app/api/v2/fail2ban.go b/agent/app/api/v2/fail2ban.go index 780e90c48..55e09a60a 100644 --- a/agent/app/api/v2/fail2ban.go +++ b/agent/app/api/v2/fail2ban.go @@ -66,7 +66,7 @@ func (b *BaseApi) OperateFail2Ban(c *gin.Context) { return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Fail2ban @@ -87,7 +87,7 @@ func (b *BaseApi) OperateSSHD(c *gin.Context) { return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Fail2ban @@ -109,7 +109,7 @@ func (b *BaseApi) UpdateFail2BanConf(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Fail2ban @@ -148,5 +148,5 @@ func (b *BaseApi) UpdateFail2BanConfByFile(c *gin.Context) { return } - helper.SuccessWithOutData(c) + helper.Success(c) } diff --git a/agent/app/api/v2/favorite.go b/agent/app/api/v2/favorite.go index b82301323..63f0992d6 100644 --- a/agent/app/api/v2/favorite.go +++ b/agent/app/api/v2/favorite.go @@ -71,5 +71,5 @@ func (b *BaseApi) DeleteFavorite(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } diff --git a/agent/app/api/v2/file.go b/agent/app/api/v2/file.go index f05e27b1e..79271372a 100644 --- a/agent/app/api/v2/file.go +++ b/agent/app/api/v2/file.go @@ -112,7 +112,7 @@ func (b *BaseApi) CreateFile(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags File @@ -134,7 +134,7 @@ func (b *BaseApi) DeleteFile(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags File @@ -156,7 +156,7 @@ func (b *BaseApi) BatchDeleteFile(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags File @@ -178,7 +178,7 @@ func (b *BaseApi) ChangeFileMode(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags File @@ -199,7 +199,7 @@ func (b *BaseApi) ChangeFileOwner(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags File @@ -221,7 +221,7 @@ func (b *BaseApi) CompressFile(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags File @@ -243,7 +243,7 @@ func (b *BaseApi) DeCompressFile(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags File @@ -286,7 +286,7 @@ func (b *BaseApi) SaveContent(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags File @@ -452,7 +452,7 @@ func (b *BaseApi) ChangeFileName(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags File @@ -497,7 +497,7 @@ func (b *BaseApi) MoveFile(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags File @@ -830,7 +830,7 @@ func (b *BaseApi) BatchChangeModeAndOwner(c *gin.Context) { if err := fileService.BatchChangeModeAndOwner(req); err != nil { helper.InternalServer(c, err) } - helper.SuccessWithOutData(c) + helper.Success(c) } func (b *BaseApi) GetPathByType(c *gin.Context) { diff --git a/agent/app/api/v2/firewall.go b/agent/app/api/v2/firewall.go index cba6b4e9c..82da28c23 100644 --- a/agent/app/api/v2/firewall.go +++ b/agent/app/api/v2/firewall.go @@ -68,7 +68,7 @@ func (b *BaseApi) OperateFirewall(c *gin.Context) { return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Firewall @@ -90,7 +90,7 @@ func (b *BaseApi) OperatePortRule(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // OperateForwardRule @@ -113,7 +113,7 @@ func (b *BaseApi) OperateForwardRule(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Firewall @@ -135,7 +135,7 @@ func (b *BaseApi) OperateIPRule(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Firewall @@ -156,7 +156,7 @@ func (b *BaseApi) BatchOperateRule(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Firewall @@ -177,7 +177,7 @@ func (b *BaseApi) UpdateFirewallDescription(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Firewall @@ -198,7 +198,7 @@ func (b *BaseApi) UpdatePortRule(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Firewall @@ -219,5 +219,5 @@ func (b *BaseApi) UpdateAddrRule(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } diff --git a/agent/app/api/v2/ftp.go b/agent/app/api/v2/ftp.go index a8b4deae6..c95f2ae20 100644 --- a/agent/app/api/v2/ftp.go +++ b/agent/app/api/v2/ftp.go @@ -69,7 +69,7 @@ func (b *BaseApi) OperateFtp(c *gin.Context) { return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags FTP @@ -125,7 +125,7 @@ func (b *BaseApi) CreateFtp(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags FTP @@ -147,7 +147,7 @@ func (b *BaseApi) DeleteFtp(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags FTP @@ -164,7 +164,7 @@ func (b *BaseApi) SyncFtp(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags FTP @@ -194,5 +194,5 @@ func (b *BaseApi) UpdateFtp(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } diff --git a/agent/app/api/v2/group.go b/agent/app/api/v2/group.go index 6d8077872..a40f5dec3 100644 --- a/agent/app/api/v2/group.go +++ b/agent/app/api/v2/group.go @@ -25,7 +25,7 @@ func (b *BaseApi) CreateGroup(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags System Group @@ -47,7 +47,7 @@ func (b *BaseApi) DeleteGroup(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags System Group @@ -69,7 +69,7 @@ func (b *BaseApi) UpdateGroup(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags System Group diff --git a/agent/app/api/v2/health.go b/agent/app/api/v2/health.go index b8af24aeb..8b693c967 100644 --- a/agent/app/api/v2/health.go +++ b/agent/app/api/v2/health.go @@ -6,5 +6,5 @@ import ( ) func (b *BaseApi) CheckHealth(c *gin.Context) { - helper.SuccessWithOutData(c) + helper.Success(c) } diff --git a/agent/app/api/v2/helper/helper.go b/agent/app/api/v2/helper/helper.go index de7dd2306..84babef6b 100644 --- a/agent/app/api/v2/helper/helper.go +++ b/agent/app/api/v2/helper/helper.go @@ -46,7 +46,7 @@ func SuccessWithData(ctx *gin.Context, data interface{}) { ctx.Abort() } -func SuccessWithOutData(ctx *gin.Context) { +func Success(ctx *gin.Context) { res := dto.Response{ Code: http.StatusOK, Message: "success", diff --git a/agent/app/api/v2/host_tool.go b/agent/app/api/v2/host_tool.go index 010b15261..5e0891f26 100644 --- a/agent/app/api/v2/host_tool.go +++ b/agent/app/api/v2/host_tool.go @@ -47,7 +47,7 @@ func (b *BaseApi) InitToolConfig(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Host tool @@ -69,7 +69,7 @@ func (b *BaseApi) OperateTool(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Host tool @@ -137,7 +137,7 @@ func (b *BaseApi) OperateProcess(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Host tool diff --git a/agent/app/api/v2/image.go b/agent/app/api/v2/image.go index b5eab841d..a55cef39e 100644 --- a/agent/app/api/v2/image.go +++ b/agent/app/api/v2/image.go @@ -85,7 +85,7 @@ func (b *BaseApi) ImageBuild(c *gin.Context) { return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Container Image @@ -108,7 +108,7 @@ func (b *BaseApi) ImagePull(c *gin.Context) { return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Container Image @@ -131,7 +131,7 @@ func (b *BaseApi) ImagePush(c *gin.Context) { return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Container Image @@ -178,7 +178,7 @@ func (b *BaseApi) ImageSave(c *gin.Context) { return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Container Image @@ -201,7 +201,7 @@ func (b *BaseApi) ImageTag(c *gin.Context) { return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Container Image @@ -224,5 +224,5 @@ func (b *BaseApi) ImageLoad(c *gin.Context) { return } - helper.SuccessWithOutData(c) + helper.Success(c) } diff --git a/agent/app/api/v2/image_repo.go b/agent/app/api/v2/image_repo.go index 65f49eaed..5d8b79bb2 100644 --- a/agent/app/api/v2/image_repo.go +++ b/agent/app/api/v2/image_repo.go @@ -69,7 +69,7 @@ func (b *BaseApi) CheckRepoStatus(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Container Image-repo @@ -92,7 +92,7 @@ func (b *BaseApi) CreateRepo(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Container Image-repo @@ -115,7 +115,7 @@ func (b *BaseApi) DeleteRepo(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Container Image-repo @@ -138,5 +138,5 @@ func (b *BaseApi) UpdateRepo(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } diff --git a/agent/app/api/v2/monitor.go b/agent/app/api/v2/monitor.go index e8d177704..2ec65b4cb 100644 --- a/agent/app/api/v2/monitor.go +++ b/agent/app/api/v2/monitor.go @@ -44,7 +44,7 @@ func (b *BaseApi) CleanMonitor(c *gin.Context) { return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Monitor @@ -81,7 +81,7 @@ func (b *BaseApi) UpdateMonitorSetting(c *gin.Context) { return } - helper.SuccessWithOutData(c) + helper.Success(c) } func (b *BaseApi) GetNetworkOptions(c *gin.Context) { diff --git a/agent/app/api/v2/nginx.go b/agent/app/api/v2/nginx.go index 25559002f..4c689c2b0 100644 --- a/agent/app/api/v2/nginx.go +++ b/agent/app/api/v2/nginx.go @@ -61,7 +61,7 @@ func (b *BaseApi) UpdateNginxConfigByScope(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags OpenResty @@ -98,7 +98,7 @@ func (b *BaseApi) UpdateNginxFile(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags OpenResty @@ -119,7 +119,7 @@ func (b *BaseApi) BuildNginx(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags OpenResty @@ -140,7 +140,7 @@ func (b *BaseApi) UpdateNginxModule(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags OpenResty diff --git a/agent/app/api/v2/php_extensions.go b/agent/app/api/v2/php_extensions.go index 320387df7..842ea43a5 100644 --- a/agent/app/api/v2/php_extensions.go +++ b/agent/app/api/v2/php_extensions.go @@ -61,7 +61,7 @@ func (b *BaseApi) CreatePHPExtensions(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags PHP Extensions @@ -81,7 +81,7 @@ func (b *BaseApi) UpdatePHPExtensions(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags PHP Extensions @@ -101,5 +101,5 @@ func (b *BaseApi) DeletePHPExtensions(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } diff --git a/agent/app/api/v2/process.go b/agent/app/api/v2/process.go index 8e77a2978..c92a18df4 100644 --- a/agent/app/api/v2/process.go +++ b/agent/app/api/v2/process.go @@ -34,5 +34,5 @@ func (b *BaseApi) StopProcess(c *gin.Context) { helper.BadRequest(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } diff --git a/agent/app/api/v2/recycle_bin.go b/agent/app/api/v2/recycle_bin.go index da735072e..5089f64de 100644 --- a/agent/app/api/v2/recycle_bin.go +++ b/agent/app/api/v2/recycle_bin.go @@ -49,7 +49,7 @@ func (b *BaseApi) ReduceRecycleBinFile(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags File @@ -65,7 +65,7 @@ func (b *BaseApi) ClearRecycleBinFile(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags File diff --git a/agent/app/api/v2/runtime.go b/agent/app/api/v2/runtime.go index 2116e4705..b1c033767 100644 --- a/agent/app/api/v2/runtime.go +++ b/agent/app/api/v2/runtime.go @@ -72,7 +72,7 @@ func (b *BaseApi) DeleteRuntime(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Website @@ -114,7 +114,7 @@ func (b *BaseApi) UpdateRuntime(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Runtime @@ -179,7 +179,7 @@ func (b *BaseApi) OperateRuntime(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Runtime @@ -221,7 +221,7 @@ func (b *BaseApi) OperateNodeModules(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Runtime @@ -236,7 +236,7 @@ func (b *BaseApi) SyncStatus(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Runtime @@ -279,7 +279,7 @@ func (b *BaseApi) InstallPHPExtension(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Runtime @@ -300,7 +300,7 @@ func (b *BaseApi) UnInstallPHPExtension(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Runtime @@ -343,7 +343,7 @@ func (b *BaseApi) UpdatePHPConfig(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Runtime @@ -364,7 +364,7 @@ func (b *BaseApi) UpdatePHPFile(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Runtime @@ -405,7 +405,7 @@ func (b *BaseApi) UpdateFPMConfig(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Runtime @@ -470,7 +470,7 @@ func (b *BaseApi) OperateSupervisorProcess(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Runtime diff --git a/agent/app/api/v2/setting.go b/agent/app/api/v2/setting.go index 73c688147..cf21f960d 100644 --- a/agent/app/api/v2/setting.go +++ b/agent/app/api/v2/setting.go @@ -36,7 +36,7 @@ func (b *BaseApi) GetSettingInfo(c *gin.Context) { // @Security Timestamp // @Router /settings/search/available [get] func (b *BaseApi) GetSystemAvailable(c *gin.Context) { - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags System Setting @@ -58,7 +58,7 @@ func (b *BaseApi) UpdateSetting(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags System Setting diff --git a/agent/app/api/v2/snapshot.go b/agent/app/api/v2/snapshot.go index afe56bc68..ae9a78f58 100644 --- a/agent/app/api/v2/snapshot.go +++ b/agent/app/api/v2/snapshot.go @@ -40,7 +40,7 @@ func (b *BaseApi) CreateSnapshot(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags System Setting @@ -62,7 +62,7 @@ func (b *BaseApi) RecreateSnapshot(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags System Setting @@ -84,7 +84,7 @@ func (b *BaseApi) ImportSnapshot(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags System Setting @@ -106,7 +106,7 @@ func (b *BaseApi) UpdateSnapDescription(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags System Setting @@ -153,7 +153,7 @@ func (b *BaseApi) RecoverSnapshot(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags System Setting @@ -175,7 +175,7 @@ func (b *BaseApi) RollbackSnapshot(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags System Setting @@ -197,5 +197,5 @@ func (b *BaseApi) DeleteSnapshot(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } diff --git a/agent/app/api/v2/ssh.go b/agent/app/api/v2/ssh.go index f1675a0fb..1a35324b2 100644 --- a/agent/app/api/v2/ssh.go +++ b/agent/app/api/v2/ssh.go @@ -40,7 +40,7 @@ func (b *BaseApi) OperateSSH(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags SSH @@ -62,7 +62,7 @@ func (b *BaseApi) UpdateSSH(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags SSH @@ -84,7 +84,7 @@ func (b *BaseApi) UpdateSSHByfile(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags SSH @@ -106,7 +106,7 @@ func (b *BaseApi) GenerateSSH(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags SSH diff --git a/agent/app/api/v2/website.go b/agent/app/api/v2/website.go index 284c97848..207c42bee 100644 --- a/agent/app/api/v2/website.go +++ b/agent/app/api/v2/website.go @@ -84,7 +84,7 @@ func (b *BaseApi) CreateWebsite(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Website @@ -106,7 +106,7 @@ func (b *BaseApi) OpWebsite(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Website @@ -128,7 +128,7 @@ func (b *BaseApi) DeleteWebsite(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Website @@ -149,7 +149,7 @@ func (b *BaseApi) UpdateWebsite(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Website @@ -237,7 +237,7 @@ func (b *BaseApi) UpdateNginxConfig(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Website HTTPS @@ -326,7 +326,7 @@ func (b *BaseApi) UpdateWebsiteNginxConfig(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Website @@ -369,7 +369,7 @@ func (b *BaseApi) ChangeDefaultServer(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Website PHP @@ -390,7 +390,7 @@ func (b *BaseApi) ChangePHPVersion(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Website @@ -432,7 +432,7 @@ func (b *BaseApi) UpdateRewriteConfig(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Website @@ -453,7 +453,7 @@ func (b *BaseApi) UpdateSiteDir(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Website @@ -474,7 +474,7 @@ func (b *BaseApi) UpdateSiteDirPermission(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Website @@ -517,7 +517,7 @@ func (b *BaseApi) UpdateProxyConfig(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Website @@ -538,7 +538,7 @@ func (b *BaseApi) UpdateProxyConfigFile(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Website @@ -579,7 +579,7 @@ func (b *BaseApi) UpdateAuthConfig(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Website @@ -620,7 +620,7 @@ func (b *BaseApi) UpdatePathAuthConfig(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Website @@ -661,7 +661,7 @@ func (b *BaseApi) UpdateAntiLeech(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Website @@ -683,7 +683,7 @@ func (b *BaseApi) UpdateRedirectConfig(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Website @@ -725,7 +725,7 @@ func (b *BaseApi) UpdateRedirectConfigFile(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Website @@ -788,7 +788,7 @@ func (b *BaseApi) UpdateDefaultHtml(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Website @@ -830,7 +830,7 @@ func (b *BaseApi) CreateLoadBalance(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Website @@ -850,7 +850,7 @@ func (b *BaseApi) DeleteLoadBalance(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Website @@ -870,7 +870,7 @@ func (b *BaseApi) UpdateLoadBalance(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Website @@ -890,7 +890,7 @@ func (b *BaseApi) UpdateLoadBalanceFile(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } func (b *BaseApi) ChangeWebsiteGroup(c *gin.Context) { @@ -902,7 +902,7 @@ func (b *BaseApi) ChangeWebsiteGroup(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Website @@ -922,7 +922,7 @@ func (b *BaseApi) UpdateProxyCache(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Summary Get website proxy cache config @@ -964,7 +964,7 @@ func (b *BaseApi) SetRealIPConfig(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Website @@ -1044,7 +1044,7 @@ func (b *BaseApi) ChangeWebsiteDatabase(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Website @@ -1064,7 +1064,7 @@ func (b *BaseApi) OperateCustomRewrite(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Website @@ -1099,5 +1099,5 @@ func (b *BaseApi) ClearProxyCache(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } diff --git a/agent/app/api/v2/website_acme_account.go b/agent/app/api/v2/website_acme_account.go index 1a9fb116b..d509b846b 100644 --- a/agent/app/api/v2/website_acme_account.go +++ b/agent/app/api/v2/website_acme_account.go @@ -71,5 +71,5 @@ func (b *BaseApi) DeleteWebsiteAcmeAccount(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } diff --git a/agent/app/api/v2/website_ca.go b/agent/app/api/v2/website_ca.go index d6d00a0a5..183517ba9 100644 --- a/agent/app/api/v2/website_ca.go +++ b/agent/app/api/v2/website_ca.go @@ -96,7 +96,7 @@ func (b *BaseApi) DeleteWebsiteCA(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Website CA @@ -144,7 +144,7 @@ func (b *BaseApi) RenewWebsiteCA(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Website CA diff --git a/agent/app/api/v2/website_dns_account.go b/agent/app/api/v2/website_dns_account.go index deee15478..21010122d 100644 --- a/agent/app/api/v2/website_dns_account.go +++ b/agent/app/api/v2/website_dns_account.go @@ -49,7 +49,7 @@ func (b *BaseApi) CreateWebsiteDnsAccount(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Website DNS @@ -70,7 +70,7 @@ func (b *BaseApi) UpdateWebsiteDnsAccount(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Website DNS @@ -91,5 +91,5 @@ func (b *BaseApi) DeleteWebsiteDnsAccount(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } diff --git a/agent/app/api/v2/website_domain.go b/agent/app/api/v2/website_domain.go index 84bdc1345..99c8c894e 100644 --- a/agent/app/api/v2/website_domain.go +++ b/agent/app/api/v2/website_domain.go @@ -24,7 +24,7 @@ func (b *BaseApi) DeleteWebDomain(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Website Domain @@ -89,5 +89,5 @@ func (b *BaseApi) UpdateWebDomain(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } diff --git a/agent/app/api/v2/website_ssl.go b/agent/app/api/v2/website_ssl.go index 02f1a911a..6a546cc10 100644 --- a/agent/app/api/v2/website_ssl.go +++ b/agent/app/api/v2/website_ssl.go @@ -85,7 +85,7 @@ func (b *BaseApi) ApplyWebsiteSSL(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Website SSL @@ -127,7 +127,7 @@ func (b *BaseApi) DeleteWebsiteSSL(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Website SSL @@ -192,7 +192,7 @@ func (b *BaseApi) UpdateWebsiteSSL(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Website SSL @@ -213,7 +213,7 @@ func (b *BaseApi) UploadWebsiteSSL(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Website SSL diff --git a/agent/app/dto/request/app_ignore_upgrade.go b/agent/app/dto/request/app_ignore_upgrade.go new file mode 100644 index 000000000..5fc3850c7 --- /dev/null +++ b/agent/app/dto/request/app_ignore_upgrade.go @@ -0,0 +1,7 @@ +package request + +type AppIgnoreUpgradeReq struct { + AppID uint `json:"appID" validate:"required"` + AppDetailID uint `json:"appDetailID"` + Scope string `json:"scope" validate:"required,oneof=all version"` +} diff --git a/agent/app/dto/request/common.go b/agent/app/dto/request/common.go new file mode 100644 index 000000000..b7b102c2e --- /dev/null +++ b/agent/app/dto/request/common.go @@ -0,0 +1,5 @@ +package request + +type ReqWithID struct { + ID uint `json:"id" validate:"required"` +} diff --git a/agent/app/dto/response/app_ignore_upgrade.go b/agent/app/dto/response/app_ignore_upgrade.go new file mode 100644 index 000000000..60eba45d4 --- /dev/null +++ b/agent/app/dto/response/app_ignore_upgrade.go @@ -0,0 +1,10 @@ +package response + +type AppIgnoreUpgradeDTO struct { + ID uint `json:"ID"` + AppID uint `json:"appID"` + AppDetailID uint `json:"appDetailID"` + Scope string `json:"scope"` + Version string `json:"version"` + Icon string `json:"icon"` +} diff --git a/agent/app/model/app_detail.go b/agent/app/model/app_detail.go index 80fd23dfb..dd94d8c85 100644 --- a/agent/app/model/app_detail.go +++ b/agent/app/model/app_detail.go @@ -12,5 +12,4 @@ type AppDetail struct { DownloadUrl string `json:"downloadUrl"` DownloadCallBackUrl string `json:"downloadCallBackUrl"` Update bool `json:"update"` - IgnoreUpgrade bool `json:"ignoreUpgrade"` } diff --git a/agent/app/model/app_ignore_upgrade.go b/agent/app/model/app_ignore_upgrade.go new file mode 100644 index 000000000..c8b7c6395 --- /dev/null +++ b/agent/app/model/app_ignore_upgrade.go @@ -0,0 +1,8 @@ +package model + +type AppIgnoreUpgrade struct { + BaseModel + AppID uint `json:"appID"` + AppDetailID uint `json:"appDetailID"` + Scope string `json:"scope"` +} diff --git a/agent/app/repo/app_ignore_upgrade.go b/agent/app/repo/app_ignore_upgrade.go new file mode 100644 index 000000000..e24a52e19 --- /dev/null +++ b/agent/app/repo/app_ignore_upgrade.go @@ -0,0 +1,41 @@ +package repo + +import ( + "github.com/1Panel-dev/1Panel/agent/app/model" + "github.com/1Panel-dev/1Panel/agent/global" + "gorm.io/gorm" +) + +type AppIgnoreUpgradeRepo struct { +} + +type IAppIgnoreUpgradeRepo interface { + WithScope(scope string) DBOption + List(opts ...DBOption) ([]model.AppIgnoreUpgrade, error) + Create(appIgnoreUpgrade *model.AppIgnoreUpgrade) error + Delete(opts ...DBOption) error +} + +func NewIAppIgnoreUpgradeRepo() IAppIgnoreUpgradeRepo { + return &AppIgnoreUpgradeRepo{} +} + +func (a AppIgnoreUpgradeRepo) WithScope(scope string) DBOption { + return func(g *gorm.DB) *gorm.DB { + return g.Where("scope = ?", scope) + } +} + +func (a AppIgnoreUpgradeRepo) List(opts ...DBOption) ([]model.AppIgnoreUpgrade, error) { + var appIgnoreUpgradeList []model.AppIgnoreUpgrade + err := getDb(opts...).Find(&appIgnoreUpgradeList).Error + return appIgnoreUpgradeList, err +} + +func (a AppIgnoreUpgradeRepo) Create(appIgnoreUpgrade *model.AppIgnoreUpgrade) error { + return global.DB.Create(appIgnoreUpgrade).Error +} + +func (a AppIgnoreUpgradeRepo) Delete(opts ...DBOption) error { + return getDb(opts...).Delete(&model.AppIgnoreUpgrade{}).Error +} diff --git a/agent/app/repo/app_install_resource.go b/agent/app/repo/app_install_resource.go index 52850fa43..2211a41e7 100644 --- a/agent/app/repo/app_install_resource.go +++ b/agent/app/repo/app_install_resource.go @@ -73,7 +73,7 @@ func (a AppInstallResourceRpo) DeleteBy(ctx context.Context, opts ...DBOption) e return getTx(ctx, opts...).Delete(&model.AppInstallResource{}).Error } -func (a *AppInstallResourceRpo) BatchUpdateBy(maps map[string]interface{}, opts ...DBOption) error { +func (a AppInstallResourceRpo) BatchUpdateBy(maps map[string]interface{}, opts ...DBOption) error { db := getDb(opts...).Model(&model.AppInstallResource{}) if len(opts) == 0 { db = db.Where("1=1") diff --git a/agent/app/service/app.go b/agent/app/service/app.go index 07b3c249f..059edfa9a 100644 --- a/agent/app/service/app.go +++ b/agent/app/service/app.go @@ -46,7 +46,6 @@ type IAppService interface { GetAppUpdate() (*response.AppUpdateRes, error) GetAppDetailByID(id uint) (*response.AppDetailDTO, error) SyncAppListFromLocal(taskID string) - GetIgnoredApp() ([]response.IgnoredApp, error) GetAppstoreConfig() (*response.AppstoreConfig, error) UpdateAppstoreConfig(req request.AppstoreUpdate) error @@ -326,27 +325,6 @@ func (a AppService) GetAppDetailByID(id uint) (*response.AppDetailDTO, error) { return res, nil } -func (a AppService) GetIgnoredApp() ([]response.IgnoredApp, error) { - var res []response.IgnoredApp - details, _ := appDetailRepo.GetBy(appDetailRepo.WithIgnored()) - if len(details) == 0 { - return res, nil - } - for _, detail := range details { - app, err := appRepo.GetFirst(repo.WithByID(detail.AppId)) - if err != nil { - return nil, err - } - res = append(res, response.IgnoredApp{ - Name: app.Name, - Version: detail.Version, - DetailID: detail.ID, - Icon: app.Icon, - }) - } - return res, nil -} - func (a AppService) Install(req request.AppInstallCreate) (appInstall *model.AppInstall, err error) { if err = docker.CreateDefaultDockerNetwork(); err != nil { err = buserr.WithDetail("Err1PanelNetworkFailed", err.Error(), nil) diff --git a/agent/app/service/app_ingore_upgrade.go b/agent/app/service/app_ingore_upgrade.go new file mode 100644 index 000000000..49fcc5866 --- /dev/null +++ b/agent/app/service/app_ingore_upgrade.go @@ -0,0 +1,76 @@ +package service + +import ( + "github.com/1Panel-dev/1Panel/agent/app/dto/request" + "github.com/1Panel-dev/1Panel/agent/app/dto/response" + "github.com/1Panel-dev/1Panel/agent/app/model" + "github.com/1Panel-dev/1Panel/agent/app/repo" + "github.com/pkg/errors" + "gorm.io/gorm" +) + +type AppIgnoreUpgradeService struct { +} + +type IAppIgnoreUpgradeService interface { + List() ([]response.AppIgnoreUpgradeDTO, error) + CreateAppIgnore(req request.AppIgnoreUpgradeReq) error + Delete(req request.ReqWithID) error +} + +func NewIAppIgnoreUpgradeService() IAppIgnoreUpgradeService { + return AppIgnoreUpgradeService{} +} + +func (a AppIgnoreUpgradeService) List() ([]response.AppIgnoreUpgradeDTO, error) { + var res []response.AppIgnoreUpgradeDTO + ignores, err := appIgnoreUpgradeRepo.List() + if err != nil { + return nil, err + } + for _, ignore := range ignores { + dto := response.AppIgnoreUpgradeDTO{ + ID: ignore.ID, + AppID: ignore.AppID, + AppDetailID: ignore.AppDetailID, + Scope: ignore.Scope, + } + app, err := appRepo.GetFirst(repo.WithByID(ignore.AppID)) + if errors.Is(err, gorm.ErrRecordNotFound) { + _ = appIgnoreUpgradeRepo.Delete(repo.WithByID(ignore.ID)) + continue + } + dto.Icon = app.Icon + if ignore.Scope == "version" { + appDetail, err := appDetailRepo.GetFirst(repo.WithByID(ignore.AppDetailID)) + if errors.Is(err, gorm.ErrRecordNotFound) { + _ = appIgnoreUpgradeRepo.Delete(repo.WithByID(ignore.ID)) + continue + } + dto.Version = appDetail.Version + } + res = append(res, dto) + } + return res, nil +} + +func (a AppIgnoreUpgradeService) CreateAppIgnore(req request.AppIgnoreUpgradeReq) error { + appIgnoreUpgrade := model.AppIgnoreUpgrade{ + AppID: req.AppID, + Scope: req.Scope, + } + if req.Scope == "version" { + appIgnoreUpgrade.AppDetailID = req.AppDetailID + } + if req.Scope == "all" { + _ = appIgnoreUpgradeRepo.Delete(appInstallRepo.WithAppId(req.AppID)) + } + if err := appIgnoreUpgradeRepo.Create(&appIgnoreUpgrade); err != nil { + return err + } + return nil +} + +func (a AppIgnoreUpgradeService) Delete(req request.ReqWithID) error { + return appIgnoreUpgradeRepo.Delete(repo.WithByID(req.ID)) +} diff --git a/agent/app/service/app_install.go b/agent/app/service/app_install.go index 81080ff80..1e2fdf502 100644 --- a/agent/app/service/app_install.go +++ b/agent/app/service/app_install.go @@ -50,7 +50,6 @@ type IAppInstallService interface { SearchForWebsite(req request.AppInstalledSearch) ([]response.AppInstallDTO, error) Operate(req request.AppInstalledOperate) error Update(req request.AppInstalledUpdate) error - IgnoreUpgrade(req request.AppInstalledIgnoreUpgrade) error SyncAll(systemInit bool) error GetServices(key string) ([]response.AppService, error) GetUpdateVersions(req request.AppUpdateVersion) ([]dto.AppVersion, error) @@ -446,15 +445,6 @@ func (a *AppInstallService) Update(req request.AppInstalledUpdate) error { return nil } -func (a *AppInstallService) IgnoreUpgrade(req request.AppInstalledIgnoreUpgrade) error { - appDetail, err := appDetailRepo.GetFirst(repo.WithByID(req.DetailID)) - if err != nil { - return err - } - appDetail.IgnoreUpgrade = req.Operate == "ignore" - return appDetailRepo.Update(context.Background(), appDetail) -} - func (a *AppInstallService) SyncAll(systemInit bool) error { allList, err := appInstallRepo.ListBy(context.Background()) if err != nil { @@ -558,7 +548,8 @@ func (a *AppInstallService) GetUpdateVersions(req request.AppUpdateVersion) ([]d return versions, err } for _, detail := range details { - if detail.IgnoreUpgrade { + ignores, _ := appIgnoreUpgradeRepo.List(runtimeRepo.WithDetailId(detail.ID), appIgnoreUpgradeRepo.WithScope("version")) + if len(ignores) > 0 { continue } if common.IsCrossVersion(install.Version, detail.Version) && !app.CrossVersionUpdate { diff --git a/agent/app/service/app_utils.go b/agent/app/service/app_utils.go index aa9bf54b3..6ab1a86bc 100644 --- a/agent/app/service/app_utils.go +++ b/agent/app/service/app_utils.go @@ -1490,7 +1490,8 @@ func handleInstalled(appInstallList []model.AppInstall, updated bool, sync bool) } var versions []string for _, detail := range details { - if detail.IgnoreUpgrade || installed.Version == "latest" { + ignores, _ := appIgnoreUpgradeRepo.List(runtimeRepo.WithDetailId(detail.ID), appIgnoreUpgradeRepo.WithScope("version")) + if len(ignores) > 0 || installed.Version == "latest" { continue } if common.IsCrossVersion(installed.Version, detail.Version) && !app.CrossVersionUpdate { @@ -1782,6 +1783,10 @@ func ignoreUpdate(installed model.AppInstall) bool { } return true } + ignores, _ := appIgnoreUpgradeRepo.List(appDetailRepo.WithAppId(installed.AppId), appIgnoreUpgradeRepo.WithScope("all")) + if len(ignores) > 0 { + return true + } return false } diff --git a/agent/app/service/entry.go b/agent/app/service/entry.go index e426692a2..3ee6709c9 100644 --- a/agent/app/service/entry.go +++ b/agent/app/service/entry.go @@ -10,6 +10,7 @@ var ( appInstallRepo = repo.NewIAppInstallRepo() launcherRepo = repo.NewILauncherRepo() appInstallResourceRepo = repo.NewIAppInstallResourceRpo() + appIgnoreUpgradeRepo = repo.NewIAppIgnoreUpgradeRepo() aiRepo = repo.NewIAiRepo() diff --git a/agent/app/service/nginx_utils.go b/agent/app/service/nginx_utils.go index 30579428b..f431ef678 100644 --- a/agent/app/service/nginx_utils.go +++ b/agent/app/service/nginx_utils.go @@ -2,6 +2,7 @@ package service import ( "errors" + "fmt" "os" "path" "strings" @@ -234,11 +235,13 @@ func opNginx(containerName, operate string) error { err error ) cmdMgr := cmd.NewCommandMgr(cmd.WithTimeout(20 * time.Second)) + cmdStr := fmt.Sprintf("docker exec -i %s nginx ", containerName) if operate == constant.NginxCheck { - out, err = cmdMgr.RunWithStdout("docker", "exec", "-i", containerName, "nginx -t") + cmdStr = cmdStr + "-t" } else { - out, err = cmdMgr.RunWithStdout("docker", "exec", "-i", containerName, "nginx -s reload") + cmdStr = cmdStr + "-s reload" } + out, err = cmdMgr.RunWithStdoutBashC(cmdStr) if err != nil { if out != "" { return errors.New(out) diff --git a/agent/i18n/lang/zh.yaml b/agent/i18n/lang/zh.yaml index f4717341a..59a2ce1b2 100644 --- a/agent/i18n/lang/zh.yaml +++ b/agent/i18n/lang/zh.yaml @@ -219,6 +219,7 @@ ErrRuleNotExist: "规则不存在" ErrParseIP: "IP 格式错误" ErrDefaultIP: "default 为保留名称,请更换其他名称" ErrGroupInUse: "IP 组被黑/白名单使用,无法删除" +ErrIPGroupAclUse: "IP 组被网站 {{ .name }} 自定义规则使用,无法删除" ErrGroupExist: "IP 组名称已存在" ErrIPRange: "IP 范围错误" ErrIPExist: "IP 已存在" diff --git a/agent/init/migration/migrate.go b/agent/init/migration/migrate.go index 9dfa5ebd1..aaec1a634 100644 --- a/agent/init/migration/migrate.go +++ b/agent/init/migration/migrate.go @@ -29,6 +29,7 @@ func InitAgentDB() { migrations.InitDefault, migrations.UpdateWebsiteExpireDate, migrations.AddLocalSSHSetting, + migrations.AddAppIgnore, }) if err := m.Migrate(); err != nil { global.LOG.Error(err) diff --git a/agent/init/migration/migrations/init.go b/agent/init/migration/migrations/init.go index ab5db461f..627db4dca 100644 --- a/agent/init/migration/migrations/init.go +++ b/agent/init/migration/migrations/init.go @@ -59,6 +59,7 @@ var AddTable = &gormigrate.Migration{ &model.WebsiteDomain{}, &model.WebsiteSSL{}, &model.Group{}, + &model.AppIgnoreUpgrade{}, ) }, } @@ -321,3 +322,13 @@ var AddLocalSSHSetting = &gormigrate.Migration{ return nil }, } + +var AddAppIgnore = &gormigrate.Migration{ + ID: "20250408-add-app-ignore", + Migrate: func(tx *gorm.DB) error { + if err := tx.AutoMigrate(&model.AppIgnoreUpgrade{}); err != nil { + return err + } + return nil + }, +} diff --git a/agent/router/ro_app.go b/agent/router/ro_app.go index 21171de1d..1fea6598b 100644 --- a/agent/router/ro_app.go +++ b/agent/router/ro_app.go @@ -22,6 +22,7 @@ func (a *AppRouter) InitRouter(Router *gin.RouterGroup) { appRouter.GET("/details/:id", baseApi.GetAppDetailByID) appRouter.POST("/install", baseApi.InstallApp) appRouter.GET("/tags", baseApi.GetAppTags) + appRouter.POST("/installed/check", baseApi.CheckAppInstalled) appRouter.POST("/installed/loadport", baseApi.LoadPort) appRouter.POST("/installed/conninfo", baseApi.LoadConnInfo) @@ -35,11 +36,13 @@ func (a *AppRouter) InitRouter(Router *gin.RouterGroup) { appRouter.POST("/installed/conf", baseApi.GetDefaultConfig) appRouter.GET("/installed/params/:appInstallId", baseApi.GetParams) appRouter.POST("/installed/params/update", baseApi.UpdateInstalled) - appRouter.POST("/installed/ignore", baseApi.IgnoreUpgrade) - appRouter.GET("/ignored/detail", baseApi.GetIgnoredApp) appRouter.POST("/installed/update/versions", baseApi.GetUpdateVersions) appRouter.POST("/installed/config/update", baseApi.UpdateAppConfig) appRouter.POST("/store/update", baseApi.UpdateAppstoreConfig) appRouter.GET("/store/config", baseApi.GetAppstoreConfig) + + appRouter.POST("/installed/ignore", baseApi.IgnoreAppUpgrade) + appRouter.GET("/ignored/detail", baseApi.ListAppIgnored) + appRouter.POST("/ignored/cancel", baseApi.CancelIgnoreAppUpgrade) } } diff --git a/core/app/api/v2/auth.go b/core/app/api/v2/auth.go index 7d93ed4c7..67995cf66 100644 --- a/core/app/api/v2/auth.go +++ b/core/app/api/v2/auth.go @@ -92,7 +92,7 @@ func (b *BaseApi) LogOut(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Auth diff --git a/core/app/api/v2/backup.go b/core/app/api/v2/backup.go index fec8d8dec..351669174 100644 --- a/core/app/api/v2/backup.go +++ b/core/app/api/v2/backup.go @@ -27,7 +27,7 @@ func (b *BaseApi) CreateBackup(c *gin.Context) { helper.InternalServer(c, err) return } - helper.SuccessWithOutData(c) + helper.Success(c) } // @Tags Backup Account diff --git a/frontend/src/api/interface/app.ts b/frontend/src/api/interface/app.ts index 8d6180fcd..240daa7e0 100644 --- a/frontend/src/api/interface/app.ts +++ b/frontend/src/api/interface/app.ts @@ -52,7 +52,7 @@ export namespace App { } export interface AppDetail extends CommonModel { - appId: string; + appId: number; icon: string; version: string; readme: string; @@ -132,7 +132,7 @@ export namespace App { export interface AppInstalled extends CommonModel { name: string; - appId: number; + appID: number; appDetailId: string; env: string; status: string; @@ -272,6 +272,16 @@ export namespace App { updateVersion?: string; } + export interface AppIgnoreReq { + appID: number; + appDetailID: number; + scope: string; + } + + export interface CancelAppIgnore { + id: number; + } + export interface AppStoreSync { taskID: string; } diff --git a/frontend/src/api/modules/app.ts b/frontend/src/api/modules/app.ts index d6e1b10ff..872d8279d 100644 --- a/frontend/src/api/modules/app.ts +++ b/frontend/src/api/modules/app.ts @@ -95,7 +95,7 @@ export const updateAppInstallParams = (req: any) => { return http.post(`apps/installed/params/update`, req); }; -export const ignoreUpgrade = (req: any) => { +export const ignoreUpgrade = (req: App.AppIgnoreReq) => { return http.post(`apps/installed/ignore`, req); }; @@ -103,6 +103,10 @@ export const getIgnoredApp = () => { return http.get(`apps/ignored/detail`); }; +export const cancelAppIgnore = (req: App.CancelAppIgnore) => { + return http.post(`apps/ignored/cancel`, req); +}; + export const updateInstallConfig = (req: App.AppConfigUpdate) => { return http.post(`apps/installed/config/update`, req); }; diff --git a/frontend/src/api/modules/website.ts b/frontend/src/api/modules/website.ts index b9e90127c..e13e5259f 100644 --- a/frontend/src/api/modules/website.ts +++ b/frontend/src/api/modules/website.ts @@ -11,7 +11,7 @@ export const searchWebsites = (req: Website.WebSiteSearch) => { }; export const listWebsites = () => { - return http.get(`/websites/list`); + return http.get(`/websites/list`); }; export const createWebsite = (req: Website.WebSiteCreateReq) => { diff --git a/frontend/src/global/mimetype.ts b/frontend/src/global/mimetype.ts index 8753be749..09cd7b912 100644 --- a/frontend/src/global/mimetype.ts +++ b/frontend/src/global/mimetype.ts @@ -264,6 +264,14 @@ export const Patterns = [ value: 'regex', hidden: ['Method'], }, + { + label: i18n.global.t('xpack.waf.belongToIpGroup'), + value: 'belongToIpGroup', + }, + { + label: i18n.global.t('xpack.waf.notBelongToIpGroup'), + value: 'notBelongToIpGroup', + }, ]; export const HttpCodes = [ @@ -275,6 +283,10 @@ export const HttpCodes = [ label: i18n.global.t('xpack.waf.forbidden'), value: 403, }, + { + label: i18n.global.t('xpack.waf.notFound'), + value: 404, + }, { label: i18n.global.t('xpack.waf.noRes'), value: 444, @@ -283,6 +295,14 @@ export const HttpCodes = [ label: i18n.global.t('xpack.waf.serverErr'), value: 500, }, + { + label: i18n.global.t('xpack.waf.serviceUnavailable'), + value: 503, + }, + { + label: i18n.global.t('xpack.waf.gatewayTimeout'), + value: 504, + }, ]; export const HttpMethods = [ diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index e16e33b9d..8b93c6e0d 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -2091,6 +2091,8 @@ const message = { 'Before installing a custom app store package, please ensure that there are no installed apps.', forceUninstall: 'Force Uninstall', syncCustomApp: 'Sync Custom App', + ignoreAll: 'Ignore all subsequent versions', + ignoreVersion: 'Ignore specified version', }, website: { primaryDomain: 'Primary Domain', @@ -3016,6 +3018,11 @@ const message = { strictHelper: 'Use stricter rules to validate requests', saveLog: 'Save Log', remoteURLHelper: 'The remote URL needs to ensure one IP per line and no other characters', + notFound: 'Not Found (404)', + serviceUnavailable: 'Service Unavailable (503)', + gatewayTimeout: 'Gateway Timeout (504)', + belongToIpGroup: 'Belongs to IP Group', + notBelongToIpGroup: 'Does not belong to IP Group', }, monitor: { name: 'Website Monitoring', diff --git a/frontend/src/lang/modules/ja.ts b/frontend/src/lang/modules/ja.ts index 0cc48e257..94088de06 100644 --- a/frontend/src/lang/modules/ja.ts +++ b/frontend/src/lang/modules/ja.ts @@ -1994,6 +1994,8 @@ const message = { 'カスタムアプリストアパッケージをインストールする前に、インストールされているアプリがないことを確認してください。', forceUninstall: '強制アンインストール', syncCustomApp: 'カスタムアプリを同期', + ignoreAll: '後続のすべてのバージョンを無視', + ignoreVersion: '指定されたバージョンを無視', }, website: { primaryDomain: 'プライマリドメイン', @@ -2876,6 +2878,11 @@ const message = { strictHelper: 'より厳格なルールを使用してリクエストを検証します', saveLog: 'ログを保存', remoteURLHelper: 'リモート URL は、1行に1つのIPで、他の文字がないことを保証する必要があります', + notFound: 'Not Found (404)', + serviceUnavailable: 'サービスを利用できません (503)', + gatewayTimeout: 'ゲートウェイタイムアウト (504)', + belongToIpGroup: 'IP グループに属しています', + notBelongToIpGroup: 'IP グループに属していません', }, monitor: { name: 'ウェブサイトモニタリング', diff --git a/frontend/src/lang/modules/ko.ts b/frontend/src/lang/modules/ko.ts index 372729293..b2197341e 100644 --- a/frontend/src/lang/modules/ko.ts +++ b/frontend/src/lang/modules/ko.ts @@ -1962,6 +1962,8 @@ const message = { customAppHelper: '사용자 정의 앱 스토어 패키지를 설치하기 전에 설치된 앱이 없는지 확인하십시오.', forceUninstall: '강제 제거', syncCustomApp: 'カスタムアプリを同期', + ignoreAll: '후속 모든 버전 무시', + ignoreVersion: '지정된 버전 무시', }, website: { primaryDomain: '기본 도메인', @@ -2831,6 +2833,11 @@ const message = { strictHelper: '더 엄격한 규칙을 사용하여 요청을 검증합니다', saveLog: '로그 저장', remoteURLHelper: '원격 URL은 한 줄에 하나의 IP만 포함하고 다른 문자는 포함하지 않아야 합니다', + notFound: 'Not Found (404)', + serviceUnavailable: '서비스 불가 (503)', + gatewayTimeout: '게이트웨이 시간 초과 (504)', + belongToIpGroup: 'IP 그룹에 속함', + notBelongToIpGroup: 'IP 그룹에 속하지 않음', }, monitor: { name: '웹사이트 모니터링', diff --git a/frontend/src/lang/modules/ms.ts b/frontend/src/lang/modules/ms.ts index d6454dbfb..b10eb36dc 100644 --- a/frontend/src/lang/modules/ms.ts +++ b/frontend/src/lang/modules/ms.ts @@ -2048,6 +2048,8 @@ const message = { 'Sebelum memasang pakej kedai aplikasi tersuai, sila pastikan tidak ada aplikasi yang dipasang.', forceUninstall: 'Paksa Nyahpasang', syncCustomApp: 'Segerakan Aplikasi Tersuai', + ignoreAll: 'Abaikan semua versi berikutnya', + ignoreVersion: 'Abaikan versi yang ditentukan', }, website: { primaryDomain: 'Domain Utama', @@ -2941,6 +2943,11 @@ const message = { strictHelper: 'Gunakan peraturan yang lebih ketat untuk mengesahkan permintaan', saveLog: 'Simpan Log', remoteURLHelper: 'URL jauh perlu memastikan satu IP setiap baris dan tiada aksara lain', + notFound: 'Not Found (404)', + serviceUnavailable: 'Perkhidmatan Tidak Tersedia (503)', + gatewayTimeout: 'Timeout Gateway (504)', + belongToIpGroup: 'Tergolong dalam Kumpulan IP', + notBelongToIpGroup: 'Tidak tergolong dalam Kumpulan IP', }, monitor: { name: 'Pemantauan Laman Web', diff --git a/frontend/src/lang/modules/pt-br.ts b/frontend/src/lang/modules/pt-br.ts index 4f826e97e..67a529346 100644 --- a/frontend/src/lang/modules/pt-br.ts +++ b/frontend/src/lang/modules/pt-br.ts @@ -2040,6 +2040,8 @@ const message = { 'Antes de instalar um pacote de loja de aplicativos personalizado, certifique-se de que não há aplicativos instalados.', forceUninstall: 'Desinstalação Forçada', syncCustomApp: 'Sincronizar Aplicativo Personalizado', + ignoreAll: 'Ignorar todas as versões subsequentes', + ignoreVersion: 'Ignorar versão especificada', }, website: { primaryDomain: 'Domínio principal', @@ -2942,6 +2944,11 @@ const message = { strictHelper: 'Usa regras mais rigorosas para validar solicitações', saveLog: 'Salvar log', remoteURLHelper: 'O URL remoto precisa garantir um IP por linha e nenhum outro caractere', + notFound: 'Not Found (404)', + serviceUnavailable: 'Serviço Indisponível (503)', + gatewayTimeout: 'Tempo Limite da Porta de Entrada (504)', + belongToIpGroup: 'Pertence ao Grupo de IP', + notBelongToIpGroup: 'Não pertence ao Grupo de IP', }, monitor: { name: 'Monitoramento de Websites', diff --git a/frontend/src/lang/modules/ru.ts b/frontend/src/lang/modules/ru.ts index 42e659751..d5be02398 100644 --- a/frontend/src/lang/modules/ru.ts +++ b/frontend/src/lang/modules/ru.ts @@ -2040,6 +2040,8 @@ const message = { 'Перед установкой пользовательского пакета из магазина приложений убедитесь, что нет установленных приложений.', forceUninstall: 'Принудительное удаление', syncCustomApp: 'Синхронизировать пользовательское приложение', + ignoreAll: 'Игнорировать все последующие версии', + ignoreVersion: 'Игнорировать указанную версию', }, website: { primaryDomain: 'Основной домен', @@ -2935,6 +2937,11 @@ const message = { strictHelper: 'Использует более строгие правила для проверки запросов', saveLog: 'Сохранить лог', remoteURLHelper: 'Удаленный URL должен содержать один IP на строку и не содержать других символов', + notFound: 'Not Found (404)', + serviceUnavailable: 'Сервис недоступен (503)', + gatewayTimeout: 'Тайм-аут шлюза (504)', + belongToIpGroup: 'Принадлежит к группе IP', + notBelongToIpGroup: 'Не принадлежит к группе IP', }, monitor: { name: 'Мониторинг веб-сайта', diff --git a/frontend/src/lang/modules/zh-Hant.ts b/frontend/src/lang/modules/zh-Hant.ts index e60cbbd33..71e5a2672 100644 --- a/frontend/src/lang/modules/zh-Hant.ts +++ b/frontend/src/lang/modules/zh-Hant.ts @@ -1936,6 +1936,8 @@ const message = { customAppHelper: '在安裝自訂應用商店包之前,請確保沒有任何已安裝的應用。', forceUninstall: '強制卸載', syncCustomApp: '同步自訂應用', + ignoreAll: '忽略後續所有版本', + ignoreVersion: '忽略指定版本', }, website: { primaryDomain: '主域名', @@ -2796,6 +2798,11 @@ const message = { strictHelper: '使用更嚴格的規則來校驗請求', saveLog: '保存日誌', remoteURLHelper: '遠程 URL 需要保證每行一個 IP 並且沒有其他字符', + notFound: 'Not Found (404)', + serviceUnavailable: '服務不可用 (503)', + gatewayTimeout: '網關超時 (504)', + belongToIpGroup: '屬於 IP 組', + notBelongToIpGroup: '不屬於 IP 組', }, monitor: { name: '網站監控', diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index 0029e8735..0d470f765 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -1926,6 +1926,8 @@ const message = { customAppHelper: '在使用自定义应用商店仓库之前,请确保没有任何已安装的应用。', forceUninstall: '强制卸载', syncCustomApp: '同步自定义应用', + ignoreAll: '忽略后续所有版本', + ignoreVersion: '忽略指定版本', }, website: { primaryDomain: '主域名', @@ -2784,6 +2786,11 @@ const message = { strictHelper: '使用更严格的规则来校验请求', saveLog: '保存日志', remoteURLHelper: '远程 URL 需要保证每行一个 IP 并且没有其他字符', + notFound: 'Not Found (404)', + serviceUnavailable: '服务不可用 (503)', + gatewayTimeout: '网关超时 (504)', + belongToIpGroup: '属于 IP 组', + notBelongToIpGroup: '不属于 IP 组', }, monitor: { name: '网站监控', diff --git a/frontend/src/views/app-store/installed/ignore/create/index.vue b/frontend/src/views/app-store/installed/ignore/create/index.vue new file mode 100644 index 000000000..9193f4ae6 --- /dev/null +++ b/frontend/src/views/app-store/installed/ignore/create/index.vue @@ -0,0 +1,93 @@ + + + diff --git a/frontend/src/views/app-store/installed/ignore/index.vue b/frontend/src/views/app-store/installed/ignore/index.vue index e06544f3a..2f6868c24 100644 --- a/frontend/src/views/app-store/installed/ignore/index.vue +++ b/frontend/src/views/app-store/installed/ignore/index.vue @@ -11,11 +11,12 @@ {{ app.name }}
- {{ app.version }} + {{ app.version }} + {{ $t('commons.table.all') + $t('app.version') }}
- + {{ $t('app.cancelIgnore') }} @@ -32,10 +33,11 @@