feat(web): Header ⌘K 搜尋提示按鈕 + sensor service file 補齊
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:
OG T
2026-04-10 00:29:15 +08:00
parent c132fd423a
commit f8c6dfc642
4 changed files with 40 additions and 0 deletions

View 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

View File

@@ -205,6 +205,7 @@
"aiModelStatus": "AI Model Status",
"loading": "Loading...",
"trendUp": "↑{pct}%",
"searchPlaceholderShort": "Search...",
"cotTitle": "Reasoning Timeline",
"cotNoEvents": "Waiting for reasoning data...",
"cotReasoning": "Reasoning",

View File

@@ -206,6 +206,7 @@
"aiModelStatus": "AI 模型狀態",
"loading": "載入中...",
"trendUp": "↑{pct}%",
"searchPlaceholderShort": "搜尋...",
"cotTitle": "推理時間軸",
"cotNoEvents": "等待事件推理資料...",
"cotReasoning": "推理",

View File

@@ -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')}