fix: 解决 PHP 运行环境网站删除之后没有删除应用的问题 (#6036)

pull/6058/head
zhengkunwang 2024-08-06 11:34:29 +08:00 committed by GitHub
parent fa633bf419
commit d639e46bc7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 19 additions and 6 deletions

View File

@ -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 {

View File

@ -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:
@ -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)
@ -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

View File

@ -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',

View File

@ -1720,6 +1720,8 @@ const message = {
useCustom: ' docker-compose.yml',
useCustomHelper: '使 docker-compose.yml ',
diffHelper: '使',
pullImage: '',
pullImageHelper: ' docker pull ',
},
website: {
website: '',

View File

@ -1721,6 +1721,8 @@ const message = {
useCustom: ' docker-compose.yml',
useCustomHelper: '使 docker-compose.yml ',
diffHelper: '使',
pullImage: '',
pullImageHelper: ' docker pull ',
},
website: {
website: '',

View File

@ -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

View File

@ -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>