dsh-ssh-manage 0.2.0 → 0.2.1

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.en.md CHANGED
@@ -96,16 +96,16 @@ Creating a host requires alias, hostname and password. The password is not writt
96
96
 
97
97
  ### From npm (recommended)
98
98
 
99
- npm package: [`dsh-ssh-manage`](https://www.npmjs.com/package/dsh-ssh-manage) (current version `0.2.0`).
99
+ npm package: [`dsh-ssh-manage`](https://www.npmjs.com/package/dsh-ssh-manage) (current version `0.2.1`).
100
100
 
101
101
  ```text
102
- plugin_manager action=install_bundle target=dsh-ssh-manage@0.2.0
102
+ plugin_manager action=install_bundle target=dsh-ssh-manage@0.2.1
103
103
  ```
104
104
 
105
105
  Or with the DSH CLI:
106
106
 
107
107
  ```bash
108
- dsh plugin add dsh-ssh-manage@0.2.0
108
+ dsh plugin add dsh-ssh-manage@0.2.1
109
109
  ```
110
110
 
111
111
  After installation, refresh the Web page; the sidebar shows an "SSH Hosts" entry with id `dsh-ssh-manage`.
package/README.md CHANGED
@@ -98,16 +98,16 @@
98
98
 
99
99
  ### 从 npm 安装(推荐)
100
100
 
101
- npm 包:[`dsh-ssh-manage`](https://www.npmjs.com/package/dsh-ssh-manage)(当前版本 `0.2.0`)。
101
+ npm 包:[`dsh-ssh-manage`](https://www.npmjs.com/package/dsh-ssh-manage)(当前版本 `0.2.1`)。
102
102
 
103
103
  ```text
104
- plugin_manager action=install_bundle target=dsh-ssh-manage@0.2.0
104
+ plugin_manager action=install_bundle target=dsh-ssh-manage@0.2.1
105
105
  ```
106
106
 
107
107
  或使用 DSH CLI:
108
108
 
109
109
  ```bash
110
- dsh plugin add dsh-ssh-manage@0.2.0
110
+ dsh plugin add dsh-ssh-manage@0.2.1
111
111
  ```
112
112
 
113
113
  安装后刷新 Web 页面,左侧栏会出现「SSH 主机」入口,入口 id 为 `dsh-ssh-manage`。
package/client.js CHANGED
@@ -31,7 +31,7 @@ window.__ModuleLoader__.load({
31
31
  'toolbar.refresh': ['刷新', 'Refresh'],
32
32
  'toolbar.groups': ['分组', 'Groups'],
33
33
  'toolbar.new': ['新建主机', 'New host'],
34
- 'toolbar.newShort': ['+ SSH', '+ SSH'],
34
+ 'toolbar.newShort': ['SSH', 'SSH'],
35
35
  'toolbar.filter': ['只看收藏', 'Favorites only'],
36
36
  'toolbar.info': ['信息', 'Info'],
37
37
  'toolbar.settings': ['显示设置', 'View options'],
@@ -280,6 +280,12 @@ window.__ModuleLoader__.load({
280
280
  return `${user}${target}${port}`
281
281
  }
282
282
 
283
+ // Table / session chrome shows only the hostname (the name column already
284
+ // carries the alias); the full user@host:port stays in titles and copy.
285
+ function hostTarget(host) {
286
+ return host.hostname || host.host
287
+ }
288
+
283
289
  function hostGroupKey(host) {
284
290
  return host.group || ''
285
291
  }
@@ -1048,7 +1054,7 @@ window.__ModuleLoader__.load({
1048
1054
  }
1049
1055
  let result = 0
1050
1056
  if (sort.key === 'system') result = String(a.system ?? '').localeCompare(String(b.system ?? ''))
1051
- else if (sort.key === 'address') result = hostAddress(a).localeCompare(hostAddress(b))
1057
+ else if (sort.key === 'address') result = hostTarget(a).localeCompare(hostTarget(b))
1052
1058
  else if (sort.key === 'notes') result = String(a.note ?? '').localeCompare(String(b.note ?? ''))
1053
1059
  else result = hostName(a).localeCompare(hostName(b), undefined, { numeric: true, sensitivity: 'base' })
1054
1060
  if (result === 0) result = a.host.localeCompare(b.host)
@@ -1068,10 +1074,10 @@ window.__ModuleLoader__.load({
1068
1074
  }
1069
1075
 
1070
1076
  function tableTracks(prefs) {
1071
- const tracks = ['32px', '112px', '92px', 'minmax(0,1.1fr)', 'minmax(0,1.2fr)']
1072
- if (prefs.info) tracks.push('minmax(250px,1.5fr)')
1073
- if (prefs.notes) tracks.push('minmax(0,0.9fr)')
1074
- tracks.push('176px', '32px')
1077
+ const tracks = ['32px', '96px', '80px', 'minmax(90px,1fr)', 'minmax(150px,1.25fr)']
1078
+ if (prefs.info) tracks.push('minmax(210px,1.4fr)')
1079
+ if (prefs.notes) tracks.push('minmax(120px,0.8fr)')
1080
+ tracks.push('150px', '28px')
1075
1081
  return tracks.join(' ')
1076
1082
  }
1077
1083
 
@@ -2394,7 +2400,7 @@ window.__ModuleLoader__.load({
2394
2400
  h(
2395
2401
  'div',
2396
2402
  { className: 'ssh-cell ssh-colAddress' },
2397
- h('span', { className: 'ssh-address', title: hostAddress(host) }, hostAddress(host)),
2403
+ h('span', { className: 'ssh-address', title: hostAddress(host) }, hostTarget(host)),
2398
2404
  h(
2399
2405
  'span',
2400
2406
  { className: 'ssh-inlineActions' },
@@ -2503,9 +2509,11 @@ window.__ModuleLoader__.load({
2503
2509
  observer.observe(node)
2504
2510
  return () => observer.disconnect()
2505
2511
  }, [])
2512
+ const hasInfo = visible.some((host) => Boolean(host.system || host.cpuCores || host.memoryGB || host.diskGB))
2513
+ const hasNotes = visible.some((host) => Boolean(host.note))
2506
2514
  const effective = {
2507
- info: columns.info && tableWidth >= 860,
2508
- notes: columns.notes && tableWidth >= 1000,
2515
+ info: columns.info && hasInfo && tableWidth >= 900,
2516
+ notes: columns.notes && hasNotes && tableWidth >= 1100,
2509
2517
  }
2510
2518
  const style = { gridTemplateColumns: tableTracks(effective) }
2511
2519
  const visibleAliases = visible.map((host) => host.host)
@@ -2741,7 +2749,7 @@ window.__ModuleLoader__.load({
2741
2749
  'div',
2742
2750
  { className: 'ssh-sessionActions' },
2743
2751
  activeHost
2744
- ? h('span', { className: 'ssh-sessionAddress', title: hostAddress(activeHost) }, hostAddress(activeHost))
2752
+ ? h('span', { className: 'ssh-sessionAddress', title: hostAddress(activeHost) }, hostTarget(activeHost))
2745
2753
  : null,
2746
2754
  activeCredential ? h(Badge, { tone: activeCredential.tone }, activeCredential.label) : null,
2747
2755
  h(
@@ -2853,7 +2861,7 @@ window.__ModuleLoader__.load({
2853
2861
  'div',
2854
2862
  { className: 'ssh-drawerTitles' },
2855
2863
  h('div', { className: 'ssh-drawerTitle', title: hostName(host) }, hostName(host)),
2856
- h('div', { className: 'ssh-drawerSub' }, hostAddress(host)),
2864
+ h('div', { className: 'ssh-drawerSub' }, hostTarget(host)),
2857
2865
  ),
2858
2866
  h(
2859
2867
  Badge,
@@ -4204,7 +4212,7 @@ window.__ModuleLoader__.load({
4204
4212
  label: t('table.select'),
4205
4213
  }),
4206
4214
  h('span', { className: 'ssh-targetName' }, hostName(host)),
4207
- h('span', { className: 'ssh-targetAddr' }, hostAddress(host)),
4215
+ h('span', { className: 'ssh-targetAddr' }, hostTarget(host)),
4208
4216
  h('span', { className: 'ssh-targetCred' }, h(Badge, { tone: credential.tone }, credential.label)),
4209
4217
  )
4210
4218
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-ssh-manage",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "A DSH sidebar plugin for managing SSH host profiles with a real interactive PTY terminal.",
5
5
  "license": "MIT",
6
6
  "private": false,