From 706a1a198fb55eb34cb74f78f1b816745970c56b Mon Sep 17 00:00:00 2001 From: zhengkunwang223 Date: Thu, 9 Mar 2023 17:50:47 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= 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 | 9 +++++++ frontend/src/api/interface/website.ts | 2 ++ frontend/src/api/modules/website.ts | 2 +- frontend/src/styles/common.scss | 6 ++++- .../website/config/basic/https/index.vue | 1 - frontend/src/views/website/website/index.vue | 24 +++++++++++++++---- 7 files changed, 38 insertions(+), 7 deletions(-) diff --git a/backend/app/dto/response/website.go b/backend/app/dto/response/website.go index a77ee781c..206deea81 100644 --- a/backend/app/dto/response/website.go +++ b/backend/app/dto/response/website.go @@ -9,6 +9,7 @@ type WebsiteDTO struct { ErrorLogPath string `json:"errorLogPath"` AccessLogPath string `json:"accessLogPath"` SitePath string `json:"sitePath"` + AppName string `json:"appName"` } type WebsitePreInstallCheck struct { diff --git a/backend/app/service/website.go b/backend/app/service/website.go index 066b944d4..fe6ea1d08 100644 --- a/backend/app/service/website.go +++ b/backend/app/service/website.go @@ -73,8 +73,17 @@ 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 { + appInstall, err := appInstallRepo.GetFirst(commonRepo.WithByID(web.AppInstallID)) + if err != nil { + return 0, nil, err + } + appName = appInstall.Name + } websiteDTOs = append(websiteDTOs, response.WebsiteDTO{ Website: web, + AppName: appName, }) } return total, websiteDTOs, nil diff --git a/frontend/src/api/interface/website.ts b/frontend/src/api/interface/website.ts index b290abc56..8d4ffe5df 100644 --- a/frontend/src/api/interface/website.ts +++ b/frontend/src/api/interface/website.ts @@ -12,6 +12,7 @@ export namespace Website { webSiteGroupId: number; otherDomains: string; defaultServer: boolean; + protocol: string; autoRenew: boolean; appinstall?: NewAppInstall; webSiteSSL: SSL; @@ -21,6 +22,7 @@ export namespace Website { errorLogPath: string; accessLogPath: string; sitePath: string; + appName: string; } export interface NewAppInstall { diff --git a/frontend/src/api/modules/website.ts b/frontend/src/api/modules/website.ts index 0af2005da..ac79ed12e 100644 --- a/frontend/src/api/modules/website.ts +++ b/frontend/src/api/modules/website.ts @@ -4,7 +4,7 @@ import { Website } from '../interface/Website'; import { File } from '../interface/file'; export const SearchWebsites = (req: Website.WebSiteSearch) => { - return http.post>(`/websites/search`, req); + return http.post>(`/websites/search`, req); }; export const ListWebsites = () => { diff --git a/frontend/src/styles/common.scss b/frontend/src/styles/common.scss index 41f11fc96..4a03fd75d 100644 --- a/frontend/src/styles/common.scss +++ b/frontend/src/styles/common.scss @@ -274,4 +274,8 @@ width: 8px; height: 8px; background-color: #000000; -} \ No newline at end of file +} + +.middle-center { + vertical-align: middle; +} diff --git a/frontend/src/views/website/website/config/basic/https/index.vue b/frontend/src/views/website/website/config/basic/https/index.vue index f61eb339a..311cd2bdc 100644 --- a/frontend/src/views/website/website/config/basic/https/index.vue +++ b/frontend/src/views/website/website/config/basic/https/index.vue @@ -233,7 +233,6 @@ const changeEnable = (enable: boolean) => { done(); } else { instance.confirmButtonLoading = true; - instance.cancelButtonLoading = true; form.enable = false; form.websiteId = id.value; UpdateHTTPSConfig(form).then(() => { diff --git a/frontend/src/views/website/website/index.vue b/frontend/src/views/website/website/index.vue index ae8979c59..e89255052 100644 --- a/frontend/src/views/website/website/index.vue +++ b/frontend/src/views/website/website/index.vue @@ -66,16 +66,26 @@ @search="search()" :class="{ mask: nginxStatus != 'Running' }" > - + @@ -175,6 +185,7 @@ import { ElMessageBox } from 'element-plus'; import { dateFormatSimple } from '@/utils/util'; import { MsgSuccess } from '@/utils/message'; import { useI18n } from 'vue-i18n'; +import { Promotion } from '@element-plus/icons-vue'; const shortcuts = [ { @@ -221,6 +232,11 @@ let req = reactive({ websiteGroupId: 0, }); +const openUrl = (row: Website.WebsiteDTO) => { + const url = row.protocol.toLowerCase() + '://' + row.primaryDomain; + window.open(url); +}; + const search = async () => { req.page = paginationConfig.currentPage; req.pageSize = paginationConfig.pageSize;