feat: 修改一些样式

This commit is contained in:
zhengkunwang223 2023-03-09 17:50:47 +08:00 committed by zhengkunwang223
parent 0d5d01fffc
commit 706a1a198f
7 changed files with 38 additions and 7 deletions

View file

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

View file

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

View file

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

View file

@ -4,7 +4,7 @@ import { Website } from '../interface/Website';
import { File } from '../interface/file';
export const SearchWebsites = (req: Website.WebSiteSearch) => {
return http.post<ResPage<Website.Website>>(`/websites/search`, req);
return http.post<ResPage<Website.WebsiteDTO>>(`/websites/search`, req);
};
export const ListWebsites = () => {

View file

@ -274,4 +274,8 @@
width: 8px;
height: 8px;
background-color: #000000;
}
}
.middle-center {
vertical-align: middle;
}

View file

@ -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(() => {

View file

@ -66,16 +66,26 @@
@search="search()"
:class="{ mask: nginxStatus != 'Running' }"
>
<el-table-column :label="$t('commons.table.name')" fix show-overflow-tooltip prop="primaryDomain">
<el-table-column
:label="$t('commons.table.name')"
fix
show-overflow-tooltip
prop="primaryDomain"
min-width="120px"
>
<template #default="{ row }">
<el-link type="primary" :underline="false" @click="openConfig(row.id)">
{{ row.primaryDomain }}
</el-link>
<el-button link :icon="Promotion" @click="openUrl(row)"></el-button>
<span>
<el-link type="primary" :underline="false" @click="openConfig(row.id)">
<span style="margin-left: 10px">{{ row.primaryDomain }}</span>
</el-link>
</span>
</template>
</el-table-column>
<el-table-column :label="$t('commons.table.type')" fix prop="type">
<template #default="{ row }">
{{ $t('website.' + row.type) }}
<span v-if="row.type === 'deployment'">[{{ row.appName }}]</span>
</template>
</el-table-column>
<el-table-column :label="$t('commons.table.status')" prop="status">
@ -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;