mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-15 21:05:51 +00:00
* feat: 支持自托管的 remote-control-server (#214) --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
28 lines
554 B
JavaScript
28 lines
554 B
JavaScript
/**
|
|
* Remote Control — Shared Utilities
|
|
*/
|
|
|
|
export function esc(str) {
|
|
if (!str) return "";
|
|
const div = document.createElement("div");
|
|
div.textContent = String(str);
|
|
return div.innerHTML;
|
|
}
|
|
|
|
export function formatTime(ts) {
|
|
if (!ts) return "";
|
|
return new Date(ts * 1000).toLocaleString();
|
|
}
|
|
|
|
export function statusClass(status) {
|
|
const map = {
|
|
active: "active",
|
|
running: "running",
|
|
idle: "idle",
|
|
requires_action: "requires_action",
|
|
archived: "archived",
|
|
error: "error",
|
|
};
|
|
return map[status] || "default";
|
|
}
|