@sunshine-star/dsh-access-pc 0.1.3 → 0.1.4
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 +3 -7
- package/assets/icon-128.png +0 -0
- package/assets/icon-16.png +0 -0
- package/assets/icon-24.png +0 -0
- package/assets/icon-256.png +0 -0
- package/assets/icon-32.png +0 -0
- package/assets/icon-48.png +0 -0
- package/assets/icon-512.png +0 -0
- package/assets/icon-64.png +0 -0
- package/assets/icon.ico +0 -0
- package/assets/icon.png +0 -0
- package/main.js +2 -1
- package/package.json +1 -1
- package/scripts/postinstall.js +15 -16
package/README.md
CHANGED
|
@@ -39,13 +39,8 @@ dsh-access-pc --hub http://10.168.1.185:8080
|
|
|
39
39
|
npx -y @sunshine-star/dsh-access-pc --hub http://10.168.1.185:8080
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
```bash
|
|
45
|
-
DSH_ACCESS_PC_SHORTCUT=1 npm i -g @sunshine-star/dsh-access-pc
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
装完也可以手动创建:
|
|
42
|
+
`npm i -g` 全局安装会**默认创建**桌面图标 + 开始菜单(Windows;Linux 为应用菜单 + 桌面)。
|
|
43
|
+
不想创建:`DSH_ACCESS_PC_NO_SHORTCUT=1 npm i -g ...`;装完也可以手动:
|
|
49
44
|
|
|
50
45
|
```bash
|
|
51
46
|
dsh-access-pc --create-shortcut # 桌面 + 开始菜单
|
|
@@ -57,6 +52,7 @@ dsh-access-pc --create-shortcut --desktop # 只建桌面
|
|
|
57
52
|
|
|
58
53
|
## 设置 Hub 地址
|
|
59
54
|
|
|
55
|
+
- **启动时会自动弹出设置窗口**(预填当前地址),改完点“保存并连接”;`--connect` 直接连接、不弹设置;
|
|
60
56
|
- 进入界面后按 **Ctrl+,**(macOS 为 Cmd+,)或菜单“导航 → 设置 Hub 地址…”;
|
|
61
57
|
- 也可以在“右键菜单 → 设置 Hub 地址…”里打开;
|
|
62
58
|
- 启动参数 `--settings` 会在打开界面时直接弹出设置;
|
package/assets/icon-128.png
CHANGED
|
Binary file
|
package/assets/icon-16.png
CHANGED
|
Binary file
|
package/assets/icon-24.png
CHANGED
|
Binary file
|
package/assets/icon-256.png
CHANGED
|
Binary file
|
package/assets/icon-32.png
CHANGED
|
Binary file
|
package/assets/icon-48.png
CHANGED
|
Binary file
|
package/assets/icon-512.png
CHANGED
|
Binary file
|
package/assets/icon-64.png
CHANGED
|
Binary file
|
package/assets/icon.ico
CHANGED
|
Binary file
|
package/assets/icon.png
CHANGED
|
Binary file
|
package/main.js
CHANGED
|
@@ -350,7 +350,8 @@ if (args.version) {
|
|
|
350
350
|
}]))
|
|
351
351
|
|
|
352
352
|
void mainWindow.loadURL(cfg.hub)
|
|
353
|
-
|
|
353
|
+
const explicitHub = typeof args.hub === 'string'
|
|
354
|
+
if (args.settings === true || (args.connect !== true && !explicitHub)) openSettings()
|
|
354
355
|
console.log(`[${APP_NAME}] 已打开 ${cfg.hub}(配置 ${file})`)
|
|
355
356
|
|
|
356
357
|
app.on('window-all-closed', () => app.quit())
|
package/package.json
CHANGED
package/scripts/postinstall.js
CHANGED
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* npm 全局安装时默认创建桌面 / 开始菜单快捷方式。
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* DSH_ACCESS_PC_SHORTCUT=
|
|
7
|
-
*
|
|
5
|
+
* 跳过:
|
|
6
|
+
* DSH_ACCESS_PC_NO_SHORTCUT=1 或 DSH_ACCESS_PC_SHORTCUT=0
|
|
7
|
+
* CI 环境自动跳过。
|
|
8
8
|
*/
|
|
9
9
|
const globalInstall = process.env.npm_config_global === 'true'
|
|
10
10
|
if (!globalInstall) process.exit(0)
|
|
11
|
-
if (process.env.
|
|
11
|
+
if (process.env.CI) process.exit(0)
|
|
12
|
+
if (process.env.DSH_ACCESS_PC_NO_SHORTCUT === '1' || process.env.DSH_ACCESS_PC_SHORTCUT === '0') {
|
|
13
|
+
process.exit(0)
|
|
14
|
+
}
|
|
12
15
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
console.error('[dsh-access-pc] 可稍后运行:dsh-access-pc --create-shortcut')
|
|
21
|
-
}
|
|
22
|
-
} else {
|
|
23
|
-
console.log('[dsh-access-pc] 想创建桌面图标:dsh-access-pc --create-shortcut(安装时设 DSH_ACCESS_PC_SHORTCUT=1 可自动创建)')
|
|
16
|
+
try {
|
|
17
|
+
const { createShortcuts } = require('./shortcut.js')
|
|
18
|
+
const created = createShortcuts({ desktop: true, menu: true })
|
|
19
|
+
for (const item of created) console.log(`[dsh-access-pc] 已创建 ${item}`)
|
|
20
|
+
} catch (error) {
|
|
21
|
+
console.error(`[dsh-access-pc] 创建快捷方式失败:${error.message}`)
|
|
22
|
+
console.error('[dsh-access-pc] 可稍后运行:dsh-access-pc --create-shortcut')
|
|
24
23
|
}
|