console rebrand Mira→Arcrun + CONSOLE_BRAND 可覆蓋(#21) #47
@@ -522,13 +522,13 @@ consoleDashboardRouter.post('/console/triage-check', async (c) => {
|
||||
return c.json({ success: true, entry_id: entryId, action, status: action === 'restore' ? 'new' : 'done' });
|
||||
});
|
||||
|
||||
function renderDashboardHtml(): string {
|
||||
function renderDashboardHtml(brand: string): string {
|
||||
return `<!doctype html>
|
||||
<html lang="zh-Hant">
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Mira 駕駛艙</title>
|
||||
<title>${brand} 駕駛艙</title>
|
||||
<script>
|
||||
// 主題預載(防閃色):預設淺色(leo 2026-07-04 明示),與 /console 共用同一 localStorage key
|
||||
document.documentElement.setAttribute('data-theme', (function () {
|
||||
@@ -620,7 +620,7 @@ function renderDashboardHtml(): string {
|
||||
<body>
|
||||
<main>
|
||||
<div class="pagehead">
|
||||
<div class="title serif">Mira<small> 駕駛艙</small></div>
|
||||
<div class="title serif">${brand}<small> 駕駛艙</small></div>
|
||||
<div style="display:flex;align-items:baseline">
|
||||
<div class="date serif" id="date-str"></div>
|
||||
<button class="theme-btn" id="theme-btn" title="切換深/淺色">☾</button>
|
||||
@@ -813,4 +813,5 @@ function renderDashboardHtml(): string {
|
||||
}
|
||||
|
||||
// GET /console/dashboard — 駕駛艙頁(無需登入;純渲染 dashboard-data,無互動、無說明文字)
|
||||
consoleDashboardRouter.get('/console/dashboard', (c) => c.html(renderDashboardHtml()));
|
||||
// 品牌字樣(Arcrun#21):引擎預設 Arcrun,實例可用 CONSOLE_BRAND 覆蓋(如 "Arcrun RAG")
|
||||
consoleDashboardRouter.get('/console/dashboard', (c) => c.html(renderDashboardHtml(c.env.CONSOLE_BRAND || 'Arcrun')));
|
||||
|
||||
@@ -63,13 +63,13 @@ import { TAIPEI_CLIENT_JS } from '../lib/taipei-time';
|
||||
|
||||
export const consoleRouter = new Hono<{ Bindings: Bindings }>();
|
||||
|
||||
function renderConsoleHtml(registryBase: string): string {
|
||||
function renderConsoleHtml(registryBase: string, brand: string): string {
|
||||
return `<!doctype html>
|
||||
<html lang="zh-Hant">
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Mira Console</title>
|
||||
<title>${brand} Console</title>
|
||||
<script>
|
||||
// 主題預載(防閃色):預設淺色(leo 2026-07-04 明示),選擇存 localStorage
|
||||
document.documentElement.setAttribute('data-theme', (function () {
|
||||
@@ -292,7 +292,7 @@ function renderConsoleHtml(registryBase: string): string {
|
||||
<div class="authwrap view" id="v-login">
|
||||
<div class="authbox">
|
||||
<div>
|
||||
<div class="brand">Mira</div>
|
||||
<div class="brand">${brand}</div>
|
||||
<div class="brand-sub">私人系統・僅供擁有者進入</div>
|
||||
</div>
|
||||
<div style="display:flex;flex-direction:column;gap:12px;text-align:left">
|
||||
@@ -311,7 +311,7 @@ function renderConsoleHtml(registryBase: string): string {
|
||||
<div class="authwrap view" id="v-setup">
|
||||
<div class="authbox" style="max-width:440px;text-align:left">
|
||||
<div style="text-align:center">
|
||||
<div class="brand" style="font-size:38px">Mira</div>
|
||||
<div class="brand" style="font-size:38px">${brand}</div>
|
||||
<div class="serif" style="margin-top:12px;font-size:21px">首次設定</div>
|
||||
<div style="margin-top:8px;font-size:15px;color:rgba(var(--ink-rgb),.55);line-height:1.7">系統偵測到尚未設定擁有者帳號。<br>設定一組 Email 與密碼,之後只有你能進入。</div>
|
||||
</div>
|
||||
@@ -329,7 +329,7 @@ function renderConsoleHtml(registryBase: string): string {
|
||||
<!-- 主應用 -->
|
||||
<div id="shell">
|
||||
<div id="sidenav">
|
||||
<div class="logo">Mira</div>
|
||||
<div class="logo">${brand}</div>
|
||||
<div class="nav" data-nav="cockpit">駕駛艙</div>
|
||||
<div class="nav" data-nav="search">總庫搜尋</div>
|
||||
<div class="nav" data-nav="workflows">工作流</div>
|
||||
@@ -343,7 +343,7 @@ function renderConsoleHtml(registryBase: string): string {
|
||||
|
||||
<!-- 駕駛艙 -->
|
||||
<div class="view page" id="v-cockpit">
|
||||
<div class="pagehead"><span class="t">Mira<span style="font-size:14px;letter-spacing:.3em;color:rgba(var(--ink-rgb),.5)"> 控制台</span></span><span class="m serif" id="ck-date"></span></div>
|
||||
<div class="pagehead"><span class="t">${brand}<span style="font-size:14px;letter-spacing:.3em;color:rgba(var(--ink-rgb),.5)"> 控制台</span></span><span class="m serif" id="ck-date"></span></div>
|
||||
<div class="cockgrid">
|
||||
<div>
|
||||
<div class="orb-row">
|
||||
@@ -1475,5 +1475,6 @@ consoleRouter.get('/console', (c) => {
|
||||
const registryBase = subdomain
|
||||
? `https://arcrun-registry.${subdomain}.workers.dev`
|
||||
: 'https://registry.arcrun.dev';
|
||||
return c.html(renderConsoleHtml(registryBase));
|
||||
// 品牌字樣(Arcrun#21):引擎預設 Arcrun,實例可用 CONSOLE_BRAND 覆蓋(如 "Arcrun RAG")
|
||||
return c.html(renderConsoleHtml(registryBase, c.env.CONSOLE_BRAND || 'Arcrun'));
|
||||
});
|
||||
|
||||
@@ -78,6 +78,10 @@ export type Bindings = {
|
||||
// console 登入後端一律用這個字串打 /kbdb/*、/workflows/search(不做多租戶,登入系統只擋外人看頁面)。
|
||||
// 未設 → routes/console-auth.ts 預設 "leo"(發現①已核實:D1 458,357 筆資料實際使用的租戶字串)。
|
||||
CONSOLE_TENANT?: string;
|
||||
// Console 顯示品牌/實例名(Arcrun#21 rebrand,非機密)。只影響 UI 字樣(title/header/logo),
|
||||
// 不影響任何行為。未設 → "Arcrun"(console 是引擎共用件,不寫死產品名)。
|
||||
// 實例可覆蓋,例:arcrun-rag demo 可設 --var CONSOLE_BRAND:"Arcrun RAG"。
|
||||
CONSOLE_BRAND?: string;
|
||||
// ── console 駕駛艙「等你的事」活資料源(fix/console-dashboard-live-data,2026-07-07)──
|
||||
// 等 leo 的事真相源=InkStoneCo sprint 檔「## 等 leo 清單」(progress-guard 每日維護),
|
||||
// 不是沒人維護的 KBDB dash_wait。cypher 進程內 fetch Gitea API(自架 Gitea,非 GitHub,
|
||||
|
||||
Reference in New Issue
Block a user