Add SSL certificate management to WebUI config

Introduces backend API endpoints and frontend UI for managing SSL certificates, including viewing status, uploading, and deleting cert/key files. Adds a new SSL configuration tab in the dashboard, allowing users to enable HTTPS by providing PEM-formatted certificate and key, with changes taking effect after restart.
This commit is contained in:
手瓜一十雪
2026-01-30 14:28:47 +08:00
parent 72e01f8c84
commit 927797f3d5
5 changed files with 294 additions and 1 deletions

View File

@@ -281,6 +281,35 @@ export default class WebUIManager {
return data.data;
}
// 获取SSL证书状态
public static async getSSLStatus () {
const { data } = await serverRequest.get<ServerResponse<{
enabled: boolean;
certExists: boolean;
keyExists: boolean;
certContent: string;
keyContent: string;
}>>('/WebUIConfig/GetSSLStatus');
return data.data;
}
// 保存SSL证书
public static async saveSSLCert (cert: string, key: string) {
const { data } = await serverRequest.post<ServerResponse<{ message: string; }>>(
'/WebUIConfig/UploadSSLCert',
{ cert, key }
);
return data.data;
}
// 删除SSL证书
public static async deleteSSLCert () {
const { data } = await serverRequest.post<ServerResponse<{ message: string; }>>(
'/WebUIConfig/DeleteSSLCert'
);
return data.data;
}
// Passkey相关方法
public static async generatePasskeyRegistrationOptions () {
const { data } = await serverRequest.post<ServerResponse<any>>(