mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-06-14 11:42:02 +08:00
feat: CLI 改密、自定义 TLS、移动端适配与扩展校验
- 新增 one-kvm user set-password(交互式),改密后吊销该用户全部会话 - /api/config/web 支持 PEM 证书/密钥上传与清除,响应含 has_custom_cert - 移动端:ActionBar 溢出菜单、ATX/粘贴底部 Sheet、BrandMark 与控制台等响应式优化 - GOSTC:校验服务器地址非空,管理器启动条件与 HTTP 热更新一致 - RustDesk:中继密钥 relay_key 校验为标准 Base64 且解码后恰好 32 字节 - StatusCard、InfoBar:合并精简冗余状态信息
This commit is contained in:
@@ -30,6 +30,8 @@ import type {
|
||||
GostcConfigUpdate,
|
||||
EasytierConfig,
|
||||
EasytierConfigUpdate,
|
||||
WebConfigResponse,
|
||||
WebConfigUpdate,
|
||||
} from '@/types/generated'
|
||||
|
||||
import { request } from './request'
|
||||
@@ -384,36 +386,24 @@ export const rtspConfigApi = {
|
||||
}
|
||||
|
||||
// ===== Web 服务器配置 API =====
|
||||
// `/config/web` 使用 `WebConfigResponse` / `WebConfigUpdate`(由 typeshare 自 Rust 生成)。
|
||||
|
||||
/** Web 服务器配置 */
|
||||
export interface WebConfig {
|
||||
http_port: number
|
||||
https_port: number
|
||||
bind_addresses: string[]
|
||||
bind_address: string
|
||||
https_enabled: boolean
|
||||
}
|
||||
/** REST `/config/web` 响应(`WebConfigResponse` 别名,兼容旧命名) */
|
||||
export type WebConfig = WebConfigResponse
|
||||
|
||||
/** Web 服务器配置更新 */
|
||||
export interface WebConfigUpdate {
|
||||
http_port?: number
|
||||
https_port?: number
|
||||
bind_addresses?: string[]
|
||||
bind_address?: string
|
||||
https_enabled?: boolean
|
||||
}
|
||||
export type { WebConfigUpdate }
|
||||
|
||||
export const webConfigApi = {
|
||||
/**
|
||||
* 获取 Web 服务器配置
|
||||
*/
|
||||
get: () => request<WebConfig>('/config/web'),
|
||||
get: () => request<WebConfigResponse>('/config/web'),
|
||||
|
||||
/**
|
||||
* 更新 Web 服务器配置
|
||||
* 更新 Web 服务器配置(含可选的证书上传)
|
||||
*/
|
||||
update: (config: WebConfigUpdate) =>
|
||||
request<WebConfig>('/config/web', {
|
||||
request<WebConfigResponse>('/config/web', {
|
||||
method: 'PATCH',
|
||||
body: JSON.stringify(config),
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user