feat: 网站增加列

pull/48/head
zhengkunwang223 2022-11-25 15:37:24 +08:00 committed by zhengkunwang223
parent bd082d4e08
commit 9f7c6b07e2
5 changed files with 16 additions and 3 deletions

View File

@ -15,6 +15,7 @@ type WebSite struct {
WebSiteGroupID uint `gorm:"type:integer" json:"webSiteGroupId"`
WebSiteSSLID uint `gorm:"type:integer" json:"webSiteSSLId"`
Domains []WebSiteDomain `json:"domains"`
WebSiteSSL WebSiteSSL `json:"webSiteSSL"`
}
func (w WebSite) TableName() string {

View File

@ -21,7 +21,7 @@ func (w WebSiteRepo) Page(page, size int, opts ...DBOption) (int64, []model.WebS
db := getDb(opts...).Model(&model.WebSite{})
count := int64(0)
db = db.Count(&count)
err := db.Debug().Limit(size).Offset(size * (page - 1)).Find(&websites).Error
err := db.Debug().Limit(size).Offset(size * (page - 1)).Preload("WebSiteSSL").Find(&websites).Error
return count, websites, err
}

View File

@ -12,6 +12,7 @@ export namespace WebSite {
webSiteGroupId: number;
otherDomains: string;
appinstall?: NewAppInstall;
webSiteSSL: SSL;
}
export interface WebSiteDTO extends CommonModel {

View File

@ -738,7 +738,7 @@ export default {
acmeAccount: 'Acme ',
provider: '',
dnsCommon: '',
expireDate: '',
expireDate: '',
brand: '',
deploySSL: '',
deploySSLHelper: '',
@ -760,6 +760,8 @@ export default {
backup: '',
log: '',
nginxPer: '',
neverExpire: '',
protocol: '',
},
nginx: {
serverNamesHashBucketSizeHelper: 'hash',

View File

@ -26,7 +26,15 @@
</el-table-column>
<el-table-column :label="$t('commons.table.status')" prop="status"></el-table-column>
<!-- <el-table-column :label="'备份'" prop="backup"></el-table-column> -->
<el-table-column :label="'备注'" prop="remark"></el-table-column>
<el-table-column :label="$t('website.remark')" prop="remark"></el-table-column>
<el-table-column :label="$t('website.protocol')" prop="protocol"></el-table-column>
<el-table-column :label="$t('website.expireDate')">
<template #default="{ row }">
<span v-if="row.protocol === 'HTTP'">{{ $t('website.neverExpire') }}</span>
<!-- <span v-else>{{ row.webSiteSSL.id }}</span> -->
<span v-else>{{ dateFromat(1, 1, row.webSiteSSL.expireDate) }}</span>
</template>
</el-table-column>
<!-- <el-table-column :label="'SSL证书'" prop="ssl"></el-table-column> -->
<fu-table-operations
:ellipsis="1"
@ -60,6 +68,7 @@ import { SearchWebSites } from '@/api/modules/website';
import { WebSite } from '@/api/interface/website';
import AppStatus from '@/components/app-status/index.vue';
import NginxConfig from './nginx/index.vue';
import { dateFromat } from '@/utils/util';
import i18n from '@/lang';
import router from '@/routers';