generated from dellevin/template
11111
This commit is contained in:
@@ -125,6 +125,73 @@
|
||||
.sidebar-search-input input::placeholder { color: #bbb; }
|
||||
.nav-item.hidden { display: none; }
|
||||
|
||||
/* 侧边栏底部设置按钮 */
|
||||
.sidebar-footer {
|
||||
margin-top: auto; padding: 12px 16px 8px;
|
||||
border-top: 1px solid #e0e0e0;
|
||||
}
|
||||
.sidebar-settings-btn {
|
||||
display: flex; align-items: center; gap: 8px;
|
||||
width: 100%; padding: 8px 10px; border: none; background: none;
|
||||
border-radius: 8px; cursor: pointer; font-size: 13px; color: #999;
|
||||
transition: all 0.15s;
|
||||
}
|
||||
.sidebar-settings-btn:hover { background: #f0f0f0; color: #666; }
|
||||
.sidebar-settings-btn i { width: 20px; text-align: center; }
|
||||
|
||||
/* 功能设置弹窗 */
|
||||
.feat-modal-overlay {
|
||||
display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
|
||||
background: rgba(0,0,0,0.35); z-index: 1000;
|
||||
justify-content: center; align-items: flex-start; padding-top: 60px;
|
||||
}
|
||||
.feat-modal-overlay.show { display: flex; }
|
||||
.feat-modal {
|
||||
background: #fff; border-radius: 12px; width: 380px; max-height: 70vh;
|
||||
box-shadow: 0 12px 40px rgba(0,0,0,0.2); overflow: hidden;
|
||||
display: flex; flex-direction: column;
|
||||
}
|
||||
.feat-modal-header {
|
||||
padding: 14px 18px; border-bottom: 1px solid #eee;
|
||||
display: flex; align-items: center; justify-content: space-between;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.feat-modal-header h3 { font-size: 14px; font-weight: 600; color: #333; }
|
||||
.feat-modal-close {
|
||||
width: 26px; height: 26px; border: none; background: #f5f5f5;
|
||||
border-radius: 6px; cursor: pointer; font-size: 13px; color: #999;
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
}
|
||||
.feat-modal-close:hover { background: #eee; color: #333; }
|
||||
.feat-modal-body {
|
||||
padding: 12px 18px; overflow-y: auto; flex: 1;
|
||||
}
|
||||
.feat-group-title {
|
||||
font-size: 11px; font-weight: 600; color: #999; text-transform: uppercase;
|
||||
letter-spacing: 0.05em; margin: 12px 0 6px;
|
||||
}
|
||||
.feat-group-title:first-child { margin-top: 0; }
|
||||
.feat-item {
|
||||
display: flex; align-items: center; gap: 8px; padding: 7px 0;
|
||||
font-size: 13px; color: #333; cursor: pointer;
|
||||
}
|
||||
.feat-item input[type="checkbox"] {
|
||||
width: 16px; height: 16px; accent-color: #0078d4; cursor: pointer;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.feat-modal-footer {
|
||||
padding: 10px 18px; border-top: 1px solid #eee;
|
||||
display: flex; justify-content: flex-end; gap: 8px; flex-shrink: 0;
|
||||
}
|
||||
.feat-modal-footer button {
|
||||
padding: 6px 16px; font-size: 12px; font-weight: 600;
|
||||
border-radius: 6px; cursor: pointer; transition: all 0.15s;
|
||||
}
|
||||
.feat-btn-cancel { border: 1px solid #e0e0e0; background: #fff; color: #666; }
|
||||
.feat-btn-cancel:hover { background: #f5f5f5; color: #333; }
|
||||
.feat-btn-save { border: none; background: #0078d4; color: #fff; }
|
||||
.feat-btn-save:hover { background: #006cbd; }
|
||||
|
||||
/* 主内容区 */
|
||||
.main {
|
||||
flex: 1;
|
||||
@@ -424,18 +491,68 @@
|
||||
.status-badge.s4xx { background: #fff3e0; color: #e65100; }
|
||||
.status-badge.s5xx { background: #fce4ec; color: #c62828; }
|
||||
|
||||
/* 汉堡按钮 */
|
||||
.hamburger {
|
||||
display: none;
|
||||
width: 36px; height: 36px;
|
||||
background: none; border: none; cursor: pointer;
|
||||
font-size: 18px; color: #333;
|
||||
align-items: center; justify-content: center;
|
||||
border-radius: 6px; transition: background 0.15s;
|
||||
}
|
||||
.hamburger:hover { background: #f0f0f0; }
|
||||
|
||||
/* 侧边栏遮罩 */
|
||||
.sidebar-overlay {
|
||||
display: none;
|
||||
position: fixed; top: 0; left: 0; right: 0; bottom: 0;
|
||||
background: rgba(0,0,0,0.3); z-index: 999;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.hamburger { display: flex; }
|
||||
|
||||
.sidebar {
|
||||
display: none;
|
||||
z-index: 1000;
|
||||
transform: translateX(-100%);
|
||||
transition: transform 0.25s ease;
|
||||
}
|
||||
.sidebar.open {
|
||||
transform: translateX(0);
|
||||
}
|
||||
.sidebar-overlay.open { display: block; }
|
||||
|
||||
.main {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.stat-cards {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.stat-card {
|
||||
min-width: calc(50% - 8px);
|
||||
flex: 1 1 calc(50% - 8px);
|
||||
}
|
||||
|
||||
.chart-row {
|
||||
flex-direction: column;
|
||||
}
|
||||
.chart-row .chart-section {
|
||||
min-width: 0;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
.chart-row .chart-section:last-child { margin-bottom: 0; }
|
||||
|
||||
.pie-chart-wrap { flex-direction: column; height: auto; }
|
||||
.pie-legend { width: 100%; max-height: 120px; flex-direction: row; flex-wrap: wrap; }
|
||||
|
||||
.data-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 侧边栏遮罩 -->
|
||||
<div class="sidebar-overlay" id="sidebar-overlay" onclick="closeSidebar()"></div>
|
||||
<!-- 侧边栏 -->
|
||||
<aside class="sidebar">
|
||||
<div class="sidebar-header">
|
||||
@@ -452,11 +569,11 @@
|
||||
|
||||
<nav class="nav-section">
|
||||
<div class="nav-section-title">概览</div>
|
||||
<a class="nav-item active" id="nav-dashboard" onclick="showDashboard()">
|
||||
<a class="nav-item active" id="nav-dashboard" data-feature="dashboard" onclick="showDashboard()">
|
||||
<i class="fas fa-chart-bar"></i>
|
||||
仪表盘
|
||||
</a>
|
||||
<a class="nav-item" data-url="/data-manage" onclick="loadTool(this, '/data-manage')">
|
||||
<a class="nav-item" data-url="/data-manage" data-feature="data-manage" onclick="loadTool(this, '/data-manage')">
|
||||
<i class="fas fa-database"></i>
|
||||
数据管理
|
||||
</a>
|
||||
@@ -465,79 +582,110 @@
|
||||
<nav class="nav-section">
|
||||
<div class="nav-section-title">工具</div>
|
||||
|
||||
<a class="nav-item" data-url="/pin-tu" onclick="loadTool(this, '/pin-tu')">
|
||||
<a class="nav-item" data-url="/pin-tu" data-feature="pin-tu" onclick="loadTool(this, '/pin-tu')">
|
||||
<i class="fas fa-images"></i>
|
||||
路径文件查阅器
|
||||
</a>
|
||||
<a class="nav-item" data-url="/down-video" onclick="loadTool(this, '/down-video')">
|
||||
<a class="nav-item" data-url="/down-video" data-feature="down-video" onclick="loadTool(this, '/down-video')">
|
||||
<i class="fas fa-video"></i>
|
||||
XBIY视频下载器
|
||||
</a>
|
||||
<a class="nav-item" data-url="/content-tag" onclick="loadTool(this, '/content-tag')">
|
||||
<a class="nav-item" data-url="/content-tag" data-feature="content-tag" onclick="loadTool(this, '/content-tag')">
|
||||
<i class="fas fa-tags"></i>
|
||||
AI生成文章标签
|
||||
</a>
|
||||
<a class="nav-item" data-url="/stt" onclick="loadTool(this, '/stt')">
|
||||
<a class="nav-item" data-url="/audio-slicer" data-feature="audio-slicer" onclick="loadTool(this, '/audio-slicer')">
|
||||
<i class="fas fa-scissors"></i>
|
||||
AS 音频分割
|
||||
</a>
|
||||
<a class="nav-item" data-url="/stt" data-feature="stt" onclick="loadTool(this, '/stt')">
|
||||
<i class="fas fa-microphone"></i>
|
||||
STT 语音转文字
|
||||
</a>
|
||||
<a class="nav-item" data-url="/rvc" onclick="loadTool(this, '/rvc')">
|
||||
<i class="fas fa-microphone"></i>
|
||||
RVC 语音音色变换
|
||||
<a class="nav-item" data-url="/uvr-sep" data-feature="uvr-sep" onclick="loadTool(this, '/uvr-sep')">
|
||||
<i class="fas fa-exchange-alt"></i>
|
||||
UVR 人声分离
|
||||
</a>
|
||||
<a class="nav-item" data-url="/ai-dubbing" onclick="loadTool(this, '/ai-dubbing')">
|
||||
<a class="nav-item" data-url="/rvc" data-feature="rvc" onclick="loadTool(this, '/rvc')">
|
||||
<i class="fas fa-microphone"></i>
|
||||
RVC 音色转换
|
||||
</a>
|
||||
<a class="nav-item" data-url="/ai-dubbing" data-feature="ai-dubbing" onclick="loadTool(this, '/ai-dubbing')">
|
||||
<i class="fas fa-microphone"></i>
|
||||
GPT-SoVITS (引擎版)
|
||||
</a>
|
||||
|
||||
<a class="nav-item" data-url="/fen-ci" onclick="loadTool(this, '/fen-ci')">
|
||||
|
||||
<a class="nav-item" data-url="/sovits-tts" data-feature="sovits-tts" onclick="loadTool(this, '/sovits-tts')">
|
||||
<i class="fas fa-microphone"></i>
|
||||
GPT-SoVITS (接口版)
|
||||
</a>
|
||||
<a class="nav-item" data-url="/fen-ci" data-feature="fen-ci" onclick="loadTool(this, '/fen-ci')">
|
||||
<i class="fas fa-scissors"></i>
|
||||
Jieba 分词网页版
|
||||
</a>
|
||||
<a class="nav-item" data-url="/base64-de-in-code" onclick="loadTool(this, '/base64-de-in-code')">
|
||||
<a class="nav-item" data-url="/base64-de-in-code" data-feature="base64" onclick="loadTool(this, '/base64-de-in-code')">
|
||||
<i class="fas fa-lock"></i>
|
||||
Base64 编码/解码
|
||||
</a>
|
||||
<a class="nav-item" data-url="/json-format" onclick="loadTool(this, '/json-format')">
|
||||
<a class="nav-item" data-url="/json-format" data-feature="json-format" onclick="loadTool(this, '/json-format')">
|
||||
<i class="fas fa-code"></i>
|
||||
JSON 美化/压缩
|
||||
</a>
|
||||
|
||||
<a class="nav-item" data-url="/http-status" onclick="loadTool(this, '/http-status')">
|
||||
<a class="nav-item" data-url="/http-status" data-feature="http-status" onclick="loadTool(this, '/http-status')">
|
||||
<i class="fas fa-info-circle"></i>
|
||||
HTTP 状态码查询
|
||||
</a>
|
||||
<a class="nav-item" data-url="/url-parser" onclick="loadTool(this, '/url-parser')">
|
||||
<a class="nav-item" data-url="/url-parser" data-feature="url-parser" onclick="loadTool(this, '/url-parser')">
|
||||
<i class="fas fa-link"></i>
|
||||
URL 路径解析器
|
||||
</a>
|
||||
<a class="nav-item" data-url="/chmod-calc" onclick="loadTool(this, '/chmod-calc')">
|
||||
<a class="nav-item" data-url="/chmod-calc" data-feature="chmod-calc" onclick="loadTool(this, '/chmod-calc')">
|
||||
<i class="fas fa-key"></i>
|
||||
Chmod 计算器
|
||||
</a>
|
||||
<a class="nav-item" data-url="/token-gen" onclick="loadTool(this, '/token-gen')">
|
||||
<a class="nav-item" data-url="/token-gen" data-feature="token-gen" onclick="loadTool(this, '/token-gen')">
|
||||
<i class="fas fa-lock"></i>
|
||||
Token 随机生成器
|
||||
</a>
|
||||
<a class="nav-item" data-url="/qr-code" onclick="loadTool(this, '/qr-code')">
|
||||
<a class="nav-item" data-url="/qr-code" data-feature="qr-code" onclick="loadTool(this, '/qr-code')">
|
||||
<i class="fas fa-qrcode"></i>
|
||||
Qr-code 生成器
|
||||
</a>
|
||||
|
||||
<div class="nav-section-title" style="margin-top: 20px">不常用</div>
|
||||
<a class="nav-item" data-url="/sovits-tts" onclick="loadTool(this, '/sovits-tts')">
|
||||
<i class="fas fa-microphone"></i>
|
||||
GPT-SoVITS (接口版)
|
||||
</a>
|
||||
|
||||
</nav>
|
||||
|
||||
<div class="sidebar-footer">
|
||||
<button class="sidebar-settings-btn" onclick="openFeatModal()">
|
||||
<i class="fas fa-eye"></i> 功能显示设置
|
||||
</button>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<!-- 功能显示设置弹窗 -->
|
||||
<div class="feat-modal-overlay" id="featModalOverlay" onclick="closeFeatModal(event)">
|
||||
<div class="feat-modal" onclick="event.stopPropagation()">
|
||||
<div class="feat-modal-header">
|
||||
<h3><i class="fas fa-eye" style="margin-right:6px;color:#999;"></i>功能显示设置</h3>
|
||||
<button class="feat-modal-close" onclick="closeFeatModal()"><i class="fas fa-times"></i></button>
|
||||
</div>
|
||||
<div class="feat-modal-body" id="featModalBody"></div>
|
||||
<div class="feat-modal-footer">
|
||||
<button class="feat-btn-cancel" onclick="closeFeatModal()">取消</button>
|
||||
<button class="feat-btn-save" onclick="saveFeatSettings()">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 主内容区 -->
|
||||
<main class="main">
|
||||
<!-- 顶部导航 -->
|
||||
<header class="topbar">
|
||||
<div class="topbar-title" id="topbar-title">
|
||||
<button class="hamburger" id="hamburger" onclick="toggleSidebar()">
|
||||
<i class="fas fa-list"></i>
|
||||
</button>
|
||||
<button class="back-btn" id="back-btn" onclick="goBack()">
|
||||
<i class="fas fa-arrow-left"></i>
|
||||
返回
|
||||
@@ -688,6 +836,7 @@
|
||||
<i class="fas fa-list"></i> 最近调用记录
|
||||
</div>
|
||||
<div class="chart-body" style="max-height:300px; overflow-y:auto;">
|
||||
<div class="data-table-wrap">
|
||||
<table class="data-table" id="recent-table">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -699,6 +848,7 @@
|
||||
</thead>
|
||||
<tbody id="recent-tbody"></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -712,12 +862,23 @@
|
||||
const dashboardHTML = document.getElementById('dashboard').outerHTML;
|
||||
let charts = {};
|
||||
|
||||
// 侧边栏 移动端开关
|
||||
function toggleSidebar() {
|
||||
document.querySelector('.sidebar').classList.toggle('open');
|
||||
document.getElementById('sidebar-overlay').classList.toggle('open');
|
||||
}
|
||||
function closeSidebar() {
|
||||
document.querySelector('.sidebar').classList.remove('open');
|
||||
document.getElementById('sidebar-overlay').classList.remove('open');
|
||||
}
|
||||
|
||||
function disposeCharts() {
|
||||
Object.values(charts).forEach(c => c && c.dispose());
|
||||
charts = {};
|
||||
}
|
||||
|
||||
function showDashboard() {
|
||||
closeSidebar();
|
||||
document.querySelectorAll('.nav-item').forEach(item => item.classList.remove('active'));
|
||||
document.getElementById('nav-dashboard').classList.add('active');
|
||||
document.getElementById('title-text').textContent = '仪表盘';
|
||||
@@ -732,6 +893,7 @@
|
||||
}
|
||||
|
||||
function loadTool(element, url) {
|
||||
closeSidebar();
|
||||
disposeCharts();
|
||||
document.querySelectorAll('.nav-item').forEach(item => item.classList.remove('active'));
|
||||
element.classList.add('active');
|
||||
@@ -1180,6 +1342,87 @@
|
||||
Object.values(charts).forEach(c => c && c.resize());
|
||||
});
|
||||
|
||||
// ===== 功能显示设置 =====
|
||||
var FEATURES = [
|
||||
{ id: 'dashboard', name: '仪表盘', section: '概览' },
|
||||
{ id: 'data-manage', name: '数据管理', section: '概览' },
|
||||
{ id: 'pin-tu', name: '路径文件查阅器', section: '工具' },
|
||||
{ id: 'down-video', name: 'XBIY视频下载器', section: '工具' },
|
||||
{ id: 'content-tag', name: 'AI生成文章标签', section: '工具' },
|
||||
{ id: 'stt', name: 'STT 语音转文字', section: '工具' },
|
||||
{ id: 'audio-slicer', name: 'AudioSlicer 音频分割', section: '工具' },
|
||||
{ id: 'uvr-sep', name: 'UVR 人声分离', section: '工具' },
|
||||
{ id: 'ai-dubbing', name: 'GPT-SoVITS (引擎版)', section: '工具' },
|
||||
{ id: 'rvc', name: 'RVC 语音音色转换', section: '工具' },
|
||||
{ id: 'fen-ci', name: 'Jieba 分词网页版', section: '工具' },
|
||||
{ id: 'base64', name: 'Base64 编码/解码', section: '工具' },
|
||||
{ id: 'json-format', name: 'JSON 美化/压缩', section: '工具' },
|
||||
{ id: 'http-status', name: 'HTTP 状态码查询', section: '工具' },
|
||||
{ id: 'url-parser', name: 'URL 路径解析器', section: '工具' },
|
||||
{ id: 'chmod-calc', name: 'Chmod 计算器', section: '工具' },
|
||||
{ id: 'token-gen', name: 'Token 随机生成器', section: '工具' },
|
||||
{ id: 'qr-code', name: 'Qr-code 生成器', section: '工具' },
|
||||
{ id: 'sovits-tts', name: 'GPT-SoVITS (接口版)', section: '不常用' }
|
||||
];
|
||||
|
||||
function getHiddenFeatures() {
|
||||
try { return JSON.parse(localStorage.getItem('hidden_features') || '[]'); } catch(e) { return []; }
|
||||
}
|
||||
|
||||
function applyFeatSettings() {
|
||||
var hidden = getHiddenFeatures();
|
||||
document.querySelectorAll('.nav-item[data-feature]').forEach(function(item) {
|
||||
var fid = item.getAttribute('data-feature');
|
||||
item.style.display = hidden.indexOf(fid) !== -1 ? 'none' : '';
|
||||
});
|
||||
// 隐藏空的 section-title
|
||||
document.querySelectorAll('.nav-section').forEach(function(section) {
|
||||
var hasVisible = false;
|
||||
section.querySelectorAll('.nav-item[data-feature]').forEach(function(item) {
|
||||
if (item.style.display !== 'none') hasVisible = true;
|
||||
});
|
||||
var title = section.querySelector('.nav-section-title');
|
||||
if (title && title.textContent.trim() !== '概览') {
|
||||
title.style.display = hasVisible ? '' : 'none';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function openFeatModal() {
|
||||
var hidden = getHiddenFeatures();
|
||||
var body = document.getElementById('featModalBody');
|
||||
var html = '';
|
||||
var currentSection = '';
|
||||
FEATURES.forEach(function(f) {
|
||||
if (f.section !== currentSection) {
|
||||
currentSection = f.section;
|
||||
html += '<div class="feat-group-title">' + currentSection + '</div>';
|
||||
}
|
||||
var checked = hidden.indexOf(f.id) === -1 ? 'checked' : '';
|
||||
html += '<label class="feat-item"><input type="checkbox" data-feature-id="' + f.id + '" ' + checked + '><span>' + f.name + '</span></label>';
|
||||
});
|
||||
body.innerHTML = html;
|
||||
document.getElementById('featModalOverlay').classList.add('show');
|
||||
}
|
||||
|
||||
function closeFeatModal(e) {
|
||||
if (e && e.target !== document.getElementById('featModalOverlay')) return;
|
||||
document.getElementById('featModalOverlay').classList.remove('show');
|
||||
}
|
||||
|
||||
function saveFeatSettings() {
|
||||
var hidden = [];
|
||||
document.querySelectorAll('#featModalBody input[type="checkbox"]').forEach(function(cb) {
|
||||
if (!cb.checked) hidden.push(cb.getAttribute('data-feature-id'));
|
||||
});
|
||||
localStorage.setItem('hidden_features', JSON.stringify(hidden));
|
||||
applyFeatSettings();
|
||||
document.getElementById('featModalOverlay').classList.remove('show');
|
||||
}
|
||||
|
||||
// 页面加载时应用功能显示设置
|
||||
applyFeatSettings();
|
||||
|
||||
loadDashboard();
|
||||
</script>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user