feat: 增强知识库索引与设置页面模块化拆分

扩展知识库索引任务和 RAG 检索支持增量入库和文档去重,优
化本体检测和规则匹配精度,前端设置页面拆分为 LLM、邮件
和 Hermes 员工同步子面板并重构样式,新增日志详情组件和
知识入库日志模型,补充单元测试覆盖。
This commit is contained in:
caoxiaozhu
2026-05-22 23:47:28 +08:00
parent 88ff04bef8
commit 5b388d08c0
84 changed files with 10170 additions and 2599 deletions

View File

@@ -0,0 +1,227 @@
/* 设置页表单/卡片/开关 — 供 SettingsView 与子面板各自 scoped 引入 */
.settings-card {
padding: 0;
border: 1px solid #e2e8f0;
border-radius: 12px;
background: #ffffff;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02), 0 4px 16px rgba(0, 0, 0, 0.03);
overflow: hidden;
display: flex;
flex-direction: column;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.settings-card:hover {
border-color: #cbd5e1;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.01), 0 10px 24px rgba(0, 0, 0, 0.04);
}
.card-head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: 14px 24px;
background: #f8fafc;
border-bottom: 1px solid #e2e8f0;
margin: 0;
}
.settings-card > *:not(.card-head) {
padding-left: 24px;
padding-right: 24px;
margin-top: 24px;
}
.settings-card > *:not(.card-head):last-child {
margin-bottom: 24px;
}
.card-head-actions {
display: flex;
align-items: center;
gap: 10px;
flex: 0 0 auto;
}
.card-head h4 {
margin: 0;
padding: 0;
color: #0f172a;
font-size: 15px;
font-weight: 700;
line-height: 1.2;
}
.card-head p {
margin: 4px 0 0 0;
padding: 0;
color: #64748b;
font-size: 13px;
line-height: 1.4;
}
.form-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 20px;
align-items: start;
}
.compact-grid {
margin-bottom: 20px;
}
.field {
display: grid;
gap: 8px;
}
.field-wide {
grid-column: span 2;
}
.field-full {
grid-column: 1 / -1;
}
.field span {
color: #475569;
font-size: 12.5px;
font-weight: 700;
line-height: 1.2;
}
.field em {
margin-right: 4px;
color: #ef4444;
font-style: normal;
}
.field input,
.field select {
width: 100%;
min-height: 44px;
padding: 0 14px;
border: 1px solid #cbd5e1;
border-radius: 12px;
background: #ffffff;
color: #0f172a;
font-size: 13px;
line-height: 1.45;
transition: all 0.2s ease;
}
.field input::placeholder {
color: #94a3b8;
}
.field input:focus,
.field select:focus {
outline: none;
border-color: #10b981;
box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.08);
background: #ffffff;
}
.switch-group {
display: grid;
gap: 12px;
}
.switch-row {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
padding: 16px 20px;
border: 1px solid #e2e8f0;
border-radius: 16px;
background: #ffffff;
text-align: left;
transition: all 0.25s ease;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.01);
cursor: pointer;
}
.switch-row:hover {
border-color: rgba(16, 185, 129, 0.25);
background: linear-gradient(180deg, #ffffff 0%, rgba(16, 185, 129, 0.01) 100%);
box-shadow: 0 4px 12px rgba(16, 185, 129, 0.03);
transform: translateY(-1px);
}
.switch-copy {
min-width: 0;
display: grid;
gap: 4px;
}
.switch-copy strong {
color: #0f172a;
font-size: 14px;
font-weight: 700;
}
.switch-copy small {
color: #64748b;
font-size: 12px;
line-height: 1.5;
}
/* Switch Toggle Buttons */
.switch-btn {
position: relative;
display: inline-flex;
align-items: center;
flex: 0 0 auto;
width: 48px;
height: 26px;
padding: 3px;
border: none;
border-radius: 99px;
background: #cbd5e1;
cursor: pointer;
outline: none;
transition: background-color 0.25s ease;
}
.switch-btn i {
width: 20px;
height: 20px;
border-radius: 50%;
background: #ffffff;
box-shadow: 0 1px 3px rgba(15, 23, 42, 0.15);
transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}
.switch-btn.active {
background-color: #10b981;
}
.switch-btn.active i {
transform: translateX(22px);
}
.switch-btn:disabled {
opacity: 0.4;
cursor: not-allowed;
}
/* Mini Switch */
.switch-btn.mini {
width: 38px;
height: 20px;
padding: 2px;
}
.switch-btn.mini i {
width: 16px;
height: 16px;
}
.switch-btn.mini.active i {
transform: translateX(18px);
}

View File

@@ -0,0 +1,228 @@
/* Container */
.hermes-settings-container {
display: flex;
flex-direction: column;
gap: 20px;
width: 100%;
}
/* Master Control Hero Card Active Hover & Color */
.hermes-hero-card.active {
border-color: rgba(16, 185, 129, 0.25);
background: linear-gradient(180deg, #ffffff 0%, rgba(16, 185, 129, 0.02) 100%);
box-shadow: 0 1px 3px rgba(16, 185, 129, 0.01), 0 8px 24px rgba(16, 185, 129, 0.05);
}
.hermes-hero-card .model-icon-box {
position: relative;
}
.hermes-hero-card .model-icon-box.active {
background: rgba(16, 185, 129, 0.1);
color: #10b981;
border-color: rgba(16, 185, 129, 0.15);
}
/* Pulse Dot */
.status-pulse-dot {
position: absolute;
top: -2px;
right: -2px;
width: 10px;
height: 10px;
background-color: #cbd5e1;
border: 2px solid #ffffff;
border-radius: 50%;
transition: background-color 0.3s ease;
}
.status-pulse-dot.active {
background-color: #10b981;
animation: pulse-ring 1.8s cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite;
}
@keyframes pulse-ring {
0% {
box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
}
70% {
box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
}
100% {
box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
}
}
.status-badge {
padding: 6px 12px;
border-radius: 99px;
background: #f1f5f9;
color: #64748b;
font-size: 12px;
font-weight: 600;
letter-spacing: 0.02em;
transition: all 0.3s ease;
}
.status-badge.active {
background: rgba(16, 185, 129, 0.1);
color: #10b981;
}
/* Task Section */
.hermes-tasks-section.disabled {
opacity: 0.6;
pointer-events: none;
}
/* Tasks Grid */
.hermes-task-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
gap: 16px;
margin: 0;
padding: 0;
list-style: none;
}
/* Task Card */
.hermes-task-card {
display: flex;
flex-direction: column;
justify-content: space-between;
padding: 20px;
background: #ffffff;
border: 1px solid #e2e8f0;
border-radius: 16px;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.01), 0 2px 8px rgba(0, 0, 0, 0.02);
transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.hermes-task-card:hover {
transform: translateY(-2px);
border-color: #cbd5e1;
box-shadow: 0 4px 6px rgba(15, 23, 42, 0.01), 0 10px 20px rgba(15, 23, 42, 0.04);
}
.task-card-header {
display: flex;
align-items: flex-start;
gap: 14px;
margin-bottom: 20px;
}
.task-icon-box {
display: flex;
align-items: center;
justify-content: center;
width: 44px;
height: 44px;
border-radius: 12px;
font-size: 20px;
transition: all 0.3s ease;
}
.task-meta-info {
flex: 1;
min-width: 0;
}
.task-meta-info strong {
display: block;
color: #0f172a;
font-size: 14px;
font-weight: 700;
line-height: 1.4;
}
.task-meta-info small {
display: block;
margin-top: 4px;
color: #64748b;
font-size: 12px;
line-height: 1.45;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/* Task card colors (SaaS Gray) */
.task-icon-box.indigo,
.task-icon-box.warning,
.task-icon-box.danger,
.task-icon-box.info,
.task-icon-box.success,
.task-icon-box.primary,
.task-icon-box.secondary,
.task-icon-box.default {
background: #f8fafc;
color: #475569;
border: 1px solid #e2e8f0;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}
/* Card Footer & Time picker */
.task-card-footer {
display: flex;
align-items: center;
justify-content: space-between;
padding-top: 14px;
border-top: 1px dashed #f1f5f9;
}
.frequency-badge {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 4px 10px;
border-radius: 99px;
background: #f8fafc;
color: #94a3b8;
font-size: 11px;
font-weight: 600;
transition: all 0.3s ease;
}
.frequency-badge.active {
background: #f0f9ff;
color: #0284c7;
}
.time-picker-wrapper input[type="time"] {
padding: 5px 8px;
border: 1px solid #e2e8f0;
border-radius: 8px;
background: #f8fafc;
color: #334155;
font-size: 12px;
font-weight: 600;
outline: none;
cursor: pointer;
transition: all 0.2s ease;
}
.time-picker-wrapper input[type="time"]:hover {
border-color: #cbd5e1;
background: #f1f5f9;
}
.time-picker-wrapper input[type="time"]:focus {
border-color: #10b981;
background: #ffffff;
box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.08);
}
.time-picker-placeholder {
color: #cbd5e1;
font-size: 11px;
font-weight: 600;
}
@media (max-width: 768px) {
.hermes-hero-card.active {
background: #ffffff;
}
.hermes-task-grid {
grid-template-columns: 1fr;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -759,7 +759,8 @@
.review-side-metric-card.editable:hover,
.review-side-metric-card.editing {
border-color: rgba(16, 185, 129, 0.34);
background: rgba(248, 252, 250, 0.92);
background: #ffffff;
box-shadow: 0 4px 12px rgba(16, 185, 129, 0.08);
transform: translateY(-1px);
}
@@ -768,10 +769,25 @@
height: 32px;
display: grid;
place-items: center;
border-radius: 10px;
background: rgba(240, 253, 244, 0.95);
color: #059669;
border-radius: 8px;
background: #f1f5f9;
border: 1px solid transparent;
color: #64748b;
font-size: 15px;
transition: all 0.2s ease;
}
.review-side-metric-card.editable:hover .review-side-metric-icon,
.review-side-metric-card.editing .review-side-metric-icon {
color: #059669;
border-color: rgba(16, 185, 129, 0.22);
background: #ecfdf5;
}
.review-side-metric-card.invalid .review-side-metric-icon {
color: #ef4444;
border-color: rgba(239, 68, 68, 0.22);
background: #fef2f2;
}
.review-side-metric-copy {

View File

@@ -298,6 +298,16 @@
cursor: not-allowed;
}
.review-next-step-rich-copy {
margin-top: 30px;
color: #475569;
line-height: 1.64;
}
.review-next-step-rich-copy :deep(.markdown-action-paragraph) {
margin-top: 10px;
}
.review-section-card {
display: grid;
gap: 10px;

View File

@@ -1,6 +1,14 @@
.review-overlay {
display: flex;
align-items: center;
justify-content: center;
}
.review-preview-modal {
width: min(980px, calc(100vw - 40px));
max-height: min(92vh, calc(100vh - 32px));
margin: auto;
flex: none;
display: grid;
grid-template-rows: auto minmax(0, 1fr);
overflow: hidden;
@@ -63,48 +71,56 @@
}
.welcome-quick-actions-title {
margin: 0 0 22px;
margin: 0 0 16px !important;
color: #64748b;
font-size: 12px;
font-weight: 800;
font-size: 13px;
font-weight: 700;
letter-spacing: 0.5px;
}
.welcome-quick-action-grid {
display: flex;
flex-wrap: wrap;
gap: 7px;
gap: 12px;
margin-top: 16px;
}
.welcome-quick-action-btn {
min-height: 30px;
min-height: 32px;
display: inline-flex;
align-items: center;
gap: 5px;
padding: 0 11px;
border: 1px solid rgba(191, 219, 254, 0.92);
border-radius: 999px;
background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(239, 246, 255, 0.94) 100%);
color: #1d4ed8;
gap: 6px;
padding: 0 14px;
border: 1px solid #cbd5e1;
border-radius: 12px;
background: #ffffff;
color: #334155;
font-size: var(--wb-fs-chip);
font-weight: 700;
font-weight: 600;
line-height: 1.2;
box-shadow: 0 4px 10px rgba(59, 130, 246, 0.07);
transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
transition: all 0.2s ease;
}
.welcome-quick-action-btn i {
font-size: 13px;
color: #2563eb;
font-size: 14px;
color: #64748b;
transition: color 0.2s ease;
}
.welcome-quick-action-btn:hover:not(:disabled) {
transform: translateY(-1px);
border-color: rgba(59, 130, 246, 0.34);
box-shadow: 0 7px 14px rgba(59, 130, 246, 0.12);
border-color: #10b981;
background: #ecfdf5;
color: #059669;
box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
}
.welcome-quick-action-btn:hover:not(:disabled) i {
color: #059669;
}
.welcome-quick-action-btn:disabled {
opacity: 0.48;
opacity: 0.5;
cursor: not-allowed;
}

View File

@@ -522,8 +522,10 @@
.insight-panel-shell {
flex: none;
display: flex;
width: clamp(300px, 28vw, 420px);
min-width: 0;
min-height: 0;
max-width: 100%;
margin-left: 0;
overflow: hidden;
@@ -634,6 +636,30 @@
box-shadow: 0 10px 22px rgba(226, 232, 240, 0.48);
}
.message-bubble-review-risk-low {
border-color: rgba(37, 99, 235, 0.72);
background: linear-gradient(180deg, rgba(239, 246, 255, 0.72), rgba(255, 255, 255, 0.96));
box-shadow:
0 0 0 2px rgba(37, 99, 235, 0.12),
0 12px 24px rgba(37, 99, 235, 0.1);
}
.message-bubble-review-risk-medium {
border-color: rgba(217, 119, 6, 0.78);
background: linear-gradient(180deg, rgba(255, 251, 235, 0.76), rgba(255, 255, 255, 0.96));
box-shadow:
0 0 0 2px rgba(217, 119, 6, 0.14),
0 12px 24px rgba(217, 119, 6, 0.11);
}
.message-bubble-review-risk-high {
border-color: rgba(220, 38, 38, 0.78);
background: linear-gradient(180deg, rgba(254, 242, 242, 0.78), rgba(255, 255, 255, 0.96));
box-shadow:
0 0 0 2px rgba(220, 38, 38, 0.14),
0 12px 24px rgba(220, 38, 38, 0.11);
}
.message-meta {
display: flex;
align-items: center;
@@ -814,6 +840,26 @@
color: #1d4ed8;
}
.message-answer-markdown :deep(.markdown-action-link-next),
.message-answer-markdown :deep(.markdown-action-link-edit) {
color: #1d4ed8;
}
.message-answer-markdown :deep(.markdown-risk-text-low) {
color: #2563eb;
font-weight: 850;
}
.message-answer-markdown :deep(.markdown-risk-text-medium) {
color: #d97706;
font-weight: 850;
}
.message-answer-markdown :deep(.markdown-risk-text-high) {
color: #dc2626;
font-weight: 850;
}
.message-answer-markdown :deep(.markdown-table-wrap) {
width: 100%;
max-width: 100%;