mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 02:15:48 +02:00
feat: add key type column for certificate list
This commit is contained in:
parent
f0dcd67004
commit
464e84a64f
4 changed files with 23 additions and 58 deletions
|
@ -25,3 +25,14 @@ export enum NginxStatus {
|
||||||
Restarting,
|
Restarting,
|
||||||
Stopped,
|
Stopped,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const PrivateKeyTypeMask = {
|
||||||
|
2048: 'RSA2048',
|
||||||
|
3072: 'RSA3072',
|
||||||
|
4096: 'RSA4096',
|
||||||
|
8192: 'RSA8192',
|
||||||
|
P256: 'EC256',
|
||||||
|
P384: 'EC384',
|
||||||
|
} as const
|
||||||
|
|
||||||
|
export const PrivateKeyTypeList = Object.entries(PrivateKeyTypeMask).map(([key, name]) => ({ key, name }))
|
||||||
|
|
|
@ -4,11 +4,11 @@ import dayjs from 'dayjs'
|
||||||
import { CloudUploadOutlined, SafetyCertificateOutlined } from '@ant-design/icons-vue'
|
import { CloudUploadOutlined, SafetyCertificateOutlined } from '@ant-design/icons-vue'
|
||||||
import { input } from '@/components/StdDesign/StdDataEntry'
|
import { input } from '@/components/StdDesign/StdDataEntry'
|
||||||
import type { customRender } from '@/components/StdDesign/StdDataDisplay/StdTableTransformer'
|
import type { customRender } from '@/components/StdDesign/StdDataDisplay/StdTableTransformer'
|
||||||
import { datetime } from '@/components/StdDesign/StdDataDisplay/StdTableTransformer'
|
import { datetime, mask } from '@/components/StdDesign/StdDataDisplay/StdTableTransformer'
|
||||||
import cert from '@/api/cert'
|
import cert from '@/api/cert'
|
||||||
import type { Column, JSXElements } from '@/components/StdDesign/types'
|
import type { Column, JSXElements } from '@/components/StdDesign/types'
|
||||||
import type { Cert } from '@/api/cert'
|
import type { Cert } from '@/api/cert'
|
||||||
import { AutoCertState } from '@/constants'
|
import { AutoCertState, PrivateKeyTypeMask } from '@/constants'
|
||||||
import StdTable from '@/components/StdDesign/StdDataDisplay/StdTable.vue'
|
import StdTable from '@/components/StdDesign/StdDataDisplay/StdTable.vue'
|
||||||
import WildcardCertificate from '@/views/certificate/WildcardCertificate.vue'
|
import WildcardCertificate from '@/views/certificate/WildcardCertificate.vue'
|
||||||
|
|
||||||
|
@ -57,6 +57,12 @@ const columns: Column[] = [{
|
||||||
},
|
},
|
||||||
sortable: true,
|
sortable: true,
|
||||||
pithy: true,
|
pithy: true,
|
||||||
|
}, {
|
||||||
|
title: () => $gettext('Key Type'),
|
||||||
|
dataIndex: 'key_type',
|
||||||
|
customRender: mask(PrivateKeyTypeMask),
|
||||||
|
sortable: true,
|
||||||
|
pithy: true,
|
||||||
}, {
|
}, {
|
||||||
title: () => $gettext('SSL Certificate Path'),
|
title: () => $gettext('SSL Certificate Path'),
|
||||||
dataIndex: 'ssl_certificate_path',
|
dataIndex: 'ssl_certificate_path',
|
||||||
|
|
|
@ -4,6 +4,7 @@ import { message } from 'ant-design-vue'
|
||||||
import type { Cert } from '@/api/cert'
|
import type { Cert } from '@/api/cert'
|
||||||
import ObtainCertLive from '@/views/domain/cert/components/ObtainCertLive.vue'
|
import ObtainCertLive from '@/views/domain/cert/components/ObtainCertLive.vue'
|
||||||
import DNSChallenge from '@/views/domain/cert/components/DNSChallenge.vue'
|
import DNSChallenge from '@/views/domain/cert/components/DNSChallenge.vue'
|
||||||
|
import { PrivateKeyTypeList } from '@/constants'
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
issued: [void]
|
issued: [void]
|
||||||
|
@ -50,33 +51,6 @@ const issueCert = () => {
|
||||||
emit('issued')
|
emit('issued')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const keyType = shallowRef([
|
|
||||||
{
|
|
||||||
key: '2048',
|
|
||||||
name: 'RSA2048',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: '3072',
|
|
||||||
name: 'RSA3072',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: '4096',
|
|
||||||
name: 'RSA4096',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: '8192',
|
|
||||||
name: 'RAS8192',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'P256',
|
|
||||||
name: 'EC256',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'P384',
|
|
||||||
name: 'EC384',
|
|
||||||
},
|
|
||||||
])
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -105,7 +79,7 @@ const keyType = shallowRef([
|
||||||
<AFormItem :label="$gettext('Key Type')">
|
<AFormItem :label="$gettext('Key Type')">
|
||||||
<ASelect v-model:value="data.key_type">
|
<ASelect v-model:value="data.key_type">
|
||||||
<ASelectOption
|
<ASelectOption
|
||||||
v-for="t in keyType"
|
v-for="t in PrivateKeyTypeList"
|
||||||
:key="t.key"
|
:key="t.key"
|
||||||
:value="t.key"
|
:value="t.key"
|
||||||
>
|
>
|
||||||
|
|
|
@ -4,6 +4,7 @@ import type { DnsChallenge } from '@/api/auto_cert'
|
||||||
import DNSChallenge from '@/views/domain/cert/components/DNSChallenge.vue'
|
import DNSChallenge from '@/views/domain/cert/components/DNSChallenge.vue'
|
||||||
import type { Cert } from '@/api/cert'
|
import type { Cert } from '@/api/cert'
|
||||||
import ACMEUserSelector from '@/views/certificate/ACMEUserSelector.vue'
|
import ACMEUserSelector from '@/views/certificate/ACMEUserSelector.vue'
|
||||||
|
import { PrivateKeyTypeList } from '@/constants'
|
||||||
|
|
||||||
defineProps<{
|
defineProps<{
|
||||||
hideNote?: boolean
|
hideNote?: boolean
|
||||||
|
@ -14,33 +15,6 @@ const no_server_name = inject('no_server_name')
|
||||||
// Provide by ObtainCert.vue
|
// Provide by ObtainCert.vue
|
||||||
const data = inject('data') as Ref<DnsChallenge & Cert>
|
const data = inject('data') as Ref<DnsChallenge & Cert>
|
||||||
|
|
||||||
const keyType = shallowRef([
|
|
||||||
{
|
|
||||||
key: '2048',
|
|
||||||
name: 'RSA2048',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: '3072',
|
|
||||||
name: 'RSA3072',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: '4096',
|
|
||||||
name: 'RSA4096',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: '8192',
|
|
||||||
name: 'RAS8192',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'P256',
|
|
||||||
name: 'EC256',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'P384',
|
|
||||||
name: 'EC384',
|
|
||||||
},
|
|
||||||
])
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (!data.value.key_type)
|
if (!data.value.key_type)
|
||||||
data.value.key_type = '2048'
|
data.value.key_type = '2048'
|
||||||
|
@ -106,7 +80,7 @@ onMounted(() => {
|
||||||
<AFormItem :label="$gettext('Key Type')">
|
<AFormItem :label="$gettext('Key Type')">
|
||||||
<ASelect v-model:value="data.key_type">
|
<ASelect v-model:value="data.key_type">
|
||||||
<ASelectOption
|
<ASelectOption
|
||||||
v-for="t in keyType"
|
v-for="t in PrivateKeyTypeList"
|
||||||
:key="t.key"
|
:key="t.key"
|
||||||
:value="t.key"
|
:value="t.key"
|
||||||
>
|
>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue