Create amily2-glossary.html

This commit is contained in:
2025-10-12 16:05:35 +08:00
committed by GitHub
parent 33b85940d8
commit 4595cbd8b6

183
assets/amily2-glossary.html Normal file
View File

@@ -0,0 +1,183 @@
<div class="amily2-header">
<div class="additional-features-title">
<i class="fas fa-book"></i> 术语表 (Sybd 系统)
</div>
<button id="amily2_back_to_main_from_glossary" class="menu_button secondary small_button interactable">
返回主殿 <i class="fas fa-arrow-right"></i>
</button>
</div>
<hr class="header-divider">
<!-- 标签页导航 -->
<div class="glossary-tabs">
<button class="glossary-tab active" data-tab="api">
<i class="fas fa-bolt"></i> API 设置
</button>
<button class="glossary-tab" data-tab="novel-process">
<i class="fas fa-file-invoice"></i> 小说处理
</button>
<button class="glossary-tab" data-tab="prompts">
<i class="fas fa-edit"></i> 待开发
</button>
<button class="glossary-tab" data-tab="context">
<i class="fas fa-book-open"></i> 待开发
</button>
</div>
<!-- 标签页内容容器 -->
<div class="glossary-content-container">
<!-- API 设置面板 -->
<div id="glossary-content-api" class="glossary-content active">
<div class="settings-group">
<div class="legend"><i class="fas fa-satellite-dish"></i> Sybd API 调用系统</div>
<small class="notes" style="text-align: center; display: block; margin-bottom: 15px;">
独立的API调用系统可与主系统并行使用支持全兼容和SillyTavern预设两种模式。
</small>
<div class="amily2_settings_block">
<label for="amily2_sybd_enabled">启用Sybd API系统</label>
<label class="toggle-switch">
<input id="amily2_sybd_enabled" type="checkbox" data-setting-key="sybdEnabled" data-type="boolean" />
<span class="slider"></span>
</label>
</div>
<div class="amily2_settings_block amily2-content-hidden" id="amily2_sybd_content">
<div class="control-group">
<label for="amily2_sybd_api_mode">API调用模式</label>
<select id="amily2_sybd_api_mode" class="text_pole" data-setting-key="sybdApiMode" data-type="string">
<option value="openai_test">全兼容模式</option>
<option value="sillytavern_preset">SillyTavern预设模式</option>
</select>
</div>
<div id="amily2_sybd_config_panel" style="margin-top: 15px;">
<!-- 全兼容模式配置 -->
<div id="amily2_sybd_compatible_config">
<div class="control-group">
<label for="amily2_sybd_api_url">API地址</label>
<input type="text" id="amily2_sybd_api_url" class="text_pole" placeholder="https://api.openai.com/v1" data-setting-key="sybdApiUrl" data-type="string" />
</div>
<div class="control-group">
<label for="amily2_sybd_api_key">API密钥</label>
<input type="password" id="amily2_sybd_api_key" class="text_pole" placeholder="sk-..." data-setting-key="sybdApiKey" data-type="string" />
</div>
<div class="control-group">
<label for="amily2_sybd_model">模型:</label>
<div class="select-with-refresh">
<select id="amily2_sybd_model_select" class="text_pole" style="flex-grow: 1; display: none;">
<option value="">-- 请选择模型 --</option>
</select>
<input type="text" id="amily2_sybd_model" class="text_pole" placeholder="gpt-4" style="flex-grow: 1;" data-setting-key="sybdModel" data-type="string" />
</div>
</div>
</div>
<!-- SillyTavern预设模式配置 -->
<div id="amily2_sybd_preset_config" style="display: none;">
<div class="control-group">
<label for="amily2_sybd_tavern_profile">选择SillyTavern预设</label>
<select id="amily2_sybd_tavern_profile" class="text_pole" data-setting-key="sybdTavernProfile" data-type="string">
<option value="">-- 请选择预设 --</option>
</select>
</div>
</div>
<!-- 通用参数配置 -->
<div class="control-group">
<label for="amily2_sybd_max_tokens">最大令牌数:<span id="amily2_sybd_max_tokens_value">4000</span></label>
<input type="range" id="amily2_sybd_max_tokens" min="100" max="100000" step="100" value="4000" data-setting-key="sybdMaxTokens" data-type="integer" />
</div>
<div class="control-group">
<label for="amily2_sybd_temperature">温度:<span id="amily2_sybd_temperature_value">0.7</span></label>
<input type="range" id="amily2_sybd_temperature" min="0" max="2" step="0.1" value="0.7" data-setting-key="sybdTemperature" data-type="float" />
</div>
<!-- 测试按钮组 - 水平排列 -->
<div class="sybd-button-row" style="display: flex; gap: 10px; justify-content: center; margin-top: 15px;">
<button id="amily2_sybd_test_connection" class="menu_button primary small_button interactable">
<i class="fas fa-plug"></i> 测试连接
</button>
<button id="amily2_sybd_fetch_models" class="menu_button secondary small_button interactable" title="获取可用模型列表">
<i class="fas fa-download"></i> 获取模型
</button>
</div>
</div>
</div>
</div>
</div>
<!-- 提示词指令面板 -->
<div id="glossary-content-prompts" class="glossary-content">
<div class="settings-group">
<div class="legend"><i class="fas fa-edit"></i> 待开发</div>
<p style="text-align: center; margin-top: 20px;">待开发</p>
</div>
</div>
<!-- 上下文设置面板 -->
<div id="glossary-content-context" class="glossary-content">
<div class="settings-group">
<div class="legend"><i class="fas fa-book-open"></i> 待开发</div>
<p style="text-align: center; margin-top: 20px;">待开发</p>
</div>
</div>
<!-- 小说处理面板 -->
<div id="glossary-content-novel-process" class="glossary-content">
<div class="settings-group">
<div class="legend"><i class="fas fa-file-upload"></i> 小说文件处理流程</div>
<div class="control-group" style="display: flex; flex-direction: column; align-items: center; gap: 10px;">
<label for="novel-file-input" class="menu_button secondary small_button interactable" style="cursor: pointer;">
<i class="fas fa-upload"></i> 1. 上传小说文件 (.txt)
</label>
<input type="file" id="novel-file-input" accept=".txt" style="display: none;">
</div>
<div class="control-group">
<label for="novel-chapter-regex">2. 章节识别规则 (高级, 可选):</label>
<input type="text" id="novel-chapter-regex" class="text_pole" placeholder="默认支持: 第1章, 1. , Chapter 1, 序章等多种格式">
</div>
<div class="sybd-button-row" style="display: flex; gap: 10px; justify-content: center; margin-top: 15px;">
<button id="novel-recognize-chapters" class="menu_button secondary small_button interactable">
<i class="fas fa-search"></i> ① 识别章节
</button>
</div>
<hr class="header-divider" style="margin-top: 20px; margin-bottom: 20px;">
<div class="control-group">
<label>3. 章节预览 (共 <span id="novel-chapter-count">0</span> 章):</label>
<div id="novel-chapter-preview" style="height: 150px; overflow-y: auto; border: 1px solid #444; padding: 10px; background-color: #2e2e2e; border-radius: 5px;">
<small>请先上传文件并识别章节...</small>
</div>
</div>
<div class="control-group">
<label for="novel-batch-size">4. 每批处理章节数:</label>
<input type="number" id="novel-batch-size" class="text_pole" value="10" min="1">
</div>
<div class="amily2_settings_block" style="justify-content: center;">
<label for="novel-force-new">强制新建条目 (不更新现有条目)</label>
<label class="toggle-switch">
<input id="novel-force-new" type="checkbox" />
<span class="slider"></span>
</label>
</div>
<div class="sybd-button-row" style="display: flex; gap: 10px; justify-content: center; margin-top: 15px;">
<button id="novel-confirm-and-process" class="menu_button primary small_button interactable" disabled>
<i class="fas fa-play-circle"></i> ② 确认并开始处理
</button>
</div>
<div id="novel-process-status" style="text-align: center; margin-top: 20px; font-weight: bold;">
等待操作...
</div>
</div>
</div>
</div>