fix: build issue

This commit is contained in:
0xJacky 2023-01-05 20:52:51 +08:00
parent b5508b7366
commit ba924cd6a9
No known key found for this signature in database
GPG key ID: B6E4A6E4A561BAF0
3 changed files with 105 additions and 3 deletions

View file

@ -13,12 +13,14 @@ declare module '@vue/runtime-core' {
AButton: typeof import('ant-design-vue/es')['Button']
ACard: typeof import('ant-design-vue/es')['Card']
AConfigProvider: typeof import('ant-design-vue/es')['ConfigProvider']
ADivider: typeof import('ant-design-vue/es')['Divider']
ADrawer: typeof import('ant-design-vue/es')['Drawer']
AEmpty: typeof import('ant-design-vue/es')['Empty']
AForm: typeof import('ant-design-vue/es')['Form']
AFormItem: typeof import('ant-design-vue/es')['FormItem']
AInput: typeof import('ant-design-vue/es')['Input']
AInputGroup: typeof import('ant-design-vue/es')['InputGroup']
AInputPassword: typeof import('ant-design-vue/es')['InputPassword']
ALayout: typeof import('ant-design-vue/es')['Layout']
ALayoutContent: typeof import('ant-design-vue/es')['LayoutContent']
ALayoutFooter: typeof import('ant-design-vue/es')['LayoutFooter']
@ -29,6 +31,7 @@ declare module '@vue/runtime-core' {
AMenu: typeof import('ant-design-vue/es')['Menu']
AMenuItem: typeof import('ant-design-vue/es')['MenuItem']
AModal: typeof import('ant-design-vue/es')['Modal']
APagination: typeof import('ant-design-vue/es')['Pagination']
APopconfirm: typeof import('ant-design-vue/es')['Popconfirm']
AProgress: typeof import('ant-design-vue/es')['Progress']
ASelect: typeof import('ant-design-vue/es')['Select']
@ -36,6 +39,7 @@ declare module '@vue/runtime-core' {
ASpace: typeof import('ant-design-vue/es')['Space']
ASubMenu: typeof import('ant-design-vue/es')['SubMenu']
ASwitch: typeof import('ant-design-vue/es')['Switch']
ATable: typeof import('ant-design-vue/es')['Table']
ATabPane: typeof import('ant-design-vue/es')['TabPane']
ATabs: typeof import('ant-design-vue/es')['Tabs']
ATag: typeof import('ant-design-vue/es')['Tag']

View file

@ -1,6 +1,11 @@
<script setup lang="ts">
<script setup lang="tsx">
import {useGettext} from 'vue3-gettext'
import {ref} from 'vue'
import {h, ref} from 'vue'
import StdTable from '@/components/StdDataDisplay/StdTable.vue'
import cert from '@/api/cert'
import {customRender, datetime} from '@/components/StdDataDisplay/StdTableTransformer'
import {input} from '@/components/StdDataEntry'
import {Badge} from 'ant-design-vue'
const {$gettext} = useGettext()
@ -8,9 +13,84 @@ const props = defineProps(['directivesMap'])
const visible = ref(false)
const columns = [{
title: () => $gettext('Name'),
dataIndex: 'name',
sorter: true,
pithy: true,
customRender: (args: customRender) => {
const {text, record} = args
if (!text) {
return h('div', record.domain)
}
return h('div', text)
},
edit: {
type: input
},
search: true
}, {
title: () => $gettext('Domain'),
dataIndex: 'domain',
sorter: true,
pithy: true,
edit: {
type: input
},
search: true
}, {
title: () => $gettext('Auto Cert'),
dataIndex: 'auto_cert',
customRender: (args: customRender) => {
const template: any = []
const {text, column} = args
if (text === true || text > 0) {
template.push(<Badge status="success"/>)
template.push($gettext('Enabled'))
} else {
template.push(<Badge status="warning"/>)
template.push($gettext('Disabled'))
}
return h('div', template)
},
sorter: true,
pithy: true
}, {
title: () => $gettext('SSL Certificate Path'),
dataIndex: 'ssl_certificate_path',
edit: {
type: input
},
display: false
}, {
title: () => $gettext('SSL Certificate Key Path'),
dataIndex: 'ssl_certificate_key_path',
edit: {
type: input
},
display: false
}, {
title: () => $gettext('Updated at'),
dataIndex: 'updated_at',
customRender: datetime,
sorter: true,
pithy: true
}, {
title: () => $gettext('Action'),
dataIndex: 'action'
}]
function open() {
visible.value = true
}
function onSelect() {
}
function onSelectedRecord() {
}
</script>
<template>
@ -21,7 +101,13 @@ function open() {
v-model:visible="visible"
:mask="false"
>
<std-table
:api="cert"
:pithy="true"
:columns="columns"
@onSelected="onSelect"
@onSelectedRecord="onSelectedRecord"
/>
</a-modal>
</div>
</template>

View file

@ -0,0 +1,12 @@
# Nginx UI Template Start
# Name: WordPress
# Description[en]: WordPress Config Template
# Description[zh_CN]: WordPress 配置模板
# Author: @0xJacky
# Nginx UI Template End
location / {
try_files $uri $uri/ /index.php?$args;
}
# Add trailing slash to */wp-admin requests.
rewrite /wp-admin$ $scheme://$host$uri/ permanent;