mirror of
https://github.com/Wx-2025/ST-Amily2-Chat-Optimisation.git
synced 2026-06-06 16:15:50 +00:00
Add files via upload
This commit is contained in:
@@ -1,11 +1,11 @@
|
|||||||
|
|
||||||
<div class="amily2-header">
|
<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">
|
<button id="amily2_back_to_main_settings" class="menu_button secondary small_button interactable">
|
||||||
<i class="fas fa-arrow-left"></i> 返回主殿
|
<i class="fas fa-arrow-left"></i> 返回主殿
|
||||||
</button>
|
</button>
|
||||||
|
<div class="additional-features-title">
|
||||||
|
<i class="fas fa-landmark-dome"></i> 内阁密室
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<hr class="header-divider">
|
<hr class="header-divider">
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,11 @@
|
|||||||
<div class="auth-code-input">
|
<div class="auth-code-input">
|
||||||
<input type="password" id="amily2_auth_code" placeholder="输入授权码..."><button id="auth_submit">验证</button>
|
<input type="password" id="amily2_auth_code" placeholder="输入授权码..."><button id="auth_submit">验证</button>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="auth-daily-code">
|
||||||
|
<span>今日授权码:</span>
|
||||||
|
<span id="amily2_daily_code_display" class="daily-code">正在生成...</span>
|
||||||
|
<button id="amily2_copy_daily_code" class="copy-button" title="复制授权码"><i class="fas fa-copy"></i></button>
|
||||||
|
</div>
|
||||||
<div class="auth-footer">授权码请联系开发者获取,完全免费,禁止商用。但目前不是很想发联系方式啊等等再说吧。</div>
|
<div class="auth-footer">授权码请联系开发者获取,完全免费,禁止商用。但目前不是很想发联系方式啊等等再说吧。</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -18,7 +23,9 @@
|
|||||||
|
|
||||||
|
|
||||||
<div class="amily2-header">
|
<div class="amily2-header">
|
||||||
|
<!-- 左侧垂直布局容器 -->
|
||||||
<div class="header-left-panel">
|
<div class="header-left-panel">
|
||||||
|
<!-- 主开关 -->
|
||||||
<div class="main-toggle amily2_settings_block">
|
<div class="main-toggle amily2_settings_block">
|
||||||
<label for="amily2_enabled" class="main-toggle-label"><strong>启动Amily2号</strong></label>
|
<label for="amily2_enabled" class="main-toggle-label"><strong>启动Amily2号</strong></label>
|
||||||
<label class="toggle-switch">
|
<label class="toggle-switch">
|
||||||
@@ -27,13 +34,15 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 翰林院入口 -->
|
||||||
<div class="rag-palace-entry-container">
|
<div class="rag-palace-entry-container">
|
||||||
<button id="amily2_open_rag_palace" class="secret-chamber-button interactable">
|
<button id="amily2_open_rag_palace" class="secret-chamber-button interactable">
|
||||||
<i class="fas fa-brain"></i> 翰林院
|
<i class="fas fa-brain"></i> 翰林院
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> <!-- 左侧容器结束 -->
|
||||||
|
|
||||||
|
<!-- 右侧操作按钮组 -->
|
||||||
<div class="header-actions-group">
|
<div class="header-actions-group">
|
||||||
<div class="update-section">
|
<div class="update-section">
|
||||||
<button id="amily2_update_button" class="menu_button small_button interactable" title="查看更新日志">
|
<button id="amily2_update_button" class="menu_button small_button interactable" title="查看更新日志">
|
||||||
@@ -79,7 +88,7 @@
|
|||||||
<div class="amily2_settings_block">
|
<div class="amily2_settings_block">
|
||||||
<label for="amily2_optimization_target_tag">御定优化标签</label>
|
<label for="amily2_optimization_target_tag">御定优化标签</label>
|
||||||
<input id="amily2_optimization_target_tag" type="text" class="text_pole" placeholder="例如: content, 正文" />
|
<input id="amily2_optimization_target_tag" type="text" class="text_pole" placeholder="例如: content, 正文" />
|
||||||
<small class="notes">指定Amily2号精准优化的唯一XML标签名。若留空或未找到,将优化全文。</small>
|
<small class="notes">指定Amily2号精准优化的唯一XML标签名。若留空或未找到,则不执行优化。</small>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,224 +1,245 @@
|
|||||||
|
/* =============================================================== */
|
||||||
|
/* ======== 【翰林院】敕造 CSS 法典 v3.1 - 奉旨重铸 ======== */
|
||||||
|
/* ======== Amily 执笔,确保与主殿风格统一 ======== */
|
||||||
|
/* =============================================================== */
|
||||||
|
|
||||||
|
/* --- 核心容器与布局 --- */
|
||||||
#amily2_hanlinyuan_panel {
|
#hly-modal-container {
|
||||||
background-color: #f0f2f5;
|
width: 100%;
|
||||||
color: #333;
|
height: 100%;
|
||||||
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;
|
display: flex;
|
||||||
justify-content: space-between;
|
flex-direction: column;
|
||||||
align-items: center;
|
gap: 15px;
|
||||||
border-bottom: 1px solid #eee;
|
padding: 10px 5px;
|
||||||
padding-bottom: 15px;
|
box-sizing: border-box;
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#amily2_hanlinyuan_panel .header h2 {
|
.hly-scroll {
|
||||||
margin: 0;
|
overflow-y: auto;
|
||||||
color: #1d2129;
|
padding-right: 10px; /* 为滚动条留出空间 */
|
||||||
}
|
}
|
||||||
|
|
||||||
#amily2_hanlinyuan_panel .header p {
|
/* --- 仿主殿的设置组样式 --- */
|
||||||
margin: 5px 0 0;
|
.hly-settings-group {
|
||||||
color: #606770;
|
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||||
|
border-radius: 12px;
|
||||||
|
padding: 15px;
|
||||||
|
margin: 0 0 20px 0;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 18px;
|
||||||
|
background: rgba(0,0,0,0.1);
|
||||||
|
box-shadow: inset 0 0 15px rgba(0,0,0,0.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
#amily2_hanlinyuan_panel .section {
|
.hly-settings-group legend {
|
||||||
margin-bottom: 25px;
|
font-size: 1.2em;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #e0e0e0;
|
||||||
|
padding: 0 10px;
|
||||||
|
margin-left: 10px;
|
||||||
|
background: linear-gradient(to right, #c0bde4, #dfdff0);
|
||||||
|
-webkit-background-clip: text;
|
||||||
|
background-clip: text;
|
||||||
|
color: transparent;
|
||||||
|
text-shadow: 0 0 5px rgba(200, 200, 255, 0.3);
|
||||||
}
|
}
|
||||||
|
|
||||||
#amily2_hanlinyuan_panel .section h3,
|
.hly-settings-group legend > i {
|
||||||
#amily2_hanlinyuan_panel .tab-content h4 {
|
margin-right: 10px;
|
||||||
color: #4b4f56;
|
color: #9e8aff; /* 紫色系强调色 */
|
||||||
margin-top: 0;
|
|
||||||
margin-bottom: 15px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#amily2_hanlinyuan_panel .form-group {
|
/* --- 控件统一样式 --- */
|
||||||
margin-bottom: 15px;
|
.hly-control-block {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#amily2_hanlinyuan_panel .form-group label {
|
.hly-control-block label, .hly-control-block .hly-label {
|
||||||
display: block;
|
font-weight: bold;
|
||||||
font-weight: 600;
|
color: #d1d1d1;
|
||||||
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;
|
font-size: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
#amily2_hanlinyuan_panel .text_pole:focus {
|
.hly-control-block .hly-notes {
|
||||||
border-color: #1877f2;
|
font-size: 0.85em;
|
||||||
|
color: #b0b0b0;
|
||||||
|
opacity: 0.9;
|
||||||
|
font-style: italic;
|
||||||
|
padding-left: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 帝国御笔 - 输入框/下拉/文本域的统一风格 */
|
||||||
|
.hly-imperial-brush {
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
background-color: rgba(0, 0, 0, 0.3);
|
||||||
|
border: 1px solid #555;
|
||||||
|
border-radius: 8px;
|
||||||
|
padding: 10px;
|
||||||
|
color: #f0f0f0;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
}
|
||||||
|
.hly-imperial-brush:focus {
|
||||||
|
background-color: rgba(0, 0, 0, 0.5);
|
||||||
|
border-color: #7e57c2;
|
||||||
|
box-shadow: 0 0 10px rgba(126, 87, 194, 0.5);
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
#amily2_hanlinyuan_panel .button-group {
|
/* 仿主殿的开关 */
|
||||||
|
.hly-toggle-switch {
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
width: 50px;
|
||||||
|
height: 26px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
.hly-toggle-switch input { opacity: 0; width: 0; height: 0; }
|
||||||
|
.hly-toggle-switch .slider {
|
||||||
|
position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
|
||||||
|
background-color: #333; border-radius: 26px; transition: .4s;
|
||||||
|
border: 1px solid #555;
|
||||||
|
}
|
||||||
|
.hly-toggle-switch .slider:before {
|
||||||
|
position: absolute; content: ""; height: 20px; width: 20px; left: 2px; bottom: 2px;
|
||||||
|
background-color: white; border-radius: 50%; transition: .4s;
|
||||||
|
}
|
||||||
|
.hly-toggle-switch input:checked + .slider {
|
||||||
|
background: linear-gradient(to right, #7e57c2, #5e35b1);
|
||||||
|
box-shadow: 0 0 8px rgba(126, 87, 194, 0.7);
|
||||||
|
}
|
||||||
|
.hly-toggle-switch input:checked + .slider:before { transform: translateX(24px); }
|
||||||
|
|
||||||
|
.hly-checkbox-group {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 10px;
|
gap: 15px;
|
||||||
flex-wrap: wrap;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
.hly-checkbox-group label {
|
||||||
|
|
||||||
#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;
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#amily2_hanlinyuan_panel .menu_button.compact {
|
|
||||||
padding: 5px 10px;
|
|
||||||
font-size: 0.9em;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#amily2_hanlinyuan_panel .menu_button.accent {
|
|
||||||
background-color: #007bff;
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#amily2_hanlinyuan_panel .tab-nav {
|
|
||||||
display: flex;
|
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#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;
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#amily2_hanlinyuan_panel #vector-list li:last-child {
|
/* --- 导航栏 --- */
|
||||||
border-bottom: none;
|
.hly-navigation-deck {
|
||||||
}
|
display: flex;
|
||||||
|
border: 1px solid #555;
|
||||||
#amily2_hanlinyuan_panel #vector-list .vector-text {
|
border-radius: 8px;
|
||||||
flex-grow: 1;
|
|
||||||
margin-right: 10px;
|
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
background-color: #2a2a2e;
|
||||||
|
}
|
||||||
|
.hly-nav-item {
|
||||||
|
flex: 1;
|
||||||
|
text-align: center;
|
||||||
|
padding: 10px 12px;
|
||||||
|
cursor: pointer;
|
||||||
|
background-color: transparent;
|
||||||
|
color: #ccc;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
border: none;
|
||||||
|
border-left: 1px solid #555;
|
||||||
|
font-size: 1em;
|
||||||
|
}
|
||||||
|
.hly-nav-item:first-of-type { border-left: none; }
|
||||||
|
.hly-nav-item.active, .hly-nav-item:hover {
|
||||||
|
background: linear-gradient(135deg, #7e57c2, #5e35b1);
|
||||||
|
color: white;
|
||||||
|
font-weight: bold;
|
||||||
|
text-shadow: 0 0 5px rgba(0,0,0,0.5);
|
||||||
|
box-shadow: inset 0 0 10px rgba(0,0,0,0.3);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --- 标签页 --- */
|
||||||
|
.hly-tab-pane { display: none; }
|
||||||
|
.hly-tab-pane.active { display: block; }
|
||||||
|
|
||||||
|
/* --- 状态诏书 --- */
|
||||||
|
.hly-imperial-edict {
|
||||||
|
background: rgba(0,0,0,0.2);
|
||||||
|
border: 1px solid rgba(255,255,255,0.15);
|
||||||
|
border-radius: 10px;
|
||||||
|
padding: 15px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
.hly-edict-row { display: flex; justify-content: space-between; align-items: center; }
|
||||||
|
.hly-edict-item { display: flex; align-items: center; gap: 8px; }
|
||||||
|
.hly-edict-label { color: #aaa; }
|
||||||
|
.hly-edict-value { color: #e0e0e0; font-weight: bold; }
|
||||||
|
.hly-memory-count {
|
||||||
|
font-size: 1.5em;
|
||||||
|
color: #ffc107;
|
||||||
|
text-shadow: 0 0 8px rgba(255, 193, 7, 0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --- 按钮 --- */
|
||||||
|
.hly-action-button {
|
||||||
|
padding: 8px 15px;
|
||||||
|
border-radius: 8px;
|
||||||
|
border: 1px solid transparent;
|
||||||
|
cursor: pointer;
|
||||||
|
font-weight: bold;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
background-color: #444;
|
||||||
|
color: #eee;
|
||||||
|
border-color: #666;
|
||||||
|
}
|
||||||
|
.hly-action-button:hover {
|
||||||
|
transform: translateY(-2px);
|
||||||
|
box-shadow: 0 4px 8px rgba(0,0,0,0.3);
|
||||||
|
}
|
||||||
|
.hly-action-button.accent {
|
||||||
|
background: linear-gradient(135deg, #7e57c2, #5e35b1);
|
||||||
|
border-color: #4527a0;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
.hly-action-button.accent:hover { box-shadow: 0 0 12px rgba(126, 87, 194, 0.7); }
|
||||||
|
.hly-action-button.secondary {
|
||||||
|
background: linear-gradient(135deg, #6c757d, #495057);
|
||||||
|
border-color: #343a40;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
.hly-action-button.secondary:hover { box-shadow: 0 0 12px rgba(108, 117, 125, 0.7); }
|
||||||
|
.hly-action-button.danger {
|
||||||
|
background: linear-gradient(135deg, #d32f2f, #b71c1c);
|
||||||
|
border-color: #8f1717;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
.hly-action-button.danger:hover { box-shadow: 0 0 12px rgba(211, 47, 47, 0.7); }
|
||||||
|
.hly-action-button.success {
|
||||||
|
background: linear-gradient(135deg, #28a745, #1e7e34);
|
||||||
|
border-color: #155d27;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
.hly-action-button.success:hover { box-shadow: 0 0 12px rgba(40, 167, 69, 0.7); }
|
||||||
|
|
||||||
|
.hly-button-group {
|
||||||
|
display: flex;
|
||||||
|
gap: 12px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --- 页脚 --- */
|
||||||
|
.hly-footer {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
gap: 15px;
|
||||||
|
padding-top: 15px;
|
||||||
|
border-top: 1px solid rgba(255,255,255,0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --- 结果显示 --- */
|
||||||
|
.hly-results-display {
|
||||||
|
background: rgba(0,0,0,0.2);
|
||||||
|
border-radius: 8px;
|
||||||
|
padding: 10px;
|
||||||
|
min-height: 50px;
|
||||||
|
font-size: 0.9em;
|
||||||
|
color: #ccc;
|
||||||
|
border: 1px solid #444;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,98 +1,245 @@
|
|||||||
<!DOCTYPE html>
|
<!-- =============================================================== -->
|
||||||
<html>
|
<!-- ======== 【翰林院】敕造殿堂 v3.2 - 奉旨重建 ======== -->
|
||||||
<head>
|
<!-- ======== Amily 执笔,确保与主殿风格统一 ======== -->
|
||||||
<meta charset="utf-8">
|
<!-- =============================================================== -->
|
||||||
<title>翰林院 - RAG 向量数据库</title>
|
<div class="amily2-header">
|
||||||
<link rel="stylesheet" href="hanlinyuan.css">
|
<div class="additional-features-title">
|
||||||
</head>
|
<i class="fas fa-landmark-dome"></i> 翰林院 · 忆识核心
|
||||||
<body>
|
</div>
|
||||||
<div class="container">
|
<button id="amily2_back_to_main_from_hanlinyuan" class="menu_button secondary small_button interactable">
|
||||||
<div class="header">
|
返回主殿 <i class="fas fa-arrow-right"></i>
|
||||||
<div class="header-content">
|
</button>
|
||||||
<h2>翰林院 - RAG 向量数据库</h2>
|
</div>
|
||||||
<p>为每个角色卡构建独立的、基于历史记录的检索增强生成系统。</p>
|
<hr class="header-divider">
|
||||||
</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">
|
<div id="hly-modal-container">
|
||||||
<h3>当前操作角色</h3>
|
<!-- 状态诏书 -->
|
||||||
<select id="character-select" class="text_pole"></select>
|
<div class="hly-imperial-edict">
|
||||||
</div>
|
<fieldset class="hly-settings-group" style="margin-bottom: 10px;">
|
||||||
|
<legend><i class="fas fa-power-off"></i> 总开关</legend>
|
||||||
<div class="tab-nav">
|
<div class="hly-control-block" style="flex-direction: row; justify-content: space-between; align-items: center;">
|
||||||
<button class="tab-button active" data-tab="api-settings">API 设置</button>
|
<label for="hly-retrieval-enabled-toggle">开启忆识检索之权</label>
|
||||||
<button class="tab-button" data-tab="rag-params">RAG 参数</button>
|
<label class="hly-toggle-switch">
|
||||||
</div>
|
<input type="checkbox" id="hly-retrieval-enabled">
|
||||||
|
<span class="slider"></span>
|
||||||
<div id="api-settings" class="tab-content active">
|
</label>
|
||||||
<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>
|
||||||
<div class="form-group">
|
</fieldset>
|
||||||
<label for="embedding-api-key">API 密钥 (Key):</label>
|
<div class="hly-edict-row">
|
||||||
<input type="password" id="embedding-api-key" class="text_pole" placeholder="请输入您的 API Key">
|
<div class="hly-edict-item">
|
||||||
|
<span class="hly-edict-label">当前会话:</span>
|
||||||
|
<span id="hly-current-chat-id" class="hly-edict-value">未开启</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="hly-edict-item">
|
||||||
<label for="embedding-model-select">嵌入模型:</label>
|
<span class="hly-edict-label">当前辅佐:</span>
|
||||||
<select id="embedding-model-select" class="text_pole"></select>
|
<span id="hly-current-character-name" class="hly-edict-value">待命中...</span>
|
||||||
</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>
|
</div>
|
||||||
|
<div class="hly-edict-row">
|
||||||
<div id="rag-params" class="tab-content">
|
<div class="hly-edict-item hly-memory-display">
|
||||||
<h4>检索增强参数配置</h4>
|
<span class="hly-edict-label">忆识总数:</span>
|
||||||
<div class="form-group form-group-inline">
|
<span id="hly-current-vector-count" class="hly-memory-count">0</span>
|
||||||
<label for="rag-enabled">启用RAG注入:</label>
|
<button class="hly-action-button" onclick="updateHLYMemoryCount()" title="刷新忆识总数" style="padding: 4px 8px; font-size: 12px;">
|
||||||
<input type="checkbox" id="rag-enabled" class="inline-checkbox">
|
🔄
|
||||||
<small>启用后,将在每次提问时自动检索相关信息并注入到提示词中。</small>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="hly-button-group" style="margin-left: auto;">
|
||||||
<label for="chunk-size">文本分块大小 (Chunk Size):</label>
|
<button class="hly-action-button" onclick="resetHLYSettings()" style="padding: 4px 8px; font-size: 12px;">重置为初</button>
|
||||||
<input type="number" id="chunk-size" class="text_pole" value="512" min="64" max="2048">
|
<button class="hly-action-button" onclick="saveHLYSettings()" style="padding: 4px 8px; font-size: 12px;">存档封印</button>
|
||||||
<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="可在此处粘贴任意文本(如角色背景、世界观设定等)进行手动向量化。 注意:由“大史官”自动生成的总结会根据其设置自动索引,无需在此手动操作。"></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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
|
||||||
</html>
|
<!-- 司南 -->
|
||||||
|
<div class="hly-navigation-deck">
|
||||||
|
<button class="hly-nav-item active" data-tab="retrieval">忆识检索</button>
|
||||||
|
<button class="hly-nav-item" data-tab="condensation">凝识成典</button>
|
||||||
|
<button class="hly-nav-item" data-tab="manual-ingestion">书库编纂</button>
|
||||||
|
<button class="hly-nav-item" data-tab="advanced">高级设定</button>
|
||||||
|
<button class="hly-nav-item" data-tab="log">运行日志</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="hly-scroll">
|
||||||
|
<!-- ==================== 忆识检索 ==================== -->
|
||||||
|
<div id="hly-retrieval-tab" class="hly-tab-pane active">
|
||||||
|
<fieldset class="hly-settings-group">
|
||||||
|
<legend><i class="fas fa-broadcast-tower"></i> 神力之源 (API)</legend>
|
||||||
|
<div class="hly-control-block">
|
||||||
|
<label for="hly-api-endpoint">API设定:</label>
|
||||||
|
<select id="hly-api-endpoint" class="hly-imperial-brush">
|
||||||
|
<option value="openai">未完成请自定义</option>
|
||||||
|
<option value="azure">未完成请自定义</option>
|
||||||
|
<option value="custom">自定义</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="hly-control-block" id="hly-custom-endpoint-docket" style="display: none;">
|
||||||
|
<label for="hly-custom-api-url">自定义路径:</label>
|
||||||
|
<input type="text" id="hly-custom-api-url" class="hly-imperial-brush" placeholder="输入神力源泉之精确路径">
|
||||||
|
</div>
|
||||||
|
<div class="hly-control-block">
|
||||||
|
<label for="hly-api-key">通行令牌 (API Key):</label>
|
||||||
|
<input type="password" id="hly-api-key" class="hly-imperial-brush" placeholder="请在此输入您的通行令牌">
|
||||||
|
</div>
|
||||||
|
<div class="hly-control-block">
|
||||||
|
<label for="hly-embedding-model">嵌入模型:</label>
|
||||||
|
<select id="hly-embedding-model" class="hly-imperial-brush"></select>
|
||||||
|
</div>
|
||||||
|
<div class="hly-button-group">
|
||||||
|
<button class="hly-action-button" onclick="testHLYApi()">测试神力</button>
|
||||||
|
<button class="hly-action-button" onclick="fetchHLYEmbeddingModels()">获取模型</button>
|
||||||
|
<button class="hly-action-button danger" onclick="purgeHLYStorage()">清空宝库</button>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- ==================== 凝识成典 ==================== -->
|
||||||
|
<div id="hly-condensation-tab" class="hly-tab-pane">
|
||||||
|
<fieldset class="hly-settings-group">
|
||||||
|
<legend><i class="fas fa-book-medical"></i> 凝识法则</legend>
|
||||||
|
<div class="hly-control-block" style="flex-direction: row; justify-content: space-between; align-items: center;">
|
||||||
|
<label for="hly-condensation-enabled-toggle">准许凝识</label>
|
||||||
|
<label class="hly-toggle-switch">
|
||||||
|
<input type="checkbox" id="hly-condensation-enabled">
|
||||||
|
<span class="slider"></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="hly-control-block">
|
||||||
|
<label>凝识范围 (聊天楼层):</label>
|
||||||
|
<div style="display: flex; gap: 10px; align-items: center;">
|
||||||
|
<input type="number" id="hly-layer-start" class="hly-imperial-brush" value="1">
|
||||||
|
<span>-</span>
|
||||||
|
<input type="number" id="hly-layer-end" class="hly-imperial-brush" value="10">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="hly-control-block">
|
||||||
|
<label class="hly-label">消息来源:</label>
|
||||||
|
<div class="hly-checkbox-group">
|
||||||
|
<label><input type="checkbox" id="hly-include-user"> 用户</label>
|
||||||
|
<label><input type="checkbox" id="hly-include-ai"> AI</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="hly-button-group">
|
||||||
|
<button class="hly-action-button success" onclick="startHLYCondensation()">🚀 开始凝识</button>
|
||||||
|
<button class="hly-action-button" onclick="previewHLYCondensation()">👁️ 预览内容</button>
|
||||||
|
</div>
|
||||||
|
<div class="hly-control-block">
|
||||||
|
<label>凝识结果预览:</label>
|
||||||
|
<div id="hly-condensation-results" class="hly-results-display"></div>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- ==================== 高级设定 ==================== -->
|
||||||
|
<div id="hly-advanced-tab" class="hly-tab-pane">
|
||||||
|
<fieldset class="hly-settings-group">
|
||||||
|
<legend><i class="fas fa-cogs"></i> 检索微调</legend>
|
||||||
|
<div class="hly-control-block">
|
||||||
|
<label for="hly-chunk-size">书卷尺寸 (Chunk Size):</label>
|
||||||
|
<input type="number" id="hly-chunk-size" class="hly-imperial-brush" value="512">
|
||||||
|
</div>
|
||||||
|
<div class="hly-control-block">
|
||||||
|
<label for="hly-overlap-size">上下文关联度 (Overlap):</label>
|
||||||
|
<input type="number" id="hly-overlap-size" class="hly-imperial-brush" value="50">
|
||||||
|
</div>
|
||||||
|
<div class="hly-control-block">
|
||||||
|
<label for="hly-match-threshold">忆识匹配度 (Threshold):</label>
|
||||||
|
<input type="number" id="hly-match-threshold" class="hly-imperial-brush" value="0.7" step="0.1">
|
||||||
|
</div>
|
||||||
|
<div class="hly-control-block">
|
||||||
|
<label for="hly-query-message-count">检索参考的消息数量:</label>
|
||||||
|
<input type="number" id="hly-query-message-count" class="hly-imperial-brush" value="5">
|
||||||
|
</div>
|
||||||
|
<div class="hly-control-block">
|
||||||
|
<label for="hly-max-results">单次检索最大结果数:</label>
|
||||||
|
<input type="number" id="hly-max-results" class="hly-imperial-brush" value="10">
|
||||||
|
</div>
|
||||||
|
<div class="hly-control-block">
|
||||||
|
<label for="hly-batch-size">批处理大小 (Batch Size):</label>
|
||||||
|
<input type="number" id="hly-batch-size" class="hly-imperial-brush" value="5">
|
||||||
|
<small class="hly-notes">每次调用API时处理的文本数量。</small>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
<fieldset class="hly-settings-group">
|
||||||
|
<legend><i class="fas fa-wand-magic-sparkles"></i> 圣言注入</legend>
|
||||||
|
<div class="hly-control-block">
|
||||||
|
<label for="hly-injection-template">圣言模板:</label>
|
||||||
|
<textarea id="hly-injection-template" class="hly-imperial-brush" rows="3">翰林院呈报相关忆识:\n{{text}}</textarea>
|
||||||
|
<small class="hly-notes">以 {{text}} 为占位符,代表检索到的内容。</small>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 最终版注入位置选择器,完全模仿真经 -->
|
||||||
|
<div class="hly-control-block">
|
||||||
|
<label>注入位置:</label>
|
||||||
|
<div class="hly-radio-group-vertical">
|
||||||
|
<label class="hly-radio-label">
|
||||||
|
<input type="radio" name="hly-injection-position" value="2" />
|
||||||
|
<span>主提示前 (在所有提示词的最前面)</span>
|
||||||
|
</label>
|
||||||
|
<label class="hly-radio-label">
|
||||||
|
<input type="radio" name="hly-injection-position" value="0" />
|
||||||
|
<span>主提示后 (在主提示词之后,聊天记录之前)</span>
|
||||||
|
</label>
|
||||||
|
<label class="hly-radio-label">
|
||||||
|
<input type="radio" name="hly-injection-position" value="1" checked />
|
||||||
|
<span>聊天内 @ 深度</span>
|
||||||
|
<input
|
||||||
|
id="hly-injection-depth"
|
||||||
|
class="hly-imperial-brush"
|
||||||
|
type="number"
|
||||||
|
min="0"
|
||||||
|
max="999"
|
||||||
|
style="width: 60px; margin-left: 10px;"
|
||||||
|
/>
|
||||||
|
<span style="margin-left: 10px;">作为</span>
|
||||||
|
<select id="hly-injection-role" class="hly-imperial-brush" style="width: auto; margin-left: 10px;">
|
||||||
|
<option value="0">系统</option>
|
||||||
|
<option value="1">用户</option>
|
||||||
|
<option value="2">助手</option>
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
<fieldset class="hly-settings-group">
|
||||||
|
<legend><i class="fas fa-bell"></i> 上奏设定</legend>
|
||||||
|
<div class="hly-control-block" style="flex-direction: row; justify-content: space-between; align-items: center;">
|
||||||
|
<label for="hly-retrieval-notify-toggle">检索成功时上奏</label>
|
||||||
|
<label class="hly-toggle-switch">
|
||||||
|
<input type="checkbox" id="hly-retrieval-notify">
|
||||||
|
<span class="slider"></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- ==================== 书库编纂 ==================== -->
|
||||||
|
<div id="hly-manual-ingestion-tab" class="hly-tab-pane">
|
||||||
|
<fieldset class="hly-settings-group">
|
||||||
|
<legend><i class="fas fa-book"></i> 手动录入</legend>
|
||||||
|
<div class="hly-control-block">
|
||||||
|
<label for="hly-manual-text">在此处粘贴您要录入的知识文书:</label>
|
||||||
|
<textarea id="hly-manual-text" class="hly-imperial-brush" rows="8" placeholder="例如,您可以粘贴角色设定、世界观、背景故事等..."></textarea>
|
||||||
|
<small class="hly-notes">录入的文本将被分块、向量化并存入当前角色的忆识宝库中。</small>
|
||||||
|
</div>
|
||||||
|
<div class="hly-button-group">
|
||||||
|
<button class="hly-action-button success" onclick="ingestHLYManualText()">
|
||||||
|
<i class="fas fa-file-import"></i> 开始录入
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- ==================== 运行日志 ==================== -->
|
||||||
|
<div id="hly-log-tab" class="hly-tab-pane">
|
||||||
|
<fieldset class="hly-settings-group">
|
||||||
|
<legend><i class="fas fa-scroll"></i> 起居注</legend>
|
||||||
|
<div id="hly-log-output" class="hly-log-display">
|
||||||
|
<p>翰林院运行日志将在此记录...</p>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="hly-footer">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -24,11 +24,19 @@
|
|||||||
.auth-status.expired { background-color: rgba(244, 67, 54, 0.2); border: 1px solid #f44336; }
|
.auth-status.expired { background-color: rgba(244, 67, 54, 0.2); border: 1px solid #f44336; }
|
||||||
|
|
||||||
.amily2-header {
|
.amily2-header {
|
||||||
display: flex; justify-content: space-between; align-items: center; padding: 0 5px;
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: flex-start; /* 修改为顶部对齐 */
|
||||||
|
padding: 0 5px;
|
||||||
}
|
}
|
||||||
.main-toggle { margin: 0; }
|
.main-toggle { margin: 0; }
|
||||||
.main-toggle label { font-size: 1.2em; }
|
.main-toggle label { font-size: 1.2em; }
|
||||||
.update-section { position: relative; }
|
.update-section {
|
||||||
|
position: relative;
|
||||||
|
display: flex; /* 使用flex布局来垂直居中 */
|
||||||
|
align-items: center;
|
||||||
|
min-height: 50px; /* 设置一个最小高度,与左侧开关区域对齐 */
|
||||||
|
}
|
||||||
#amily2_update_button { background: none; border: 1px solid rgba(255,255,255,0.2); padding: 5px 8px; }
|
#amily2_update_button { background: none; border: 1px solid rgba(255,255,255,0.2); padding: 5px 8px; }
|
||||||
#amily2_update_button:hover { background: rgba(255,255,255,0.1); }
|
#amily2_update_button:hover { background: rgba(255,255,255,0.1); }
|
||||||
.update-indicator {
|
.update-indicator {
|
||||||
@@ -277,8 +285,8 @@ hr { border: none; border-top: 1px solid rgba(255,255,255,0.1); margin: 0; }
|
|||||||
.header-actions-group {
|
.header-actions-group {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: flex-end;
|
align-items: flex-end; /* 保持右对齐 */
|
||||||
gap: 6px;
|
gap: 10px; /* 增加间距以匹配左侧 */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -401,22 +409,22 @@ hr { border: none; border-top: 1px solid rgba(255,255,255,0.1); margin: 0; }
|
|||||||
font-size: 9px;
|
font-size: 9px;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
|
/* 左侧容器:垂直布局 */
|
||||||
.header-left-panel {
|
.header-left-panel {
|
||||||
display: flex;
|
display: flex; /* 弹性布局 */
|
||||||
flex-direction: column;
|
flex-direction: column; /* 垂直排列 */
|
||||||
align-items: flex-start;
|
align-items: flex-start;/* 左对齐 */
|
||||||
gap: 10px;
|
gap: 10px; /* 内部元素间距 */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 翰林院入口容器 (简化无背景) */
|
||||||
.rag-palace-entry-container {
|
.rag-palace-entry-container {
|
||||||
width: auto;
|
width: auto; /* 自适应宽度 */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 翰林院按钮 - 与内阁密室一致 */
|
||||||
#amily2_open_rag_palace {
|
#amily2_open_rag_palace {
|
||||||
|
/* 完全复用内阁密室的样式 */
|
||||||
background: none !important;
|
background: none !important;
|
||||||
border: none !important;
|
border: none !important;
|
||||||
box-shadow: none !important;
|
box-shadow: none !important;
|
||||||
@@ -425,7 +433,7 @@ hr { border: none; border-top: 1px solid rgba(255,255,255,0.1); margin: 0; }
|
|||||||
color: var(--SmartThemeBodyColor);
|
color: var(--SmartThemeBodyColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 确保所有可切换面板表现一致 */
|
||||||
#rag_palace_panel {
|
#rag_palace_panel {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user