Support custom WebUI fonts and UI additions

Backend: add CheckWebUIFontExist API and route; set --font-family-mono CSS variable in InitWebUi for aacute/custom/default. Improve webui font uploader: force saved filename to CustomFont, robustly clean old webui/CustomFont files, and log failures.

Frontend: add FileManager.checkWebUIFontExists; update theme settings to show upload UI only when 'custom' is selected, display uploaded status, attempt delete-before-upload, reload after actions, and adjust Accordion props. ColorPicker: enable pointer events on PopoverContent to allow dragging. applyFont now sets --font-family-mono for all modes.
This commit is contained in:
手瓜一十雪
2026-02-01 14:00:27 +08:00
parent c69589ee11
commit 8f6be073c1
8 changed files with 115 additions and 45 deletions

View File

@@ -5,8 +5,8 @@ import { ColorResult, SketchPicker } from 'react-color';
// 假定 heroui 提供的 Popover组件
interface ColorPickerProps {
color: string
onChange: (color: ColorResult) => void
color: string;
onChange: (color: ColorResult) => void;
}
const ColorPicker: React.FC<ColorPickerProps> = ({ color, onChange }) => {
@@ -22,7 +22,8 @@ const ColorPicker: React.FC<ColorPickerProps> = ({ color, onChange }) => {
style={{ background: color }}
/>
</PopoverTrigger>
<PopoverContent>
{/* 移除 PopoverContent 默认的事件阻止,允许鼠标拖动到外部 */}
<PopoverContent className='pointer-events-auto'>
<SketchPicker
color={color}
onChange={handleChange}