fix: config template parse issue

This commit is contained in:
0xJacky 2023-01-05 20:47:33 +08:00
parent b16536b1f0
commit b5508b7366
No known key found for this signature in database
GPG key ID: B6E4A6E4A561BAF0
17 changed files with 184 additions and 398 deletions

View file

@ -12,17 +12,13 @@ declare module '@vue/runtime-core' {
ABreadcrumbItem: typeof import('ant-design-vue/es')['BreadcrumbItem'] ABreadcrumbItem: typeof import('ant-design-vue/es')['BreadcrumbItem']
AButton: typeof import('ant-design-vue/es')['Button'] AButton: typeof import('ant-design-vue/es')['Button']
ACard: typeof import('ant-design-vue/es')['Card'] ACard: typeof import('ant-design-vue/es')['Card']
ACol: typeof import('ant-design-vue/es')['Col']
AConfigProvider: typeof import('ant-design-vue/es')['ConfigProvider'] AConfigProvider: typeof import('ant-design-vue/es')['ConfigProvider']
ADivider: typeof import('ant-design-vue/es')['Divider']
ADrawer: typeof import('ant-design-vue/es')['Drawer'] ADrawer: typeof import('ant-design-vue/es')['Drawer']
AEmpty: typeof import('ant-design-vue/es')['Empty'] AEmpty: typeof import('ant-design-vue/es')['Empty']
AForm: typeof import('ant-design-vue/es')['Form'] AForm: typeof import('ant-design-vue/es')['Form']
AFormItem: typeof import('ant-design-vue/es')['FormItem'] AFormItem: typeof import('ant-design-vue/es')['FormItem']
AInput: typeof import('ant-design-vue/es')['Input'] AInput: typeof import('ant-design-vue/es')['Input']
AInputGroup: typeof import('ant-design-vue/es')['InputGroup'] AInputGroup: typeof import('ant-design-vue/es')['InputGroup']
AInputNumber: typeof import('ant-design-vue/es')['InputNumber']
AInputPassword: typeof import('ant-design-vue/es')['InputPassword']
ALayout: typeof import('ant-design-vue/es')['Layout'] ALayout: typeof import('ant-design-vue/es')['Layout']
ALayoutContent: typeof import('ant-design-vue/es')['LayoutContent'] ALayoutContent: typeof import('ant-design-vue/es')['LayoutContent']
ALayoutFooter: typeof import('ant-design-vue/es')['LayoutFooter'] ALayoutFooter: typeof import('ant-design-vue/es')['LayoutFooter']
@ -33,20 +29,13 @@ declare module '@vue/runtime-core' {
AMenu: typeof import('ant-design-vue/es')['Menu'] AMenu: typeof import('ant-design-vue/es')['Menu']
AMenuItem: typeof import('ant-design-vue/es')['MenuItem'] AMenuItem: typeof import('ant-design-vue/es')['MenuItem']
AModal: typeof import('ant-design-vue/es')['Modal'] AModal: typeof import('ant-design-vue/es')['Modal']
APagination: typeof import('ant-design-vue/es')['Pagination']
APopconfirm: typeof import('ant-design-vue/es')['Popconfirm'] APopconfirm: typeof import('ant-design-vue/es')['Popconfirm']
AProgress: typeof import('ant-design-vue/es')['Progress'] AProgress: typeof import('ant-design-vue/es')['Progress']
AResult: typeof import('ant-design-vue/es')['Result']
ARow: typeof import('ant-design-vue/es')['Row']
ASelect: typeof import('ant-design-vue/es')['Select'] ASelect: typeof import('ant-design-vue/es')['Select']
ASelectOption: typeof import('ant-design-vue/es')['SelectOption'] ASelectOption: typeof import('ant-design-vue/es')['SelectOption']
ASpace: typeof import('ant-design-vue/es')['Space'] ASpace: typeof import('ant-design-vue/es')['Space']
AStatistic: typeof import('ant-design-vue/es')['Statistic']
AStep: typeof import('ant-design-vue/es')['Step']
ASteps: typeof import('ant-design-vue/es')['Steps']
ASubMenu: typeof import('ant-design-vue/es')['SubMenu'] ASubMenu: typeof import('ant-design-vue/es')['SubMenu']
ASwitch: typeof import('ant-design-vue/es')['Switch'] ASwitch: typeof import('ant-design-vue/es')['Switch']
ATable: typeof import('ant-design-vue/es')['Table']
ATabPane: typeof import('ant-design-vue/es')['TabPane'] ATabPane: typeof import('ant-design-vue/es')['TabPane']
ATabs: typeof import('ant-design-vue/es')['Tabs'] ATabs: typeof import('ant-design-vue/es')['Tabs']
ATag: typeof import('ant-design-vue/es')['Tag'] ATag: typeof import('ant-design-vue/es')['Tag']
@ -68,8 +57,5 @@ declare module '@vue/runtime-core' {
StdDataEntryComponentsStdPassword: typeof import('./src/components/StdDataEntry/components/StdPassword.vue')['default'] StdDataEntryComponentsStdPassword: typeof import('./src/components/StdDataEntry/components/StdPassword.vue')['default']
StdDataEntryComponentsStdSelect: typeof import('./src/components/StdDataEntry/components/StdSelect.vue')['default'] StdDataEntryComponentsStdSelect: typeof import('./src/components/StdDataEntry/components/StdSelect.vue')['default']
StdDataEntryComponentsStdSelector: typeof import('./src/components/StdDataEntry/components/StdSelector.vue')['default'] StdDataEntryComponentsStdSelector: typeof import('./src/components/StdDataEntry/components/StdSelector.vue')['default']
StdDataEntryCompontentsStdPassword: typeof import('./src/components/StdDataEntry/compontents/StdPassword.vue')['default']
StdDataEntryCompontentsStdSelect: typeof import('./src/components/StdDataEntry/compontents/StdSelect.vue')['default']
StdDataEntryCompontentsStdSelector: typeof import('./src/components/StdDataEntry/compontents/StdSelector.vue')['default']
} }
} }

View file

@ -1,51 +0,0 @@
<script setup lang="ts">
import {computed, ref} from 'vue'
const props = defineProps(['value', 'generate', 'placeholder'])
const emit = defineEmits(['update:value'])
const M_value = computed({
get() {
return props.value
},
set(v) {
emit('update:value', v)
}
})
const visibility = ref(false)
function handle_generate() {
visibility.value = true
M_value.value = 'xxxx'
const chars = '0123456789abcdefghijklmnopqrstuvwxyz!@#$%^&*()ABCDEFGHIJKLMNOPQRSTUVWXYZ'
const passwordLength = 12
let password = ''
for (let i = 0; i <= passwordLength; i++) {
const randomNumber = Math.floor(Math.random() * chars.length)
password += chars.substring(randomNumber, randomNumber + 1)
}
M_value.value = password
}
</script>
<template>
<a-input-group compact>
<a-input-password
v-if="!visibility"
:class="{compact: generate}"
v-model:value="M_value" :placeholoder="placeholder"/>
<a-input v-else :class="{compact: generate}" v-model:value="M_value" :placeholoder="placeholder"/>
<a-button @click="handle_generate" v-if="generate" type="primary">
<translate>Generate</translate>
</a-button>
</a-input-group>
</template>
<style scoped>
.compact {
width: calc(100% - 91px)
}
</style>

View file

@ -1,45 +0,0 @@
<script setup lang="ts">
import {computed, ref} from 'vue'
import {SelectProps} from 'ant-design-vue'
const props = defineProps(['value', 'mask'])
const emit = defineEmits(['update:value'])
const options = computed(() => {
const _options = ref<SelectProps['options']>([])
for (const [key, value] of Object.entries(props.mask)) {
const v = value as any
_options.value!.push({label: v?.(), value: key})
}
return _options
})
const _value = computed({
get() {
let v
if (typeof props.mask?.[props.value] === 'function') {
v = props.mask[props.value]()
} else if (typeof props.mask?.[props.value] === 'string') {
v = props.mask[props.value]
} else {
v = props.value
}
return v
},
set(v) {
emit('update:value', v)
}
})
</script>
<template>
<a-select v-model:value="_value"
:options="options.value" style="min-width: 180px"/>
</template>
<style lang="less" scoped>
</style>

View file

@ -1,137 +0,0 @@
<script setup lang="ts">
import {onMounted, reactive, ref, watch} from 'vue'
import StdTable from '@/components/StdDataDisplay/StdTable.vue'
import gettext from '@/gettext'
const {$gettext} = gettext
const props = defineProps(['selectedKey', 'value', 'recordValueIndex',
'selectionType', 'api', 'columns', 'data_key',
'disable_search', 'get_params', 'description'])
const emit = defineEmits(['update:selectedKey', 'changeSelect'])
const visible = ref(false)
const M_value = ref('')
onMounted(() => {
init()
})
const selected = ref([])
const record: any = reactive({})
function init() {
if (props.selectedKey && !props.value && props.selectionType === 'radio') {
props.api.get(props.selectedKey).then((r: any) => {
Object.assign(record, r)
M_value.value = r[props.recordValueIndex]
})
}
}
function show() {
visible.value = true
}
function onSelect(_selected: any) {
selected.value = _selected
}
function onSelectedRecord(r: any) {
Object.assign(record, r)
}
function ok() {
visible.value = false
if (props.selectionType == 'radio') {
emit('update:selectedKey', selected.value[0])
} else {
emit('update:selectedKey', selected.value)
}
M_value.value = record[props.recordValueIndex]
emit('changeSelect', record)
}
watch(props, () => {
if (!props?.selectedKey) {
M_value.value = ''
} else if (props.value) {
M_value.value = props.value
} else {
init()
}
})
</script>
<template>
<div class="std-selector-container">
<div class="std-selector" @click="show()">
<a-input v-model="selectedKey" disabled hidden/>
<div class="value">
{{ M_value }}
</div>
<a-modal
:mask="false"
:visible="visible"
:cancel-text="$gettext('Cancel')"
:ok-text="$gettext('OK')"
:title="$gettext('Selector')"
@cancel="visible=false"
@ok="ok()"
:width="800"
destroyOnClose
>
{{ description }}
<std-table
:api="api"
:columns="columns"
:data_key="data_key"
:disable_search="disable_search"
:pithy="true"
:get_params="get_params"
:selectionType="selectionType"
:disable_query_params="true"
@onSelected="onSelect"
@onSelectedRecord="onSelectedRecord"
/>
</a-modal>
</div>
</div>
</template>
<style lang="less" scoped>
.dark .std-selector-container {
background-color: #1e1f20;
border: 1px solid #666666;
color: rgba(255, 255, 255, 0.99);
}
.std-selector-container {
height: 39.9px;
display: flex;
align-items: flex-start;
.std-selector {
box-sizing: border-box;
font-variant: tabular-nums;
list-style: none;
font-feature-settings: 'tnum';
height: 32px;
padding: 4px 11px;
color: rgba(0, 0, 0, 0.85);
font-size: 14px;
line-height: 1.5;
background-color: #fff;
background-image: none;
border: 1px solid #d9d9d9;
border-radius: 4px;
transition: all 0.3s;
margin: 0 10px 0 0;
cursor: pointer;
min-width: 180px;
.value {
}
}
}
</style>

View file

@ -91,11 +91,11 @@ msgstr ""
msgid "Auto Refresh" msgid "Auto Refresh"
msgstr "" msgstr ""
#: src/views/domain/cert/IssueCert.vue:72 #: src/views/domain/cert/IssueCert.vue:71
msgid "Auto-renewal disabled for %{name}" msgid "Auto-renewal disabled for %{name}"
msgstr "Auto-renewal disabled for %{name}" msgstr "Auto-renewal disabled for %{name}"
#: src/views/domain/cert/IssueCert.vue:66 #: src/views/domain/cert/IssueCert.vue:65
msgid "Auto-renewal enabled for %{name}" msgid "Auto-renewal enabled for %{name}"
msgstr "Auto-renewal enabled for %{name}" msgstr "Auto-renewal enabled for %{name}"
@ -134,7 +134,6 @@ msgstr "Build with"
#: src/components/StdDataDisplay/StdBatchEdit.vue:7 #: src/components/StdDataDisplay/StdBatchEdit.vue:7
#: src/components/StdDataDisplay/StdCurd.vue:27 #: src/components/StdDataDisplay/StdCurd.vue:27
#: src/components/StdDataEntry/components/StdSelector.vue:11 #: src/components/StdDataEntry/components/StdSelector.vue:11
#: src/components/StdDataEntry/compontents/StdSelector.vue:11
msgid "Cancel" msgid "Cancel"
msgstr "Cancel" msgstr "Cancel"
@ -146,7 +145,7 @@ msgstr "Certificate has expired"
msgid "Certificate is valid" msgid "Certificate is valid"
msgstr "Certificate is valid" msgstr "Certificate is valid"
#: src/views/cert/Cert.vue:12 src/views/domain/cert/Cert.vue:31 #: src/views/cert/Cert.vue:12 src/views/domain/cert/Cert.vue:35
msgid "Certificate Status" msgid "Certificate Status"
msgstr "Certificate Status" msgstr "Certificate Status"
@ -155,6 +154,13 @@ msgstr "Certificate Status"
msgid "Certification" msgid "Certification"
msgstr "Certificate is valid" msgstr "Certificate is valid"
#: src/views/domain/cert/ChangeCert.vue:2
#: src/views/domain/cert/ChangeCert.vue:3
#: src/views/domain/cert/ChangeCert.vue:5
#, fuzzy
msgid "Change Certificate"
msgstr "Certificate is valid"
#: src/views/domain/ngx_conf/directive/DirectiveEditorItem.vue:34 #: src/views/domain/ngx_conf/directive/DirectiveEditorItem.vue:34
#: src/views/domain/ngx_conf/LocationEditor.vue:31 #: src/views/domain/ngx_conf/LocationEditor.vue:31
#: src/views/domain/ngx_conf/LocationEditor.vue:47 #: src/views/domain/ngx_conf/LocationEditor.vue:47
@ -267,7 +273,7 @@ msgstr "Directive"
msgid "Directives" msgid "Directives"
msgstr "Directives" msgstr "Directives"
#: src/views/domain/cert/IssueCert.vue:74 #: src/views/domain/cert/IssueCert.vue:73
msgid "Disable auto-renewal failed for %{name}" msgid "Disable auto-renewal failed for %{name}"
msgstr "Disable auto-renewal failed for %{name}" msgstr "Disable auto-renewal failed for %{name}"
@ -310,7 +316,7 @@ msgstr "Edit Site"
msgid "Email (*)" msgid "Email (*)"
msgstr "Email (*)" msgstr "Email (*)"
#: src/views/domain/cert/IssueCert.vue:68 #: src/views/domain/cert/IssueCert.vue:67
msgid "Enable auto-renewal failed for %{name}" msgid "Enable auto-renewal failed for %{name}"
msgstr "Enable auto-renewal failed for %{name}" msgstr "Enable auto-renewal failed for %{name}"
@ -397,7 +403,6 @@ msgid "Format successfully"
msgstr "Saved successfully" msgstr "Saved successfully"
#: src/components/StdDataEntry/components/StdPassword.vue:42 #: src/components/StdDataEntry/components/StdPassword.vue:42
#: src/components/StdDataEntry/compontents/StdPassword.vue:42
msgid "Generate" msgid "Generate"
msgstr "" msgstr ""
@ -405,7 +410,7 @@ msgstr ""
msgid "Generating private key for registering account" msgid "Generating private key for registering account"
msgstr "" msgstr ""
#: src/views/domain/cert/IssueCert.vue:97 #: src/views/domain/cert/IssueCert.vue:96
msgid "Getting the certificate, please wait..." msgid "Getting the certificate, please wait..."
msgstr "Getting the certificate, please wait..." msgstr "Getting the certificate, please wait..."
@ -478,7 +483,7 @@ msgstr "Login successful"
msgid "Logout successful" msgid "Logout successful"
msgstr "Logout successful" msgstr "Logout successful"
#: src/views/domain/cert/IssueCert.vue:210 #: src/views/domain/cert/IssueCert.vue:211
msgid "" msgid ""
"Make sure you have configured a reverse proxy for .well-known directory to " "Make sure you have configured a reverse proxy for .well-known directory to "
"HTTPChallengePort (default: 9180) before getting the certificate." "HTTPChallengePort (default: 9180) before getting the certificate."
@ -578,13 +583,9 @@ msgstr "Not Found"
msgid "Not Valid Before: %{date}" msgid "Not Valid Before: %{date}"
msgstr "Not Valid Before: %{date}" msgstr "Not Valid Before: %{date}"
#: src/views/domain/cert/IssueCert.vue:202 #: src/views/domain/cert/IssueCert.vue:38
msgid "" msgid "Note"
"Note: The server_name in the current configuration must be the domain name "
"you need to get the certificate."
msgstr "" msgstr ""
"Note: The server_name in the current configuration must be the domain name "
"you need to get the certificate."
#: src/language/constants.ts:16 src/views/domain/cert/IssueCert.vue:3 #: src/language/constants.ts:16 src/views/domain/cert/IssueCert.vue:3
msgid "Obtaining certificate" msgid "Obtaining certificate"
@ -594,7 +595,6 @@ msgstr ""
#: src/components/StdDataDisplay/StdCurd.vue:28 #: src/components/StdDataDisplay/StdCurd.vue:28
#: src/components/StdDataDisplay/StdTable.vue:53 #: src/components/StdDataDisplay/StdTable.vue:53
#: src/components/StdDataEntry/components/StdSelector.vue:12 #: src/components/StdDataEntry/components/StdSelector.vue:12
#: src/components/StdDataEntry/compontents/StdSelector.vue:12
#: src/views/domain/DomainList.vue:25 #: src/views/domain/DomainList.vue:25
msgid "OK" msgid "OK"
msgstr "" msgstr ""
@ -719,7 +719,6 @@ msgid "Saved successfully"
msgstr "Saved successfully" msgstr "Saved successfully"
#: src/components/StdDataEntry/components/StdSelector.vue:13 #: src/components/StdDataEntry/components/StdSelector.vue:13
#: src/components/StdDataEntry/compontents/StdSelector.vue:13
msgid "Selector" msgid "Selector"
msgstr "" msgstr ""
@ -742,11 +741,11 @@ msgstr "Server error"
msgid "Server Info" msgid "Server Info"
msgstr "Server Info" msgstr "Server Info"
#: src/views/domain/cert/IssueCert.vue:29 #: src/views/domain/cert/IssueCert.vue:30
msgid "server_name not found in directives" msgid "server_name not found in directives"
msgstr "server_name not found in directives" msgstr "server_name not found in directives"
#: src/views/domain/cert/IssueCert.vue:196 src/views/domain/DomainAdd.vue:111 #: src/views/domain/cert/IssueCert.vue:195 src/views/domain/DomainAdd.vue:111
msgid "server_name parameter is required" msgid "server_name parameter is required"
msgstr "server_name parameter is required" msgstr "server_name parameter is required"
@ -813,7 +812,7 @@ msgstr "Terminal"
msgid "Terminal Start Command" msgid "Terminal Start Command"
msgstr "" msgstr ""
#: src/views/domain/cert/IssueCert.vue:206 #: src/views/domain/cert/IssueCert.vue:207
msgid "" msgid ""
"The certificate for the domain will be checked every hour, and will be " "The certificate for the domain will be checked every hour, and will be "
"renewed if it has been more than 1 month since it was last issued." "renewed if it has been more than 1 month since it was last issued."
@ -825,6 +824,15 @@ msgstr ""
msgid "The filename cannot contain the following characters: %{c}" msgid "The filename cannot contain the following characters: %{c}"
msgstr "The filename cannot contain the following characters: %{c}" msgstr "The filename cannot contain the following characters: %{c}"
#: src/views/domain/cert/IssueCert.vue:203
#, fuzzy
msgid ""
"The server_name in the current configuration must be the domain name you "
"need to get the certificate."
msgstr ""
"Note: The server_name in the current configuration must be the domain name "
"you need to get the certificate."
#: src/language/constants.ts:6 #: src/language/constants.ts:6
msgid "The username or password is incorrect" msgid "The username or password is incorrect"
msgstr "" msgstr ""

View file

@ -87,11 +87,11 @@ msgstr ""
msgid "Auto Refresh" msgid "Auto Refresh"
msgstr "" msgstr ""
#: src/views/domain/cert/IssueCert.vue:72 #: src/views/domain/cert/IssueCert.vue:71
msgid "Auto-renewal disabled for %{name}" msgid "Auto-renewal disabled for %{name}"
msgstr "" msgstr ""
#: src/views/domain/cert/IssueCert.vue:66 #: src/views/domain/cert/IssueCert.vue:65
msgid "Auto-renewal enabled for %{name}" msgid "Auto-renewal enabled for %{name}"
msgstr "" msgstr ""
@ -132,7 +132,6 @@ msgstr ""
#: src/components/StdDataDisplay/StdBatchEdit.vue:7 #: src/components/StdDataDisplay/StdBatchEdit.vue:7
#: src/components/StdDataDisplay/StdCurd.vue:27 #: src/components/StdDataDisplay/StdCurd.vue:27
#: src/components/StdDataEntry/components/StdSelector.vue:11 #: src/components/StdDataEntry/components/StdSelector.vue:11
#: src/components/StdDataEntry/compontents/StdSelector.vue:11
msgid "Cancel" msgid "Cancel"
msgstr "" msgstr ""
@ -145,7 +144,7 @@ msgid "Certificate is valid"
msgstr "" msgstr ""
#: src/views/cert/Cert.vue:12 #: src/views/cert/Cert.vue:12
#: src/views/domain/cert/Cert.vue:31 #: src/views/domain/cert/Cert.vue:35
msgid "Certificate Status" msgid "Certificate Status"
msgstr "" msgstr ""
@ -154,6 +153,12 @@ msgstr ""
msgid "Certification" msgid "Certification"
msgstr "" msgstr ""
#: src/views/domain/cert/ChangeCert.vue:2
#: src/views/domain/cert/ChangeCert.vue:3
#: src/views/domain/cert/ChangeCert.vue:5
msgid "Change Certificate"
msgstr ""
#: src/views/domain/ngx_conf/directive/DirectiveEditorItem.vue:34 #: src/views/domain/ngx_conf/directive/DirectiveEditorItem.vue:34
#: src/views/domain/ngx_conf/LocationEditor.vue:31 #: src/views/domain/ngx_conf/LocationEditor.vue:31
#: src/views/domain/ngx_conf/LocationEditor.vue:47 #: src/views/domain/ngx_conf/LocationEditor.vue:47
@ -266,7 +271,7 @@ msgstr ""
msgid "Directives" msgid "Directives"
msgstr "" msgstr ""
#: src/views/domain/cert/IssueCert.vue:74 #: src/views/domain/cert/IssueCert.vue:73
msgid "Disable auto-renewal failed for %{name}" msgid "Disable auto-renewal failed for %{name}"
msgstr "" msgstr ""
@ -316,7 +321,7 @@ msgstr ""
msgid "Email (*)" msgid "Email (*)"
msgstr "" msgstr ""
#: src/views/domain/cert/IssueCert.vue:68 #: src/views/domain/cert/IssueCert.vue:67
msgid "Enable auto-renewal failed for %{name}" msgid "Enable auto-renewal failed for %{name}"
msgstr "" msgstr ""
@ -411,7 +416,6 @@ msgid "Format successfully"
msgstr "" msgstr ""
#: src/components/StdDataEntry/components/StdPassword.vue:42 #: src/components/StdDataEntry/components/StdPassword.vue:42
#: src/components/StdDataEntry/compontents/StdPassword.vue:42
msgid "Generate" msgid "Generate"
msgstr "" msgstr ""
@ -419,7 +423,7 @@ msgstr ""
msgid "Generating private key for registering account" msgid "Generating private key for registering account"
msgstr "" msgstr ""
#: src/views/domain/cert/IssueCert.vue:97 #: src/views/domain/cert/IssueCert.vue:96
msgid "Getting the certificate, please wait..." msgid "Getting the certificate, please wait..."
msgstr "" msgstr ""
@ -492,7 +496,7 @@ msgstr ""
msgid "Logout successful" msgid "Logout successful"
msgstr "" msgstr ""
#: src/views/domain/cert/IssueCert.vue:210 #: src/views/domain/cert/IssueCert.vue:211
msgid "Make sure you have configured a reverse proxy for .well-known directory to HTTPChallengePort (default: 9180) before getting the certificate." msgid "Make sure you have configured a reverse proxy for .well-known directory to HTTPChallengePort (default: 9180) before getting the certificate."
msgstr "" msgstr ""
@ -592,8 +596,8 @@ msgstr ""
msgid "Not Valid Before: %{date}" msgid "Not Valid Before: %{date}"
msgstr "" msgstr ""
#: src/views/domain/cert/IssueCert.vue:202 #: src/views/domain/cert/IssueCert.vue:38
msgid "Note: The server_name in the current configuration must be the domain name you need to get the certificate." msgid "Note"
msgstr "" msgstr ""
#: src/language/constants.ts:16 #: src/language/constants.ts:16
@ -605,7 +609,6 @@ msgstr ""
#: src/components/StdDataDisplay/StdCurd.vue:28 #: src/components/StdDataDisplay/StdCurd.vue:28
#: src/components/StdDataDisplay/StdTable.vue:53 #: src/components/StdDataDisplay/StdTable.vue:53
#: src/components/StdDataEntry/components/StdSelector.vue:12 #: src/components/StdDataEntry/components/StdSelector.vue:12
#: src/components/StdDataEntry/compontents/StdSelector.vue:12
#: src/views/domain/DomainList.vue:25 #: src/views/domain/DomainList.vue:25
msgid "OK" msgid "OK"
msgstr "" msgstr ""
@ -734,7 +737,6 @@ msgid "Saved successfully"
msgstr "" msgstr ""
#: src/components/StdDataEntry/components/StdSelector.vue:13 #: src/components/StdDataEntry/components/StdSelector.vue:13
#: src/components/StdDataEntry/compontents/StdSelector.vue:13
msgid "Selector" msgid "Selector"
msgstr "" msgstr ""
@ -762,11 +764,11 @@ msgstr ""
msgid "Server Info" msgid "Server Info"
msgstr "" msgstr ""
#: src/views/domain/cert/IssueCert.vue:29 #: src/views/domain/cert/IssueCert.vue:30
msgid "server_name not found in directives" msgid "server_name not found in directives"
msgstr "" msgstr ""
#: src/views/domain/cert/IssueCert.vue:196 #: src/views/domain/cert/IssueCert.vue:195
#: src/views/domain/DomainAdd.vue:111 #: src/views/domain/DomainAdd.vue:111
msgid "server_name parameter is required" msgid "server_name parameter is required"
msgstr "" msgstr ""
@ -829,7 +831,7 @@ msgstr ""
msgid "Terminal Start Command" msgid "Terminal Start Command"
msgstr "" msgstr ""
#: src/views/domain/cert/IssueCert.vue:206 #: src/views/domain/cert/IssueCert.vue:207
msgid "The certificate for the domain will be checked every hour, and will be renewed if it has been more than 1 month since it was last issued." msgid "The certificate for the domain will be checked every hour, and will be renewed if it has been more than 1 month since it was last issued."
msgstr "" msgstr ""
@ -837,6 +839,10 @@ msgstr ""
msgid "The filename cannot contain the following characters: %{c}" msgid "The filename cannot contain the following characters: %{c}"
msgstr "" msgstr ""
#: src/views/domain/cert/IssueCert.vue:203
msgid "The server_name in the current configuration must be the domain name you need to get the certificate."
msgstr ""
#: src/language/constants.ts:6 #: src/language/constants.ts:6
msgid "The username or password is incorrect" msgid "The username or password is incorrect"
msgstr "" msgstr ""

File diff suppressed because one or more lines are too long

Binary file not shown.

View file

@ -92,11 +92,11 @@ msgstr "自动更新已启用,请勿修改此证书配置。"
msgid "Auto Refresh" msgid "Auto Refresh"
msgstr "自动刷新" msgstr "自动刷新"
#: src/views/domain/cert/IssueCert.vue:72 #: src/views/domain/cert/IssueCert.vue:71
msgid "Auto-renewal disabled for %{name}" msgid "Auto-renewal disabled for %{name}"
msgstr "成功关闭 %{name} 自动续签" msgstr "成功关闭 %{name} 自动续签"
#: src/views/domain/cert/IssueCert.vue:66 #: src/views/domain/cert/IssueCert.vue:65
msgid "Auto-renewal enabled for %{name}" msgid "Auto-renewal enabled for %{name}"
msgstr "成功启用 %{name} 自动续签" msgstr "成功启用 %{name} 自动续签"
@ -133,7 +133,6 @@ msgstr "构建基于"
#: src/components/StdDataDisplay/StdBatchEdit.vue:7 #: src/components/StdDataDisplay/StdBatchEdit.vue:7
#: src/components/StdDataDisplay/StdCurd.vue:27 #: src/components/StdDataDisplay/StdCurd.vue:27
#: src/components/StdDataEntry/components/StdSelector.vue:11 #: src/components/StdDataEntry/components/StdSelector.vue:11
#: src/components/StdDataEntry/compontents/StdSelector.vue:11
msgid "Cancel" msgid "Cancel"
msgstr "取消" msgstr "取消"
@ -145,7 +144,7 @@ msgstr "此证书已过期"
msgid "Certificate is valid" msgid "Certificate is valid"
msgstr "此证书有效" msgstr "此证书有效"
#: src/views/cert/Cert.vue:12 src/views/domain/cert/Cert.vue:31 #: src/views/cert/Cert.vue:12 src/views/domain/cert/Cert.vue:35
msgid "Certificate Status" msgid "Certificate Status"
msgstr "证书状态" msgstr "证书状态"
@ -153,6 +152,12 @@ msgstr "证书状态"
msgid "Certification" msgid "Certification"
msgstr "证书" msgstr "证书"
#: src/views/domain/cert/ChangeCert.vue:2
#: src/views/domain/cert/ChangeCert.vue:3
#: src/views/domain/cert/ChangeCert.vue:5
msgid "Change Certificate"
msgstr "更改证书"
#: src/views/domain/ngx_conf/directive/DirectiveEditorItem.vue:34 #: src/views/domain/ngx_conf/directive/DirectiveEditorItem.vue:34
#: src/views/domain/ngx_conf/LocationEditor.vue:31 #: src/views/domain/ngx_conf/LocationEditor.vue:31
#: src/views/domain/ngx_conf/LocationEditor.vue:47 #: src/views/domain/ngx_conf/LocationEditor.vue:47
@ -264,7 +269,7 @@ msgstr "指令"
msgid "Directives" msgid "Directives"
msgstr "指令" msgstr "指令"
#: src/views/domain/cert/IssueCert.vue:74 #: src/views/domain/cert/IssueCert.vue:73
msgid "Disable auto-renewal failed for %{name}" msgid "Disable auto-renewal failed for %{name}"
msgstr "关闭 %{name} 自动续签失败" msgstr "关闭 %{name} 自动续签失败"
@ -307,7 +312,7 @@ msgstr "编辑站点"
msgid "Email (*)" msgid "Email (*)"
msgstr "邮箱 (*)" msgstr "邮箱 (*)"
#: src/views/domain/cert/IssueCert.vue:68 #: src/views/domain/cert/IssueCert.vue:67
msgid "Enable auto-renewal failed for %{name}" msgid "Enable auto-renewal failed for %{name}"
msgstr "启用 %{name} 自动续签失败" msgstr "启用 %{name} 自动续签失败"
@ -392,7 +397,6 @@ msgid "Format successfully"
msgstr "保存成功" msgstr "保存成功"
#: src/components/StdDataEntry/components/StdPassword.vue:42 #: src/components/StdDataEntry/components/StdPassword.vue:42
#: src/components/StdDataEntry/compontents/StdPassword.vue:42
msgid "Generate" msgid "Generate"
msgstr "生成" msgstr "生成"
@ -400,7 +404,7 @@ msgstr "生成"
msgid "Generating private key for registering account" msgid "Generating private key for registering account"
msgstr "正在生成私钥用于注册账户" msgstr "正在生成私钥用于注册账户"
#: src/views/domain/cert/IssueCert.vue:97 #: src/views/domain/cert/IssueCert.vue:96
msgid "Getting the certificate, please wait..." msgid "Getting the certificate, please wait..."
msgstr "正在获取证书,请稍等..." msgstr "正在获取证书,请稍等..."
@ -471,7 +475,7 @@ msgstr "登录成功"
msgid "Logout successful" msgid "Logout successful"
msgstr "登出成功" msgstr "登出成功"
#: src/views/domain/cert/IssueCert.vue:210 #: src/views/domain/cert/IssueCert.vue:211
msgid "" msgid ""
"Make sure you have configured a reverse proxy for .well-known directory to " "Make sure you have configured a reverse proxy for .well-known directory to "
"HTTPChallengePort (default: 9180) before getting the certificate." "HTTPChallengePort (default: 9180) before getting the certificate."
@ -569,11 +573,9 @@ msgstr "找不到页面"
msgid "Not Valid Before: %{date}" msgid "Not Valid Before: %{date}"
msgstr "此前无效: %{date}" msgstr "此前无效: %{date}"
#: src/views/domain/cert/IssueCert.vue:202 #: src/views/domain/cert/IssueCert.vue:38
msgid "" msgid "Note"
"Note: The server_name in the current configuration must be the domain name " msgstr "注意"
"you need to get the certificate."
msgstr "注意:当前配置中的 server_name 必须为需要申请证书的域名。"
#: src/language/constants.ts:16 src/views/domain/cert/IssueCert.vue:3 #: src/language/constants.ts:16 src/views/domain/cert/IssueCert.vue:3
msgid "Obtaining certificate" msgid "Obtaining certificate"
@ -583,7 +585,6 @@ msgstr "正在获取证书"
#: src/components/StdDataDisplay/StdCurd.vue:28 #: src/components/StdDataDisplay/StdCurd.vue:28
#: src/components/StdDataDisplay/StdTable.vue:53 #: src/components/StdDataDisplay/StdTable.vue:53
#: src/components/StdDataEntry/components/StdSelector.vue:12 #: src/components/StdDataEntry/components/StdSelector.vue:12
#: src/components/StdDataEntry/compontents/StdSelector.vue:12
#: src/views/domain/DomainList.vue:25 #: src/views/domain/DomainList.vue:25
msgid "OK" msgid "OK"
msgstr "确定" msgstr "确定"
@ -704,7 +705,6 @@ msgid "Saved successfully"
msgstr "保存成功" msgstr "保存成功"
#: src/components/StdDataEntry/components/StdSelector.vue:13 #: src/components/StdDataEntry/components/StdSelector.vue:13
#: src/components/StdDataEntry/compontents/StdSelector.vue:13
msgid "Selector" msgid "Selector"
msgstr "选择器" msgstr "选择器"
@ -727,11 +727,11 @@ msgstr "服务器错误"
msgid "Server Info" msgid "Server Info"
msgstr "服务器信息" msgstr "服务器信息"
#: src/views/domain/cert/IssueCert.vue:29 #: src/views/domain/cert/IssueCert.vue:30
msgid "server_name not found in directives" msgid "server_name not found in directives"
msgstr "未在指令集合中找到 server_name" msgstr "未在指令集合中找到 server_name"
#: src/views/domain/cert/IssueCert.vue:196 src/views/domain/DomainAdd.vue:111 #: src/views/domain/cert/IssueCert.vue:195 src/views/domain/DomainAdd.vue:111
msgid "server_name parameter is required" msgid "server_name parameter is required"
msgstr "必须为 server_name 指令指明参数" msgstr "必须为 server_name 指令指明参数"
@ -792,7 +792,7 @@ msgstr "终端"
msgid "Terminal Start Command" msgid "Terminal Start Command"
msgstr "终端启动命令" msgstr "终端启动命令"
#: src/views/domain/cert/IssueCert.vue:206 #: src/views/domain/cert/IssueCert.vue:207
msgid "" msgid ""
"The certificate for the domain will be checked every hour, and will be " "The certificate for the domain will be checked every hour, and will be "
"renewed if it has been more than 1 month since it was last issued." "renewed if it has been more than 1 month since it was last issued."
@ -803,6 +803,12 @@ msgstr ""
msgid "The filename cannot contain the following characters: %{c}" msgid "The filename cannot contain the following characters: %{c}"
msgstr "文件名不能包含以下字符: %{c}" msgstr "文件名不能包含以下字符: %{c}"
#: src/views/domain/cert/IssueCert.vue:203
msgid ""
"The server_name in the current configuration must be the domain name you "
"need to get the certificate."
msgstr "当前配置中的 server_name 必须为需要申请证书的域名。"
#: src/language/constants.ts:6 #: src/language/constants.ts:6
msgid "The username or password is incorrect" msgid "The username or password is incorrect"
msgstr "用户名或密码错误" msgstr "用户名或密码错误"

View file

@ -94,11 +94,11 @@ msgstr ""
msgid "Auto Refresh" msgid "Auto Refresh"
msgstr "自動刷新" msgstr "自動刷新"
#: src/views/domain/cert/IssueCert.vue:72 #: src/views/domain/cert/IssueCert.vue:71
msgid "Auto-renewal disabled for %{name}" msgid "Auto-renewal disabled for %{name}"
msgstr "已關閉 %{name} 自動續簽" msgstr "已關閉 %{name} 自動續簽"
#: src/views/domain/cert/IssueCert.vue:66 #: src/views/domain/cert/IssueCert.vue:65
msgid "Auto-renewal enabled for %{name}" msgid "Auto-renewal enabled for %{name}"
msgstr "已啟用 %{name} 自動續簽" msgstr "已啟用 %{name} 自動續簽"
@ -135,7 +135,6 @@ msgstr "構建基於"
#: src/components/StdDataDisplay/StdBatchEdit.vue:7 #: src/components/StdDataDisplay/StdBatchEdit.vue:7
#: src/components/StdDataDisplay/StdCurd.vue:27 #: src/components/StdDataDisplay/StdCurd.vue:27
#: src/components/StdDataEntry/components/StdSelector.vue:11 #: src/components/StdDataEntry/components/StdSelector.vue:11
#: src/components/StdDataEntry/compontents/StdSelector.vue:11
msgid "Cancel" msgid "Cancel"
msgstr "取消" msgstr "取消"
@ -147,7 +146,7 @@ msgstr "此憑證已過期"
msgid "Certificate is valid" msgid "Certificate is valid"
msgstr "此憑證有效" msgstr "此憑證有效"
#: src/views/cert/Cert.vue:12 src/views/domain/cert/Cert.vue:31 #: src/views/cert/Cert.vue:12 src/views/domain/cert/Cert.vue:35
msgid "Certificate Status" msgid "Certificate Status"
msgstr "憑證狀態" msgstr "憑證狀態"
@ -156,6 +155,13 @@ msgstr "憑證狀態"
msgid "Certification" msgid "Certification"
msgstr "此憑證有效" msgstr "此憑證有效"
#: src/views/domain/cert/ChangeCert.vue:2
#: src/views/domain/cert/ChangeCert.vue:3
#: src/views/domain/cert/ChangeCert.vue:5
#, fuzzy
msgid "Change Certificate"
msgstr "正在獲取證書,請稍等..."
#: src/views/domain/ngx_conf/directive/DirectiveEditorItem.vue:34 #: src/views/domain/ngx_conf/directive/DirectiveEditorItem.vue:34
#: src/views/domain/ngx_conf/LocationEditor.vue:31 #: src/views/domain/ngx_conf/LocationEditor.vue:31
#: src/views/domain/ngx_conf/LocationEditor.vue:47 #: src/views/domain/ngx_conf/LocationEditor.vue:47
@ -268,7 +274,7 @@ msgstr "指令"
msgid "Directives" msgid "Directives"
msgstr "指令" msgstr "指令"
#: src/views/domain/cert/IssueCert.vue:74 #: src/views/domain/cert/IssueCert.vue:73
msgid "Disable auto-renewal failed for %{name}" msgid "Disable auto-renewal failed for %{name}"
msgstr "關閉 %{name} 自動續簽失敗" msgstr "關閉 %{name} 自動續簽失敗"
@ -311,7 +317,7 @@ msgstr "編輯站點"
msgid "Email (*)" msgid "Email (*)"
msgstr "郵箱 (*)" msgstr "郵箱 (*)"
#: src/views/domain/cert/IssueCert.vue:68 #: src/views/domain/cert/IssueCert.vue:67
msgid "Enable auto-renewal failed for %{name}" msgid "Enable auto-renewal failed for %{name}"
msgstr "啟用 %{name} 自動續簽失敗" msgstr "啟用 %{name} 自動續簽失敗"
@ -398,7 +404,6 @@ msgid "Format successfully"
msgstr "保存成功" msgstr "保存成功"
#: src/components/StdDataEntry/components/StdPassword.vue:42 #: src/components/StdDataEntry/components/StdPassword.vue:42
#: src/components/StdDataEntry/compontents/StdPassword.vue:42
msgid "Generate" msgid "Generate"
msgstr "生成" msgstr "生成"
@ -406,7 +411,7 @@ msgstr "生成"
msgid "Generating private key for registering account" msgid "Generating private key for registering account"
msgstr "生成註冊賬號私鑰" msgstr "生成註冊賬號私鑰"
#: src/views/domain/cert/IssueCert.vue:97 #: src/views/domain/cert/IssueCert.vue:96
msgid "Getting the certificate, please wait..." msgid "Getting the certificate, please wait..."
msgstr "正在獲取憑證,請稍等..." msgstr "正在獲取憑證,請稍等..."
@ -479,7 +484,7 @@ msgstr "登入成功"
msgid "Logout successful" msgid "Logout successful"
msgstr "登出成功" msgstr "登出成功"
#: src/views/domain/cert/IssueCert.vue:210 #: src/views/domain/cert/IssueCert.vue:211
msgid "" msgid ""
"Make sure you have configured a reverse proxy for .well-known directory to " "Make sure you have configured a reverse proxy for .well-known directory to "
"HTTPChallengePort (default: 9180) before getting the certificate." "HTTPChallengePort (default: 9180) before getting the certificate."
@ -580,11 +585,9 @@ msgstr "找不到頁面"
msgid "Not Valid Before: %{date}" msgid "Not Valid Before: %{date}"
msgstr "此前無效: %{date}" msgstr "此前無效: %{date}"
#: src/views/domain/cert/IssueCert.vue:202 #: src/views/domain/cert/IssueCert.vue:38
msgid "" msgid "Note"
"Note: The server_name in the current configuration must be the domain name " msgstr ""
"you need to get the certificate."
msgstr "注意:當前配置中的 server_name 必須為需要申請證書的域名。"
#: src/language/constants.ts:16 src/views/domain/cert/IssueCert.vue:3 #: src/language/constants.ts:16 src/views/domain/cert/IssueCert.vue:3
msgid "Obtaining certificate" msgid "Obtaining certificate"
@ -594,7 +597,6 @@ msgstr "正在獲取證書,請稍等..."
#: src/components/StdDataDisplay/StdCurd.vue:28 #: src/components/StdDataDisplay/StdCurd.vue:28
#: src/components/StdDataDisplay/StdTable.vue:53 #: src/components/StdDataDisplay/StdTable.vue:53
#: src/components/StdDataEntry/components/StdSelector.vue:12 #: src/components/StdDataEntry/components/StdSelector.vue:12
#: src/components/StdDataEntry/compontents/StdSelector.vue:12
#: src/views/domain/DomainList.vue:25 #: src/views/domain/DomainList.vue:25
msgid "OK" msgid "OK"
msgstr "確定" msgstr "確定"
@ -716,7 +718,6 @@ msgid "Saved successfully"
msgstr "儲存成功" msgstr "儲存成功"
#: src/components/StdDataEntry/components/StdSelector.vue:13 #: src/components/StdDataEntry/components/StdSelector.vue:13
#: src/components/StdDataEntry/compontents/StdSelector.vue:13
msgid "Selector" msgid "Selector"
msgstr "選擇器" msgstr "選擇器"
@ -739,11 +740,11 @@ msgstr "伺服器錯誤"
msgid "Server Info" msgid "Server Info"
msgstr "伺服器資訊" msgstr "伺服器資訊"
#: src/views/domain/cert/IssueCert.vue:29 #: src/views/domain/cert/IssueCert.vue:30
msgid "server_name not found in directives" msgid "server_name not found in directives"
msgstr "未在指令集合中找到 server_name" msgstr "未在指令集合中找到 server_name"
#: src/views/domain/cert/IssueCert.vue:196 src/views/domain/DomainAdd.vue:111 #: src/views/domain/cert/IssueCert.vue:195 src/views/domain/DomainAdd.vue:111
msgid "server_name parameter is required" msgid "server_name parameter is required"
msgstr "必須為 server_name 指令指明參數" msgstr "必須為 server_name 指令指明參數"
@ -808,7 +809,7 @@ msgstr "終端"
msgid "Terminal Start Command" msgid "Terminal Start Command"
msgstr "" msgstr ""
#: src/views/domain/cert/IssueCert.vue:206 #: src/views/domain/cert/IssueCert.vue:207
msgid "" msgid ""
"The certificate for the domain will be checked every hour, and will be " "The certificate for the domain will be checked every hour, and will be "
"renewed if it has been more than 1 month since it was last issued." "renewed if it has been more than 1 month since it was last issued."
@ -820,6 +821,13 @@ msgstr ""
msgid "The filename cannot contain the following characters: %{c}" msgid "The filename cannot contain the following characters: %{c}"
msgstr "檔名不能包含以下字元: %{c}" msgstr "檔名不能包含以下字元: %{c}"
#: src/views/domain/cert/IssueCert.vue:203
#, fuzzy
msgid ""
"The server_name in the current configuration must be the domain name you "
"need to get the certificate."
msgstr "注意:當前配置中的 server_name 必須為需要申請證書的域名。"
#: src/language/constants.ts:6 #: src/language/constants.ts:6
msgid "The username or password is incorrect" msgid "The username or password is incorrect"
msgstr "用戶名或密碼不正確" msgstr "用戶名或密碼不正確"

View file

@ -2,6 +2,10 @@
import CertInfo from '@/views/domain/cert/CertInfo.vue' import CertInfo from '@/views/domain/cert/CertInfo.vue'
import IssueCert from '@/views/domain/cert/IssueCert.vue' import IssueCert from '@/views/domain/cert/IssueCert.vue'
import {computed, ref} from 'vue' import {computed, ref} from 'vue'
import {useGettext} from 'vue3-gettext'
import ChangeCert from '@/views/domain/cert/ChangeCert.vue'
const {$gettext} = useGettext()
const props = defineProps(['directivesMap', 'current_server_directives', 'enabled', 'cert_info']) const props = defineProps(['directivesMap', 'current_server_directives', 'enabled', 'cert_info'])
@ -31,6 +35,8 @@ const enabled = computed({
<h2 v-translate>Certificate Status</h2> <h2 v-translate>Certificate Status</h2>
<cert-info ref="info" :cert="props.cert_info"/> <cert-info ref="info" :cert="props.cert_info"/>
<change-cert :directives-map="props.directivesMap"/>
<issue-cert <issue-cert
:current_server_directives="props.current_server_directives" :current_server_directives="props.current_server_directives"
:directives-map="props.directivesMap" :directives-map="props.directivesMap"

View file

@ -0,0 +1,31 @@
<script setup lang="ts">
import {useGettext} from 'vue3-gettext'
import {ref} from 'vue'
const {$gettext} = useGettext()
const props = defineProps(['directivesMap'])
const visible = ref(false)
function open() {
visible.value = true
}
</script>
<template>
<div>
<a-button @click="open">{{ $gettext('Change Certificate') }}</a-button>
<a-modal
:title="$gettext('Change Certificate')"
v-model:visible="visible"
:mask="false"
>
</a-modal>
</div>
</template>
<style lang="less" scoped>
</style>

View file

@ -4,6 +4,7 @@ import {computed, h, nextTick, onMounted, ref, VNode, watch} from 'vue'
import {message} from 'ant-design-vue' import {message} from 'ant-design-vue'
import domain from '@/api/domain' import domain from '@/api/domain'
import websocket from '@/lib/websocket' import websocket from '@/lib/websocket'
import Template from '@/views/template/Template.vue'
const {$gettext, interpolate} = useGettext() const {$gettext, interpolate} = useGettext()
@ -56,8 +57,6 @@ function job() {
function callback(ssl_certificate: string, ssl_certificate_key: string) { function callback(ssl_certificate: string, ssl_certificate_key: string) {
props.directivesMap['ssl_certificate'][0]['params'] = ssl_certificate props.directivesMap['ssl_certificate'][0]['params'] = ssl_certificate
props.directivesMap['ssl_certificate_key'][0]['params'] = ssl_certificate_key props.directivesMap['ssl_certificate_key'][0]['params'] = ssl_certificate_key
emit('callback')
} }
function change_auto_cert(r: boolean) { function change_auto_cert(r: boolean) {
@ -178,7 +177,7 @@ const modalClosable = ref(false)
</div> </div>
</a-modal> </a-modal>
<div> <div class="issue-cert">
<a-form-item :label="$gettext('Encrypt website with Let\'s Encrypt')"> <a-form-item :label="$gettext('Encrypt website with Let\'s Encrypt')">
<a-switch <a-switch
:loading="issuing_cert" :loading="issuing_cert"
@ -199,18 +198,22 @@ const modalClosable = ref(false)
</template> </template>
</a-alert> </a-alert>
</a-form-item> </a-form-item>
<p v-translate> <a-alert type="info" closable :message="$gettext('Note')">
Note: The server_name in the current configuration must be the domain name <template #description>
you need to get the certificate. <p v-translate>
</p> The server_name in the current configuration must be the domain name
<p v-translate> you need to get the certificate.
The certificate for the domain will be checked every hour, </p>
and will be renewed if it has been more than 1 month since it was last issued. <p v-translate>
</p> The certificate for the domain will be checked every hour,
<p v-translate> and will be renewed if it has been more than 1 month since it was last issued.
Make sure you have configured a reverse proxy for .well-known </p>
directory to HTTPChallengePort (default: 9180) before getting the certificate. <p v-translate>
</p> Make sure you have configured a reverse proxy for .well-known
directory to HTTPChallengePort (default: 9180) before getting the certificate.
</p>
</template>
</a-alert>
</div> </div>
</template> </template>
@ -231,6 +234,10 @@ const modalClosable = ref(false)
</style> </style>
<style lang="less" scoped> <style lang="less" scoped>
.issue-cert {
margin: 15px 0;
}
.switch-wrapper { .switch-wrapper {
position: relative; position: relative;

View file

@ -118,11 +118,15 @@ func ParseTemplate(path, name string) (c ConfigDetail, err error) {
for _, d := range config.GetDirectives() { for _, d := range config.GetDirectives() {
switch d.GetName() { switch d.GetName() {
case nginx.Location: case nginx.Location:
l := &nginx.NgxLocation{} l := &nginx.NgxLocation{
Path: strings.Join(d.GetParameters(), " "),
}
l.ParseLocation(d, 0) l.ParseLocation(d, 0)
c.NgxServer.Locations = append(c.NgxServer.Locations, l) c.NgxServer.Locations = append(c.NgxServer.Locations, l)
default: default:
dir := &nginx.NgxDirective{} dir := &nginx.NgxDirective{
Directive: d.GetName(),
}
dir.ParseDirective(d, 0) dir.ParseDirective(d, 0)
c.NgxServer.Directives = append(c.NgxServer.Directives, dir) c.NgxServer.Directives = append(c.NgxServer.Directives, dir)
} }

View file

@ -4,23 +4,14 @@
# Description[zh_CN]: Nginx UI 配置模板 # Description[zh_CN]: Nginx UI 配置模板
# Author: @0xJacky # Author: @0xJacky
# Nginx UI Template End # Nginx UI Template End
# Nginx UI Custom Start
map $http_upgrade $connection_upgrade { map $http_upgrade $connection_upgrade {
default upgrade; default upgrade;
'' close; '' close;
} }
server { # Nginx UI Custom End
listen 80; location / {
listen [::]:80;
server_name ;
rewrite ^(.*)$ https://$host$1 permanent;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name ;
ssl_certificate ;
ssl_certificate_key ;
location / {
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@ -29,5 +20,4 @@ server {
proxy_set_header Upgrade $http_upgrade; proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade; proxy_set_header Connection $connection_upgrade;
proxy_pass http://127.0.0.1:9000/; proxy_pass http://127.0.0.1:9000/;
}
} }

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;

View file

@ -1,45 +0,0 @@
# Nginx UI Template Start
# Name: WordPress-PHP8.1
# Description[en]: WordPress PHP 8.1 Config Template
# Description[zh_CN]: WordPress PHP 8.1 配置模板
# Author: @0xJacky
# Nginx UI Template End
server {
listen 80;
listen [::]:80;
server_name ;
rewrite ^(.*)$ https://$host$1 permanent;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name ;
ssl_certificate ;
ssl_certificate_key ;
root ;
index index.php;
location ~ [^/]\.php(/|$) {
try_files $uri =404;
fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
fastcgi_index index.php;
include fastcgi.conf;
}
location / {
try_files $uri $uri/ /index.php?$args;
}
# Add trailing slash to */wp-admin requests.
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
location /.well-known {
proxy_set_header Host $host;
proxy_set_header X-Real_IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr:$remote_port;
proxy_pass http://127.0.0.1:{{ HTTP01PORT }};
}
}