mirror of
https://github.com/Wx-2025/ST-Amily2-Chat-Optimisation.git
synced 2026-06-06 19:45:50 +00:00
Add files via upload
This commit is contained in:
@@ -42,6 +42,84 @@
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset class="settings-group">
|
||||
<legend><i class="fas fa-satellite-dish"></i> Ngms API 调用系统</legend>
|
||||
<small class="notes" style="text-align: center; display: block; margin-bottom: 15px;">
|
||||
独立的API调用系统,可与主系统并行使用,支持全兼容和SillyTavern预设两种模式。
|
||||
</small>
|
||||
|
||||
<div class="amily2_settings_block">
|
||||
<label for="amily2_ngms_enabled">启用Ngms API系统</label>
|
||||
<label class="toggle-switch">
|
||||
<input id="amily2_ngms_enabled" type="checkbox" />
|
||||
<span class="slider"></span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="amily2_settings_block" id="amily2_ngms_content" style="display: none;">
|
||||
<div class="control-group">
|
||||
<label for="amily2_ngms_api_mode">API调用模式:</label>
|
||||
<select id="amily2_ngms_api_mode" class="text_pole">
|
||||
<option value="openai_test">全兼容模式</option>
|
||||
<option value="sillytavern_preset">SillyTavern预设模式</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div id="amily2_ngms_config_panel" style="margin-top: 15px;">
|
||||
<!-- 全兼容模式配置 -->
|
||||
<div id="amily2_ngms_compatible_config">
|
||||
<div class="control-group">
|
||||
<label for="amily2_ngms_api_url">API地址:</label>
|
||||
<input type="text" id="amily2_ngms_api_url" class="text_pole" placeholder="https://api.openai.com/v1" />
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label for="amily2_ngms_api_key">API密钥:</label>
|
||||
<input type="password" id="amily2_ngms_api_key" class="text_pole" placeholder="sk-..." />
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label for="amily2_ngms_model">模型:</label>
|
||||
<div class="select-with-refresh">
|
||||
<select id="amily2_ngms_model_select" class="text_pole" style="flex-grow: 1; display: none;">
|
||||
<option value="">-- 请选择模型 --</option>
|
||||
</select>
|
||||
<input type="text" id="amily2_ngms_model" class="text_pole" placeholder="gpt-4" style="flex-grow: 1;" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- SillyTavern预设模式配置 -->
|
||||
<div id="amily2_ngms_preset_config" style="display: none;">
|
||||
<div class="control-group">
|
||||
<label for="amily2_ngms_tavern_profile">选择SillyTavern预设:</label>
|
||||
<select id="amily2_ngms_tavern_profile" class="text_pole">
|
||||
<option value="">-- 请选择预设 --</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 通用参数配置 -->
|
||||
<div class="control-group">
|
||||
<label for="amily2_ngms_max_tokens">最大令牌数:<span id="amily2_ngms_max_tokens_value">4000</span></label>
|
||||
<input type="range" id="amily2_ngms_max_tokens" min="100" max="100000" step="100" value="4000" />
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label for="amily2_ngms_temperature">温度:<span id="amily2_ngms_temperature_value">0.7</span></label>
|
||||
<input type="range" id="amily2_ngms_temperature" min="0" max="2" step="0.1" value="0.7" />
|
||||
</div>
|
||||
|
||||
<!-- 测试按钮组 - 水平排列 -->
|
||||
<div class="ngms-button-row" style="display: flex; gap: 10px; justify-content: center; margin-top: 15px;">
|
||||
<button id="amily2_ngms_test_connection" class="menu_button primary small_button interactable">
|
||||
<i class="fas fa-plug"></i> 测试连接
|
||||
</button>
|
||||
<button id="amily2_ngms_fetch_models" class="menu_button secondary small_button interactable" title="获取可用模型列表">
|
||||
<i class="fas fa-download"></i> 获取模型
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
|
||||
|
||||
<fieldset class="settings-group">
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 0;
|
||||
min-width: 0; /* Prevents flex items from overflowing */
|
||||
}
|
||||
|
||||
.scrollable-container {
|
||||
@@ -138,6 +138,7 @@
|
||||
|
||||
<div id="table_worldbook_select_wrapper" style="display: none;">
|
||||
<div class="worldbook-selection-container">
|
||||
<!-- World Book List Column -->
|
||||
<div class="worldbook-column">
|
||||
<div class="amily2_opt_label_with_button_wrapper">
|
||||
<label>选择世界书 (可多选)</label>
|
||||
@@ -150,6 +151,8 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- World Book Entry List Column -->
|
||||
<div class="worldbook-column" style="margin-top: 10px;">
|
||||
<label>选择条目 (可多选)</label>
|
||||
<div id="table_worldbook_entry_list" class="scrollable-container">
|
||||
@@ -206,6 +209,74 @@
|
||||
|
||||
<hr class="section-divider" style="margin: 10px 0;">
|
||||
|
||||
<!-- Nccs API 控制区域 -->
|
||||
<fieldset class="settings-group" style="border-style: dashed; padding: 8px; margin-bottom: 10px;">
|
||||
<legend><i class="fas fa-brain"></i> Nccs API 系统</legend>
|
||||
|
||||
<div class="control-block-with-switch" style="margin-bottom: 10px;">
|
||||
<label for="nccs-api-enabled">启用 Nccs API</label>
|
||||
<label class="toggle-switch">
|
||||
<input type="checkbox" id="nccs-api-enabled" data-setting-key="nccsEnabled" data-type="boolean">
|
||||
<span class="slider"></span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div id="nccs-api-config" style="display: none;">
|
||||
<div class="amily2_opt_settings_block" style="margin-bottom: 10px;">
|
||||
<label for="nccs-api-mode">API 模式</label>
|
||||
<select id="nccs-api-mode" class="text_pole">
|
||||
<option value="openai_test">全兼容模式</option>
|
||||
<option value="sillytavern_preset">SillyTavern预设模式</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="amily2_opt_settings_block" style="margin-bottom: 10px;">
|
||||
<label for="nccs-api-url">API URL</label>
|
||||
<input type="text" id="nccs-api-url" class="text_pole" placeholder="https://api.openai.com/v1">
|
||||
</div>
|
||||
|
||||
<div class="amily2_opt_settings_block" style="margin-bottom: 10px;">
|
||||
<label for="nccs-api-key">API Key</label>
|
||||
<input type="password" id="nccs-api-key" class="text_pole" placeholder="输入您的API密钥">
|
||||
</div>
|
||||
|
||||
<div class="amily2_opt_settings_block" style="margin-bottom: 10px;">
|
||||
<label for="nccs-api-model">模型</label>
|
||||
<div style="display: flex; gap: 5px; align-items: center;">
|
||||
<input type="text" id="nccs-api-model" class="text_pole" placeholder="选择或输入模型">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="amily2_opt_settings_block" style="margin-bottom: 10px;">
|
||||
<label for="nccs-max-tokens">最大Token数: <span id="nccs-max-tokens-value">2000</span></label>
|
||||
<input type="range" id="nccs-max-tokens" min="100" max="8000" step="100" value="2000">
|
||||
</div>
|
||||
|
||||
<div class="amily2_opt_settings_block" style="margin-bottom: 10px;">
|
||||
<label for="nccs-temperature">Temperature: <span id="nccs-temperature-value">0.7</span></label>
|
||||
<input type="range" id="nccs-temperature" min="0" max="2" step="0.1" value="0.7">
|
||||
</div>
|
||||
|
||||
<div class="amily2_opt_settings_block" style="margin-bottom: 10px;">
|
||||
<label for="nccs-sillytavern-preset">SillyTavern 预设</label>
|
||||
<select id="nccs-sillytavern-preset" class="text_pole">
|
||||
<option value="">选择预设</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="nccs-button-row" style="display: flex; gap: 10px; justify-content: center; margin-top: 15px;">
|
||||
<button id="nccs-test-connection" class="menu_button primary small_button interactable">
|
||||
<i class="fas fa-plug"></i> 测试连接
|
||||
</button>
|
||||
<button id="nccs-fetch-models" class="menu_button secondary small_button interactable">
|
||||
<i class="fas fa-download"></i> 获取模型
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<hr class="section-divider" style="margin: 10px 0;">
|
||||
|
||||
<div class="action-center-buttons" id="theme-action-buttons" style="gap: 8px;">
|
||||
<button id="amily2-import-theme-btn" class="menu_button small_button interactable"><i class="fas fa-palette"></i> 导入主题</button>
|
||||
<button id="amily2-export-theme-btn" class="menu_button small_button interactable"><i class="fas fa-paint-brush"></i> 导出主题</button>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
gap: 0px;
|
||||
}
|
||||
.side-button {
|
||||
writing-mode: vertical-rl;
|
||||
writing-mode: vertical-rl; /* 【V59.0】恢复垂直模式 */
|
||||
text-orientation: mixed;
|
||||
height: 140px;
|
||||
width: 50px;
|
||||
@@ -40,6 +40,53 @@
|
||||
display: none;
|
||||
background-color: #4CAF50 !important;
|
||||
}
|
||||
|
||||
.version-info-container {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 8px 12px;
|
||||
background-color: rgba(255, 255, 255, 0.03);
|
||||
border-radius: 5px;
|
||||
font-size: 12px;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.version-info-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
color: #adb6e6;
|
||||
}
|
||||
|
||||
.version-label {
|
||||
font-size: 10px;
|
||||
opacity: 0.7;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
.version-number {
|
||||
font-weight: bold;
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
.version-current .version-number {
|
||||
color: #68b7ff;
|
||||
}
|
||||
|
||||
.version-latest .version-number {
|
||||
color: #4CAF50;
|
||||
}
|
||||
|
||||
.version-latest.has-update .version-number {
|
||||
color: #ff6b6b;
|
||||
animation: glow 2s ease-in-out infinite alternate;
|
||||
}
|
||||
|
||||
@keyframes glow {
|
||||
from { text-shadow: 0 0 5px rgba(255, 107, 107, 0.5); }
|
||||
to { text-shadow: 0 0 10px rgba(255, 107, 107, 0.8), 0 0 15px rgba(255, 107, 107, 0.3); }
|
||||
}
|
||||
</style>
|
||||
<div class="flex-container">
|
||||
<div id="amily2_chat_optimiser">
|
||||
@@ -65,27 +112,10 @@
|
||||
<div class="plugin-features" style="display: none;">
|
||||
|
||||
<fieldset class="settings-group">
|
||||
<legend>Amily中枢</legend>
|
||||
<legend><i class="fas fa-cog"></i> Amily中枢</legend>
|
||||
<div class="amily2-header">
|
||||
<!-- 左列 -->
|
||||
<div class="header-column left" style="flex-direction: row; align-items: center; gap: 5px;">
|
||||
<button id="amily2_open_rag_palace" class="secret-chamber-button interactable side-button">
|
||||
<i class="fas fa-brain"></i>翰林学院
|
||||
</button>
|
||||
<button id="amily2_open_memorisation_forms" class="secret-chamber-button interactable side-button">
|
||||
<i class="fas fa-table"></i>内存储司
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="header-column center">
|
||||
<div style="position: relative;">
|
||||
<button id="amily2_update_button" class="menu_button small_button interactable" title="查看更新日志">
|
||||
<i class="fas fa-bell"></i>
|
||||
</button>
|
||||
<div id="amily2_update_indicator" class="update-indicator" style="display: none;"></div>
|
||||
</div>
|
||||
<div class="main-toggle amily2_settings_block">
|
||||
<div class="header-column center" style="width: 100%; flex-direction: row; justify-content: center; gap: 20px;">
|
||||
<div class="main-toggle amily2_settings_block" style="margin: 0;">
|
||||
<label class="toggle-switch">
|
||||
<input id="amily2_enabled" type="checkbox" />
|
||||
<span class="slider"></span>
|
||||
@@ -94,17 +124,18 @@
|
||||
<button id="amily2_open_tutorial" class="menu_button small_button interactable" title="查看使用教程">
|
||||
教程
|
||||
</button>
|
||||
<button id="amily2_update_button_new" class="menu_button small_button interactable" title="查看更新日志">更新</button>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<div class="header-column right" style="flex-direction: row; align-items: center; gap: 5px;">
|
||||
<button id="amily2_open_additional_features" class="secret-chamber-button interactable side-button">
|
||||
<i class="fas fa-landmark-dome"></i>内阁密室
|
||||
</button>
|
||||
<button id="amily2_open_plot_optimization" class="secret-chamber-button interactable side-button">
|
||||
<i class="fas fa-feather-alt"></i>剧情优化
|
||||
</button>
|
||||
</div>
|
||||
<fieldset class="settings-group">
|
||||
<legend><i class="fas fa-plus-circle"></i> 新增扩展</legend>
|
||||
<div class="button-group" style="display: flex; justify-content: space-between; gap: 8px;">
|
||||
<button id="amily2_open_additional_features" class="menu_button wide_button"><i class="fas fa-landmark-dome"></i> 内阁密室</button>
|
||||
<button id="amily2_open_rag_palace" class="menu_button wide_button"><i class="fas fa-brain"></i> 翰林学院</button>
|
||||
<button id="amily2_open_memorisation_forms" class="menu_button wide_button"><i class="fas fa-table"></i> 内存储司</button>
|
||||
<button id="amily2_open_plot_optimization" class="menu_button wide_button"><i class="fas fa-feather-alt"></i> 剧情优化</button>
|
||||
<button id="amily2_open_character_world_book" class="menu_button wide_button"><i class="fa-solid fa-book-atlas"></i> 角色世界</button>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
@@ -115,10 +146,33 @@
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset class="settings-group">
|
||||
<legend><i class="fas fa-code-branch"></i> 版本信息</legend>
|
||||
<div class="version-info-container">
|
||||
<div class="version-info-item version-current">
|
||||
<div class="version-label">当前版本</div>
|
||||
<div id="amily2_current_version" class="version-number">加载中...</div>
|
||||
</div>
|
||||
<div class="version-info-item version-center" style="display: flex; flex-direction: column; align-items: center; gap: 5px;">
|
||||
<div style="position: relative;">
|
||||
<button id="amily2_update_button" class="menu_button small_button interactable" title="查看更新日志">
|
||||
<i class="fas fa-bell"></i>
|
||||
</button>
|
||||
<div id="amily2_update_indicator" class="update-indicator" style="display: none;"></div>
|
||||
</div>
|
||||
<button id="amily2_update_button_new" class="menu_button small_button interactable" title="查看更新日志">更新</button>
|
||||
</div>
|
||||
<div class="version-info-item version-latest">
|
||||
<div class="version-label">最新版本</div>
|
||||
<div id="amily2_latest_version" class="version-number">检查中...</div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<hr class="header-divider">
|
||||
|
||||
<fieldset class="settings-group">
|
||||
<legend><i class="fas fa-cogs"></i> 核心功能</legend>
|
||||
<legend><i class="fas fa-cogs"></i> 正文优化</legend>
|
||||
|
||||
|
||||
<div class="control-pair-container" style="justify-content: space-around;">
|
||||
|
||||
@@ -374,3 +374,57 @@
|
||||
gap: 12px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
/* Ngms API 按钮样式 - 水平扁平按钮 */
|
||||
.ngms-button-row {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
justify-content: center;
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
.ngms-button-row .menu_button {
|
||||
min-width: 120px;
|
||||
height: 35px;
|
||||
padding: 8px 16px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 6px;
|
||||
border-radius: 20px;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
transition: all 0.3s ease;
|
||||
text-transform: none;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.ngms-button-row .menu_button.primary {
|
||||
background: linear-gradient(135deg, #4CAF50, #45a049);
|
||||
border: 1px solid #388e3c;
|
||||
color: white;
|
||||
text-shadow: 0 1px 2px rgba(0,0,0,0.2);
|
||||
}
|
||||
|
||||
.ngms-button-row .menu_button.primary:hover {
|
||||
background: linear-gradient(135deg, #5CBF60, #4CAF50);
|
||||
box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.ngms-button-row .menu_button.secondary {
|
||||
background: linear-gradient(135deg, #2196F3, #1976D2);
|
||||
border: 1px solid #1565C0;
|
||||
color: white;
|
||||
text-shadow: 0 1px 2px rgba(0,0,0,0.2);
|
||||
}
|
||||
|
||||
.ngms-button-row .menu_button.secondary:hover {
|
||||
background: linear-gradient(135deg, #42A5F5, #2196F3);
|
||||
box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.ngms-button-row .menu_button i {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
@@ -308,28 +308,22 @@ hr { border: none; border-top: 1px solid rgba(255,255,255,0.1); margin: 0; }
|
||||
flex-grow: 1;
|
||||
gap: 15px;
|
||||
}
|
||||
|
||||
/* 左侧容器:垂直布局 */
|
||||
.header-left-panel {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 10px;
|
||||
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);
|
||||
width: auto; /* 自适应宽度 */
|
||||
}
|
||||
|
||||
|
||||
/* 翰林院按钮样式已移至新增扩展区域,使用统一按钮样式 */
|
||||
|
||||
/* 确保所有可切换面板表现一致 */
|
||||
#rag_palace_panel {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@@ -308,13 +308,13 @@
|
||||
}
|
||||
|
||||
|
||||
.prompt-editor-area {
|
||||
#amily2_memorisation_forms_panel.prompt-editor-area {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.editor-buttons-panel {
|
||||
#amily2_memorisation_forms_panel.editor-buttons-panel {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 8px;
|
||||
@@ -622,3 +622,43 @@ th.amily2-menu-open .amily2-header-text {
|
||||
border-color: rgba(120, 120, 120, 0.6) !important;
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
/* Nccs API 按钮行样式 */
|
||||
.nccs-button-row {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
.nccs-button-row .menu_button {
|
||||
min-width: 120px;
|
||||
height: 35px;
|
||||
border-radius: 20px;
|
||||
background: linear-gradient(45deg, rgba(74, 158, 255, 0.6), rgba(138, 114, 255, 0.6));
|
||||
border: 1px solid rgba(74, 158, 255, 0.8) !important;
|
||||
color: #fff !important;
|
||||
font-weight: bold;
|
||||
transition: all 0.3s ease;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 5px;
|
||||
}
|
||||
|
||||
.nccs-button-row .menu_button:hover {
|
||||
background: linear-gradient(45deg, rgba(74, 158, 255, 0.8), rgba(138, 114, 255, 0.8));
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 15px rgba(74, 158, 255, 0.4);
|
||||
}
|
||||
|
||||
.nccs-button-row .menu_button.secondary {
|
||||
background: linear-gradient(45deg, rgba(120, 120, 120, 0.6), rgba(160, 160, 160, 0.6));
|
||||
border: 1px solid rgba(120, 120, 120, 0.8) !important;
|
||||
}
|
||||
|
||||
.nccs-button-row .menu_button.secondary:hover {
|
||||
background: linear-gradient(45deg, rgba(120, 120, 120, 0.8), rgba(160, 160, 160, 0.8));
|
||||
box-shadow: 0 4px 15px rgba(120, 120, 120, 0.4);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user