feat: Introduce Wiki Fixer agent and related functionalities
- Added a new built-in agent, "Wiki Fixer," designed to repair and optimize Wiki pages based on linter issues, with multilingual support for enhanced accessibility. - Implemented a corresponding system prompt detailing the agent's role, mission, and workflow for effective issue resolution. - Introduced new API functions for listing and updating wiki issues, allowing for better management of content conflicts and errors. - Enhanced the frontend with new UI elements to display pending issues and facilitate auto-fixing, improving user interaction with the Wiki content. These changes significantly enhance the agent's capabilities for maintaining the accuracy and quality of Wiki pages, fostering a more reliable knowledge base.
This commit is contained in:
@@ -41,9 +41,24 @@ export interface WikiStats {
|
||||
orphan_count: number;
|
||||
recent_updates: WikiPage[];
|
||||
pending_tasks: number;
|
||||
pending_issues: number;
|
||||
is_active: boolean;
|
||||
}
|
||||
|
||||
export interface WikiPageIssue {
|
||||
id: string;
|
||||
tenant_id: number;
|
||||
knowledge_base_id: string;
|
||||
slug: string;
|
||||
issue_type: string;
|
||||
description: string;
|
||||
suspected_knowledge_ids: string[];
|
||||
status: string;
|
||||
reported_by: string;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
}
|
||||
|
||||
// Wiki API Functions
|
||||
export function listWikiPages(kbId: string, params?: {
|
||||
page_type?: string;
|
||||
@@ -104,6 +119,17 @@ export function searchWikiPages(kbId: string, q: string, limit?: number) {
|
||||
return get(`/api/v1/knowledgebase/${kbId}/wiki/search?${params.toString()}`);
|
||||
}
|
||||
|
||||
export function listWikiIssues(kbId: string, slug?: string, status?: string) {
|
||||
const params = new URLSearchParams();
|
||||
if (slug) params.set('slug', slug);
|
||||
if (status) params.set('status', status);
|
||||
return get(`/api/v1/knowledgebase/${kbId}/wiki/issues?${params.toString()}`);
|
||||
}
|
||||
|
||||
export function updateWikiIssueStatus(kbId: string, issueId: string, status: string) {
|
||||
return put(`/api/v1/knowledgebase/${kbId}/wiki/issues/${issueId}/status`, { status });
|
||||
}
|
||||
|
||||
export function rebuildWikiLinks(kbId: string) {
|
||||
return post(`/api/v1/knowledgebase/${kbId}/wiki/rebuild-links`, {});
|
||||
}
|
||||
|
||||
@@ -1704,17 +1704,16 @@ const getBuiltinAgentNotReadyReasons = (agent: CustomAgent, isAgentMode: boolean
|
||||
const reasons: string[] = []
|
||||
const config = agent.config || {}
|
||||
|
||||
// 检查对话模型(Summary Model)
|
||||
if (!config.model_id || config.model_id.trim() === '') {
|
||||
reasons.push(t('input.customAgentMissingSummaryModel'))
|
||||
}
|
||||
// 内置智能体会自动回退到租户的默认模型,因此不再在前端强制校验 model_id
|
||||
|
||||
// 检查重排模型(Rerank Model)- 如果使用知识库则需要
|
||||
if (config.kb_selection_mode !== 'none') {
|
||||
if (!config.rerank_model_id || config.rerank_model_id.trim() === '') {
|
||||
reasons.push(t('input.customAgentMissingRerankModel'))
|
||||
}
|
||||
}
|
||||
// 检查重排模型(Rerank Model)- 仅当允许使用 knowledge_search 工具时需要
|
||||
// 内置智能体允许重排模型为空(使用默认配置)
|
||||
// const hasKnowledgeSearchTool = config.allowed_tools && config.allowed_tools.includes('knowledge_search')
|
||||
// if (hasKnowledgeSearchTool) {
|
||||
// if (!config.rerank_model_id || config.rerank_model_id.trim() === '') {
|
||||
// reasons.push(t('input.customAgentMissingRerankModel'))
|
||||
// }
|
||||
// }
|
||||
|
||||
// Agent 模式还需要检查允许的工具
|
||||
if (isAgentMode) {
|
||||
@@ -1735,8 +1734,9 @@ const getCustomAgentNotReadyReasons = (agent: CustomAgent): string[] => {
|
||||
if (!config.model_id || config.model_id.trim() === '') {
|
||||
reasons.push(t('input.customAgentMissingSummaryModel'))
|
||||
}
|
||||
// 检查重排模型(Rerank Model)- 如果使用知识库则需要
|
||||
if (config.kb_selection_mode !== 'none') {
|
||||
// 检查重排模型(Rerank Model)- 仅当允许使用 knowledge_search 工具时需要
|
||||
const hasKnowledgeSearchTool = config.allowed_tools && config.allowed_tools.includes('knowledge_search')
|
||||
if (hasKnowledgeSearchTool) {
|
||||
if (!config.rerank_model_id || config.rerank_model_id.trim() === '') {
|
||||
reasons.push(t('input.customAgentMissingRerankModel'))
|
||||
}
|
||||
@@ -2211,13 +2211,17 @@ const getImgSrc = (url: string) => {
|
||||
z-index: 99;
|
||||
bottom: 60px;
|
||||
left: 50%;
|
||||
transform: translateX(-400px);
|
||||
transform: translateX(-50%);
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
/* 富文本输入框容器 */
|
||||
.rich-input-container {
|
||||
position: relative;
|
||||
width: 800px;
|
||||
width: 100%;
|
||||
max-width: 800px;
|
||||
background: var(--td-bg-color-container, #FFF);
|
||||
border-radius: 12px;
|
||||
border: .5px solid var(--td-component-border, #E7E7E7);
|
||||
|
||||
@@ -1638,6 +1638,27 @@ export default {
|
||||
hideArrows: 'Hide arrows',
|
||||
healthCheck: 'Health Check',
|
||||
queueStatus: '{count} pending tasks in Wiki queue',
|
||||
issueTitle: 'This page has {count} pending knowledge conflicts or errors',
|
||||
issueFixBtn: 'AI Auto-Fix',
|
||||
issueMixed: 'Mixed Info',
|
||||
issueConflict: 'Factual Conflict',
|
||||
issueOutdated: 'Outdated',
|
||||
issueAttention: 'Needs Attention',
|
||||
issueReportedBy: 'Reported by {reporter}',
|
||||
issueAiLinter: 'AI Linter',
|
||||
issueIgnore: 'Ignore False Alarm',
|
||||
globalIssuesTitle: 'Global Pending Content Issues',
|
||||
globalIssuesCount: '{count} Pending Content Issues',
|
||||
globalIssuesEmpty: 'No pending content issues',
|
||||
issuePagePrefix: 'Page: ',
|
||||
issueGoFix: 'Go to fix',
|
||||
fixAssistantTitle: 'Wiki Smart Fix Assistant',
|
||||
issueFixSuggestions: 'Content Optimization Suggestions ({count})',
|
||||
issueFixSingle: 'Fix',
|
||||
fixStartError: 'Failed to start fix assistant',
|
||||
issueFixPromptSingle: 'Please help me fix the following issue on page [[{slug}]]:\n\n- [{type}] {desc}\n\nOnce resolved, please call the `wiki_update_issue` tool to mark this issue (ID: {id}) as resolved.',
|
||||
issueFixPromptAutoStart: 'Please help me fix all pending issues on page [[{slug}]]:',
|
||||
issueFixPromptAutoEnd: 'Once resolved, please call the `wiki_update_issue` tool to mark these issues as resolved.',
|
||||
},
|
||||
buttons: {
|
||||
create: 'Create Knowledge Base',
|
||||
|
||||
@@ -2161,6 +2161,27 @@ export default {
|
||||
hideArrows: '화살표 숨기기',
|
||||
healthCheck: "상태 점검",
|
||||
queueStatus: "Wiki 대기열에 {count}개의 보류 중인 작업",
|
||||
issueTitle: "이 페이지에는 {count}개의 대기 중인 지식 충돌 또는 오류가 있습니다",
|
||||
issueFixBtn: "AI 자동 수정",
|
||||
issueMixed: "혼합된 정보",
|
||||
issueConflict: "사실 충돌",
|
||||
issueOutdated: "오래된 정보",
|
||||
issueAttention: "주의 필요",
|
||||
issueReportedBy: "{reporter} 보고함",
|
||||
issueAiLinter: "AI 검사기",
|
||||
issueIgnore: "오탐지 무시",
|
||||
globalIssuesTitle: "전체 보류 중인 콘텐츠 문제",
|
||||
globalIssuesCount: "보류 중인 콘텐츠 문제: {count}개",
|
||||
globalIssuesEmpty: "보류 중인 콘텐츠 문제가 없습니다",
|
||||
issuePagePrefix: "페이지: ",
|
||||
issueGoFix: "수정하러 가기",
|
||||
fixAssistantTitle: "Wiki 스마트 수정 도우미",
|
||||
issueFixSuggestions: "콘텐츠 최적화 제안 ({count})",
|
||||
issueFixSingle: "수정",
|
||||
fixStartError: "수정 도우미 시작 실패",
|
||||
issueFixPromptSingle: "페이지 [[{slug}]] 의 다음 문제를 수정해 주세요:\n\n- [{type}] {desc}\n\n해결 완료 후 `wiki_update_issue` 도구를 호출하여 이 문제(ID: {id})를 해결됨으로 표시해 주세요.",
|
||||
issueFixPromptAutoStart: "페이지 [[{slug}]] 의 모든 보류 중인 문제를 수정해 주세요:",
|
||||
issueFixPromptAutoEnd: "해결 완료 후 `wiki_update_issue` 도구를 호출하여 이 문제들을 해결됨으로 표시해 주세요.",
|
||||
},
|
||||
buttons: {
|
||||
create: "지식베이스 생성",
|
||||
|
||||
@@ -1840,6 +1840,27 @@ export default {
|
||||
hideArrows: 'Скрыть стрелки',
|
||||
healthCheck: 'Проверка здоровья',
|
||||
queueStatus: '{count} ожидающих задач в очереди Wiki',
|
||||
issueTitle: 'На этой странице есть {count} неразрешенных конфликтов или ошибок знаний',
|
||||
issueFixBtn: 'AI Автоисправление',
|
||||
issueMixed: 'Смешанная инфо',
|
||||
issueConflict: 'Фактический конфликт',
|
||||
issueOutdated: 'Устарело',
|
||||
issueAttention: 'Требует внимания',
|
||||
issueReportedBy: 'Сообщил {reporter}',
|
||||
issueAiLinter: 'AI Линтер',
|
||||
issueIgnore: 'Игнорировать',
|
||||
globalIssuesTitle: 'Глобальные проблемы содержимого',
|
||||
globalIssuesCount: 'Ожидающие проблемы содержимого: {count}',
|
||||
globalIssuesEmpty: 'Нет ожидающих проблем содержимого',
|
||||
issuePagePrefix: 'Страница: ',
|
||||
issueGoFix: 'Исправить',
|
||||
fixAssistantTitle: 'Wiki Умный помощник исправления',
|
||||
issueFixSuggestions: 'Предложения по оптимизации ({count})',
|
||||
issueFixSingle: 'Исправить',
|
||||
fixStartError: 'Не удалось запустить помощник исправления',
|
||||
issueFixPromptSingle: 'Пожалуйста, помогите исправить следующую проблему на странице [[{slug}]]:\n\n- [{type}] {desc}\n\nПосле устранения проблемы, пожалуйста, вызовите инструмент `wiki_update_issue`, чтобы пометить эту проблему (ID: {id}) как решенную.',
|
||||
issueFixPromptAutoStart: 'Пожалуйста, помогите исправить все ожидающие проблемы на странице [[{slug}]]:',
|
||||
issueFixPromptAutoEnd: 'После устранения проблем, пожалуйста, вызовите инструмент `wiki_update_issue`, чтобы пометить эти проблемы как решенные.',
|
||||
},
|
||||
buttons: {
|
||||
create: 'Создать базу знаний',
|
||||
|
||||
@@ -2146,6 +2146,27 @@ export default {
|
||||
hideArrows: '隐藏箭头',
|
||||
healthCheck: "健康检查",
|
||||
queueStatus: "Wiki 队列中 {count} 个待处理任务",
|
||||
issueTitle: "此页面存在 {count} 个待处理的知识冲突或错误",
|
||||
issueFixBtn: "AI 一键修复",
|
||||
issueMixed: "信息混杂",
|
||||
issueConflict: "事实冲突",
|
||||
issueOutdated: "信息过时",
|
||||
issueAttention: "需要关注",
|
||||
issueReportedBy: "由 {reporter} 报告",
|
||||
issueAiLinter: "AI 巡检",
|
||||
issueIgnore: "忽略误报",
|
||||
globalIssuesTitle: "全库待修复内容问题",
|
||||
globalIssuesCount: "待修复内容问题: {count} 项",
|
||||
globalIssuesEmpty: "暂无待处理的内容问题",
|
||||
issuePagePrefix: "页面: ",
|
||||
issueGoFix: "去处理",
|
||||
fixAssistantTitle: "Wiki 智能修复助手",
|
||||
issueFixSuggestions: "内容优化建议 ({count})",
|
||||
issueFixSingle: "修复",
|
||||
fixStartError: "启动修复助手失败",
|
||||
issueFixPromptSingle: "请帮我修复页面 [[{slug}]] 上的以下问题:\n\n- [{type}] {desc}\n\n解决完毕后,请调用 `wiki_update_issue` 工具将该问题 (ID: {id}) 标记为已解决。",
|
||||
issueFixPromptAutoStart: "请帮我修复页面 [[{slug}]] 上的所有待处理问题:",
|
||||
issueFixPromptAutoEnd: "解决完毕后,请调用 `wiki_update_issue` 工具将这些问题标记为已解决。",
|
||||
},
|
||||
buttons: {
|
||||
create: "创建知识库",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="bot_msg">
|
||||
<div class="bot_msg" :class="{ 'is-embedded': embeddedMode }">
|
||||
<div style="display: flex;flex-direction: column; gap:8px">
|
||||
<!-- 显示@的知识库和文件(非 Agent 模式下显示) -->
|
||||
<div v-if="!session.isAgentMode && mentionedItems && mentionedItems.length > 0" class="mentioned_items">
|
||||
@@ -127,6 +127,10 @@ const props = defineProps({
|
||||
isFirstEnter: {
|
||||
type: Boolean,
|
||||
required: false
|
||||
},
|
||||
embeddedMode: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
});
|
||||
|
||||
@@ -298,6 +302,16 @@ onBeforeUnmount(() => {
|
||||
@import '../../../components/css/markdown.less';
|
||||
@import '../../../components/css/chat-message-shared.less';
|
||||
|
||||
.bot_msg {
|
||||
&.is-embedded {
|
||||
width: 100%;
|
||||
|
||||
:deep(.agent-stream-display) {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 内容包装器 - 与 Agent 模式的 answer 样式一致
|
||||
.content-wrapper {
|
||||
background: var(--td-bg-color-container);
|
||||
|
||||
@@ -197,6 +197,7 @@ const getWebSearchDisplayText = (item) => {
|
||||
background-color: var(--td-bg-color-container);
|
||||
border: .5px solid var(--td-component-stroke);
|
||||
box-shadow: 0 2px 4px rgba(7, 192, 95, 0.08);
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
box-sizing: border-box;
|
||||
transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="user_msg_container" ref="containerRef">
|
||||
<div class="user_msg_container" ref="containerRef" :class="{ 'is-embedded': embeddedMode }">
|
||||
<!-- 显示@的知识库和文件 -->
|
||||
<div v-if="mentioned_items && mentioned_items.length > 0" class="mentioned_items">
|
||||
<span
|
||||
@@ -84,6 +84,10 @@ const props = defineProps({
|
||||
type: String,
|
||||
required: false,
|
||||
default: ''
|
||||
},
|
||||
embeddedMode: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
});
|
||||
|
||||
@@ -216,6 +220,14 @@ const closePreImg = () => {
|
||||
}
|
||||
}
|
||||
|
||||
.user_msg_container {
|
||||
&.is-embedded {
|
||||
.user_msg {
|
||||
max-width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.user_msg {
|
||||
width: max-content;
|
||||
max-width: 776px;
|
||||
@@ -233,7 +245,6 @@ const closePreImg = () => {
|
||||
font-size: 15px;
|
||||
text-align: justify;
|
||||
word-break: break-all;
|
||||
max-width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="chat">
|
||||
<div class="chat" :class="{ 'is-embedded': embeddedMode }">
|
||||
<div ref="scrollContainer" class="chat_scroll_box" @scroll="handleScroll">
|
||||
<div class="msg_list">
|
||||
<div class="msg_list" :class="{ 'is-embedded': embeddedMode }">
|
||||
<!-- 消息列表骨架屏 -->
|
||||
<div v-if="historyLoading && messagesList.length === 0" class="msg-skeleton-list">
|
||||
<div class="msg-skeleton msg-skeleton-user">
|
||||
@@ -47,11 +47,11 @@
|
||||
</div>
|
||||
<div v-for="(session, id) in messagesList" :key='id'>
|
||||
<div v-if="session.role == 'user'">
|
||||
<usermsg :content="session.content" :mentioned_items="session.mentioned_items" :images="session.images" :attachments="session.attachments"></usermsg>
|
||||
<usermsg :content="session.content" :mentioned_items="session.mentioned_items" :images="session.images" :attachments="session.attachments" :embeddedMode="embeddedMode"></usermsg>
|
||||
</div>
|
||||
<div v-if="session.role == 'assistant'">
|
||||
<botmsg :content="session.content" :session="session" :user-query="getUserQuery(id)" @scroll-bottom="scrollToBottom"
|
||||
:isFirstEnter="isFirstEnter"></botmsg>
|
||||
:isFirstEnter="isFirstEnter" :embeddedMode="embeddedMode"></botmsg>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="loading"
|
||||
@@ -69,7 +69,7 @@
|
||||
<t-icon name="chevron-down" size="20px" />
|
||||
</div>
|
||||
</transition>
|
||||
<div style="min-height: 115px; margin: 16px auto 4px;width: 100%;max-width: 800px;">
|
||||
<div class="input-container" :class="{ 'is-embedded': embeddedMode }">
|
||||
<InputField
|
||||
ref="inputFieldRef"
|
||||
@send-msg="(query, modelId, mentionedItems, imageFiles, attachmentFiles) => sendMsg(query, modelId, mentionedItems, imageFiles, attachmentFiles)"
|
||||
@@ -77,6 +77,7 @@
|
||||
:isReplying="isReplying"
|
||||
:sessionId="session_id"
|
||||
:assistantMessageId="currentAssistantMessageId"
|
||||
:embeddedMode="embeddedMode"
|
||||
></InputField>
|
||||
</div>
|
||||
</div>
|
||||
@@ -91,7 +92,7 @@
|
||||
</template>
|
||||
<script setup>
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { ref, onMounted, onUnmounted, nextTick, watch, reactive, onBeforeUnmount } from 'vue';
|
||||
import { ref, onMounted, onUnmounted, nextTick, watch, reactive, onBeforeUnmount, defineProps } from 'vue';
|
||||
import { useRoute, useRouter, onBeforeRouteLeave, onBeforeRouteUpdate } from 'vue-router';
|
||||
import InputField from '../../components/Input-field.vue';
|
||||
import botmsg from './components/botmsg.vue';
|
||||
@@ -106,6 +107,14 @@ import { useI18n } from 'vue-i18n';
|
||||
import { useUIStore } from '@/stores/ui';
|
||||
import KnowledgeBaseEditorModal from '@/views/knowledge/KnowledgeBaseEditorModal.vue';
|
||||
import { useKnowledgeBaseCreationNavigation } from '@/hooks/useKnowledgeBaseCreationNavigation';
|
||||
|
||||
const props = defineProps({
|
||||
session_id: { type: String, default: '' },
|
||||
agentId: { type: String, default: '' },
|
||||
kbIds: { type: Array, default: () => [] },
|
||||
embeddedMode: { type: Boolean, default: false }
|
||||
});
|
||||
|
||||
const usemenuStore = useMenuStore();
|
||||
const useSettingsStoreInstance = useSettingsStore();
|
||||
const uiStore = useUIStore();
|
||||
@@ -115,7 +124,7 @@ const { menuArr, isFirstSession, firstQuery, firstMentionedItems, firstModelId,
|
||||
const { output, onChunk, isStreaming, isLoading, error, startStream, stopStream } = useStream();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const session_id = ref(route.params.chatid);
|
||||
const session_id = ref(props.session_id || route.params.chatid);
|
||||
const sessionData = ref(null);
|
||||
const inputFieldRef = ref();
|
||||
const created_at = ref('');
|
||||
@@ -1140,10 +1149,16 @@ onMounted(async () => {
|
||||
messagesList.splice(0);
|
||||
|
||||
// 若从智能体列表点击共享智能体进入,URL 带 agent_id 与 source_tenant_id,同步到 store
|
||||
const agentIdFromQuery = route.query.agent_id && String(route.query.agent_id);
|
||||
const agentIdFromQuery = props.embeddedAgentId || (route.query.agent_id && String(route.query.agent_id));
|
||||
const sourceTenantIdFromQuery = route.query.source_tenant_id && String(route.query.source_tenant_id);
|
||||
if (agentIdFromQuery && sourceTenantIdFromQuery) {
|
||||
useSettingsStoreInstance.selectAgent(agentIdFromQuery, sourceTenantIdFromQuery);
|
||||
} else if (agentIdFromQuery) {
|
||||
useSettingsStoreInstance.selectAgent(agentIdFromQuery, null);
|
||||
}
|
||||
|
||||
if (props.embeddedKbIds && props.embeddedKbIds.length > 0) {
|
||||
useSettingsStoreInstance.selectKnowledgeBases(props.embeddedKbIds);
|
||||
}
|
||||
|
||||
// 初始化状态:加载历史消息时不应显示loading
|
||||
@@ -1211,6 +1226,21 @@ onBeforeRouteUpdate((to, from, next) => {
|
||||
max-width: calc(100vw - 260px);
|
||||
min-width: 400px;
|
||||
|
||||
&.is-embedded {
|
||||
max-width: 100%;
|
||||
min-width: 100%;
|
||||
padding: 0;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
&.is-embedded :deep(.answers-input) {
|
||||
transform: translateX(0);
|
||||
width: 100%;
|
||||
left: 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
:deep(.answers-input) {
|
||||
position: static;
|
||||
transform: translateX(0);
|
||||
@@ -1321,6 +1351,21 @@ onBeforeRouteUpdate((to, from, next) => {
|
||||
padding-left: 4px;
|
||||
}
|
||||
|
||||
.input-container {
|
||||
min-height: 115px;
|
||||
margin: 16px auto 4px;
|
||||
width: 100%;
|
||||
max-width: 800px;
|
||||
box-sizing: border-box;
|
||||
|
||||
&.is-embedded {
|
||||
max-width: 100%;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
.msg_list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
@@ -6,19 +6,25 @@
|
||||
<div ref="graphRef" class="wiki-graph-canvas"></div>
|
||||
|
||||
<!-- Graph Search Overlay -->
|
||||
<div v-if="graphReady" class="wiki-graph-search">
|
||||
<t-select
|
||||
v-model="graphSearchValue"
|
||||
filterable
|
||||
:options="graphSearchOptions"
|
||||
:placeholder="$t('knowledgeEditor.wikiBrowser.searchPlaceholder')"
|
||||
@change="handleGraphSearchSelect"
|
||||
@enter="handleGraphSearchEnter"
|
||||
:popup-props="{ zIndex: 100 }"
|
||||
class="graph-search-select"
|
||||
>
|
||||
<template #prefixIcon><t-icon name="search" /></template>
|
||||
</t-select>
|
||||
<div v-if="graphReady" class="wiki-graph-search-container">
|
||||
<div class="wiki-graph-search">
|
||||
<t-select
|
||||
v-model="graphSearchValue"
|
||||
filterable
|
||||
:options="graphSearchOptions"
|
||||
:placeholder="$t('knowledgeEditor.wikiBrowser.searchPlaceholder')"
|
||||
@change="handleGraphSearchSelect"
|
||||
@enter="handleGraphSearchEnter"
|
||||
:popup-props="{ zIndex: 100 }"
|
||||
class="graph-search-select"
|
||||
>
|
||||
<template #prefixIcon><t-icon name="search" /></template>
|
||||
</t-select>
|
||||
</div>
|
||||
<div v-if="stats && stats.pending_issues > 0" class="wiki-global-issues-status graph-issues-badge" @click="showGlobalIssuesDrawer = true">
|
||||
<t-icon name="error-circle" style="color: var(--td-warning-color);" />
|
||||
<span class="queue-text">{{ $t('knowledgeEditor.wikiBrowser.globalIssuesCount', { count: stats.pending_issues }) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Legend Overlay -->
|
||||
@@ -121,6 +127,11 @@
|
||||
<t-loading size="small" />
|
||||
<span class="queue-text">{{ $t('knowledgeEditor.wikiBrowser.queueStatus', { count: stats.pending_tasks || 0 }) }}</span>
|
||||
</div>
|
||||
<!-- Global Issues -->
|
||||
<div v-if="stats && stats.pending_issues > 0" class="wiki-global-issues-status" @click="showGlobalIssuesDrawer = true">
|
||||
<t-icon name="error-circle" style="color: var(--td-warning-color);" />
|
||||
<span class="queue-text">{{ $t('knowledgeEditor.wikiBrowser.globalIssuesCount', { count: stats.pending_issues }) }}</span>
|
||||
</div>
|
||||
<t-input
|
||||
v-model="searchQuery"
|
||||
:placeholder="$t('knowledgeEditor.wikiBrowser.searchPlaceholder')"
|
||||
@@ -211,7 +222,64 @@
|
||||
|
||||
<!-- Page header -->
|
||||
<div class="wiki-reader-header">
|
||||
<h2 class="wiki-reader-title">{{ selectedPage.title }}</h2>
|
||||
<h2 class="wiki-reader-title" style="display: flex; align-items: center;">
|
||||
{{ selectedPage.title }}
|
||||
|
||||
<t-popup
|
||||
v-if="pageIssues.length > 0"
|
||||
v-model="showIssuesBox"
|
||||
placement="bottom-left"
|
||||
trigger="click"
|
||||
:overlayInnerStyle="{ padding: 0, boxShadow: 'var(--td-shadow-3)', borderRadius: '8px', width: '560px', maxWidth: '90vw' }"
|
||||
>
|
||||
<t-tag
|
||||
theme="warning"
|
||||
variant="light-outline"
|
||||
class="wiki-issue-trigger"
|
||||
>
|
||||
<template #icon><t-icon name="error-circle" /></template>
|
||||
{{ $t('knowledgeEditor.wikiBrowser.issueTitle', { count: pageIssues.length }) }}
|
||||
</t-tag>
|
||||
|
||||
<template #content>
|
||||
<div class="wiki-issue-popup-content">
|
||||
<div class="wiki-issue-popup-header">
|
||||
<div class="wiki-issue-popup-title">
|
||||
<span>{{ $t('knowledgeEditor.wikiBrowser.issueFixSuggestions', { count: pageIssues.length }) }}</span>
|
||||
</div>
|
||||
<t-button size="small" theme="primary" variant="base" @click="triggerAutoFix">
|
||||
<template #icon><t-icon name="magic" /></template>
|
||||
{{ $t('knowledgeEditor.wikiBrowser.issueFixBtn') }}
|
||||
</t-button>
|
||||
</div>
|
||||
<div class="wiki-issue-popup-list">
|
||||
<div v-for="issue in pageIssues" :key="issue.id" class="wiki-issue-popup-item">
|
||||
<div class="wiki-issue-popup-main">
|
||||
<div class="wiki-issue-popup-tags">
|
||||
<t-tag v-if="issue.issue_type === 'mixed_entities'" theme="warning" variant="light" size="small">{{ $t('knowledgeEditor.wikiBrowser.issueMixed') }}</t-tag>
|
||||
<t-tag v-else-if="issue.issue_type === 'contradictory_facts'" theme="danger" variant="light" size="small">{{ $t('knowledgeEditor.wikiBrowser.issueConflict') }}</t-tag>
|
||||
<t-tag v-else-if="issue.issue_type === 'out_of_date'" theme="default" variant="light" size="small">{{ $t('knowledgeEditor.wikiBrowser.issueOutdated') }}</t-tag>
|
||||
<t-tag v-else theme="primary" variant="light" size="small">{{ $t('knowledgeEditor.wikiBrowser.issueAttention') }}</t-tag>
|
||||
</div>
|
||||
<div class="wiki-issue-popup-desc">
|
||||
{{ issue.description }}
|
||||
</div>
|
||||
<div class="wiki-issue-popup-meta">
|
||||
<span class="wiki-issue-popup-reporter">
|
||||
{{ issue.reported_by === 'wiki-researcher-agent' ? $t('knowledgeEditor.wikiBrowser.issueAiLinter') : $t('knowledgeEditor.wikiBrowser.issueReportedBy', { reporter: issue.reported_by }) }}
|
||||
</span>
|
||||
<span class="wiki-issue-popup-action" @click="triggerFixIssue(issue)" style="margin-right: 12px; font-weight: 500;">
|
||||
<t-icon name="magic" style="margin-right: 2px;" />{{ $t('knowledgeEditor.wikiBrowser.issueFixSingle') }}
|
||||
</span>
|
||||
<span class="wiki-issue-popup-action" style="color: var(--td-text-color-placeholder);" @click="handleIssueIgnore(issue.id)">{{ $t('knowledgeEditor.wikiBrowser.issueIgnore') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</t-popup>
|
||||
</h2>
|
||||
<div v-if="selectedPage.aliases && selectedPage.aliases.length" class="wiki-reader-aliases">
|
||||
<span class="wiki-alias-label">{{ $t('knowledgeEditor.wikiBrowser.aliases') }}:</span>
|
||||
<t-tag v-for="alias in selectedPage.aliases" :key="alias" size="small" variant="light" class="wiki-alias-tag">
|
||||
@@ -281,26 +349,96 @@
|
||||
<Teleport to="body">
|
||||
<picturePreview v-if="imagePreviewVisible" :reviewImg="imagePreviewVisible" :reviewUrl="imagePreviewUrl" @closePreImg="closeImagePreview" />
|
||||
</Teleport>
|
||||
|
||||
<!-- Global Issues Drawer -->
|
||||
<t-drawer
|
||||
v-model:visible="showGlobalIssuesDrawer"
|
||||
:header="$t('knowledgeEditor.wikiBrowser.globalIssuesTitle')"
|
||||
size="480px"
|
||||
:footer="false"
|
||||
class="wiki-global-issues-drawer"
|
||||
>
|
||||
<div class="wiki-issue-popup-list">
|
||||
<div v-for="issue in globalIssues" :key="issue.id" class="wiki-issue-popup-item">
|
||||
<div class="wiki-issue-popup-main">
|
||||
<div class="wiki-issue-popup-tags">
|
||||
<t-tag v-if="issue.issue_type === 'mixed_entities'" theme="warning" variant="light" size="small">{{ $t('knowledgeEditor.wikiBrowser.issueMixed') }}</t-tag>
|
||||
<t-tag v-else-if="issue.issue_type === 'contradictory_facts'" theme="danger" variant="light" size="small">{{ $t('knowledgeEditor.wikiBrowser.issueConflict') }}</t-tag>
|
||||
<t-tag v-else-if="issue.issue_type === 'out_of_date'" theme="default" variant="light" size="small">{{ $t('knowledgeEditor.wikiBrowser.issueOutdated') }}</t-tag>
|
||||
<t-tag v-else theme="primary" variant="light" size="small">{{ $t('knowledgeEditor.wikiBrowser.issueAttention') }}</t-tag>
|
||||
</div>
|
||||
<div class="wiki-issue-popup-desc">
|
||||
<div style="font-weight: 500; margin-bottom: 4px; color: var(--td-brand-color); cursor: pointer;" @click="navigateToSlugAndFix(issue.slug)">
|
||||
<t-icon name="link" size="12px"/> {{ $t('knowledgeEditor.wikiBrowser.issuePagePrefix') }}{{ slugDisplayName(issue.slug) }}
|
||||
</div>
|
||||
{{ issue.description }}
|
||||
</div>
|
||||
<div class="wiki-issue-popup-meta">
|
||||
<span class="wiki-issue-popup-reporter">
|
||||
{{ issue.reported_by === 'wiki-researcher-agent' ? $t('knowledgeEditor.wikiBrowser.issueAiLinter') : $t('knowledgeEditor.wikiBrowser.issueReportedBy', { reporter: issue.reported_by }) }}
|
||||
</span>
|
||||
<span class="wiki-issue-popup-action" @click="navigateToSlugAndFix(issue.slug)" style="margin-right: 12px; font-weight: 500;">
|
||||
<t-icon name="arrow-right-circle" style="margin-right: 2px;" />{{ $t('knowledgeEditor.wikiBrowser.issueGoFix') }}
|
||||
</span>
|
||||
<span class="wiki-issue-popup-action" style="color: var(--td-text-color-placeholder);" @click="handleGlobalIssueIgnore(issue.id)">{{ $t('knowledgeEditor.wikiBrowser.issueIgnore') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="globalIssues.length === 0" style="padding: 40px; text-align: center; color: var(--td-text-color-placeholder);">
|
||||
{{ $t('knowledgeEditor.wikiBrowser.globalIssuesEmpty') }}
|
||||
</div>
|
||||
</div>
|
||||
</t-drawer>
|
||||
|
||||
<!-- Fix Chat Drawer -->
|
||||
<t-drawer
|
||||
v-model:visible="showFixDrawer"
|
||||
:header="$t('knowledgeEditor.wikiBrowser.fixAssistantTitle')"
|
||||
size="700px"
|
||||
:footer="false"
|
||||
class="wiki-fix-drawer"
|
||||
>
|
||||
<ChatView
|
||||
v-if="showFixDrawer"
|
||||
:session_id="currentFixSessionId"
|
||||
agentId="builtin-wiki-fixer"
|
||||
:kbIds="[props.knowledgeBaseId]"
|
||||
:embeddedMode="true"
|
||||
/>
|
||||
</t-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, onMounted, onUnmounted, watch, nextTick, reactive } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useMenuStore } from '@/stores/menu'
|
||||
import { useSettingsStore } from '@/stores/settings'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { marked } from 'marked'
|
||||
import { MessagePlugin } from 'tdesign-vue-next'
|
||||
import { hydrateProtectedFileImages } from '@/utils/security'
|
||||
import picturePreview from '@/components/picture-preview.vue'
|
||||
import { createSessions } from '@/api/chat'
|
||||
import ChatView from '@/views/chat/index.vue'
|
||||
import {
|
||||
listWikiPages,
|
||||
getWikiPage,
|
||||
getWikiGraph,
|
||||
getWikiStats,
|
||||
searchWikiPages,
|
||||
listWikiIssues,
|
||||
updateWikiIssueStatus,
|
||||
type WikiPage,
|
||||
type WikiGraphData,
|
||||
type WikiStats,
|
||||
type WikiPageIssue,
|
||||
} from '@/api/wiki'
|
||||
|
||||
const router = useRouter()
|
||||
const menuStore = useMenuStore()
|
||||
const settingsStore = useSettingsStore()
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
const props = defineProps<{
|
||||
@@ -313,6 +451,12 @@ const emit = defineEmits<{
|
||||
}>()
|
||||
const pages = ref<WikiPage[]>([])
|
||||
const selectedPage = ref<WikiPage | null>(null)
|
||||
const pageIssues = ref<WikiPageIssue[]>([])
|
||||
const showIssuesBox = ref(false)
|
||||
const showFixDrawer = ref(false)
|
||||
const showGlobalIssuesDrawer = ref(false)
|
||||
const globalIssues = ref<WikiPageIssue[]>([])
|
||||
const currentFixSessionId = ref('')
|
||||
const stats = ref<WikiStats | null>(null)
|
||||
const graphData = ref<WikiGraphData | null>(null)
|
||||
const searchQuery = ref('')
|
||||
@@ -328,6 +472,40 @@ const showArrows = ref(true)
|
||||
// Graph filtering
|
||||
const graphFilterTypes = ref<Set<string>>(new Set(['summary', 'entity', 'concept', 'synthesis', 'comparison', 'index', 'log']))
|
||||
|
||||
watch(showGlobalIssuesDrawer, async (val) => {
|
||||
if (val) {
|
||||
try {
|
||||
const res = await listWikiIssues(props.knowledgeBaseId, '', 'pending')
|
||||
globalIssues.value = (res as any).data || res as any || []
|
||||
} catch (e) {
|
||||
console.error('Failed to load global wiki issues:', e)
|
||||
globalIssues.value = []
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
async function navigateToSlugAndFix(slug: string) {
|
||||
showGlobalIssuesDrawer.value = false
|
||||
if (props.view === 'graph') {
|
||||
handleGraphSearchSelect(slug)
|
||||
} else {
|
||||
await navigateToSlug(slug)
|
||||
showIssuesBox.value = true
|
||||
}
|
||||
}
|
||||
|
||||
async function handleGlobalIssueIgnore(issueId: string) {
|
||||
try {
|
||||
await updateWikiIssueStatus(props.knowledgeBaseId, issueId, 'ignored')
|
||||
// Refresh list
|
||||
const res = await listWikiIssues(props.knowledgeBaseId, '', 'pending')
|
||||
globalIssues.value = (res as any).data || res as any || []
|
||||
loadStats()
|
||||
} catch (e) {
|
||||
console.error('Failed to update issue status:', e)
|
||||
}
|
||||
}
|
||||
|
||||
function toggleGraphFilterType(type: string) {
|
||||
const newSet = new Set(graphFilterTypes.value)
|
||||
if (newSet.has(type)) {
|
||||
@@ -646,6 +824,18 @@ async function loadGraph() {
|
||||
}
|
||||
}
|
||||
|
||||
async function loadPageIssues(slug: string) {
|
||||
try {
|
||||
const res = await listWikiIssues(props.knowledgeBaseId, slug, 'pending')
|
||||
pageIssues.value = (res as any).data || res as any || []
|
||||
showIssuesBox.value = false
|
||||
} catch (e) {
|
||||
console.error('Failed to load wiki issues:', e)
|
||||
pageIssues.value = []
|
||||
showIssuesBox.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function selectPage(page: WikiPage) {
|
||||
try {
|
||||
if (selectedPage.value && selectedPage.value.id !== page.id) {
|
||||
@@ -653,6 +843,7 @@ async function selectPage(page: WikiPage) {
|
||||
}
|
||||
const res = await getWikiPage(props.knowledgeBaseId, page.slug)
|
||||
selectedPage.value = (res as any).data || res as any
|
||||
await loadPageIssues(page.slug)
|
||||
} catch (e) {
|
||||
console.error('Failed to load wiki page:', e)
|
||||
}
|
||||
@@ -665,6 +856,7 @@ async function navigateToSlug(slug: string) {
|
||||
}
|
||||
const res = await getWikiPage(props.knowledgeBaseId, slug)
|
||||
selectedPage.value = (res as any).data || res as any
|
||||
await loadPageIssues(slug)
|
||||
} catch (e) {
|
||||
console.error(`Failed to navigate to ${slug}:`, e)
|
||||
}
|
||||
@@ -674,9 +866,89 @@ function goBack() {
|
||||
const prev = navHistory.value.pop()
|
||||
if (prev) {
|
||||
selectedPage.value = prev
|
||||
loadPageIssues(prev.slug)
|
||||
}
|
||||
}
|
||||
|
||||
async function handleIssueIgnore(issueId: string) {
|
||||
try {
|
||||
await updateWikiIssueStatus(props.knowledgeBaseId, issueId, 'ignored')
|
||||
if (selectedPage.value) {
|
||||
await loadPageIssues(selectedPage.value.slug)
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Failed to update issue status:', e)
|
||||
}
|
||||
}
|
||||
|
||||
async function startFixSession(prompt: string) {
|
||||
settingsStore.selectAgent("builtin-wiki-fixer", null)
|
||||
|
||||
const sessionData: any = {
|
||||
agent_config: {
|
||||
enabled: true,
|
||||
max_iterations: 30,
|
||||
temperature: 0.7,
|
||||
knowledge_bases: [props.knowledgeBaseId],
|
||||
knowledge_ids: [],
|
||||
allowed_tools: ["thinking", "wiki_read_page", "wiki_search", "wiki_read_source_doc", "wiki_edit_page", "wiki_read_issue", "wiki_update_issue"]
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
const res = await createSessions(sessionData)
|
||||
if (res && (res as any).data && (res as any).data.id) {
|
||||
const sessionId = (res as any).data.id
|
||||
const now = new Date().toISOString()
|
||||
|
||||
menuStore.updataMenuChildren({
|
||||
title: t('knowledgeEditor.wikiBrowser.fixAssistantTitle'),
|
||||
path: `chat/${sessionId}`,
|
||||
id: sessionId,
|
||||
isMore: false,
|
||||
isNoTitle: true,
|
||||
created_at: now,
|
||||
updated_at: now
|
||||
})
|
||||
|
||||
menuStore.changeIsFirstSession(true)
|
||||
menuStore.changeFirstQuery(prompt, [], '', [])
|
||||
|
||||
currentFixSessionId.value = sessionId
|
||||
showFixDrawer.value = true
|
||||
showIssuesBox.value = false // Hide issues box
|
||||
} else {
|
||||
MessagePlugin.error(t('knowledgeEditor.wikiBrowser.fixStartError'))
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Failed to create fix session', e)
|
||||
MessagePlugin.error(t('knowledgeEditor.wikiBrowser.fixStartError'))
|
||||
}
|
||||
}
|
||||
|
||||
function triggerFixIssue(issue: WikiPageIssue) {
|
||||
if (!selectedPage.value) return
|
||||
const prompt = t('knowledgeEditor.wikiBrowser.issueFixPromptSingle', {
|
||||
slug: selectedPage.value.slug,
|
||||
type: issue.issue_type,
|
||||
desc: issue.description,
|
||||
id: issue.id
|
||||
})
|
||||
startFixSession(prompt)
|
||||
}
|
||||
|
||||
function triggerAutoFix() {
|
||||
if (!selectedPage.value || pageIssues.value.length === 0) return
|
||||
let prompt = t('knowledgeEditor.wikiBrowser.issueFixPromptAutoStart', { slug: selectedPage.value.slug }) + '\n\n'
|
||||
|
||||
pageIssues.value.forEach((issue, idx) => {
|
||||
prompt += `${idx + 1}. [${issue.issue_type}] ${issue.description} (ID: ${issue.id})\n`
|
||||
})
|
||||
|
||||
prompt += '\n' + t('knowledgeEditor.wikiBrowser.issueFixPromptAutoEnd')
|
||||
startFixSession(prompt)
|
||||
}
|
||||
|
||||
async function doSearch() {
|
||||
if (!searchQuery.value.trim()) { loadPages(); return }
|
||||
loading.value = true
|
||||
@@ -1567,6 +1839,28 @@ onUnmounted(() => {
|
||||
}
|
||||
}
|
||||
|
||||
.wiki-global-issues-status {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 8px 12px;
|
||||
background: var(--td-warning-color-light);
|
||||
border-radius: 6px;
|
||||
color: var(--td-warning-color-8);
|
||||
font-size: 13px;
|
||||
cursor: pointer;
|
||||
transition: filter 0.2s;
|
||||
|
||||
&:hover {
|
||||
filter: brightness(0.95);
|
||||
}
|
||||
|
||||
.queue-text {
|
||||
line-height: 1.2;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
|
||||
.wiki-page-list {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
@@ -2006,16 +2300,28 @@ onUnmounted(() => {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.wiki-graph-search {
|
||||
.wiki-graph-search-container {
|
||||
position: absolute;
|
||||
top: 16px;
|
||||
left: 16px;
|
||||
width: 280px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
z-index: 10;
|
||||
width: 280px;
|
||||
}
|
||||
|
||||
.wiki-graph-search {
|
||||
width: 100%;
|
||||
box-shadow: var(--td-shadow-1);
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.graph-issues-badge {
|
||||
box-shadow: var(--td-shadow-1);
|
||||
opacity: 0.95;
|
||||
}
|
||||
|
||||
:deep(.wiki-graph-drawer) {
|
||||
box-shadow: -4px 0 16px rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
@@ -2137,4 +2443,170 @@ onUnmounted(() => {
|
||||
transform-origin: 0 0;
|
||||
animation: node-active-pulse 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
|
||||
}
|
||||
|
||||
// ── Issues Popup ──
|
||||
.wiki-issue-trigger {
|
||||
margin-left: 12px;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
user-select: none;
|
||||
|
||||
&:hover {
|
||||
filter: brightness(0.95);
|
||||
}
|
||||
}
|
||||
|
||||
.wiki-issue-popup-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: var(--td-bg-color-container);
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.wiki-issue-popup-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 12px 16px;
|
||||
background: var(--td-bg-color-secondarycontainer);
|
||||
border-bottom: 1px solid var(--td-component-stroke);
|
||||
}
|
||||
|
||||
.wiki-issue-popup-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-weight: 500;
|
||||
font-size: 14px;
|
||||
color: var(--td-text-color-primary);
|
||||
|
||||
.wiki-issue-popup-icon {
|
||||
color: var(--td-brand-color);
|
||||
margin-right: 8px;
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.wiki-issue-popup-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
max-height: 400px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.wiki-issue-popup-item {
|
||||
display: flex;
|
||||
padding: 16px;
|
||||
gap: 12px;
|
||||
border-bottom: 1px solid var(--td-component-stroke);
|
||||
transition: background-color 0.2s ease;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: var(--td-bg-color-container-hover);
|
||||
}
|
||||
}
|
||||
|
||||
.wiki-issue-popup-main {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.wiki-issue-popup-tags {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.wiki-issue-popup-desc {
|
||||
font-size: 13px;
|
||||
color: var(--td-text-color-primary);
|
||||
line-height: 1.6;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
max-height: 150px;
|
||||
overflow-y: auto;
|
||||
padding-right: 4px;
|
||||
}
|
||||
|
||||
/* 优化描述区域的滚动条样式 */
|
||||
.wiki-issue-popup-desc::-webkit-scrollbar {
|
||||
width: 4px;
|
||||
}
|
||||
.wiki-issue-popup-desc::-webkit-scrollbar-thumb {
|
||||
background: var(--td-scrollbar-color);
|
||||
border-radius: 4px;
|
||||
}
|
||||
.wiki-issue-popup-desc::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.wiki-issue-popup-meta {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.wiki-issue-popup-reporter {
|
||||
font-size: 12px;
|
||||
color: var(--td-text-color-placeholder);
|
||||
}
|
||||
|
||||
.wiki-issue-popup-action {
|
||||
font-size: 12px;
|
||||
color: var(--td-brand-color);
|
||||
cursor: pointer;
|
||||
transition: opacity 0.2s ease;
|
||||
|
||||
&:hover {
|
||||
opacity: 0.8;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="less">
|
||||
/* Fix Embedded Chat UI (unscoped because drawer attaches to body) */
|
||||
.wiki-fix-drawer {
|
||||
.t-drawer__body {
|
||||
padding: 20px !important;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.chat {
|
||||
max-width: 100% !important;
|
||||
min-width: 100% !important;
|
||||
padding: 0 !important;
|
||||
height: 100% !important;
|
||||
flex: 1 !important;
|
||||
border-radius: 0 !important;
|
||||
}
|
||||
|
||||
.chat_scroll_box {
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.chat > .input-container {
|
||||
padding: 16px 0 0 0 !important;
|
||||
box-sizing: border-box;
|
||||
width: 100% !important;
|
||||
max-width: 100% !important;
|
||||
margin: 0 !important;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.msg_list {
|
||||
max-width: 100% !important;
|
||||
padding-bottom: 0 !important;
|
||||
margin: 0 !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user