feat: add software download center

This commit is contained in:
lwt
2026-06-08 20:53:14 +08:00
parent aa29e4e462
commit c8cfe68361
18 changed files with 3738 additions and 0 deletions
+137
View File
@@ -0,0 +1,137 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="robots" content="noindex" />
<meta name="theme-color" content="#edf5ff" />
<title>sumi.work - 软件管理</title>
<link rel="stylesheet" href="../assets/css/software.css?v=20260608-1" />
</head>
<body>
<header class="soft-topbar">
<div class="soft-topbar-inner">
<a class="soft-brand" href="../software.html" aria-label="返回软件下载">
<img src="../assets/icons/software.svg" alt="" aria-hidden="true" />
<span>软件管理</span>
</a>
<nav class="soft-nav" aria-label="软件管理导航">
<a href="../index.html">首页</a>
<a href="../software.html">软件下载</a>
<a class="is-active" href="software.html">管理后台</a>
</nav>
</div>
</header>
<main class="admin-shell">
<section class="admin-panel" aria-labelledby="token-title">
<h1 id="token-title">管理令牌</h1>
<p class="admin-note">令牌通过请求头发送到服务端,用于新增、上传和更新软件。</p>
<div class="token-row">
<input id="admin-token" type="password" autocomplete="current-password" placeholder="输入 ADMIN_TOKEN" />
<button class="primary-action" type="button" id="save-token">保存</button>
</div>
<p class="status-message" id="token-status"></p>
</section>
<div class="admin-layout">
<section class="admin-panel" aria-labelledby="form-title">
<h2 id="form-title">新增软件</h2>
<form id="software-form">
<input type="hidden" name="id" id="software-id" />
<div class="field-grid">
<div class="field">
<label for="name">软件名称</label>
<input id="name" name="name" required maxlength="80" />
</div>
<div class="field">
<label for="version">版本号</label>
<input id="version" name="version" required maxlength="40" placeholder="1.0.0" />
</div>
<div class="field">
<label for="category">分类</label>
<select id="category" name="category">
<option value="office">办公效率</option>
<option value="dev">开发工具</option>
<option value="media">影音娱乐</option>
<option value="security">安全系统</option>
<option value="network">网络工具</option>
<option value="tools">系统工具</option>
</select>
</div>
<div class="field">
<label for="platform">平台</label>
<input id="platform" name="platform" maxlength="60" value="Windows" />
</div>
<div class="field">
<label for="publisher">发布者</label>
<input id="publisher" name="publisher" maxlength="80" value="sumi.work" />
</div>
<div class="field">
<label for="homepage">官网</label>
<input id="homepage" name="homepage" type="url" placeholder="https://example.com" />
</div>
<div class="field full">
<label for="description">软件简介</label>
<textarea id="description" name="description" maxlength="240" required></textarea>
</div>
<div class="field full">
<label for="changelog">更新记录</label>
<textarea id="changelog" name="changelog" maxlength="1000"></textarea>
</div>
<div class="field">
<label for="tags">标签</label>
<input id="tags" name="tags" placeholder="官方, 推荐" />
</div>
<div class="field">
<label for="sort">排序</label>
<input id="sort" name="sort" type="number" value="100" />
</div>
<div class="field full">
<label for="download-url">外部下载地址</label>
<input id="download-url" name="downloadUrl" type="url" placeholder="上传安装包时可留空" />
</div>
<div class="field">
<label for="icon">软件图标</label>
<input id="icon" name="icon" type="file" accept="image/*" />
</div>
<div class="field">
<label for="package">安装包</label>
<input id="package" name="package" type="file" />
</div>
</div>
<div class="checkbox-row">
<label class="checkbox-field"><input name="active" type="checkbox" checked /> 前台显示</label>
<label class="checkbox-field"><input name="featured" type="checkbox" /> 精选推荐</label>
</div>
<p class="form-hint">更新软件时只选择新的安装包即可替换下载文件;不选择文件会保留原安装包。</p>
<div class="form-actions">
<button class="primary-action" type="submit" id="submit-button">保存软件</button>
<button class="secondary-action" type="button" id="reset-form">清空</button>
</div>
<p class="status-message" id="form-status"></p>
</form>
</section>
<section class="admin-panel" aria-labelledby="list-title">
<div class="section-title-row">
<div>
<h2 id="list-title">软件列表</h2>
<p id="admin-summary">正在加载...</p>
</div>
<button class="text-button" type="button" id="reload-admin">
<svg aria-hidden="true" viewBox="0 0 24 24">
<path d="M20 12a8 8 0 1 1-2.3-5.7"></path>
<path d="M20 4v6h-6"></path>
</svg>
刷新
</button>
</div>
<div class="admin-list" id="admin-list"></div>
</section>
</div>
</main>
<script src="../assets/js/software-admin.js?v=20260608-1"></script>
</body>
</html>