feat(web): Header ⌘K 搜尋提示按鈕 + sensor service file 補齊
Some checks are pending
CD Pipeline / build-and-deploy (push) Has started running
Some checks are pending
CD Pipeline / build-and-deploy (push) Has started running
Header: - 新增 ⌘K 入口按鈕(搜尋圖示 + "搜尋..." + ⌘K badge) - 點擊觸發 window keydown(meta+k) 開啟 CommandPalette - hover 變藍(UX 提示) Sensor: - 補齊 apps/sensor/awoooi-sensor.service(PYTHONUNBUFFERED=1 + --loop) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
17
apps/sensor/awoooi-sensor.service
Normal file
17
apps/sensor/awoooi-sensor.service
Normal file
@@ -0,0 +1,17 @@
|
||||
[Unit]
|
||||
Description=AWOOOI Sensor Agent -- Phase 5.5 神經末梢
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=%h/awoooi-sensor
|
||||
ExecStart=/usr/bin/python3 -u %h/awoooi-sensor/agent.py --loop --interval 30
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
Environment=AWOOOI_REDIS_URL=redis://192.168.0.188:6380/10
|
||||
Environment=PYTHONUNBUFFERED=1
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
@@ -205,6 +205,7 @@
|
||||
"aiModelStatus": "AI Model Status",
|
||||
"loading": "Loading...",
|
||||
"trendUp": "↑{pct}%",
|
||||
"searchPlaceholderShort": "Search...",
|
||||
"cotTitle": "Reasoning Timeline",
|
||||
"cotNoEvents": "Waiting for reasoning data...",
|
||||
"cotReasoning": "Reasoning",
|
||||
|
||||
@@ -206,6 +206,7 @@
|
||||
"aiModelStatus": "AI 模型狀態",
|
||||
"loading": "載入中...",
|
||||
"trendUp": "↑{pct}%",
|
||||
"searchPlaceholderShort": "搜尋...",
|
||||
"cotTitle": "推理時間軸",
|
||||
"cotNoEvents": "等待事件推理資料...",
|
||||
"cotReasoning": "推理",
|
||||
|
||||
@@ -143,6 +143,27 @@ export function Header({
|
||||
{tDashboard('title')}
|
||||
</span>
|
||||
|
||||
{/* ⌘K Command Palette 入口提示 */}
|
||||
<button
|
||||
onClick={() => {
|
||||
const e = new KeyboardEvent('keydown', { key: 'k', metaKey: true, bubbles: true })
|
||||
window.dispatchEvent(e)
|
||||
}}
|
||||
style={{
|
||||
display: 'flex', alignItems: 'center', gap: 6,
|
||||
padding: '5px 12px',
|
||||
background: '#fff', border: '0.5px solid #e0ddd4', borderRadius: 8,
|
||||
cursor: 'pointer', fontSize: 11, color: '#87867f',
|
||||
transition: 'all 0.15s',
|
||||
}}
|
||||
onMouseEnter={e => { (e.currentTarget as HTMLButtonElement).style.borderColor = '#4A90D9'; (e.currentTarget as HTMLButtonElement).style.color = '#4A90D9' }}
|
||||
onMouseLeave={e => { (e.currentTarget as HTMLButtonElement).style.borderColor = '#e0ddd4'; (e.currentTarget as HTMLButtonElement).style.color = '#87867f' }}
|
||||
>
|
||||
<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.35-4.35"/></svg>
|
||||
<span style={{ fontFamily: 'var(--font-body), monospace' }}>{tDashboard('searchPlaceholderShort')}</span>
|
||||
<kbd style={{ fontSize: 9, background: '#f0ede5', borderRadius: 3, padding: '1px 5px', fontFamily: 'monospace', color: '#87867f' }}>⌘K</kbd>
|
||||
</button>
|
||||
|
||||
{/* Language switcher — pill style */}
|
||||
<button
|
||||
onClick={() => switchLocale('zh-TW')}
|
||||
|
||||
Reference in New Issue
Block a user