Skip to content

DeepSeek Harness Tauri 桌面版 | Only 8mb installer, zero environment setup, preset plugins, Windows / macOS / Linux.

feat(ssh-ui): 远端会话页只留一张大告示卡

Menghuan19180ff03d23d1f7
diff --git a/packages/dsh-tauri-ssh-ui/src/client/components/machines-section.test.tsx b/packages/dsh-tauri-ssh-ui/src/client/components/machines-section.test.tsx
index 48daa9df..589c55a2 100644
--- a/packages/dsh-tauri-ssh-ui/src/client/components/machines-section.test.tsx
+++ b/packages/dsh-tauri-ssh-ui/src/client/components/machines-section.test.tsx
@@ -73,7 +73,12 @@ describe('machinesSection', () => {
await waitFor(() => expect(screen.getByTestId('remote-session-banner')).toBeTruthy())
expect(screen.getByText('Currently in an SSH session')).toBeTruthy()
expect(screen.getByText(/over SSH from ops/)).toBeTruthy()
+ // 告示卡点明回发起端用「同步到远端…」搬插件与 Skill
+ expect(screen.getByTestId('remote-session-sync-hint').textContent).toContain('Sync to remote')
+ // 其余内容整块让位:添加/刷新/说明/机器列表都不渲染
expect(screen.queryByText('Add machine')).toBeNull()
+ expect(screen.queryByText('Refresh')).toBeNull()
+ expect(screen.queryByText(/Connect straight through your local/)).toBeNull()
expect(screen.queryByTestId('machine-a')).toBeNull()
})
diff --git a/packages/dsh-tauri-ssh-ui/src/client/components/machines-section.tsx b/packages/dsh-tauri-ssh-ui/src/client/components/machines-section.tsx
index 5996a375..bee7beab 100644
--- a/packages/dsh-tauri-ssh-ui/src/client/components/machines-section.tsx
+++ b/packages/dsh-tauri-ssh-ui/src/client/components/machines-section.tsx
@@ -838,6 +838,31 @@ export function MachinesSection({ t, store, bridge }: MachinesSectionProps): Rea
// 纯 Web 端移除,避免按钮闪现造成布局跳动。
const bridgePending = availability === 'unknown'
+ // 远端会话:本实例自己就是 SSH 目标,机器管理在发起端——整页只剩告示卡
+ // (列表/添加/刷新全部让位),并点明回发起端用「同步到远端…」搬插件与 Skill。
+ if (state.role?.remote === true) {
+ return (
+ <div className={cls.section} data-testid="remote-session">
+ <h2 className={cls.title}>{t('title')}</h2>
+ <div className={cls.remoteCard} data-testid="remote-session-banner">
+ <span className={cls.remoteIcon} aria-hidden="true">
+ <svg fill="none" height="22" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="1.6" viewBox="0 0 24 24" width="22">
+ <path d="M4 17l6-6-6-6" />
+ <path d="M12 19h8" />
+ </svg>
+ </span>
+ <p className={cls.remoteTitle}>{t('session.remoteTitle')}</p>
+ <p className={cls.remoteHint}>
+ {state.role.origin !== undefined && state.role.origin !== ''
+ ? t('session.remoteHintNamed').replace('{name}', state.role.origin)
+ : t('session.remoteHint')}
+ </p>
+ <p className={cls.remoteNote} data-testid="remote-session-sync-hint">{t('session.remoteSyncHint')}</p>
+ </div>
+ </div>
+ )
+ }
+
return (
<div className={cls.section}>
<div className={cls.sectionHead}>
@@ -849,13 +874,9 @@ export function MachinesSection({ t, store, bridge }: MachinesSectionProps): Rea
<Button variant="outline" size="sm" disabled={state.status === 'loading'} onClick={() => void store.load()}>
{t('refresh')}
</Button>
- {state.role?.remote === true
- ? null
- : (
- <Button variant="primary" size="sm" disabled={state.status === 'loading'} onClick={() => setAddOpen(true)}>
- {t('addMachine')}
- </Button>
- )}
+ <Button variant="primary" size="sm" disabled={state.status === 'loading'} onClick={() => setAddOpen(true)}>
+ {t('addMachine')}
+ </Button>
</div>
</div>
{state.notice !== null ? <p className={cls.notice} data-testid="notice">{noticeTextOf(state.notice, t)}</p> : null}
@@ -879,30 +900,92 @@ export function MachinesSection({ t, store, bridge }: MachinesSectionProps): Rea
{state.status === 'ready' && state.machines.length === 0 && state.discovered.length === 0
? <p className={cls.empty}>{t('empty')}</p>
: null}
- {state.role?.remote === true
- ? (
- <div className={cls.emptyBlock} data-testid="remote-session-banner">
- <p className={cls.empty}>{t('session.remoteTitle')}</p>
- <p className={cls.hint}>
- {state.role.origin !== undefined && state.role.origin !== ''
- ? t('session.remoteHintNamed').replace('{name}', state.role.origin)
- : t('session.remoteHint')}
- </p>
- </div>
- )
- : (
- <>
- <ul className={cls.rows}>
- {state.machines.map((row) => {
- const draft = drafts[row.id] ?? { key: row.id, row }
- return (
+ <>
+ <ul className={cls.rows}>
+ {state.machines.map((row) => {
+ const draft = drafts[row.id] ?? { key: row.id, row }
+ return (
+ <RowShell
+ key={row.id}
+ id={row.id}
+ name={row.name === '' ? row.id : row.name}
+ tag={row.host}
+ tintColor={colorOf(row)}
+ tintBorder={row.tintBorder === true}
+ status={state.statuses[row.id]}
+ trail={state.trails[row.id] ?? []}
+ t={t}
+ actions={(
+ <RowActions
+ id={row.id}
+ t={t}
+ status={state.statuses[row.id]}
+ busy={state.busy[row.id]}
+ bridgeOpen={bridgeOpen}
+ bridgePending={bridgePending}
+ opening={openingId === row.id}
+ onTest={id => void store.test(id)}
+ onConnect={id => void store.connect(id)}
+ onDisconnect={id => void store.disconnect(id)}
+ onOpen={openRemoteWindow}
+ extras={(
+ <>
+ <Button variant="outline" size="sm" disabled={editingId !== null && editingId !== row.id} onClick={() => editingId === row.id ? closeEditor(row.id) : openEditor(row)}>
+ {t('edit')}
+ </Button>
+ <Button variant="ghost" size="sm" className={cls.dangerAction} disabled={state.busy[row.id] !== undefined} onClick={() => setRemoveTarget({ key: row.id, id: row.id, name: row.name === '' ? row.id : row.name })}>
+ {t('remove')}
+ </Button>
+ </>
+ )}
+ />
+ )}
+ >
+ {editingId === row.id
+ ? (
+ <EditPanel
+ draft={draft}
+ t={t}
+ secretSet={secretFlagsOf(row)}
+ dirty={dirty[row.id] ?? {}}
+ saving={savingId === row.id}
+ onChange={patchDraft}
+ onSecret={patchDirty}
+ onSave={key => void saveRow(key)}
+ onCancel={closeEditor}
+ />
+ )
+ : null}
+ <RowDetails
+ id={row.id}
+ status={state.statuses[row.id]}
+ busy={state.busy[row.id]}
+ logLines={state.logs[row.id] ?? []}
+ bridgeError={bridgeErrors[row.id]}
+ installResult={state.installResults[row.id]}
+ t={t}
+ onInstall={id => void store.install(id)}
+ />
+ </RowShell>
+ )
+ })}
+ </ul>
+ {state.discovered.length > 0
+ ? (
+ <>
+ <div className={cls.group}>
+ <h3 className={cls.groupTitle}>{t('configHosts')}</h3>
+ <p className={cls.groupHint}>{t('configHostsHint')}</p>
+ </div>
+ <ul className={cls.rows}>
+ {state.discovered.map(row => (
<RowShell
key={row.id}
id={row.id}
- name={row.name === '' ? row.id : row.name}
- tag={row.host}
- tintColor={colorOf(row)}
- tintBorder={row.tintBorder === true}
+ name={row.name}
+ tag={t('configTag')}
+ tintColor={undefined}
+ tintBorder={false}
status={state.statuses[row.id]}
trail={state.trails[row.id] ?? []}
t={t}
@@ -919,34 +1002,9 @@ export function MachinesSection({ t, store, bridge }: MachinesSectionProps): Rea
onConnect={id => void store.connect(id)}
onDisconnect={id => void store.disconnect(id)}
onOpen={openRemoteWindow}
- extras={(
- <>
- <Button variant="outline" size="sm" disabled={editingId !== null && editingId !== row.id} onClick={() => editingId === row.id ? closeEditor(row.id) : openEditor(row)}>
- {t('edit')}
- </Button>
- <Button variant="ghost" size="sm" className={cls.dangerAction} disabled={state.busy[row.id] !== undefined} onClick={() => setRemoveTarget({ key: row.id, id: row.id, name: row.name === '' ? row.id : row.name })}>
- {t('remove')}
- </Button>
- </>
- )}
/>
)}
>
- {editingId === row.id
- ? (
- <EditPanel
- draft={draft}
- t={t}
- secretSet={secretFlagsOf(row)}
- dirty={dirty[row.id] ?? {}}
- saving={savingId === row.id}
- onChange={patchDraft}
- onSecret={patchDirty}
- onSave={key => void saveRow(key)}
- onCancel={closeEditor}
- />
- )
- : null}
<RowDetails
id={row.id}
status={state.statuses[row.id]}
@@ -958,62 +1016,12 @@ export function MachinesSection({ t, store, bridge }: MachinesSectionProps): Rea
onInstall={id => void store.install(id)}
/>
</RowShell>
- )
- })}
- </ul>
- {state.discovered.length > 0
- ? (
- <>
- <div className={cls.group}>
- <h3 className={cls.groupTitle}>{t('configHosts')}</h3>
- <p className={cls.groupHint}>{t('configHostsHint')}</p>
- </div>
- <ul className={cls.rows}>
- {state.discovered.map(row => (
- <RowShell
- key={row.id}
- id={row.id}
- name={row.name}
- tag={t('configTag')}
- tintColor={undefined}
- tintBorder={false}
- status={state.statuses[row.id]}
- trail={state.trails[row.id] ?? []}
- t={t}
- actions={(
- <RowActions
- id={row.id}
- t={t}
- status={state.statuses[row.id]}
- busy={state.busy[row.id]}
- bridgeOpen={bridgeOpen}
- bridgePending={bridgePending}
- opening={openingId === row.id}
- onTest={id => void store.test(id)}
- onConnect={id => void store.connect(id)}
- onDisconnect={id => void store.disconnect(id)}
- onOpen={openRemoteWindow}
- />
- )}
- >
- <RowDetails
- id={row.id}
- status={state.statuses[row.id]}
- busy={state.busy[row.id]}
- logLines={state.logs[row.id] ?? []}
- bridgeError={bridgeErrors[row.id]}
- installResult={state.installResults[row.id]}
- t={t}
- onInstall={id => void store.install(id)}
- />
- </RowShell>
- ))}
- </ul>
- </>
- )
- : null}
- </>
- )}
+ ))}
+ </ul>
+ </>
+ )
+ : null}
+ </>
{addOpen
? (
<AddMachineDialog
diff --git a/packages/dsh-tauri-ssh-ui/src/client/locales/index.ts b/packages/dsh-tauri-ssh-ui/src/client/locales/index.ts
index 35774c32..ace8bd26 100644
--- a/packages/dsh-tauri-ssh-ui/src/client/locales/index.ts
+++ b/packages/dsh-tauri-ssh-ui/src/client/locales/index.ts
@@ -34,8 +34,9 @@ export const zh = {
'session.remoteTitle': '目前正在 SSH 中',
'sync.nav': '同步到远端',
'sync.notConnectedHint': '还没有已连接的机器——先在「SSH 远程机器」里连接一台,即可把插件和 Skill 同步过去。',
- 'session.remoteHintNamed': '此实例正通过 SSH 来自 {name} 的连接使用——机器管理请在发起 SSH 连接的机器上配置。',
- 'session.remoteHint': '此实例正通过 SSH 远程连接使用——机器管理请在发起 SSH 连接的机器上配置。',
+ 'session.remoteHintNamed': '此实例正通过 SSH 来自 {name} 的连接使用;机器的添加、编辑与连接都在发起端操作。',
+ 'session.remoteHint': '此实例正通过 SSH 远程连接使用;机器的添加、编辑与连接都在发起端操作。',
+ 'session.remoteSyncHint': '想把发起端的插件和 Skill 搬过来?回到发起连接的机器,在顶部切换器里选「同步到远端…」。',
'field.remotePort': '远端端口',
'field.profileName': '远端档案(默认 remote)',
'field.startCommand': '启动命令(可选)',
@@ -138,8 +139,9 @@ export const en = {
'session.remoteTitle': 'Currently in an SSH session',
'sync.nav': 'Sync to remote',
'sync.notConnectedHint': 'No connected machines yet — connect one under “SSH machines” first, then sync plugins and skills to it.',
- 'session.remoteHintNamed': 'This instance is in use over SSH from {name} — manage machines on the machine that initiated the SSH connection.',
- 'session.remoteHint': 'This instance is in use over SSH — manage machines on the machine that initiated the SSH connection.',
+ 'session.remoteHintNamed': 'This instance is in use over SSH from {name}; add, edit and connect machines on the machine that started the session.',
+ 'session.remoteHint': 'This instance is in use over an SSH session; add, edit and connect machines on the machine that started it.',
+ 'session.remoteSyncHint': 'Want the plugins and skills from that side? On the machine that started the session, pick “Sync to remote…” in the top switcher.',
'field.remotePort': 'Remote port',
'field.profileName': 'Remote profile (default remote)',
'field.startCommand': 'Start command (optional)',
diff --git a/packages/dsh-tauri-ssh-ui/src/client/styles/index.cssr.ts b/packages/dsh-tauri-ssh-ui/src/client/styles/index.cssr.ts
index 7c88612d..6f117743 100644
--- a/packages/dsh-tauri-ssh-ui/src/client/styles/index.cssr.ts
+++ b/packages/dsh-tauri-ssh-ui/src/client/styles/index.cssr.ts
@@ -446,6 +446,62 @@ export default c([
gap: '8px',
}),
+ /*
+ * 远端会话页(本实例自己就是 SSH 目标):整个分区只剩这张告示卡——机器
+ * 列表、添加/刷新全部让位,标题刻意放大到页面级,一眼看清「这里没有可管
+ * 理的东西,回发起端去配」。
+ */
+ c('.dshp-ssh-remote-card', {
+ display: 'flex',
+ flexDirection: 'column',
+ alignItems: 'center',
+ gap: '12px',
+ marginTop: '4px',
+ padding: '40px 24px',
+ border: '0.5px solid var(--dsw-alias-border-l2)',
+ borderRadius: '12px',
+ background: 'var(--dsw-alias-bg-layer-1)',
+ textAlign: 'center',
+ }),
+
+ c('.dshp-ssh-remote-icon', {
+ display: 'inline-flex',
+ alignItems: 'center',
+ justifyContent: 'center',
+ width: '44px',
+ height: '44px',
+ borderRadius: '50%',
+ background: 'var(--dsw-alias-surface-tinted)',
+ color: 'var(--dsw-alias-state-success-primary)',
+ }),
+
+ c('.dshp-ssh-remote-title', {
+ margin: 0,
+ fontSize: '22px',
+ lineHeight: '32px',
+ fontWeight: 600,
+ color: 'var(--dsw-alias-label-primary)',
+ }),
+
+ c('.dshp-ssh-remote-hint', {
+ margin: 0,
+ maxWidth: '460px',
+ fontSize: '13px',
+ lineHeight: '21px',
+ color: 'var(--dsw-alias-label-secondary)',
+ }),
+
+ c('.dshp-ssh-remote-note', {
+ margin: 0,
+ maxWidth: '460px',
+ padding: '8px 12px',
+ borderRadius: '8px',
+ background: 'var(--dsw-alias-surface-tinted)',
+ fontSize: '12px',
+ lineHeight: '19px',
+ color: 'var(--dsw-alias-label-tertiary)',
+ }),
+
/* The sync panel (a section-level group under the machine list). */
c('.dshp-ssh-sync-panel', {
display: 'flex',
diff --git a/packages/dsh-tauri-ssh-ui/src/client/styles/index.ts b/packages/dsh-tauri-ssh-ui/src/client/styles/index.ts
index a5b62093..9f62cdc1 100644
--- a/packages/dsh-tauri-ssh-ui/src/client/styles/index.ts
+++ b/packages/dsh-tauri-ssh-ui/src/client/styles/index.ts
@@ -65,6 +65,11 @@ export const cls = {
hint: 'dshp-ssh-hint',
empty: 'dshp-ssh-empty',
emptyBlock: 'dshp-ssh-empty-block',
+ remoteCard: 'dshp-ssh-remote-card',
+ remoteIcon: 'dshp-ssh-remote-icon',
+ remoteTitle: 'dshp-ssh-remote-title',
+ remoteHint: 'dshp-ssh-remote-hint',
+ remoteNote: 'dshp-ssh-remote-note',
syncPanel: 'dshp-ssh-sync-panel',
syncTargets: 'dshp-ssh-sync-targets',
syncGroups: 'dshp-ssh-sync-groups',