Skip to content

Commit

Permalink
fix: 解决 PHP 运行环境网站删除之后没有删除应用的问题 (#6036)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengkunwang223 authored Aug 6, 2024
1 parent fa633bf commit d639e46
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 6 deletions.
1 change: 1 addition & 0 deletions backend/app/dto/response/website.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ type WebsiteRes struct {
RuntimeName string `json:"runtimeName"`
SSLExpireDate time.Time `json:"sslExpireDate"`
SSLStatus string `json:"sslStatus"`
AppInstallID uint `json:"appInstallId"`
}

type WebsiteOption struct {
Expand Down
8 changes: 6 additions & 2 deletions backend/app/service/website.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,9 @@ func (w WebsiteService) PageWebsite(req request.WebsiteSearch) (int64, []respons
}
for _, web := range websites {
var (
appName string
runtimeName string
appName string
runtimeName string
appInstallID uint
)
switch web.Type {
case constant.Deployment:
Expand All @@ -149,12 +150,14 @@ func (w WebsiteService) PageWebsite(req request.WebsiteSearch) (int64, []respons
return 0, nil, err
}
appName = appInstall.Name
appInstallID = appInstall.ID
case constant.Runtime:
runtime, err := runtimeRepo.GetFirst(commonRepo.WithByID(web.RuntimeID))
if err != nil {
return 0, nil, err
}
runtimeName = runtime.Name
appInstallID = runtime.ID
}
sitePath := path.Join(constant.AppInstallDir, constant.AppOpenresty, nginxInstall.Name, "www", "sites", web.Alias)

Expand All @@ -173,6 +176,7 @@ func (w WebsiteService) PageWebsite(req request.WebsiteSearch) (int64, []respons
SSLStatus: checkSSLStatus(web.WebsiteSSL.ExpireDate),
RuntimeName: runtimeName,
SitePath: sitePath,
AppInstallID: appInstallID,
})
}
return total, websiteDTOs, nil
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/lang/modules/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1852,6 +1852,10 @@ const message = {
useCustom: 'Customize docker-compose.yml',
useCustomHelper:
'Using a custom docker-compose.yml file may cause the application upgrade to fail. If it is not necessary, do not check it',
diffHelper:
'The left side is the old version, the right side is the new version. After editing, click to save the custom version',
pullImage: 'Pull Image',
pullImageHelper: 'Execute docker pull to pull the image before the application starts',
},
website: {
website: 'Website',
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/lang/modules/tw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1720,6 +1720,8 @@ const message = {
useCustom: '自 docker-compose.yml',
useCustomHelper: '使用自訂 docker-compose.yml 文件可能會導致應用程式升級失敗如無必要請勿勾選',
diffHelper: '左側為舊版本右側為新版編輯之後點選使用自訂版本儲存',
pullImage: '拉取鏡像',
pullImageHelper: '在應用啟動之前執行 docker pull 來拉取鏡像',
},
website: {
website: '網',
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/lang/modules/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1721,6 +1721,8 @@ const message = {
useCustom: '自定义 docker-compose.yml',
useCustomHelper: '使用自定义 docker-compose.yml 文件可能会导致应用升级失败如无必要请勿勾选',
diffHelper: '左侧为旧版本右侧为新版编辑之后点击使用自定义版本保存',
pullImage: '拉取镜像',
pullImageHelper: '在应用启动之前执行 docker pull 来拉取镜像',
},
website: {
website: '网',
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/views/app-store/detail/install/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@
<span class="input-help">{{ $t('app.editComposeHelper') }}</span>
</el-form-item>
<el-form-item pro="pullImage">
<el-checkbox v-model="req.pullImage" :label="$t('container.forcePull')" size="large" />
<span class="input-help">{{ $t('container.forcePullHelper') }}</span>
<el-checkbox v-model="req.pullImage" :label="$t('app.pullImage')" size="large" />
<span class="input-help">{{ $t('app.pullImageHelper') }}</span>
</el-form-item>
<div v-if="req.editCompose">
<codemirror
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/views/app-store/installed/upgrade/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
</span>
</el-form-item>
<el-form-item pro="pullImage" v-if="operateReq.operate === 'upgrade'">
<el-checkbox v-model="operateReq.pullImage" :label="$t('container.forcePull')" size="large" />
<span class="input-help">{{ $t('container.forcePullHelper') }}</span>
<el-checkbox v-model="operateReq.pullImage" :label="$t('app.pullImage')" size="large" />
<span class="input-help">{{ $t('app.pullImageHelper') }}</span>
</el-form-item>
</el-form>
</el-col>
Expand Down

0 comments on commit d639e46

Please sign in to comment.