1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-19 08:19:15 +08:00

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"` ErrorLogPath string `json:"errorLogPath"`
AccessLogPath string `json:"accessLogPath"` AccessLogPath string `json:"accessLogPath"`
SitePath string `json:"sitePath"` SitePath string `json:"sitePath"`
AppName string `json:"appName"`
} }
type WebsitePreInstallCheck struct { type WebsitePreInstallCheck struct {

View File

@ -73,8 +73,17 @@ func (w WebsiteService) PageWebsite(req request.WebsiteSearch) (int64, []respons
return 0, nil, err return 0, nil, err
} }
for _, web := range websites { 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{ websiteDTOs = append(websiteDTOs, response.WebsiteDTO{
Website: web, Website: web,
AppName: appName,
}) })
} }
return total, websiteDTOs, nil return total, websiteDTOs, nil

View File

@ -12,6 +12,7 @@ export namespace Website {
webSiteGroupId: number; webSiteGroupId: number;
otherDomains: string; otherDomains: string;
defaultServer: boolean; defaultServer: boolean;
protocol: string;
autoRenew: boolean; autoRenew: boolean;
appinstall?: NewAppInstall; appinstall?: NewAppInstall;
webSiteSSL: SSL; webSiteSSL: SSL;
@ -21,6 +22,7 @@ export namespace Website {
errorLogPath: string; errorLogPath: string;
accessLogPath: string; accessLogPath: string;
sitePath: string; sitePath: string;
appName: string;
} }
export interface NewAppInstall { export interface NewAppInstall {

View File

@ -4,7 +4,7 @@ import { Website } from '../interface/Website';
import { File } from '../interface/file'; import { File } from '../interface/file';
export const SearchWebsites = (req: Website.WebSiteSearch) => { 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 = () => { export const ListWebsites = () => {

View File

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

View File

@ -233,7 +233,6 @@ const changeEnable = (enable: boolean) => {
done(); done();
} else { } else {
instance.confirmButtonLoading = true; instance.confirmButtonLoading = true;
instance.cancelButtonLoading = true;
form.enable = false; form.enable = false;
form.websiteId = id.value; form.websiteId = id.value;
UpdateHTTPSConfig(form).then(() => { UpdateHTTPSConfig(form).then(() => {

View File

@ -66,16 +66,26 @@
@search="search()" @search="search()"
:class="{ mask: nginxStatus != 'Running' }" :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 }"> <template #default="{ row }">
<el-link type="primary" :underline="false" @click="openConfig(row.id)"> <el-button link :icon="Promotion" @click="openUrl(row)"></el-button>
{{ row.primaryDomain }} <span>
</el-link> <el-link type="primary" :underline="false" @click="openConfig(row.id)">
<span style="margin-left: 10px">{{ row.primaryDomain }}</span>
</el-link>
</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('commons.table.type')" fix prop="type"> <el-table-column :label="$t('commons.table.type')" fix prop="type">
<template #default="{ row }"> <template #default="{ row }">
{{ $t('website.' + row.type) }} {{ $t('website.' + row.type) }}
<span v-if="row.type === 'deployment'">[{{ row.appName }}]</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('commons.table.status')" prop="status"> <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 { dateFormatSimple } from '@/utils/util';
import { MsgSuccess } from '@/utils/message'; import { MsgSuccess } from '@/utils/message';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { Promotion } from '@element-plus/icons-vue';
const shortcuts = [ const shortcuts = [
{ {
@ -221,6 +232,11 @@ let req = reactive({
websiteGroupId: 0, websiteGroupId: 0,
}); });
const openUrl = (row: Website.WebsiteDTO) => {
const url = row.protocol.toLowerCase() + '://' + row.primaryDomain;
window.open(url);
};
const search = async () => { const search = async () => {
req.page = paginationConfig.currentPage; req.page = paginationConfig.currentPage;
req.pageSize = paginationConfig.pageSize; req.pageSize = paginationConfig.pageSize;