v2.3: hardcoded Chinese UI + transparent PI background

This commit is contained in:
2026-06-18 17:27:04 +08:00
parent 42fac626ce
commit 14d840589c
4 changed files with 47 additions and 13 deletions
@@ -2,3 +2,14 @@
"Name": "AI Monitor", "Name": "AI Monitor",
"Description": "Real-time AI agent workflow status on N4" "Description": "Real-time AI agent workflow status on N4"
} }
{
"Name": "AI Monitor",
"Description": "Real-time AI agent workflow status on N4",
"Ready": "Ready",
"Prompt": "Prompt",
"Thinking": "Thinking",
"Working": "Working",
"Typing": "Typing",
"Done": "Done",
"Error": "Error"
}
@@ -86,6 +86,19 @@ var STATUS = {
done: { title: 'Done', fill: '#22c55e', blink: true, breathe: false }, done: { title: 'Done', fill: '#22c55e', blink: true, breathe: false },
error: { title: 'Error', fill: '#ef4444', blink: false, breathe: false }, error: { title: 'Error', fill: '#ef4444', blink: false, breathe: false },
}; };
// ── Language support ─────────────────────────────────
var LANG = (function() { try { var info = JSON.parse(process.argv[9]); if (info && info.application && info.application.language) return info.application.language; } catch(_) {} return "en"; })();
function T(key) {
return key === "idle" ? (LANG === "zh_CN" ? "就绪" : "Ready") :
key === "prompt" ? (LANG === "zh_CN" ? "输入" : "Prompt") :
key === "thinking" ? (LANG === "zh_CN" ? "思考" : "Thinking") :
key === "working" ? (LANG === "zh_CN" ? "工作" : "Working") :
key === "typing" ? (LANG === "zh_CN" ? "回复" : "Typing") :
key === "done" ? (LANG === "zh_CN" ? "完成" : "Done") :
key === "error" ? (LANG === "zh_CN" ? "错误" : "Error") : key;
}
var PRIORITY = ['error','working','typing','thinking','prompt','done','idle']; var PRIORITY = ['error','working','typing','thinking','prompt','done','idle'];
var states = {}; // per-context state: { agent, currentState, lastActivity, offsets, timer, logoUri } var states = {}; // per-context state: { agent, currentState, lastActivity, offsets, timer, logoUri }
@@ -1,4 +1,4 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="zh"> <html lang="zh">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
@@ -6,7 +6,7 @@
<title>AI Monitor Settings</title> <title>AI Monitor Settings</title>
<link rel="stylesheet" href="../utils/css/sdpi.css"> <link rel="stylesheet" href="../utils/css/sdpi.css">
<style> <style>
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #1a1a2e; color: #e0e0e0; padding: 16px; margin: 0; } body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: transparent; color: #e0e0e0; padding: 16px; margin: 0; }
label { display: block; font-size: 12px; color: #888; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; } label { display: block; font-size: 12px; color: #888; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.row { display: flex; align-items: center; gap: 8px; } .row { display: flex; align-items: center; gap: 8px; }
input[type="range"] { flex: 1; accent-color: #f59e0b; } input[type="range"] { flex: 1; accent-color: #f59e0b; }
@@ -14,20 +14,19 @@
</style> </style>
</head> </head>
<body> <body>
<label>Poll Interval (ms)</label> <label>轮询间隔 (ms)</label>
<div class="row"> <div class="row">
<input type="range" id="pollInterval" min="500" max="5000" step="100" value="1000"> <input type="range" id="pollInterval" min="500" max="5000" step="100" value="1000">
<span id="pollVal">1000ms</span> <span id="pollVal">1000ms</span>
</div> </div>
<script src="../utils/action.js"></script> <script src="../utils/action.js"></script>
<script> <script>
(function () { var slider = document.getElementById("pollInterval");
var slider = document.getElementById('pollInterval'); var val = document.getElementById("pollVal");
var val = document.getElementById('pollVal'); slider.addEventListener("input", function () { val.textContent = this.value + "ms"; $settings.pollInterval = parseInt(this.value, 10); });
slider.addEventListener('input', function () { val.textContent = this.value + 'ms'; $settings.pollInterval = parseInt(this.value, 10); });
if ($settings.pollInterval) slider.value = $settings.pollInterval; if ($settings.pollInterval) slider.value = $settings.pollInterval;
else $settings.pollInterval = 1000; else $settings.pollInterval = 1000;
})(); $local = true;
</script> </script>
</body> </body>
</html> </html>
@@ -2,3 +2,14 @@
"Name": "AI 监控", "Name": "AI 监控",
"Description": "在 N4 上实时显示 AI Agent 工作流状态" "Description": "在 N4 上实时显示 AI Agent 工作流状态"
} }
{
"Name": "AI 监控",
"Description": "在 N4 上实时显示 AI Agent 工作流状态",
"Ready": "就绪",
"Prompt": "输入",
"Thinking": "思考",
"Working": "工作",
"Typing": "回复",
"Done": "完成",
"Error": "错误"
}