diff --git a/console-ui/public/portal/index.html b/console-ui/public/portal/index.html index 9278fac..2efcccb 100644 --- a/console-ui/public/portal/index.html +++ b/console-ui/public/portal/index.html @@ -647,12 +647,25 @@ function taipeiMonthDay(ms) { var d = new Date(ms + TAIPEI_OFFSET_MS); return { return src.slice(5).replace(/#[^#]*$/, ''); } function entryLib(e) { var m = entryMeta(e); return (typeof m.library === 'string' && m.library) ? m.library : 'general'; } + // 內部型別 → 人話標籤(2026-08-07:entry_type 原始值如 wiki_card / block / execution_log + // 是資料庫內部分類,不是用戶該懂的詞——尤其 wiki_card 直接違背上傳頁自己講的「AI 整理後 + // 會以 wiki 卡形式出現」,若卡片上貼的標籤是英文 snake_case「wiki_card」,等於自打嘴巴。 + // 未知型別一律落地成中性的「筆記」,不吐原始英文字串給使用者。 + var ENTRY_TYPE_LABEL = { + wiki_card: '知識卡', block: '知識卡', value: '記錄', workflow: '工作流', + execution_log: '執行紀錄', todo: '待辦', inbox: '收件', user_template: '範本', + recipe_submission: '投稿', agent_feedback: '回饋' + }; + function entryTypeLabel(t) { return ENTRY_TYPE_LABEL[t] || '筆記'; } + // 搜尋模式的原始值(keyword/semantic)是 API 參數,不是用戶詞彙——一律轉中文再顯示。 + var SEARCH_MODE_LABEL = { keyword: '關鍵字', semantic: '語意', graph: '圖譜' }; + function searchModeLabel(m) { return SEARCH_MODE_LABEL[m] || m; } function entryTitle(e) { if (e.page_name) return e.page_name; var first = String(e.content || '').split(/\r?\n/).find(function (l) { return l.trim(); }) || ''; first = first.replace(/^#+\s*/, '').replace(/^[-*>]\s*/, '').trim(); if (first.length > 60) first = first.slice(0, 60) + '…'; - return first || '(無標題・' + (e.entry_type || 'entry') + ')'; + return first || '(無標題・' + entryTypeLabel(e.entry_type) + ')'; } function entrySnippet(e) { var lines = String(e.content || '').split(/\r?\n/).filter(function (l) { return l.trim(); }); @@ -1165,10 +1178,14 @@ function taipeiMonthDay(ms) { var d = new Date(ms + TAIPEI_OFFSET_MS); return { if (!x.ok) { $('se-count').innerHTML = '' + esc(x.d.error || ('查詢失敗(HTTP ' + x.status + ')')) + ''; return; } var d = x.d; if (S.mode === 'semantic' && d.mode === 'keyword') { - $('se-banner').innerHTML = '