glad-web 1.0.7 → 1.0.9
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 +15 -2
- package/README.zh-CN.md +15 -2
- package/lib/commands/web.js +12 -5
- package/lib/web/index.html +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -43,6 +43,19 @@ Our design philosophy is **Easy to use, Stable, and Restrained**. Glad focuses s
|
|
|
43
43
|
|
|
44
44
|
## Quick Start
|
|
45
45
|
|
|
46
|
+
### Install with npm
|
|
47
|
+
|
|
48
|
+
Requirements:
|
|
49
|
+
|
|
50
|
+
- Node.js `>=18`
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npm install -g glad-web
|
|
54
|
+
glad
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
After installation, the package name is `glad-web` and the command is `glad`.
|
|
58
|
+
|
|
46
59
|
### Run from source
|
|
47
60
|
|
|
48
61
|
Requirements:
|
|
@@ -50,7 +63,7 @@ Requirements:
|
|
|
50
63
|
- Node.js `>=18`
|
|
51
64
|
|
|
52
65
|
```bash
|
|
53
|
-
git clone
|
|
66
|
+
git clone https://github.com/Next2012/Glad.git
|
|
54
67
|
cd glad
|
|
55
68
|
npm install
|
|
56
69
|
node bin/cli.js
|
|
@@ -179,4 +192,4 @@ See [SECURITY.md](./SECURITY.md) for details.
|
|
|
179
192
|
|
|
180
193
|
## License
|
|
181
194
|
|
|
182
|
-
MIT. Glad is maintained by [next2012](https://
|
|
195
|
+
MIT. Glad is maintained by [next2012](https://github.com/Next2012/Glad).
|
package/README.zh-CN.md
CHANGED
|
@@ -43,6 +43,19 @@ Glad 的初衷是开发一款完全运行在本地的、足够简单的,且登
|
|
|
43
43
|
|
|
44
44
|
## 快速开始
|
|
45
45
|
|
|
46
|
+
### 通过 npm 安装
|
|
47
|
+
|
|
48
|
+
要求:
|
|
49
|
+
|
|
50
|
+
- Node.js `>=18`
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npm install -g glad-web
|
|
54
|
+
glad
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
安装时的 npm 包名是 `glad-web`,安装后的命令是 `glad`。
|
|
58
|
+
|
|
46
59
|
### 从源码运行
|
|
47
60
|
|
|
48
61
|
要求:
|
|
@@ -50,7 +63,7 @@ Glad 的初衷是开发一款完全运行在本地的、足够简单的,且登
|
|
|
50
63
|
- Node.js `>=18`
|
|
51
64
|
|
|
52
65
|
```bash
|
|
53
|
-
git clone
|
|
66
|
+
git clone https://github.com/Next2012/Glad.git
|
|
54
67
|
cd glad
|
|
55
68
|
npm install
|
|
56
69
|
node bin/cli.js
|
|
@@ -179,4 +192,4 @@ Glad 面向受信任的本机或局域网环境使用。
|
|
|
179
192
|
|
|
180
193
|
## 开源协议
|
|
181
194
|
|
|
182
|
-
本项目使用 MIT 协议,由 [next2012](https://
|
|
195
|
+
本项目使用 MIT 协议,由 [next2012](https://github.com/Next2012/Glad) 维护。
|
package/lib/commands/web.js
CHANGED
|
@@ -385,6 +385,8 @@ async function webCommand(options) {
|
|
|
385
385
|
});
|
|
386
386
|
|
|
387
387
|
// Frontend routes
|
|
388
|
+
const logoPath = path.resolve(__dirname, '../../assets/logo.svg');
|
|
389
|
+
|
|
388
390
|
app.get('/', (req, res) => {
|
|
389
391
|
try {
|
|
390
392
|
const htmlPath = path.join(__dirname, '../web/index.html');
|
|
@@ -404,11 +406,16 @@ async function webCommand(options) {
|
|
|
404
406
|
});
|
|
405
407
|
|
|
406
408
|
app.get('/logo.svg', (req, res) => {
|
|
407
|
-
|
|
408
|
-
res.
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
|
|
409
|
+
res.sendFile(logoPath, error => {
|
|
410
|
+
if (error && !res.headersSent) res.status(404).send('Not found');
|
|
411
|
+
});
|
|
412
|
+
});
|
|
413
|
+
|
|
414
|
+
app.get('/favicon.ico', (req, res) => {
|
|
415
|
+
res.type('image/svg+xml');
|
|
416
|
+
res.sendFile(logoPath, error => {
|
|
417
|
+
if (error && !res.headersSent) res.status(404).send('Not found');
|
|
418
|
+
});
|
|
412
419
|
});
|
|
413
420
|
|
|
414
421
|
app.get('/manifest.json', (req, res) => res.json({
|
package/lib/web/index.html
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover">
|
|
7
7
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
8
8
|
<link rel="manifest" href="/manifest.json">
|
|
9
|
+
<link rel="icon" type="image/svg+xml" href="/logo.svg">
|
|
9
10
|
<link rel="apple-touch-icon" href="/logo.svg">
|
|
10
11
|
<link rel="stylesheet" href="https://unpkg.com/xterm@5.3.0/css/xterm.css" />
|
|
11
12
|
<style>
|