2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 13:47:15 +08:00

feat: 支持一键签发证书

This commit is contained in:
耗子
2024-10-26 02:28:52 +08:00
parent 9ac5ae4968
commit 95cf05879d
14 changed files with 112 additions and 29 deletions

View File

@@ -20,16 +20,18 @@ export default {
config: (id: number): Promise<AxiosResponse<any>> => request.get('/website/' + id),
// 保存网站配置
saveConfig: (id: number, data: any): Promise<AxiosResponse<any>> =>
request.put('/website/' + id, data),
request.put(`/website/${id}`, data),
// 清空日志
clearLog: (id: number): Promise<AxiosResponse<any>> => request.delete('/website/' + id + '/log'),
// 更新备注
updateRemark: (id: number, remark: string): Promise<AxiosResponse<any>> =>
request.post('/website/' + id + '/updateRemark', { remark }),
request.post(`/website/${id}` + '/updateRemark', { remark }),
// 重置配置
resetConfig: (id: number): Promise<AxiosResponse<any>> =>
request.post('/website/' + id + '/resetConfig'),
request.post(`/website/${id}/resetConfig`),
// 修改状态
status: (id: number, status: boolean): Promise<AxiosResponse<any>> =>
request.post('/website/' + id + '/status', { status })
request.post(`/website/${id}/status`, { status }),
// 签发证书
obtainCert: (id: number): Promise<AxiosResponse<any>> => request.post(`/website/${id}/obtainCert`)
}

View File

@@ -96,6 +96,13 @@ const handleReset = async () => {
})
}
const handleObtainCert = async () => {
await website.obtainCert(Number(id)).then(() => {
getWebsiteSetting()
window.$message.success('成功,请开启 HTTPS 并保存')
})
}
const clearLog = async () => {
await website.clearLog(Number(id)).then(() => {
getWebsiteSetting()
@@ -140,6 +147,10 @@ onMounted(async () => {
</template>
确定要重置配置吗
</n-popconfirm>
<n-button v-if="current === 'https'" class="ml-16" type="success" @click="handleObtainCert">
<TheIcon :size="18" icon="material-symbols:done-rounded" />
一键签发证书
</n-button>
<n-button v-if="current !== 'log'" class="ml-16" type="primary" @click="handleSave">
<TheIcon :size="18" icon="material-symbols:save-outline" />
保存
@@ -174,7 +185,7 @@ onMounted(async () => {
:on-create="onCreateListen"
>
<template #default="{ value }">
<div w-full flex items-center >
<div w-full flex items-center>
<n-input v-model:value="value.address" clearable />
<n-checkbox v-model:checked="value.https" ml-20 mr-20 w-120> HTTPS </n-checkbox>
<n-checkbox v-model:checked="value.quic" w-200> QUIC(HTTP3) </n-checkbox>