From 1bba2664b6ea183e3cd5bf34d7abbf92c486d64d Mon Sep 17 00:00:00 2001 From: zhengkunwang223 <31820853+zhengkunwang223@users.noreply.github.com> Date: Mon, 10 Apr 2023 16:24:26 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=BD=91=E7=AB=99=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=BF=90=E8=A1=8C=E7=8E=AF=E5=A2=83=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=20(#562)?= 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 | 19 +++++++++++++++---- frontend/src/api/interface/website.ts | 1 + frontend/src/views/website/website/index.vue | 11 ++++++----- 4 files changed, 23 insertions(+), 9 deletions(-) diff --git a/backend/app/dto/response/website.go b/backend/app/dto/response/website.go index 1f9f80d9d..4e842dad7 100644 --- a/backend/app/dto/response/website.go +++ b/backend/app/dto/response/website.go @@ -10,6 +10,7 @@ type WebsiteDTO struct { AccessLogPath string `json:"accessLogPath"` SitePath string `json:"sitePath"` AppName string `json:"appName"` + RuntimeName string `json:"runtimeName"` } type WebsitePreInstallCheck struct { diff --git a/backend/app/service/website.go b/backend/app/service/website.go index 1159a5afc..78bc70089 100644 --- a/backend/app/service/website.go +++ b/backend/app/service/website.go @@ -78,17 +78,28 @@ func (w WebsiteService) PageWebsite(req request.WebsiteSearch) (int64, []respons return 0, nil, err } for _, web := range websites { - var appName string - if web.Type == constant.Deployment { + var ( + appName string + runtimeName string + ) + switch web.Type { + case constant.Deployment: appInstall, err := appInstallRepo.GetFirst(commonRepo.WithByID(web.AppInstallID)) if err != nil { return 0, nil, err } appName = appInstall.Name + case constant.Runtime: + runtime, err := runtimeRepo.GetFirst(commonRepo.WithByID(web.RuntimeID)) + if err != nil { + return 0, nil, err + } + runtimeName = runtime.Name } websiteDTOs = append(websiteDTOs, response.WebsiteDTO{ - Website: web, - AppName: appName, + Website: web, + AppName: appName, + RuntimeName: runtimeName, }) } return total, websiteDTOs, nil diff --git a/frontend/src/api/interface/website.ts b/frontend/src/api/interface/website.ts index be734914c..6123cd8a8 100644 --- a/frontend/src/api/interface/website.ts +++ b/frontend/src/api/interface/website.ts @@ -24,6 +24,7 @@ export namespace Website { accessLogPath: string; sitePath: string; appName: string; + runtimeName: string; } export interface NewAppInstall { diff --git a/frontend/src/views/website/website/index.vue b/frontend/src/views/website/website/index.vue index 103f3edd4..7257a7ff0 100644 --- a/frontend/src/views/website/website/index.vue +++ b/frontend/src/views/website/website/index.vue @@ -76,6 +76,7 @@ @@ -203,11 +204,11 @@ const maskShow = ref(true); const createRef = ref(); const deleteRef = ref(); const groupRef = ref(); -let openNginxConfig = ref(false); -let nginxIsExist = ref(false); -let containerName = ref(''); -let nginxStatus = ref(''); -let installPath = ref(''); +const openNginxConfig = ref(false); +const nginxIsExist = ref(false); +const containerName = ref(''); +const nginxStatus = ref(''); +const installPath = ref(''); const uploadRef = ref(); const dialogBackupRef = ref(); const defaultRef = ref();