ENTRY 005
頻道清單:/static/channels.json(前端「頻道 ▾」下拉)
一句話總結:這個檔案是前端「頻道 ▾」下拉選單的資料來源,陣列中每一個元素=一個可點擊的入口。
改這個 JSON 就能增減頻道,不必動程式碼——前端以
fetch('/static/channels.json?t=…') 每次帶時間戳、cache:'no-store' 動態載入。
① 檔案位置與角色
| 檔案 | 角色 |
|---|---|
| html/static/channels.json | 頻道清單本體(線上讀取路徑 /static/channels.json) |
| agent/indexPage/scripts/patch_channel_20260926.py | 把「頻道下拉載入邏輯」注入前端的補丁(來源:indexPage 2026-09-26) |
| agent/indexPage/jobs/頻道清單/index.html | 可視化編輯頁(同時管理 channels.json 與 tools.json) |
② 欄位說明
| 欄位 | 必填 | 說明 |
|---|---|---|
| id | 是 | 頻道唯一識別碼(產生 DOM 元素用,勿重複) |
| icon | 是 | 顯示用 emoji 圖示 |
| label | 是 | 下拉選單顯示文字 |
| href | 是 | 點擊後前往的位置,四種寫法:絕對路徑 /index.html、相對路徑 report/…、外部網址 https://…、關鍵字 會議模式/game(交給前端既有邏輯處理) |
| tone | 否 | 該頻道主題色(HEX),用於按鈕/左側色條 |
③ 目前頻道一覽(共 13 筆)
| # | id | icon | label | href | tone |
|---|---|---|---|---|---|
| 01 | room | 🏠 | 房間 | /index.html | #4ec9b0 |
| 02 | meeting | 📋 | 會議 | 會議模式 | #4ec9b0 |
| 03 | game | 🎮 | game | game | #ffb84d |
| 04 | live3 | 🎬 | 直播房3 | report/病毒引擎/直播房3/index.html | #e06c9f |
| 05 | social2 | 🌐 | mokagi社交平台2 | report/春/mokagi社交平台2/index.html | #4ea3ff |
| 06 | github-pages | 📄 | GitHub Pages | https://64071181.github.io/ | #c084fc |
| 07 | project | 📁 | project | https://64071181.xyz/project/ | #f59e0b |
| 08 | mokcs | 🧩 | MokCs | https://64071181.xyz/project/MokCs/ | #34d399 |
| 09 | api | 🔌 | api | https://64071181.xyz/project/api/ | #60a5fa |
| 10 | schedule | 🗓️ | mokagi日程 | https://64071181.xyz/report/莫氏集團/mokagi日程/index.html | #f472b6 |
| 11 | mokagi-gh | 🐙 | MOKAGI (GitHub) | https://github.com/MOK2026/MOKAGI | #94a3b8 |
| 12 | call48 | 📞 | 48call 老人陪伴房 | report/衍/48call_老人陪伴房/web/index.html | #f59e0b |
| 13 | wiki | 📖 | mokagi 說明書 (WIKI) | /project/wiki/index.html | #fbbf24 |
④ 原始內容(完整 JSON)
{
"channels": [
{
"id": "room",
"icon": "🏠",
"label": "房間",
"href": "/index.html",
"tone": "#4ec9b0"
},
{
"id": "meeting",
"icon": "📋",
"label": "會議",
"href": "會議模式",
"tone": "#4ec9b0"
},
{
"id": "game",
"icon": "🎮",
"label": "game",
"href": "game",
"tone": "#ffb84d"
},
{
"id": "live3",
"icon": "🎬",
"label": "直播房3",
"href": "report/病毒引擎/直播房3/index.html",
"tone": "#e06c9f"
},
{
"id": "social2",
"icon": "🌐",
"label": "mokagi社交平台2",
"href": "report/春/mokagi社交平台2/index.html",
"tone": "#4ea3ff"
},
{
"id": "github-pages",
"icon": "📄",
"label": "GitHub Pages",
"href": "https://64071181.github.io/",
"tone": "#c084fc"
},
{
"id": "project",
"icon": "📁",
"label": "project",
"href": "https://64071181.xyz/project/",
"tone": "#f59e0b"
},
{
"id": "mokcs",
"icon": "🧩",
"label": "MokCs",
"href": "https://64071181.xyz/project/MokCs/",
"tone": "#34d399"
},
{
"id": "api",
"icon": "🔌",
"label": "api",
"href": "https://64071181.xyz/project/api/",
"tone": "#60a5fa"
},
{
"id": "schedule",
"icon": "🗓️",
"label": "mokagi日程",
"href": "https://64071181.xyz/report/莫氏集團/mokagi日程/index.html",
"tone": "#f472b6"
},
{
"id": "mokagi-gh",
"icon": "🐙",
"label": "MOKAGI (GitHub)",
"href": "https://github.com/MOK2026/MOKAGI",
"tone": "#94a3b8"
},
{
"id": "call48",
"icon": "📞",
"label": "48call 老人陪伴房",
"href": "report/衍/48call_老人陪伴房/web/index.html",
"tone": "#f59e0b"
},
{
"id": "wiki",
"icon": "📖",
"label": "mokagi 說明書 (WIKI)",
"href": "/project/wiki/index.html",
"tone": "#fbbf24"
}
]
}
⑤ 相關條目
所屬機制請見 002|前端=面孔:一套核心、多入口;右側工具面板請見 006|右側工具面板 tools.json。