skill-base 2.0.4 → 2.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +177 -115
- package/bin/skill-base.js +7 -0
- package/package.json +3 -1
- package/src/cappy.js +416 -0
- package/src/database.js +11 -0
- package/src/index.js +87 -24
- package/src/middleware/auth.js +96 -32
- package/src/routes/auth.js +1 -1
- package/src/routes/skills.js +10 -5
- package/src/utils/zip.js +15 -4
- package/static/android-chrome-192x192.png +0 -0
- package/static/android-chrome-512x512.png +0 -0
- package/static/apple-touch-icon.png +0 -0
- package/static/assets/index-BgwubB87.css +1 -0
- package/static/assets/index-DBHCo8Mz.js +230 -0
- package/static/favicon-16x16.png +0 -0
- package/static/favicon-32x32.png +0 -0
- package/static/favicon.ico +0 -0
- package/static/favicon.svg +14 -0
- package/static/index.html +18 -248
- package/static/site.webmanifest +1 -0
- package/static/admin/users.html +0 -593
- package/static/cli-code.html +0 -203
- package/static/css/.gitkeep +0 -0
- package/static/css/style.css +0 -1567
- package/static/diff.html +0 -466
- package/static/file.html +0 -443
- package/static/js/.gitkeep +0 -0
- package/static/js/admin/users.js +0 -346
- package/static/js/app.js +0 -508
- package/static/js/auth.js +0 -151
- package/static/js/cli-code.js +0 -184
- package/static/js/collaborators.js +0 -283
- package/static/js/diff.js +0 -540
- package/static/js/file.js +0 -619
- package/static/js/i18n.js +0 -739
- package/static/js/index.js +0 -168
- package/static/js/publish.js +0 -718
- package/static/js/settings.js +0 -124
- package/static/js/setup.js +0 -157
- package/static/js/skill.js +0 -808
- package/static/login.html +0 -82
- package/static/publish.html +0 -459
- package/static/settings.html +0 -163
- package/static/setup.html +0 -101
- package/static/skill.html +0 -851
package/static/settings.html
DELETED
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
-
<title data-i18n="settings.title">账户设置 - Skill Base</title>
|
|
7
|
-
<link rel="stylesheet" href="/css/style.css">
|
|
8
|
-
<style>
|
|
9
|
-
.settings-card {
|
|
10
|
-
max-width: 640px;
|
|
11
|
-
margin: 0 auto;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.settings-header {
|
|
15
|
-
margin-bottom: var(--spacing-lg);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.settings-title {
|
|
19
|
-
font-size: 1.5rem;
|
|
20
|
-
font-weight: 600;
|
|
21
|
-
color: var(--text-color);
|
|
22
|
-
margin-bottom: var(--spacing-xs);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.settings-subtitle {
|
|
26
|
-
font-size: 0.875rem;
|
|
27
|
-
color: var(--text-secondary);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.settings-section {
|
|
31
|
-
margin-bottom: var(--spacing-xl);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.settings-section-title {
|
|
35
|
-
font-size: 1.125rem;
|
|
36
|
-
font-weight: 600;
|
|
37
|
-
color: var(--text-color);
|
|
38
|
-
margin-bottom: var(--spacing-md);
|
|
39
|
-
padding-bottom: var(--spacing-sm);
|
|
40
|
-
border-bottom: 1px solid var(--border-color);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.form-hint {
|
|
44
|
-
font-size: 0.875rem;
|
|
45
|
-
color: var(--text-secondary);
|
|
46
|
-
margin-top: var(--spacing-xs);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.cli-code-link {
|
|
50
|
-
display: inline-flex;
|
|
51
|
-
align-items: center;
|
|
52
|
-
gap: var(--spacing-sm);
|
|
53
|
-
padding: var(--spacing-md);
|
|
54
|
-
background-color: rgba(56, 189, 248, 0.1);
|
|
55
|
-
border: 1px solid rgba(56, 189, 248, 0.2);
|
|
56
|
-
border-radius: var(--radius);
|
|
57
|
-
color: var(--info-color);
|
|
58
|
-
text-decoration: none;
|
|
59
|
-
transition: var(--transition);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.cli-code-link:hover {
|
|
63
|
-
background-color: rgba(56, 189, 248, 0.15);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.cli-code-link svg {
|
|
67
|
-
width: 18px;
|
|
68
|
-
height: 18px;
|
|
69
|
-
}
|
|
70
|
-
</style>
|
|
71
|
-
</head>
|
|
72
|
-
<body class="app-devtools">
|
|
73
|
-
<!-- 导航栏 -->
|
|
74
|
-
<nav class="navbar">
|
|
75
|
-
<div class="container">
|
|
76
|
-
<a href="/" class="navbar-brand">
|
|
77
|
-
<svg class="navbar-brand-icon" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"/><polyline points="3.27 6.96 12 12.01 20.73 6.96"/><line x1="12" y1="22.08" x2="12" y2="12"/></svg>
|
|
78
|
-
<span>Skill Base</span>
|
|
79
|
-
</a>
|
|
80
|
-
<div class="navbar-nav">
|
|
81
|
-
<a href="/" data-i18n="nav.home">首页</a>
|
|
82
|
-
<a href="/publish.html" class="hide-mobile" data-i18n="nav.publish">发布</a>
|
|
83
|
-
</div>
|
|
84
|
-
<!-- 用户区域由 JS 动态渲染 -->
|
|
85
|
-
</div>
|
|
86
|
-
</nav>
|
|
87
|
-
|
|
88
|
-
<!-- 页面内容 -->
|
|
89
|
-
<main class="page-content">
|
|
90
|
-
<div class="container">
|
|
91
|
-
<div class="card settings-card">
|
|
92
|
-
<div class="settings-header">
|
|
93
|
-
<h1 class="settings-title" data-i18n="settings.heading">账户设置</h1>
|
|
94
|
-
<p class="settings-subtitle" data-i18n="settings.subtitle">管理您的个人信息和凭证</p>
|
|
95
|
-
</div>
|
|
96
|
-
|
|
97
|
-
<!-- 基本信息 -->
|
|
98
|
-
<div class="settings-section">
|
|
99
|
-
<h2 class="settings-section-title" data-i18n="settings.basicInfo">基本信息</h2>
|
|
100
|
-
<form id="profileForm">
|
|
101
|
-
<div class="form-group">
|
|
102
|
-
<label class="form-label" data-i18n="settings.usernameLabel">用户名</label>
|
|
103
|
-
<input type="text" id="username" required>
|
|
104
|
-
<p class="form-hint" data-i18n="settings.usernameHint">至少 1 个字符,最多 50 个字符</p>
|
|
105
|
-
</div>
|
|
106
|
-
<div class="form-group">
|
|
107
|
-
<label class="form-label" data-i18n="settings.nameLabel">姓名</label>
|
|
108
|
-
<input type="text" id="name" data-i18n-placeholder="settings.namePlaceholder" placeholder="请输入您的姓名">
|
|
109
|
-
<p class="form-hint" data-i18n="settings.nameHint">可选,用于显示在技能作者信息中</p>
|
|
110
|
-
</div>
|
|
111
|
-
<button type="submit" class="btn btn-primary" id="saveProfileBtn" data-i18n="settings.saveBtn">
|
|
112
|
-
保存修改
|
|
113
|
-
</button>
|
|
114
|
-
</form>
|
|
115
|
-
</div>
|
|
116
|
-
|
|
117
|
-
<!-- CLI 验证码 -->
|
|
118
|
-
<div class="settings-section">
|
|
119
|
-
<h2 class="settings-section-title" data-i18n="settings.cliSection">CLI 访问凭证</h2>
|
|
120
|
-
<p class="text-secondary mb-2" data-i18n-html="settings.cliDesc">
|
|
121
|
-
在本地终端使用 <code>skb</code> 命令行工具时,需要获取验证码进行登录。
|
|
122
|
-
</p>
|
|
123
|
-
<a href="/cli-code.html" class="cli-code-link">
|
|
124
|
-
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
125
|
-
<rect x="3" y="11" width="18" height="11" rx="2" ry="2"/>
|
|
126
|
-
<path d="M7 11V7a5 5 0 0 1 10 0v4"/>
|
|
127
|
-
</svg>
|
|
128
|
-
<span data-i18n="settings.cliLink">获取 CLI 验证码</span>
|
|
129
|
-
</a>
|
|
130
|
-
</div>
|
|
131
|
-
|
|
132
|
-
<!-- 修改密码 -->
|
|
133
|
-
<div class="settings-section">
|
|
134
|
-
<h2 class="settings-section-title" data-i18n="settings.passwordSection">修改密码</h2>
|
|
135
|
-
<form id="passwordForm">
|
|
136
|
-
<div class="form-group">
|
|
137
|
-
<label class="form-label required" data-i18n="settings.oldPassword">当前密码</label>
|
|
138
|
-
<input type="password" id="oldPassword" required>
|
|
139
|
-
</div>
|
|
140
|
-
<div class="form-group">
|
|
141
|
-
<label class="form-label required" data-i18n="settings.newPassword">新密码</label>
|
|
142
|
-
<input type="password" id="newPassword" required>
|
|
143
|
-
<p class="form-hint" data-i18n="settings.newPasswordHint">至少 6 个字符</p>
|
|
144
|
-
</div>
|
|
145
|
-
<div class="form-group">
|
|
146
|
-
<label class="form-label required" data-i18n="settings.confirmPassword">确认新密码</label>
|
|
147
|
-
<input type="password" id="confirmPassword" required>
|
|
148
|
-
</div>
|
|
149
|
-
<button type="submit" class="btn btn-secondary" id="changePasswordBtn" data-i18n="settings.changePasswordBtn">
|
|
150
|
-
修改密码
|
|
151
|
-
</button>
|
|
152
|
-
</form>
|
|
153
|
-
</div>
|
|
154
|
-
</div>
|
|
155
|
-
</div>
|
|
156
|
-
</main>
|
|
157
|
-
|
|
158
|
-
<!-- 引入 JS -->
|
|
159
|
-
<script src="/js/i18n.js"></script>
|
|
160
|
-
<script src="/js/app.js"></script>
|
|
161
|
-
<script src="/js/settings.js"></script>
|
|
162
|
-
</body>
|
|
163
|
-
</html>
|
package/static/setup.html
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
-
<title data-i18n="setup.title">初始化 - Skill Base</title>
|
|
7
|
-
<link rel="stylesheet" href="/css/style.css">
|
|
8
|
-
</head>
|
|
9
|
-
<body class="login-body">
|
|
10
|
-
<div class="login-page">
|
|
11
|
-
<div class="login-devtools" aria-label="初始化设置">
|
|
12
|
-
<header class="devtools-chrome">
|
|
13
|
-
<div class="devtools-titlebar">
|
|
14
|
-
<div class="devtools-traffic" aria-hidden="true">
|
|
15
|
-
<span class="devtools-dot devtools-dot--close"></span>
|
|
16
|
-
<span class="devtools-dot devtools-dot--min"></span>
|
|
17
|
-
<span class="devtools-dot devtools-dot--max"></span>
|
|
18
|
-
</div>
|
|
19
|
-
<span class="devtools-titlebar-title">DevTools — Skill Base · Initial Setup</span>
|
|
20
|
-
</div>
|
|
21
|
-
</header>
|
|
22
|
-
|
|
23
|
-
<div class="login-card">
|
|
24
|
-
<div class="login-panel-toolbar">
|
|
25
|
-
<span class="login-panel-breadcrumb">System</span>
|
|
26
|
-
<span class="login-panel-sep">›</span>
|
|
27
|
-
<span class="login-panel-breadcrumb login-panel-breadcrumb--accent">Initialize</span>
|
|
28
|
-
</div>
|
|
29
|
-
|
|
30
|
-
<div class="login-header">
|
|
31
|
-
<h1 class="login-title"><span class="login-title-prompt">$</span> Skill Base</h1>
|
|
32
|
-
<p class="login-subtitle" data-i18n="setup.subtitle">// 首次启动 · 请设置管理员账号</p>
|
|
33
|
-
</div>
|
|
34
|
-
|
|
35
|
-
<div id="setupError" class="login-error" role="alert"></div>
|
|
36
|
-
<div id="setupSuccess" class="login-success" role="status" style="display:none"></div>
|
|
37
|
-
|
|
38
|
-
<form id="setupForm">
|
|
39
|
-
<div class="form-group">
|
|
40
|
-
<label for="username" class="form-label"><span class="login-prop">admin_username</span></label>
|
|
41
|
-
<input
|
|
42
|
-
type="text"
|
|
43
|
-
id="username"
|
|
44
|
-
name="username"
|
|
45
|
-
placeholder=""admin""
|
|
46
|
-
autocomplete="username"
|
|
47
|
-
required
|
|
48
|
-
minlength="3"
|
|
49
|
-
maxlength="50"
|
|
50
|
-
class="login-input"
|
|
51
|
-
>
|
|
52
|
-
<p class="form-hint" data-i18n="setup.usernameHint">3-50 个字符</p>
|
|
53
|
-
</div>
|
|
54
|
-
|
|
55
|
-
<div class="form-group">
|
|
56
|
-
<label for="password" class="form-label"><span class="login-prop">password</span></label>
|
|
57
|
-
<input
|
|
58
|
-
type="password"
|
|
59
|
-
id="password"
|
|
60
|
-
name="password"
|
|
61
|
-
placeholder="••••••••"
|
|
62
|
-
autocomplete="new-password"
|
|
63
|
-
required
|
|
64
|
-
minlength="6"
|
|
65
|
-
class="login-input"
|
|
66
|
-
>
|
|
67
|
-
<p class="form-hint" data-i18n="setup.passwordHint">至少 6 个字符</p>
|
|
68
|
-
</div>
|
|
69
|
-
|
|
70
|
-
<div class="form-group">
|
|
71
|
-
<label for="confirmPassword" class="form-label"><span class="login-prop">confirm_password</span></label>
|
|
72
|
-
<input
|
|
73
|
-
type="password"
|
|
74
|
-
id="confirmPassword"
|
|
75
|
-
name="confirmPassword"
|
|
76
|
-
placeholder="••••••••"
|
|
77
|
-
autocomplete="new-password"
|
|
78
|
-
required
|
|
79
|
-
minlength="6"
|
|
80
|
-
class="login-input"
|
|
81
|
-
>
|
|
82
|
-
</div>
|
|
83
|
-
|
|
84
|
-
<div class="form-group login-actions">
|
|
85
|
-
<button type="submit" id="setupButton" class="btn btn-devtools btn-block btn-lg">
|
|
86
|
-
<svg class="btn-devtools-icon" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
87
|
-
<path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/>
|
|
88
|
-
</svg>
|
|
89
|
-
<span data-i18n="setup.submit">创建管理员账号</span>
|
|
90
|
-
</button>
|
|
91
|
-
</div>
|
|
92
|
-
</form>
|
|
93
|
-
</div>
|
|
94
|
-
</div>
|
|
95
|
-
</div>
|
|
96
|
-
|
|
97
|
-
<!-- 引入 JS -->
|
|
98
|
-
<script src="/js/i18n.js"></script>
|
|
99
|
-
<script src="/js/setup.js"></script>
|
|
100
|
-
</body>
|
|
101
|
-
</html>
|