mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-03-24 23:06:51 +00:00
feat: 设置页面wayland说明和缓存目录展示
This commit is contained in:
@@ -175,6 +175,21 @@ function SettingsPage({ onClose }: SettingsPageProps = {}) {
|
|||||||
|
|
||||||
const isClearingCache = isClearingAnalyticsCache || isClearingImageCache || isClearingAllCache
|
const isClearingCache = isClearingAnalyticsCache || isClearingImageCache || isClearingAllCache
|
||||||
|
|
||||||
|
const [isWayland, setIsWayland] = useState(false)
|
||||||
|
useEffect(() => {
|
||||||
|
const checkWaylandStatus = async () => {
|
||||||
|
if (window.electronAPI?.app?.checkWayland) {
|
||||||
|
try {
|
||||||
|
const wayland = await window.electronAPI.app.checkWayland()
|
||||||
|
setIsWayland(wayland)
|
||||||
|
} catch (e) {
|
||||||
|
console.error('检查 Wayland 状态失败:', e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
checkWaylandStatus()
|
||||||
|
}, [])
|
||||||
|
|
||||||
// 检查 Hello 可用性
|
// 检查 Hello 可用性
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (window.PublicKeyCredential) {
|
if (window.PublicKeyCredential) {
|
||||||
@@ -1169,6 +1184,11 @@ function SettingsPage({ onClose }: SettingsPageProps = {}) {
|
|||||||
<div className="form-group">
|
<div className="form-group">
|
||||||
<label>通知显示位置</label>
|
<label>通知显示位置</label>
|
||||||
<span className="form-hint">选择通知弹窗在屏幕上的显示位置</span>
|
<span className="form-hint">选择通知弹窗在屏幕上的显示位置</span>
|
||||||
|
{isWayland && (
|
||||||
|
<span className="form-hint" style={{ color: '#ff4d4f', marginTop: '4px', display: 'block' }}>
|
||||||
|
⚠️ 注意:Wayland 环境下该配置可能无效!
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
<div className="custom-select">
|
<div className="custom-select">
|
||||||
<div
|
<div
|
||||||
className={`custom-select-trigger ${positionDropdownOpen ? 'open' : ''}`}
|
className={`custom-select-trigger ${positionDropdownOpen ? 'open' : ''}`}
|
||||||
@@ -1667,7 +1687,22 @@ function SettingsPage({ onClose }: SettingsPageProps = {}) {
|
|||||||
scheduleConfigSave('cachePath', () => configService.setCachePath(value))
|
scheduleConfigSave('cachePath', () => configService.setCachePath(value))
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<div className="btn-row">
|
|
||||||
|
<div style={{ marginTop: '8px', fontSize: '13px', color: 'var(--text-secondary)' }}>
|
||||||
|
当前缓存位置:
|
||||||
|
<code style={{
|
||||||
|
background: 'var(--bg-secondary)',
|
||||||
|
padding: '3px 6px',
|
||||||
|
borderRadius: '4px',
|
||||||
|
userSelect: 'all',
|
||||||
|
wordBreak: 'break-all',
|
||||||
|
marginLeft: '4px'
|
||||||
|
}}>
|
||||||
|
{cachePath || (isMac ? '~/Documents/WeFlow' : isLinux ? '~/Documents/WeFlow' : '系统 文档\\WeFlow 目录')}
|
||||||
|
</code>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="btn-row" style={{ marginTop: '12px' }}>
|
||||||
<button className="btn btn-secondary" onClick={handleSelectCachePath}><FolderOpen size={16} /> 浏览选择</button>
|
<button className="btn btn-secondary" onClick={handleSelectCachePath}><FolderOpen size={16} /> 浏览选择</button>
|
||||||
<button
|
<button
|
||||||
className="btn btn-secondary"
|
className="btn btn-secondary"
|
||||||
|
|||||||
Reference in New Issue
Block a user