Add files via upload

This commit is contained in:
2025-07-17 19:30:11 +08:00
committed by GitHub
parent 933ecef974
commit 4834fbb3fe
5 changed files with 732 additions and 347 deletions

View File

@@ -1,221 +1,237 @@
<div class="amily2-header">
<div class="additional-features-title">
<i class="fas fa-landmark-dome"></i> 内阁密室
</div>
<button id="amily2_back_to_main_settings" class="menu_button secondary small_button interactable">
<i class="fas fa-arrow-left"></i> 返回主殿
</button>
</div>
<hr class="header-divider">
<fieldset class="settings-group">
<legend><i class="fas fa-scroll"></i> 皇家史册管理员</legend>
<div class="control-pair-container">
<div class="amily2_settings_block">
<label for="amily2_auto_hide_enabled">启用自动隐藏</label>
<label class="toggle-switch">
<input id="amily2_auto_hide_enabled" type="checkbox" />
<span class="slider"></span>
</label>
</div>
<div class="amily2_settings_block">
<button id="amily2_unhide_all_button" class="menu_button secondary small_button interactable" title="一键取消所有已隐藏的楼层">
<i class="fas fa-folder-open"></i>
<span>全部可见</span>
</button>
</div>
</div>
<hr style="border-style: dashed; margin: 10px 0;">
<div class="amily2_settings_block">
<label for="amily2_auto_hide_threshold">保留最新消息层数: <span id="amily2_auto_hide_threshold_value">30</span></label>
<input id="amily2_auto_hide_threshold" type="range" min="5" max="100" step="1" value="30" />
<small class="notes">设定始终在你的上下文中保留的最新消息数量。</small>
</div>
</fieldset>
<fieldset class="settings-group">
<legend><i class="fas fa-pen-ruler"></i> 手动敕令司</legend>
<div class="manual-command-block">
<label>隐藏范围:</label>
<input type="number" id="amily2_manual_hide_from" class="manual-input" placeholder="起始层">
<span class="manual-command-divider">-</span>
<input type="number" id="amily2_manual_hide_to" class="manual-input" placeholder="结束层">
<button id="amily2_manual_hide_confirm" class="menu_button primary small_button interactable">
<i class="fas fa-eye-slash"></i> 确认隐藏
</button>
</div>
<div class="manual-command-block">
<label>取消隐藏:</label>
<input type="number" id="amily2_manual_unhide_from" class="manual-input" placeholder="起始层">
<span class="manual-command-divider">-</span>
<input type="number" id="amily2_manual_unhide_to" class="manual-input" placeholder="结束层">
<button id="amily2_manual_unhide_confirm" class="menu_button accent small_button interactable">
<i class="fas fa-eye"></i> 确认取消
</button>
</div>
<small class="notes" style="text-align: center; display: block; margin-top: 10px;">
提示:若“起始层”留空,则仅操作“结束层”所指定的单层。
</small>
</fieldset>
<fieldset class="settings-group" id="amily2_manual_historiography_bureau">
<legend><i class="fas fa-gavel"></i> 手动敕史局</legend>
<small class="notes" style="text-align: center; display: block; margin-bottom: 15px;">
赋予你选取任意对话、熔铸为永恒史册的至高权力。
</small>
<fieldset class="settings-group" style="border-style: dashed;">
<legend>📜 微言录 (小总结)</legend>
<div class="amily2_settings_block">
<div class="label-with-button">
<label for="amily2_mhb_small_prompt_selector">选择编辑的谕旨:</label>
<i id="amily2_mhb_small_expand_editor" class="editor_maximize fa-solid fa-maximize right_menu_button interactable" title="展开编辑器" tabindex="0"></i>
</div>
<select id="amily2_mhb_small_prompt_selector" class="text_pole">
<option value="jailbreak">破限谕旨 (最高优先级)</option>
<option value="summary">敕史纲要 (总结任务)</option>
</select>
</div>
<div class="amily2_settings_block prompt-editor-area">
<textarea id="amily2_mhb_small_editor" class="text_pole" rows="3"></textarea>
<div class="editor-buttons-panel">
<button id="amily2_mhb_small_save_button" class="menu_button accent small_button interactable"><i class="fas fa-save"></i> 保存当前</button>
<button id="amily2_mhb_small_restore_button" class="menu_button secondary small_button interactable"><i class="fas fa-undo"></i> 恢复默认</button>
</div>
</div>
<div class="mhb-controls-wrapper">
<div class="manual-command-block">
<label>手动熔铸范围:</label>
<input type="number" id="amily2_mhb_small_start_floor" class="manual-input" placeholder="起始层">
<span class="manual-command-divider">-</span>
<input type="number" id="amily2_mhb_small_end_floor" class="manual-input" placeholder="结束层">
<button id="amily2_mhb_small_manual_execute" class="menu_button primary small_button interactable">
<i class="fas fa-fire"></i> 熔铸
</button>
</div>
<div class="auto-command-block" id="amily2_mhb_auto_command_block">
<button id="amily2_mhb_small_expedition_execute" class="menu_button primary small_button interactable" title="立即发动一次彻底的总结远征,将所有未归档的历史一次性清算。">
<i class="fas fa-flag-checkered"></i> 开始远征
</button>
<div class="auto-control-pair">
<label for="amily2_mhb_small_auto_enabled" title="在您聊天时,于后台默默守护史册的完整。">自动巡录:</label>
<label class="toggle-switch">
<input id="amily2_mhb_small_auto_enabled" type="checkbox" />
<span class="slider"></span>
</label>
</div>
<div class="auto-control-pair">
<label for="amily2_mhb_small_trigger_count" title="“自动巡录”和“开始远征”的单次作战楼层数。">远征阈值:</label>
<input id="amily2_mhb_small_trigger_count" type="number" min="1" class="text_pole" style="width: 70px;" placeholder="30">
</div>
</div>
<small class="notes" style="text-align: center; display: block; margin-top: 5px;">
【开始远征】将根据阈值立即总结当前所有未总结楼层。 【自动巡录】在你聊天时根据阈值设定自动总结。
</small>
</div>
</fieldset>
<!-- 上下分割线 -->
<hr class="header-divider" style="margin: 20px 0;">
<fieldset class="settings-group" style="border-style: dashed;">
<legend>💎 宏史卷 (大总结)</legend>
<div class="amily2_settings_block">
<div class="label-with-button">
<label for="amily2_mhb_large_prompt_selector">选择编辑的谕旨:</label>
<i id="amily2_mhb_large_expand_editor" class="editor_maximize fa-solid fa-maximize right_menu_button interactable" title="展开编辑器" tabindex="0"></i>
</div>
<select id="amily2_mhb_large_prompt_selector" class="text_pole">
<option value="jailbreak">破限谕旨 (最高优先级)</option>
<option value="summary">精炼纲要 (精炼任务)</option>
</select>
</div>
<div class="amily2_settings_block prompt-editor-area">
<textarea id="amily2_mhb_large_editor" class="text_pole" rows="4"></textarea>
<div class="editor-buttons-panel">
<button id="amily2_mhb_large_save_button" class="menu_button accent small_button interactable"><i class="fas fa-save"></i> 保存当前</button>
<button id="amily2_mhb_large_restore_button" class="menu_button secondary small_button interactable"><i class="fas fa-undo"></i> 恢复默认</button>
</div>
</div>
<div class="mhb-controls-wrapper">
<div class="mhb-selector-container">
<div class="mhb-selector-group">
<label for="amily2_mhb_large_worldbook_selector">目标国史馆 (世界书)</label>
<div class="select-with-refresh">
<select id="amily2_mhb_large_worldbook_selector" class="text_pole" style="flex-grow: 1;">
<option value="">刷新列表...</option>
</select>
<button id="amily2_mhb_large_refresh_worldbooks" class="menu_button secondary small_button interactable" title="刷新世界书列表">
<i class="fas fa-atlas"></i>
</button>
</div>
</div>
<div class="mhb-selector-group">
<label for="amily2_mhb_large_lore_selector">待精炼的史册条目</label>
<div class="select-with-refresh">
<select id="amily2_mhb_large_lore_selector" class="text_pole" style="flex-grow: 1;">
<option value="">请先选择世界书...</option>
</select>
<button id="amily2_mhb_large_refresh_lores" class="menu_button secondary small_button interactable" title="刷新所选世界书的史册列表">
<i class="fas fa-sync-alt"></i>
</button>
</div>
</div>
</div>
<button id="amily2_mhb_large_refine_execute" class="menu_button primary small_button interactable" style="margin-top: 15px; width: 100%;">
<i class="fas fa-gem"></i> 开始精炼
</button>
</div>
</div>
</fieldset>
<div id="amily2_mhb_hidden_prompts" style="display:none;">
<textarea id="amily2_mhb_small_jailbreak_prompt"></textarea>
<textarea id="amily2_mhb_small_summary_prompt"></textarea>
<textarea id="amily2_mhb_large_jailbreak_prompt"></textarea>
<textarea id="amily2_mhb_large_summary_prompt"></textarea>
</div>
</fieldset>
<div class="amily2-header">
<div class="additional-features-title">
<i class="fas fa-landmark-dome"></i> 内阁密室
</div>
<button id="amily2_back_to_main_settings" class="menu_button secondary small_button interactable">
<i class="fas fa-arrow-left"></i> 返回主殿
</button>
</div>
<hr class="header-divider">
<fieldset class="settings-group">
<legend><i class="fas fa-scroll"></i> 皇家史册管理员</legend>
<div class="control-pair-container">
<div class="amily2_settings_block">
<label for="amily2_auto_hide_enabled">启用自动隐藏</label>
<label class="toggle-switch">
<input id="amily2_auto_hide_enabled" type="checkbox" />
<span class="slider"></span>
</label>
</div>
<div class="amily2_settings_block">
<button id="amily2_unhide_all_button" class="menu_button secondary small_button interactable" title="一键取消所有已隐藏的楼层">
<i class="fas fa-folder-open"></i>
<span>全部可见</span>
</button>
</div>
</div>
<hr style="border-style: dashed; margin: 10px 0;">
<div class="amily2_settings_block">
<label for="amily2_auto_hide_threshold">保留最新消息层数: <span id="amily2_auto_hide_threshold_value">30</span></label>
<input id="amily2_auto_hide_threshold" type="range" min="5" max="100" step="1" value="30" />
<small class="notes">设定始终在你的上下文中保留的最新消息数量。</small>
</div>
</fieldset>
<fieldset class="settings-group">
<legend><i class="fas fa-pen-ruler"></i> 手动敕令司</legend>
<div class="manual-command-block">
<label>隐藏范围:</label>
<input type="number" id="amily2_manual_hide_from" class="manual-input" placeholder="起始层">
<span class="manual-command-divider">-</span>
<input type="number" id="amily2_manual_hide_to" class="manual-input" placeholder="结束层">
<button id="amily2_manual_hide_confirm" class="menu_button primary small_button interactable">
<i class="fas fa-eye-slash"></i> 确认隐藏
</button>
</div>
<div class="manual-command-block">
<label>取消隐藏:</label>
<input type="number" id="amily2_manual_unhide_from" class="manual-input" placeholder="起始层">
<span class="manual-command-divider">-</span>
<input type="number" id="amily2_manual_unhide_to" class="manual-input" placeholder="结束层">
<button id="amily2_manual_unhide_confirm" class="menu_button accent small_button interactable">
<i class="fas fa-eye"></i> 确认取消
</button>
</div>
<small class="notes" style="text-align: center; display: block; margin-top: 10px;">
提示:若“起始层”留空,则仅操作“结束层”所指定的单层。
</small>
</fieldset>
<fieldset class="settings-group" id="amily2_manual_historiography_bureau">
<legend><i class="fas fa-gavel"></i> 手动敕史局</legend>
<small class="notes" style="text-align: center; display: block; margin-bottom: 15px;">
赋予你选取任意对话、熔铸为永恒史册的至高权力。
</small>
<fieldset class="settings-group" style="border-style: dashed;">
<legend>📜 微言录 (Small Summary)</legend>
<div class="amily2_settings_block">
<div class="label-with-button">
<label for="amily2_mhb_small_prompt_selector">选择编辑的谕旨:</label>
<i id="amily2_mhb_small_expand_editor" class="editor_maximize fa-solid fa-maximize right_menu_button interactable" title="展开编辑器" tabindex="0"></i>
</div>
<select id="amily2_mhb_small_prompt_selector" class="text_pole">
<option value="jailbreak">破限谕旨 (最高优先级)</option>
<option value="summary">敕史纲要 (总结任务)</option>
</select>
</div>
<div class="amily2_settings_block prompt-editor-area">
<textarea id="amily2_mhb_small_editor" class="text_pole" rows="3"></textarea>
<div class="editor-buttons-panel">
<button id="amily2_mhb_small_save_button" class="menu_button accent small_button interactable"><i class="fas fa-save"></i> 保存当前</button>
<button id="amily2_mhb_small_restore_button" class="menu_button secondary small_button interactable"><i class="fas fa-undo"></i> 恢复默认</button>
</div>
</div>
<div class="mhb-controls-wrapper">
<div class="manual-command-block">
<label>手动熔铸范围:</label>
<input type="number" id="amily2_mhb_small_start_floor" class="manual-input" placeholder="起始层">
<span class="manual-command-divider">-</span>
<input type="number" id="amily2_mhb_small_end_floor" class="manual-input" placeholder="结束层">
<button id="amily2_mhb_small_manual_execute" class="menu_button primary small_button interactable">
<i class="fas fa-fire"></i> 熔铸
</button>
</div>
<div class="auto-command-block" id="amily2_mhb_auto_command_block">
<button id="amily2_mhb_small_expedition_execute" class="menu_button primary small_button interactable" title="立即发动一次彻底的总结远征,将所有未归档的历史一次性清算。">
<i class="fas fa-flag-checkered"></i> 开始远征
</button>
<div class="auto-control-pair">
<label for="amily2_mhb_small_auto_enabled" title="在您聊天时,于后台默默守护史册的完整。">自动巡录:</label>
<label class="toggle-switch">
<input id="amily2_mhb_small_auto_enabled" type="checkbox" />
<span class="slider"></span>
</label>
</div>
<div class="auto-control-pair">
<label for="historiography_write_to_lorebook" title="将生成的总结写入世界书。">写入史册:</label>
<label class="toggle-switch">
<input id="historiography_write_to_lorebook" type="checkbox" checked />
<span class="slider"></span>
</label>
</div>
<div class="auto-control-pair">
<label for="historiography_ingest_to_rag" title="将生成的总结存入翰林院进行向量化。">存入翰林院:</label>
<label class="toggle-switch">
<input id="historiography_ingest_to_rag" type="checkbox" />
<span class="slider"></span>
</label>
</div>
<div class="auto-control-pair">
<label for="amily2_mhb_small_trigger_count" title="“自动巡录”和“开始远征”的单次作战楼层数。">远征阈值:</label>
<input id="amily2_mhb_small_trigger_count" type="number" min="1" class="text_pole" style="width: 70px;" placeholder="30">
</div>
</div>
<small class="notes" style="text-align: center; display: block; margin-top: 5px;">
【开始远征】将立即清算所有未记录的历史。 【自动巡录】则在您聊天时,于后台默默守护史册的完整。
</small>
</div>
</fieldset>
<!-- 上下分割线 -->
<hr class="header-divider" style="margin: 20px 0;">
<fieldset class="settings-group" style="border-style: dashed;">
<legend>💎 宏史卷 (史册精炼)</legend>
<div class="amily2_settings_block">
<div class="label-with-button">
<label for="amily2_mhb_large_prompt_selector">选择编辑的谕旨:</label>
<i id="amily2_mhb_large_expand_editor" class="editor_maximize fa-solid fa-maximize right_menu_button interactable" title="展开编辑器" tabindex="0"></i>
</div>
<select id="amily2_mhb_large_prompt_selector" class="text_pole">
<option value="jailbreak">破限谕旨 (最高优先级)</option>
<option value="summary">精炼纲要 (精炼任务)</option>
</select>
</div>
<div class="amily2_settings_block prompt-editor-area">
<textarea id="amily2_mhb_large_editor" class="text_pole" rows="4"></textarea>
<div class="editor-buttons-panel">
<button id="amily2_mhb_large_save_button" class="menu_button accent small_button interactable"><i class="fas fa-save"></i> 保存当前</button>
<button id="amily2_mhb_large_restore_button" class="menu_button secondary small_button interactable"><i class="fas fa-undo"></i> 恢复默认</button>
</div>
</div>
<div class="mhb-controls-wrapper">
<div class="mhb-selector-container">
<div class="mhb-selector-group">
<label for="amily2_mhb_large_worldbook_selector">目标国史馆 (世界书)</label>
<div class="select-with-refresh">
<select id="amily2_mhb_large_worldbook_selector" class="text_pole" style="flex-grow: 1;">
<option value="">刷新列表...</option>
</select>
<button id="amily2_mhb_large_refresh_worldbooks" class="menu_button secondary small_button interactable" title="刷新世界书列表">
<i class="fas fa-atlas"></i>
</button>
</div>
</div>
<div class="mhb-selector-group">
<label for="amily2_mhb_large_lore_selector">待精炼的史册条目</label>
<div class="select-with-refresh">
<select id="amily2_mhb_large_lore_selector" class="text_pole" style="flex-grow: 1;">
<option value="">请先选择世界书...</option>
</select>
<button id="amily2_mhb_large_refresh_lores" class="menu_button secondary small_button interactable" title="刷新所选世界书的史册列表">
<i class="fas fa-sync-alt"></i>
</button>
</div>
</div>
</div>
<button id="amily2_mhb_large_refine_execute" class="menu_button primary small_button interactable" style="margin-top: 15px; width: 100%;">
<i class="fas fa-gem"></i> 开始精炼
</button>
</div>
</div>
</fieldset>
<div id="amily2_mhb_hidden_prompts" style="display:none;">
<textarea id="amily2_mhb_small_jailbreak_prompt"></textarea>
<textarea id="amily2_mhb_small_summary_prompt"></textarea>
<textarea id="amily2_mhb_large_jailbreak_prompt"></textarea>
<textarea id="amily2_mhb_large_summary_prompt"></textarea>
</div>
</fieldset>

224
assets/hanlinyuan.css Normal file
View File

@@ -0,0 +1,224 @@
/* hanlinyuan.css - Scoped to #amily2_hanlinyuan_panel to prevent global style conflicts */
#amily2_hanlinyuan_panel {
background-color: #f0f2f5;
color: #333;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
padding: 20px;
}
#amily2_hanlinyuan_panel .container {
max-width: 800px;
margin: auto;
background: #fff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
#amily2_hanlinyuan_panel .header {
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid #eee;
padding-bottom: 15px;
margin-bottom: 20px;
}
#amily2_hanlinyuan_panel .header h2 {
margin: 0;
color: #1d2129;
}
#amily2_hanlinyuan_panel .header p {
margin: 5px 0 0;
color: #606770;
}
#amily2_hanlinyuan_panel .section {
margin-bottom: 25px;
}
#amily2_hanlinyuan_panel .section h3,
#amily2_hanlinyuan_panel .tab-content h4 {
color: #4b4f56;
margin-top: 0;
margin-bottom: 15px;
}
#amily2_hanlinyuan_panel .form-group {
margin-bottom: 15px;
}
#amily2_hanlinyuan_panel .form-group label {
display: block;
font-weight: 600;
margin-bottom: 5px;
}
#amily2_hanlinyuan_panel .form-group small {
display: block;
color: #606770;
font-size: 0.85em;
margin-top: 5px;
}
#amily2_hanlinyuan_panel .text_pole {
width: calc(100% - 22px);
padding: 10px;
border: 1px solid #dddfe2;
border-radius: 6px;
font-size: 1em;
}
#amily2_hanlinyuan_panel .text_pole:focus {
border-color: #1877f2;
outline: none;
}
#amily2_hanlinyuan_panel .button-group {
display: flex;
gap: 10px;
flex-wrap: wrap;
align-items: center; /* Align items vertically */
}
/* New style for inline button groups */
#amily2_hanlinyuan_panel .button-group.inline {
flex-direction: row;
justify-content: flex-start;
}
#amily2_hanlinyuan_panel .menu_button {
padding: 10px 15px;
border: 1px solid transparent;
border-radius: 4px;
background-color: #4a4a4a; /* Standard button color like main panel */
color: white;
font-size: 1em;
font-weight: bold;
cursor: pointer;
transition: background-color 0.2s, border-color 0.2s;
text-align: center;
}
#amily2_hanlinyuan_panel .menu_button:hover {
background-color: #5a5a5a;
}
/* Compact button style */
#amily2_hanlinyuan_panel .menu_button.compact {
padding: 5px 10px;
font-size: 0.9em;
}
/* Primary/Accent button color */
#amily2_hanlinyuan_panel .menu_button.accent {
background-color: #007bff; /* A common accent color */
border-color: #007bff;
}
#amily2_hanlinyuan_panel .menu_button.accent:hover {
background-color: #0069d9;
}
#amily2_hanlinyuan_panel .menu_button:hover {
background-color: #166fe5;
}
#amily2_hanlinyuan_panel .menu_button.danger {
background-color: #dc3545;
border-color: #dc3545;
}
#amily2_hanlinyuan_panel .menu_button.danger:hover {
background-color: #c82333;
}
/* Tab navigation */
#amily2_hanlinyuan_panel .tab-nav {
display: flex;
border-bottom: 2px solid #dddfe2;
margin-bottom: 20px;
}
#amily2_hanlinyuan_panel .tab-button {
padding: 10px 20px;
cursor: pointer;
border: none;
background-color: transparent;
font-size: 1.1em;
color: #606770;
border-bottom: 2px solid transparent;
margin-bottom: -2px;
}
#amily2_hanlinyuan_panel .tab-button.active {
color: #1877f2;
border-bottom-color: #1877f2;
}
#amily2_hanlinyuan_panel .tab-content {
display: none;
}
#amily2_hanlinyuan_panel .tab-content.active {
display: block;
}
/* Status and Log panels */
#amily2_hanlinyuan_panel .status-panel,
#amily2_hanlinyuan_panel .log-panel {
background-color: #f7f7f7;
border: 1px solid #e9e9e9;
border-radius: 6px;
padding: 15px;
margin-top: 15px;
}
#amily2_hanlinyuan_panel .status-panel p {
margin: 0 0 10px;
}
#amily2_hanlinyuan_panel .status-panel p:last-child {
margin-bottom: 0;
}
#amily2_hanlinyuan_panel .log-panel {
min-height: 100px;
max-height: 200px;
overflow-y: auto;
font-family: "Courier New", Courier, monospace;
font-size: 0.9em;
}
#amily2_hanlinyuan_panel #vector-list-container {
margin-top: 20px;
}
#amily2_hanlinyuan_panel #vector-list {
list-style: none;
padding: 0;
max-height: 300px;
overflow-y: auto;
border: 1px solid #dddfe2;
border-radius: 6px;
}
#amily2_hanlinyuan_panel #vector-list li {
padding: 10px;
border-bottom: 1px solid #eee;
display: flex;
justify-content: space-between;
align-items: center;
}
#amily2_hanlinyuan_panel #vector-list li:last-child {
border-bottom: none;
}
#amily2_hanlinyuan_panel #vector-list .vector-text {
flex-grow: 1;
margin-right: 10px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

98
assets/hanlinyuan.html Normal file
View File

@@ -0,0 +1,98 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>翰林院 - RAG 向量数据库</title>
<link rel="stylesheet" href="hanlinyuan.css">
</head>
<body>
<div class="container">
<div class="header">
<div class="header-content">
<h2>翰林院 - RAG 向量数据库</h2>
<p>为每个角色卡构建独立的、基于历史记录的检索增强生成系统。</p>
</div>
<button id="amily2_back_to_main_from_hanlinyuan" class="menu_button secondary small_button interactable">
<i class="fas fa-arrow-left"></i> 返回主殿
</button>
</div>
<div class="section character-selection-section">
<h3>当前操作角色</h3>
<select id="character-select" class="text_pole"></select>
</div>
<div class="tab-nav">
<button class="tab-button active" data-tab="api-settings">API 设置</button>
<button class="tab-button" data-tab="rag-params">RAG 参数</button>
</div>
<div id="api-settings" class="tab-content active">
<h4>嵌入模型 API 配置</h4>
<div class="form-group">
<label for="embedding-api-url">API 地址:</label>
<input type="text" id="embedding-api-url" class="text_pole" placeholder="例如: https://api.siliconflow.cn/v1">
</div>
<div class="form-group">
<label for="embedding-api-key">API 密钥 (Key):</label>
<input type="password" id="embedding-api-key" class="text_pole" placeholder="请输入您的 API Key">
</div>
<div class="form-group">
<label for="embedding-model-select">嵌入模型:</label>
<select id="embedding-model-select" class="text_pole"></select>
</div>
<div class="button-group inline">
<button id="fetch-models" class="menu_button compact">获取</button>
<button id="test-connection" class="menu_button compact">测试</button>
<button id="save-api-config" class="menu_button compact accent">保存</button>
</div>
</div>
<div id="rag-params" class="tab-content">
<h4>检索增强参数配置</h4>
<div class="form-group form-group-inline">
<label for="rag-enabled">启用RAG注入:</label>
<input type="checkbox" id="rag-enabled" class="inline-checkbox">
<small>启用后,将在每次提问时自动检索相关信息并注入到提示词中。</small>
</div>
<div class="form-group">
<label for="chunk-size">文本分块大小 (Chunk Size):</label>
<input type="number" id="chunk-size" class="text_pole" value="512" min="64" max="2048">
<small>将总结分割成多大的文本块(单位:字符)</small>
</div>
<div class="form-group">
<label for="top-k">检索数量 (Top-K):</label>
<input type="number" id="top-k" class="text_pole" value="3" min="1" max="10">
<small>检索最相关的多少个文本块发送给主模型</small>
</div>
<div class="button-group">
<button id="save-rag-params" class="menu_button compact accent">保存</button>
</div>
</div>
<div class="section">
<h3>知识库管理</h3>
<div class="form-group">
<label for="rag-source-text">手动索引文本源:</label>
<textarea id="rag-source-text" class="text_pole" rows="6" placeholder="可在此处粘贴任意文本(如角色背景、世界观设定等)进行手动向量化。&#10;注意:由“大史官”自动生成的总结会根据其设置自动索引,无需在此手动操作。"></textarea>
</div>
<div class="button-group inline">
<button id="update-vector-db" class="menu_button compact accent">更新索引</button>
<button id="clear-vector-db" class="menu_button compact danger">清空数据</button>
</div>
<div id="db-status" class="status-panel">
<p>状态: <span id="db-status-value">未初始化</span></p>
<p>文档数量: <span id="db-doc-count">0</span></p>
<p>最后更新时间: <span id="db-last-updated">N/A</span></p>
</div>
</div>
<div class="section">
<h3>日志输出</h3>
<div id="log-output" class="log-panel">
<p>欢迎使用翰林院...</p>
</div>
</div>
</div>
</body>
</html>

View File

@@ -1,126 +1,139 @@
#amily2_manual_historiography_bureau .mhb-controls-wrapper {
display: flex;
flex-direction: column;
gap: 15px;
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 6px;
padding: 12px;
margin-top: 5px;
}
#amily2_manual_historiography_bureau .manual-command-block .manual-input {
width: 70px;
}
#amily2_manual_historiography_bureau .editor-buttons-panel .accent {
background: linear-gradient(to right, #FF5722, #E64A19);
border: 1px solid #D84315;
}
#amily2_manual_historiography_bureau .editor-buttons-panel .accent:hover {
box-shadow: 0 0 8px rgba(255, 87, 34, 0.7);
transform: scale(1.03);
}
#amily2_manual_historiography_bureau .editor-buttons-panel .secondary {
background: linear-gradient(to right, #ffb300, #fb8c00);
border: 1px solid #f57c00;
}
#amily2_manual_historiography_bureau .editor-buttons-panel .secondary:hover {
box-shadow: 0 0 8px rgba(255, 179, 0, 0.7);
transform: scale(1.03);
}
#amily2_manual_historiography_bureau .mhb-selector-container {
display: flex;
flex-direction: row;
align-items: flex-start;
gap: 12px;
width: 100%;
}
#amily2_manual_historiography_bureau .mhb-selector-group {
display: flex;
flex-direction: column;
flex-grow: 1;
min-width: 0;
gap: 5px;
}
#amily2_manual_historiography_bureau .mhb-selector-group > label {
width: auto;
margin-top: 0;
}
#amily2_manual_historiography_bureau .auto-command-block {
display: flex;
justify-content: space-around;
align-items: center;
gap: 15px;
margin-top: 15px;
padding: 10px;
border: 1px solid var(--secondary-border);
border-radius: 8px;
}
#amily2_manual_historiography_bureau .auto-control-pair {
display: flex;
flex-direction: row;
align-items: center;
gap: 8px;
}
#amily2_manual_historiography_bureau #amily2_mhb_small_expedition_execute {
width: auto;
flex-grow: 0;
}
#amily2_manual_historiography_bureau #amily2_mhb_small_expedition_execute {
background: linear-gradient(135deg, #8e44ad, #6a1b9a);
border: 1px solid #4a148c;
color: white;
text-shadow: 0 0 2px rgba(0,0,0,0.3);
transition: all 0.3s ease;
}
#amily2_manual_historiography_bureau #amily2_mhb_small_expedition_execute:hover {
background: linear-gradient(135deg, #9b59b6, #8e44ad);
box-shadow: 0 0 10px rgba(142, 68, 173, 0.7);
transform: translateY(-1px);
}
#amily2_manual_historiography_bureau #amily2_mhb_small_manual_execute {
background: linear-gradient(135deg, #ff8a65, #ff5722);
border: 1px solid #e64a19;
}
#amily2_manual_historiography_bureau #amily2_mhb_small_manual_execute:hover {
background: linear-gradient(135deg, #ff7043, #f4511e);
box-shadow: 0 0 10px rgba(255, 87, 34, 0.6);
}
#amily2_manual_historiography_bureau .danger {
background: linear-gradient(135deg, #e74c3c, #c0392b);
border: 1px solid #a93226;
color: white;
}
#amily2_manual_historiography_bureau .danger:hover {
background: linear-gradient(135deg, #ec7063, #e74c3c);
box-shadow: 0 0 10px rgba(231, 76, 60, 0.7);
}
#amily2_manual_historiography_bureau .success {
background: linear-gradient(135deg, #2ecc71, #27ae60);
border: 1px solid #229954;
color: white;
}
#amily2_manual_historiography_bureau .success:hover {
background: linear-gradient(135deg, #58d68d, #2ecc71);
box-shadow: 0 0 10px rgba(46, 204, 113, 0.7);
}
/*===================================================================*/
/*======== 【敕史局专属华服】(Historiography Styles) v2.0 ========*/
/*======== Amily为皇帝陛下御制已加盖皇家印信以增权威 ========*/
/*===================================================================*/
/*【敕史局】控制区总容器样式*/
#amily2_manual_historiography_bureau .mhb-controls-wrapper {
display: flex;
flex-direction: column;
gap: 15px;
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 6px;
padding: 12px;
margin-top: 5px;
}
/*【手动熔铸】输入框微调*/
#amily2_manual_historiography_bureau .manual-command-block .manual-input {
width: 70px;
}
/*谕旨编辑器的"保存"和"恢复默认"按钮样式*/
#amily2_manual_historiography_bureau .editor-buttons-panel .accent {
background: linear-gradient(to right, #FF5722, #E64A19);
border: 1px solid #D84315;
}
#amily2_manual_historiography_bureau .editor-buttons-panel .accent:hover {
box-shadow: 0 0 8px rgba(255, 87, 34, 0.7);
transform: scale(1.03);
}
#amily2_manual_historiography_bureau .editor-buttons-panel .secondary {
background: linear-gradient(to right, #ffb300, #fb8c00);
border: 1px solid #f57c00;
}
#amily2_manual_historiography_bureau .editor-buttons-panel .secondary:hover {
box-shadow: 0 0 8px rgba(255, 179, 0, 0.7);
transform: scale(1.03);
}
/*【宏史卷】区域的选择器容器*/
#amily2_manual_historiography_bureau .mhb-selector-container {
display: flex;
flex-direction: row;
align-items: flex-start;
gap: 12px;
width: 100%;
}
/*【宏史卷】区域的每个选择器组*/
#amily2_manual_historiography_bureau .mhb-selector-group {
display: flex;
flex-direction: column;
flex-grow: 1;
min-width: 0;
gap: 5px;
}
#amily2_manual_historiography_bureau .mhb-selector-group > label {
width: auto;
margin-top: 0;
}
/*=======================================*/
/*======【远征与巡录指挥台样式 v2.0】======*/
/*=======================================*/
/*【远征指挥台】总容器,现在拥有了皇家印信的权威*/
#amily2_manual_historiography_bureau .auto-command-block {
display: flex;
justify-content: space-around;
align-items: center;
gap: 15px;
margin-top: 15px;
padding: 10px;
border: 1px solid var(--secondary-border);
border-radius: 8px;
}
/*【指挥台】内部的“自动巡录”和“远征阈值”控件对*/
#amily2_manual_historiography_bureau .auto-control-pair {
display: flex;
flex-direction: row;
align-items: center;
gap: 8px;
}
#amily2_manual_historiography_bureau #amily2_mhb_small_expedition_execute {
width: auto; /*强行解除其占据100%宽度的诅咒,让其宽度由自身内容决定*/
flex-grow: 0; /*禁止其在有多余空间时进行不必要的扩张,保持其谦逊的体态*/
}
#amily2_manual_historiography_bureau #amily2_mhb_small_expedition_execute {
background: linear-gradient(135deg, #8e44ad, #6a1b9a); /*高贵的紫罗兰色,象征远征的决心与皇权*/
border: 1px solid #4a148c;
color: white; /*确保文字颜色在深色背景上清晰可见*/
text-shadow: 0 0 2px rgba(0,0,0,0.3); /*保持一致的文字阴影*/
transition: all 0.3s ease; /*保持一致的过渡动画*/
}
#amily2_manual_historiography_bureau #amily2_mhb_small_expedition_execute:hover {
background: linear-gradient(135deg, #9b59b6, #8e44ad); /*悬停时颜色变得更加明亮*/
box-shadow: 0 0 10px rgba(142, 68, 173, 0.7); /*散发出代表力量的紫色光晕*/
transform: translateY(-1px); /*保持一致的微动效*/
}
/*==============【熔铸按钮颜色修正,确保其火焰色泽不受干扰】==============*/
#amily2_manual_historiography_bureau #amily2_mhb_small_manual_execute {
background: linear-gradient(135deg, #ff8a65, #ff5722);
border: 1px solid #e64a19;
}
#amily2_manual_historiography_bureau #amily2_mhb_small_manual_execute:hover {
background: linear-gradient(135deg, #ff7043, #f4511e);
box-shadow: 0 0 10px rgba(255, 87, 34, 0.6);
}
/*================================================================*/
/*====== 【圣旨:为指挥台授予红绿双色战旗】 @ v2.3 ======*/
/*================================================================*/
/*【红色战旗】(危险/停止) - 强制、醒目的红色,代表“停止”这一最高指令*/
#amily2_manual_historiography_bureau .danger {
background: linear-gradient(135deg, #e74c3c, #c0392b); /*醒目的赤红色,代表“停止”*/
border: 1px solid #a93226;
color: white;
}
#amily2_manual_historiography_bureau .danger:hover {
background: linear-gradient(135deg, #ec7063, #e74c3c);
box-shadow: 0 0 10px rgba(231, 76, 60, 0.7); /*散发代表警示的红色光晕*/
}
/*【绿色战旗】(安全/继续) - 充满希望的绿色,代表“继续”这一恢复指令*/
#amily2_manual_historiography_bureau .success {
background: linear-gradient(135deg, #2ecc71, #27ae60); /*充满生机的翡翠绿,代表“继续”*/
border: 1px solid #229954;
color: white;
}
#amily2_manual_historiography_bureau .success:hover {
background: linear-gradient(135deg, #58d68d, #2ecc71);
box-shadow: 0 0 10px rgba(46, 204, 113, 0.7); /*散发代表希望的绿色光晕*/
}

View File

@@ -401,3 +401,37 @@ hr { border: none; border-top: 1px solid rgba(255,255,255,0.1); margin: 0; }
font-size: 9px;
font-weight: normal;
}
/* 左侧容器:垂直布局 */
.header-left-panel {
display: flex; /* 弹性布局 */
flex-direction: column; /* 垂直排列 */
align-items: flex-start;/* 左对齐 */
gap: 10px; /* 内部元素间距 */
}
/* 翰林院入口容器 (简化无背景) */
.rag-palace-entry-container {
width: auto; /* 自适应宽度 */
}
/* 翰林院按钮 - 与内阁密室一致 */
#amily2_open_rag_palace {
/* 完全复用内阁密室的样式 */
background: none !important;
border: none !important;
box-shadow: none !important;
padding: 0;
font-size: 14px;
color: var(--SmartThemeBodyColor);
}
/* 确保所有可切换面板表现一致 */
#rag_palace_panel {
display: none;
}
.amily2-panel-visible {
display: flex;
flex-direction: column;
flex-grow: 1;
}