✨ (manage): 书源存数据库,远程管理网页支持导入、分页、有效性检查与启停

This commit is contained in:
garfield committed 2026-12-04 00:33:36 +08:00
1 parent 3a7cb92270
commit f0d737e68a
9 files changed
+1519

No files matched your search

@@ -0,0 +1,116 @@
<!DOCTYPE html>
<!-- Legado 书源管理页(moonsource_legadorule 经 web.routes 开放;外壳沿用订阅页;逻辑在 /legado_sources.js,接口 /api/legado_sources/*) -->
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">
<title>Legado 书源管理 - 远程管理</title>
<link rel="icon" href="/favicon.ico?v=2" sizes="16x16 32x32 48x48">
<link rel="apple-touch-icon" href="/apple-touch-icon.png?v=2">
<meta name="theme-color" content="#263a52">
<link rel="stylesheet" href="/style.css">
<link rel="stylesheet" href="/legado_sources.css">
<script>try{var t=localStorage.getItem('moon-theme');if(t==='light'||t==='dark')document.documentElement.setAttribute('data-theme',t);var l=localStorage.getItem('moon-lang');if(l&&!/^zh_CN/.test(l))document.documentElement.classList.add('i18n-wait')}catch(e){}</script>
</head>
<body class="file-page ls-page">
<header class="appbar"><div class="appbar-inner">
<a class="appbar-brand" href="/"><img src="/logo.jpg" alt="" width="28" height="28"><span>月读远程管理</span></a>
<nav class="appbar-nav" aria-label="页面导航"><a href="/"><svg viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true"><path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg><span>首页</span></a><a href="/file.html"><svg viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true"><path d="M10 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"/></svg><span>文件</span></a><a href="/input.html"><svg viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true"><path d="M20 5H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm-9 3h2v2h-2V8zm0 3h2v2h-2v-2zM8 8h2v2H8V8zm0 3h2v2H8v-2zm-1 2H5v-2h2v2zm0-3H5V8h2v2zm9 7H8v-2h8v2zm0-4h-2v-2h2v2zm0-3h-2V8h2v2zm3 3h-2v-2h2v2zm0-3h-2V8h2v2z"/></svg><span>输入</span></a><a href="/clipboard.html"><svg viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true"><path d="M19 3h-4.18C14.4 1.84 13.3 1 12 1S9.6 1.84 9.18 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm5 14H7v-2h10v2zm0-4H7v-2h10v2zm0-4H7V7h10v2z"/></svg><span>剪贴板</span></a><a href="/settings.html"><svg viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true"><path d="M19.14 12.94c.04-.31.06-.63.06-.94s-.02-.63-.06-.94l2.03-1.58a.49.49 0 0 0 .12-.61l-1.92-3.32a.49.49 0 0 0-.59-.22l-2.39.96a7.03 7.03 0 0 0-1.62-.94l-.36-2.54a.48.48 0 0 0-.48-.41h-3.84a.47.47 0 0 0-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96a.48.48 0 0 0-.59.22L2.74 8.87a.47.47 0 0 0 .12.61l2.03 1.58c-.04.31-.06.63-.06.94s.02.63.06.94l-2.03 1.58a.49.49 0 0 0-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32a.48.48 0 0 0-.12-.61l-2.01-1.58zM12 15.6a3.6 3.6 0 1 1 0-7.2 3.6 3.6 0 0 1 0 7.2z"/></svg><span>配置</span></a><a href="/update.html"><svg viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true"><path d="M5 20h14v-2H5v2zm0-10h4v6h6v-6h4l-7-7-7 7z"/></svg><span>更新</span></a></nav>
<button type="button" id="theme-toggle" class="icon-btn" aria-label="切换主题" title="主题:跟随系统"><svg viewBox="0 0 24 24" width="20" height="20" fill="currentColor" aria-hidden="true"><path d="M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm0 18V4a8 8 0 0 1 0 16z"/></svg></button>
</div></header>
<main class="file-main">
<div class="tab-strip sub-strip">
<div class="file-action-toolbar sub-toolbar" role="toolbar" aria-label="书源操作">
<div class="fa-group fa-left">
<label class="sub-search"><span class="visually-hidden">搜索书源</span><input id="q" type="search" placeholder="搜索名称或地址" autocomplete="off"></label>
</div>
<div class="fa-group fa-right">
<button type="button" id="check-all" class="file-action">检查有效性</button>
<button type="button" id="switch" class="file-action">书架换源</button>
<button type="button" id="add" class="file-action primary">添加书源</button>
</div>
</div>
</div>
<div id="batch" class="sub-batch" role="toolbar" aria-label="批量操作" hidden>
<span id="batch-count" class="count-badge"></span>
<button type="button" id="b-check" class="file-action">检查所选</button>
<button type="button" id="b-on" class="file-action">启用</button>
<button type="button" id="b-off" class="file-action">禁用</button>
<button type="button" id="b-delete" class="file-action danger-text">删除</button>
<button type="button" id="b-clear" class="file-action">取消选择</button>
</div>
<div id="progress" class="ls-progress" role="status" hidden><span id="pr-text"></span><div class="ls-track" role="progressbar" aria-valuemin="0" aria-valuemax="100"><div id="pr-fill" class="ls-fill"></div></div></div>
<div class="explorer-shell">
<aside class="explorer-sidebar sub-sidebar" aria-label="状态">
<div class="sidebar-title">状态</div>
<div id="groups" class="quick-list sub-groups"></div>
<div class="sidebar-credit">月读 · Ankio · <a href="https://ankio.net" target="_blank" rel="noopener noreferrer">ankio.net</a></div>
</aside>
<section class="explorer-content" aria-labelledby="list-title">
<h1 id="list-title" class="visually-hidden">书源列表</h1>
<div class="table-wrap" id="listwrap">
<table class="sub-list">
<thead><tr><th class="sel"><input type="checkbox" id="pick-all" aria-label="全选"></th><th></th><th>书源</th><th>状态</th><th></th></tr></thead>
<tbody id="list"><tr><td class="empty" colspan="5">正在加载…</td></tr></tbody>
</table>
</div>
<div id="pager" class="ls-pager" hidden>
<button type="button" id="pg-prev" class="file-action">上一页</button>
<span id="pg-info" class="ls-pginfo"></span>
<button type="button" id="pg-next" class="file-action">下一页</button>
</div>
</section>
</div>
</main>
<div id="toasts" class="sub-toasts" aria-live="polite"></div>
<div id="ov" class="overlay" hidden>
<div id="dlg" class="dialog" role="dialog" aria-modal="true" aria-labelledby="dt">
<h2 id="dt"></h2>
<p id="dm"></p>
<div class="btns">
<button type="button" id="dc">取消</button>
<button type="button" id="dk" class="primary">确定</button>
</div>
</div>
</div>
<div id="add-dlg" class="overlay up-overlay" hidden>
<form id="add-form" class="dialog sub-dialog" role="dialog" aria-modal="true" aria-labelledby="ad-title">
<h2 id="ad-title">添加书源</h2>
<div id="ad-kinds" class="sub-kinds" role="radiogroup" aria-label="添加方式">
<label class="opt"><input type="radio" name="kind" value="once" checked><span><strong>在线地址</strong><small>单个 JSON、数组或合集,只下载一次</small></span></label>
<label class="opt"><input type="radio" name="kind" value="text"><span><strong>粘贴 JSON</strong><small>单个、数组或每行一个</small></span></label>
<label class="opt"><input type="radio" name="kind" value="file"><span><strong>本地文件</strong><small>.json / .jsonl / .txt</small></span></label>
</div>
<div class="field" id="ad-url-row"><label for="ad-url">地址</label><input id="ad-url" type="url" placeholder="https://" spellcheck="false"></div>
<div class="field" id="ad-text-row" hidden><label for="ad-text">书源 JSON</label><textarea id="ad-text" rows="8" spellcheck="false" placeholder="粘贴书源 JSON…"></textarea></div>
<div class="field" id="ad-file-row" hidden><label for="ad-file">文件</label><input id="ad-file" type="file" accept=".json,.jsonl,.txt,application/json"></div>
<div id="ad-state" class="state" role="status"></div>
<div class="btns">
<button type="button" id="ad-cancel">取消</button>
<button type="submit" id="ad-ok" class="primary">添加</button>
</div>
</form>
</div>
<div id="sw-dlg" class="overlay up-overlay" hidden>
<div class="dialog sub-dialog" role="dialog" aria-modal="true" aria-labelledby="sw-title">
<h2 id="sw-title">书架换源</h2>
<p id="sw-hint" class="sw-hint">书的进度和阅读时间不变,只改从哪个书源读取。来源已失效的书排在前面。</p>
<div id="sw-progress" class="ls-progress" role="status" hidden><span id="sw-text"></span><div class="ls-track"><div id="sw-fill" class="ls-fill"></div></div></div>
<ul id="sw-list" class="sw-list"></ul>
<div class="btns">
<button type="button" id="sw-back" hidden>返回书架</button>
<button type="button" id="sw-close">关闭</button>
</div>
</div>
</div>
<script src="/js.js"></script>
<script src="/legado_sources.js"></script>
</body>
</html>