From e0a5e14978f935caef00cfbccc861088c47e6973 Mon Sep 17 00:00:00 2001 From: zhengkunwang <31820853+zhengkunwang223@users.noreply.github.com> Date: Tue, 20 Aug 2024 17:42:47 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E9=9D=9E=20PHP=20?= =?UTF-8?q?=E8=BF=90=E8=A1=8C=E7=8E=AF=E5=A2=83=E7=BD=91=E7=AB=99=E7=9A=84?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=8F=90=E7=A4=BA=20(#6189)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/dto/response/website.go | 1 + backend/app/service/website.go | 3 +++ frontend/src/api/interface/website.ts | 1 + frontend/src/components/log-file/index.vue | 3 ++- frontend/src/views/log/system/index.vue | 1 - frontend/src/views/website/website/delete/index.vue | 4 ++-- 6 files changed, 9 insertions(+), 4 deletions(-) diff --git a/backend/app/dto/response/website.go b/backend/app/dto/response/website.go index 17de036da..dfcc31ab8 100644 --- a/backend/app/dto/response/website.go +++ b/backend/app/dto/response/website.go @@ -31,6 +31,7 @@ type WebsiteRes struct { SSLExpireDate time.Time `json:"sslExpireDate"` SSLStatus string `json:"sslStatus"` AppInstallID uint `json:"appInstallId"` + RuntimeType string `json:"runtimeType"` } type WebsiteOption struct { diff --git a/backend/app/service/website.go b/backend/app/service/website.go index e0738dfc8..e1460dca1 100644 --- a/backend/app/service/website.go +++ b/backend/app/service/website.go @@ -141,6 +141,7 @@ func (w WebsiteService) PageWebsite(req request.WebsiteSearch) (int64, []respons var ( appName string runtimeName string + runtimeType string appInstallID uint ) switch web.Type { @@ -157,6 +158,7 @@ func (w WebsiteService) PageWebsite(req request.WebsiteSearch) (int64, []respons return 0, nil, err } runtimeName = runtime.Name + runtimeType = runtime.Type appInstallID = runtime.ID } sitePath := path.Join(constant.AppInstallDir, constant.AppOpenresty, nginxInstall.Name, "www", "sites", web.Alias) @@ -177,6 +179,7 @@ func (w WebsiteService) PageWebsite(req request.WebsiteSearch) (int64, []respons RuntimeName: runtimeName, SitePath: sitePath, AppInstallID: appInstallID, + RuntimeType: runtimeType, }) } return total, websiteDTOs, nil diff --git a/frontend/src/api/interface/website.ts b/frontend/src/api/interface/website.ts index 797b9b885..a7d7170b7 100644 --- a/frontend/src/api/interface/website.ts +++ b/frontend/src/api/interface/website.ts @@ -31,6 +31,7 @@ export namespace Website { sitePath: string; appName: string; runtimeName: string; + runtimeType: string; } export interface WebsiteRes extends CommonModel { protocol: string; diff --git a/frontend/src/components/log-file/index.vue b/frontend/src/components/log-file/index.vue index becbee84d..fdf84db8b 100644 --- a/frontend/src/components/log-file/index.vue +++ b/frontend/src/components/log-file/index.vue @@ -174,6 +174,8 @@ const getContent = (pre: boolean) => { } end.value = res.data.end; + content.value = logs.value.join('\n'); + emit('update:hasContent', content.value !== ''); nextTick(() => { if (pre) { @@ -199,7 +201,6 @@ const getContent = (pre: boolean) => { } isLoading.value = false; - content.value = logs.value.join('\n'); }); }; diff --git a/frontend/src/views/log/system/index.vue b/frontend/src/views/log/system/index.vue index 4012c51b2..3b258920e 100644 --- a/frontend/src/views/log/system/index.vue +++ b/frontend/src/views/log/system/index.vue @@ -32,7 +32,6 @@ ref="logRef" :config="logConfig" :default-button="false" - v-if="showLog" v-model:loading="loading" v-model:hasContent="hasContent" :style="'height: calc(100vh - 370px);min-height: 200px'" diff --git a/frontend/src/views/website/website/delete/index.vue b/frontend/src/views/website/website/delete/index.vue index 424bdc781..391384c05 100644 --- a/frontend/src/views/website/website/delete/index.vue +++ b/frontend/src/views/website/website/delete/index.vue @@ -80,14 +80,14 @@ const handleClose = () => { em('close', false); }; -const acceptParams = async (website: Website.Website) => { +const acceptParams = async (website: Website.WebsiteDTO) => { deleteReq.value = { id: 0, deleteApp: false, deleteBackup: false, forceDelete: false, }; - if (website.type === 'runtime' && website.appInstallId > 0) { + if (website.type === 'runtime' && website.appInstallId > 0 && website.runtimeType == 'php') { runtimeApp.value = true; deleteReq.value.deleteApp = true; }