@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 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
- 安装时可顺便创建桌面图标(Windows 桌面 + 开始菜单;Linux 应用菜单 + 桌面):
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` 会在打开界面时直接弹出设置;
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
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
- if (args.settings === true) openSettings()
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sunshine-star/dsh-access-pc",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "DSH Access PC client (Electron shell around the hub console)",
5
5
  "main": "main.js",
6
6
  "bin": {
@@ -1,24 +1,23 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * 可选:npm 全局安装时创建桌面/开始菜单快捷方式。
3
+ * npm 全局安装时默认创建桌面 / 开始菜单快捷方式。
4
4
  *
5
- * 默认不创建,只提示;显式设置 DSH_ACCESS_PC_SHORTCUT=1 才创建:
6
- * DSH_ACCESS_PC_SHORTCUT=1 npm i -g @sunshine-star/dsh-access-pc
7
- * 设 0 或 DSH_ACCESS_PC_NO_SHORTCUT=1 可关闭提示。
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.DSH_ACCESS_PC_SHORTCUT === '0' || process.env.DSH_ACCESS_PC_NO_SHORTCUT === '1') process.exit(0)
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
- if (process.env.DSH_ACCESS_PC_SHORTCUT === '1' || process.env.DSH_ACCESS_PC_SHORTCUT === 'desktop') {
14
- try {
15
- const { createShortcuts } = require('./shortcut.js')
16
- const created = createShortcuts({ desktop: true, menu: true })
17
- for (const item of created) console.log(`[dsh-access-pc] 已创建 ${item}`)
18
- } catch (error) {
19
- console.error(`[dsh-access-pc] 创建快捷方式失败:${error.message}`)
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
  }