gitlink-cli/doc/dashboard.html

430 lines
21 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>gitlink-cli · 功能全景</title>
<style>
:root {
--bg: #0d1117;
--bg-card: #161b22;
--bg-card-hover: #1c2129;
--bg-input: #0d1117;
--border: #30363d;
--text: #e6edf3;
--text-dim: #8b949e;
--text-muted: #6e7681;
--blue: #58a6ff;
--green: #3fb950;
--orange: #d2991d;
--red: #f85149;
--purple: #a371f7;
--cyan: #39c5cf;
--accent: #1f6feb;
--accent-subtle: #1f6feb22;
--radius: 8px;
--radius-sm: 6px;
--font-mono: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
background: var(--bg);
color: var(--text);
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans SC', sans-serif;
line-height: 1.6;
min-height: 100vh;
}
/* ── Header ── */
.header {
background: var(--bg-card);
border-bottom: 1px solid var(--border);
padding: 28px 32px 20px;
position: sticky; top: 0; z-index: 100;
backdrop-filter: blur(12px);
}
.header-inner { max-width: 1200px; margin: 0 auto; }
.header h1 {
font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em;
display: flex; align-items: center; gap: 10px;
}
.header h1 .logo {
width: 36px; height: 36px;
background: linear-gradient(135deg, var(--accent), var(--purple));
border-radius: 8px; display: flex; align-items: center; justify-content: center;
font-size: 1.2rem;
}
.stats { display: flex; gap: 24px; margin-top: 14px; flex-wrap: wrap; }
.stat { display: flex; align-items: baseline; gap: 6px; }
.stat .num { font-size: 1.5rem; font-weight: 700; color: var(--blue); }
.stat .label { font-size: 0.85rem; color: var(--text-dim); }
/* ── Search ── */
.search-wrap {
margin-top: 18px; position: relative; max-width: 600px;
}
.search-wrap input {
width: 100%; padding: 10px 14px 10px 40px;
background: var(--bg-input); border: 1px solid var(--border);
border-radius: var(--radius); color: var(--text);
font-size: 0.95rem; outline: none; transition: border-color 0.2s;
}
.search-wrap input:focus { border-color: var(--accent); }
.search-wrap .search-icon {
position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
color: var(--text-muted); font-size: 1.1rem; pointer-events: none;
}
/* ── Main Grid ── */
.container { max-width: 1200px; margin: 24px auto; padding: 0 32px 60px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
/* ── Category Card ── */
.card {
background: var(--bg-card); border: 1px solid var(--border);
border-radius: var(--radius); overflow: hidden;
transition: border-color 0.2s, box-shadow 0.2s;
}
.card:hover { border-color: #484f58; }
.card-header {
display: flex; align-items: center; gap: 10px;
padding: 14px 18px; cursor: pointer; user-select: none;
transition: background 0.15s;
}
.card-header:hover { background: var(--bg-card-hover); }
.card-icon { font-size: 1.3rem; width: 28px; text-align: center; flex-shrink: 0; }
.card-title { font-weight: 600; font-size: 0.95rem; flex: 1; }
.card-count {
font-size: 0.78rem; color: var(--text-dim);
background: var(--accent-subtle); padding: 2px 10px;
border-radius: 10px; font-weight: 500;
}
.card-chevron {
color: var(--text-muted); font-size: 0.75rem;
transition: transform 0.25s; flex-shrink: 0;
}
.card.open .card-chevron { transform: rotate(180deg); }
.card-body { display: none; }
.card.open .card-body { display: block; }
/* ── Shortcut Row ── */
.shortcut {
display: flex; align-items: flex-start; gap: 10px;
padding: 10px 18px; border-top: 1px solid var(--border);
cursor: pointer; transition: background 0.12s;
flex-wrap: wrap;
}
.shortcut:hover { background: var(--bg-card-hover); }
.shortcut .cmd {
font-family: var(--font-mono); font-size: 0.84rem;
color: var(--blue); white-space: nowrap; font-weight: 500;
min-width: 130px;
}
.shortcut .badge {
font-size: 0.68rem; padding: 1px 8px; border-radius: 10px;
font-weight: 600; white-space: nowrap; flex-shrink: 0;
margin-top: 1px;
}
.badge-auth { background: #1f4620; color: var(--green); }
.badge-public { background: #1a2d4a; color: var(--blue); }
.shortcut .desc {
font-size: 0.82rem; color: var(--text-dim); flex: 1; min-width: 120px;
}
.shortcut .example { display: none; width: 100%; margin-top: 6px; }
.shortcut.expanded .example { display: block; }
.example code {
display: block; background: #0d1117; padding: 8px 14px;
border-radius: var(--radius-sm); font-family: var(--font-mono);
font-size: 0.78rem; color: var(--cyan); border: 1px solid var(--border);
overflow-x: auto; white-space: pre-wrap; word-break: break-all;
}
/* ── Empty State ── */
.empty { text-align: center; padding: 60px 20px; color: var(--text-muted); display: none; }
.empty.show { display: block; }
.empty .empty-icon { font-size: 3rem; margin-bottom: 12px; }
/* ── Footer ── */
.footer {
text-align: center; padding: 20px; color: var(--text-muted);
font-size: 0.78rem; border-top: 1px solid var(--border);
}
/* ── Responsive ── */
@media (max-width: 768px) {
.header { padding: 18px 16px 14px; }
.container { padding: 16px; }
.grid { grid-template-columns: 1fr; }
.shortcut .cmd { min-width: 100px; }
}
</style>
</head>
<body>
<!-- ═══ HEADER ═══ -->
<header class="header">
<div class="header-inner">
<h1><span class="logo"></span>gitlink-cli · 功能全景</h1>
<div class="stats">
<div class="stat"><span class="num" id="statCats">14</span><span class="label">分类</span></div>
<div class="stat"><span class="num" id="statCmds">69</span><span class="label">Shortcuts</span></div>
<div class="stat"><span class="num" id="statAuth">44</span><span class="label">需认证</span></div>
<div class="stat"><span class="num" id="statPublic">25</span><span class="label">公开接口</span></div>
</div>
<div class="search-wrap">
<span class="search-icon">🔍</span>
<input type="text" id="search" placeholder="搜索命令或描述…(如 repo、issue、webhook" autofocus>
</div>
</div>
</header>
<!-- ═══ MAIN ═══ -->
<main class="container">
<div class="grid" id="grid"></div>
<div class="empty" id="empty"><div class="empty-icon">📭</div><p>没有匹配的命令</p></div>
</main>
<footer class="footer">
🤖 由 gitlink-code-insight skill 生成 · 数据来源gitlink-cli v1.x Shortcuts
</footer>
<script>
// ── Data ──
const categories = [
{
icon: "📦", name: "仓库管理", key: "repo",
shortcuts: [
{ cmd: "repo +list", auth: false, desc: "仓库列表", example: "gitlink-cli repo +list --user zhangsan" },
{ cmd: "repo +info", auth: false, desc: "仓库详情", example: "gitlink-cli repo +info --owner Gitlink --repo forgeplus" },
{ cmd: "repo +create", auth: true, desc: "创建仓库", example: "gitlink-cli repo +create --name my-project --description \"项目描述\"" },
{ cmd: "repo +fork", auth: true, desc: "Fork 仓库", example: "gitlink-cli repo +fork --owner Gitlink --repo forgeplus" },
{ cmd: "repo +delete", auth: true, desc: "删除仓库(不可逆)", example: "gitlink-cli repo +delete --owner myuser --repo old-project" },
{ cmd: "repo +batch-create",auth: true, desc: "批量创建仓库", example: "gitlink-cli repo +batch-create --from repos.csv" },
{ cmd: "repo +batch-update",auth: true, desc: "批量更新仓库", example: "gitlink-cli repo +batch-update --from updates.csv" },
{ cmd: "repo +add-member", auth: true, desc: "添加仓库成员", example: "gitlink-cli repo +add-member --owner myuser --repo myrepo --user newmember --role developer" },
]
},
{
icon: "🌿", name: "分支管理", key: "branch",
shortcuts: [
{ cmd: "branch +list", auth: false, desc: "分支列表", example: "gitlink-cli branch +list --owner Gitlink --repo forgeplus" },
{ cmd: "branch +create", auth: true, desc: "创建分支", example: "gitlink-cli branch +create --name feature/new-feature" },
{ cmd: "branch +delete", auth: true, desc: "删除分支(不可逆)", example: "gitlink-cli branch +delete --name feature/old-feature" },
{ cmd: "branch +protect", auth: true, desc: "保护分支", example: "gitlink-cli branch +protect --name main" },
{ cmd: "branch +unprotect", auth: true, desc: "取消保护", example: "gitlink-cli branch +unprotect --name main" },
]
},
{
icon: "🐛", name: "Issue 管理", key: "issue",
shortcuts: [
{ cmd: "issue +list", auth: false, desc: "Issue 列表", example: "gitlink-cli issue +list --owner Gitlink --repo forgeplus --state open" },
{ cmd: "issue +view", auth: false, desc: "Issue 详情", example: "gitlink-cli issue +view --owner Gitlink --repo forgeplus --number 4" },
{ cmd: "issue +create", auth: true, desc: "创建 Issue", example: "gitlink-cli issue +create --owner myuser --repo myrepo --title \"Bug: 登录失败\" --body \"复现步骤\"" },
{ cmd: "issue +update", auth: true, desc: "更新 Issue", example: "gitlink-cli issue +update --number 4 --title \"新标题\" --body \"更新描述\"" },
{ cmd: "issue +close", auth: true, desc: "关闭 Issue", example: "gitlink-cli issue +close --number 4" },
{ cmd: "issue +batch-close",auth: true, desc: "批量关闭 Issue", example: "gitlink-cli issue +batch-close --numbers 123,124 --dry-run" },
{ cmd: "issue +comment", auth: true, desc: "添加评论", example: "gitlink-cli issue +comment --number 4 --body \"已修复\"" },
]
},
{
icon: "🔀", name: "Pull Request", key: "pr",
shortcuts: [
{ cmd: "pr +list", auth: false, desc: "PR 列表", example: "gitlink-cli pr +list --owner Gitlink --repo forgeplus --state open" },
{ cmd: "pr +view", auth: false, desc: "PR 详情", example: "gitlink-cli pr +view --id 3" },
{ cmd: "pr +create", auth: true, desc: "创建 PR", example: "gitlink-cli pr +create --title \"feat: 新功能\" --head feature/x --base master" },
{ cmd: "pr +merge", auth: true, desc: "合并 PR", example: "gitlink-cli pr +merge --id 3 --method squash" },
{ cmd: "pr +close", auth: true, desc: "关闭 PR", example: "gitlink-cli pr +close --id 3" },
{ cmd: "pr +files", auth: false, desc: "变更文件列表", example: "gitlink-cli pr +files --id 3" },
{ cmd: "pr +diff", auth: false, desc: "查看提交列表", example: "gitlink-cli pr +diff --id 3" },
{ cmd: "pr +comment", auth: true, desc: "PR 评论", example: "gitlink-cli pr +comment --id 3 --body \"LGTM\"" },
{ cmd: "pr +review", auth: true, desc: "代码审查", example: "gitlink-cli pr +review --id 3 --event COMMENT --body \"整体 LGTM\"" },
]
},
{
icon: "🚀", name: "版本发布", key: "release",
shortcuts: [
{ cmd: "release +list", auth: false, desc: "发布列表", example: "gitlink-cli release +list --owner Gitlink --repo forgeplus" },
{ cmd: "release +view", auth: false, desc: "发布详情", example: "gitlink-cli release +view --id <version_id>" },
{ cmd: "release +create", auth: true, desc: "创建发布", example: "gitlink-cli release +create --tag v1.0.0 --name \"v1.0.0\" --target master" },
{ cmd: "release +delete", auth: true, desc: "删除发布(不可逆)", example: "gitlink-cli release +delete --id <version_id>" },
]
},
{
icon: "📖", name: "Wiki 管理", key: "wiki",
shortcuts: [
{ cmd: "wiki +list", auth: false, desc: "Wiki 页面列表", example: "gitlink-cli wiki +list --owner Gitlink --repo forgeplus" },
{ cmd: "wiki +view", auth: false, desc: "查看页面内容", example: "gitlink-cli wiki +view --owner Gitlink --repo forgeplus --title \"Home\"" },
{ cmd: "wiki +create", auth: true, desc: "创建页面", example: "gitlink-cli wiki +create --owner myuser --repo myrepo --title \"API 文档\" --file ./api.md" },
{ cmd: "wiki +update", auth: true, desc: "更新页面", example: "gitlink-cli wiki +update --owner myuser --repo myrepo --title \"设计文档\" --add \"新内容\"" },
{ cmd: "wiki +delete", auth: true, desc: "删除页面", example: "gitlink-cli wiki +delete --owner myuser --repo myrepo --title \"废弃页面\"" },
]
},
{
icon: "⚙️", name: "CI / CD", key: "ci",
shortcuts: [
{ cmd: "ci +builds", auth: true, desc: "构建列表", example: "gitlink-cli ci +builds --owner myuser --repo myrepo" },
{ cmd: "ci +logs", auth: true, desc: "构建日志", example: "gitlink-cli ci +logs --build 42 --stage 1 --step 1" },
{ cmd: "ci +restart", auth: true, desc: "重启构建", example: "gitlink-cli ci +restart --build 42" },
{ cmd: "ci +stop", auth: true, desc: "停止构建", example: "gitlink-cli ci +stop --build 42" },
]
},
{
icon: "🔔", name: "Webhook", key: "webhook",
shortcuts: [
{ cmd: "webhook +list", auth: true, desc: "Webhook 列表", example: "gitlink-cli webhook +list --owner myuser --repo myrepo" },
{ cmd: "webhook +info", auth: true, desc: "Webhook 详情", example: "gitlink-cli webhook +info --owner myuser --repo myrepo --id 123" },
{ cmd: "webhook +events", auth: false, desc: "支持的事件类型", example: "gitlink-cli webhook +events" },
{ cmd: "webhook +create", auth: true, desc: "创建 Webhook", example: "gitlink-cli webhook +create --url https://example.com/hook --events push" },
{ cmd: "webhook +update", auth: true, desc: "更新 Webhook", example: "gitlink-cli webhook +update --id 123 --events push,pull_request" },
{ cmd: "webhook +test", auth: true, desc: "测试 Webhook", example: "gitlink-cli webhook +test --id 123 --event push" },
{ cmd: "webhook +delete", auth: true, desc: "删除 Webhook", example: "gitlink-cli webhook +delete --id 123" },
]
},
{
icon: "🏢", name: "组织管理", key: "org",
shortcuts: [
{ cmd: "org +list", auth: false, desc: "组织列表", example: "gitlink-cli org +list" },
{ cmd: "org +info", auth: false, desc: "组织详情", example: "gitlink-cli org +info --id Gitlink" },
{ cmd: "org +members", auth: false, desc: "成员列表", example: "gitlink-cli org +members --id Gitlink" },
{ cmd: "org +create", auth: true, desc: "创建组织", example: "gitlink-cli org +create --name my-org --description \"我的组织\"" },
{ cmd: "org +batch-add", auth: true, desc: "批量添加成员", example: "gitlink-cli org +batch-add --id my-org --users \"user1,user2\"" },
]
},
{
icon: "👤", name: "用户与搜索", key: "user",
shortcuts: [
{ cmd: "user +me", auth: true, desc: "当前登录用户", example: "gitlink-cli user +me" },
{ cmd: "user +info", auth: false, desc: "用户详情", example: "gitlink-cli user +info --login zhangsan" },
{ cmd: "search +repos", auth: false, desc: "搜索仓库", example: "gitlink-cli search +repos --keyword \"machine learning\"" },
{ cmd: "search +users", auth: false, desc: "搜索用户", example: "gitlink-cli search +users --keyword \"zhangsan\"" },
]
},
{
icon: "🛡️", name: "安全与合规", key: "compliance",
shortcuts: [
{ cmd: "compliance +scan", auth: false, desc: "全量扫描", example: "gitlink-cli compliance +scan" },
{ cmd: "compliance +license", auth: false, desc: "许可证合规检查", example: "gitlink-cli compliance +license" },
{ cmd: "compliance +deps", auth: false, desc: "依赖许可证检查", example: "gitlink-cli compliance +deps" },
{ cmd: "compliance +secrets", auth: false, desc: "敏感信息扫描", example: "gitlink-cli compliance +secrets" },
{ cmd: "compliance +exposure", auth: false, desc: "PII 与暴露面扫描", example: "gitlink-cli compliance +exposure" },
{ cmd: "compliance +vocab", auth: false, desc: "敏感词汇扫描", example: "gitlink-cli compliance +vocab" },
]
},
{
icon: "👋", name: "新人引导", key: "onboard",
shortcuts: [
{ cmd: "onboard +welcome", auth: true, desc: "添加引导评论", example: "gitlink-cli onboard +welcome --issues \"3,7,15\"" },
]
},
{
icon: "👥", name: "团队管理", key: "team",
shortcuts: [
{ cmd: "team +list", auth: false, desc: "团队列表", example: "gitlink-cli team +list --org my-org" },
{ cmd: "team +create", auth: true, desc: "创建团队", example: "gitlink-cli team +create --org my-org --name dev-team" },
{ cmd: "team +add-member", auth: true, desc: "添加成员", example: "gitlink-cli team +add-member --org my-org --team dev-team --user newmember" },
]
},
{
icon: "📊", name: "贡献报告", key: "contrib",
shortcuts: [
{ cmd: "contrib +report", auth: false, desc: "贡献统计报告", example: "gitlink-cli contrib +report --owner myuser --repo myrepo" },
]
},
];
// ── Build UI ──
const grid = document.getElementById('grid');
const empty = document.getElementById('empty');
const search = document.getElementById('search');
function escHtml(s) {
return s.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
}
function buildCard(cat) {
const card = document.createElement('div');
card.className = 'card visible';
card.dataset.key = cat.key;
const header = document.createElement('div');
header.className = 'card-header';
header.innerHTML =
'<span class="card-icon">' + cat.icon + '</span>' +
'<span class="card-title">' + cat.name + '</span>' +
'<span class="card-count">' + cat.shortcuts.length + '</span>' +
'<span class="card-chevron">▼</span>';
header.addEventListener('click', function() { card.classList.toggle('open'); });
const body = document.createElement('div');
body.className = 'card-body';
cat.shortcuts.forEach(function(s) {
const row = document.createElement('div');
row.className = 'shortcut';
row.innerHTML =
'<span class="cmd">' + s.cmd + '</span>' +
'<span class="badge ' + (s.auth ? 'badge-auth' : 'badge-public') + '">' +
(s.auth ? '🔒 需认证' : '🌐 公开') + '</span>' +
'<span class="desc">' + s.desc + '</span>' +
'<div class="example"><code>' + escHtml(s.example) + '</code></div>';
row.addEventListener('click', function(e) {
e.stopPropagation();
row.classList.toggle('expanded');
});
body.appendChild(row);
});
card.appendChild(header);
card.appendChild(body);
return card;
}
// Render all cards
categories.forEach(function(cat) { grid.appendChild(buildCard(cat)); });
// ── Search ──
search.addEventListener('input', function() {
var q = search.value.toLowerCase().trim();
var visibleCount = 0;
document.querySelectorAll('.card').forEach(function(card) {
var rows = card.querySelectorAll('.shortcut');
var rowVisible = 0;
rows.forEach(function(row) {
var cmd = row.querySelector('.cmd').textContent.toLowerCase();
var desc = row.querySelector('.desc').textContent.toLowerCase();
var match = !q || cmd.indexOf(q) !== -1 || desc.indexOf(q) !== -1;
row.style.display = match ? '' : 'none';
if (match) rowVisible++;
});
if (rowVisible > 0) {
card.classList.add('visible');
card.style.display = '';
visibleCount++;
} else {
card.classList.remove('visible');
card.style.display = 'none';
}
});
if (visibleCount === 0) { empty.classList.add('show'); }
else { empty.classList.remove('show'); }
});
// ── Stats ──
(function() {
var total = 0, auth = 0, pub = 0;
categories.forEach(function(c) {
c.shortcuts.forEach(function(s) { total++; if (s.auth) auth++; else pub++; });
});
document.getElementById('statCats').textContent = categories.length;
document.getElementById('statCmds').textContent = total;
document.getElementById('statAuth').textContent = auth;
document.getElementById('statPublic').textContent = pub;
})();
</script>
</body>
</html>