feat: release OpsXShell 2.1.0 native Tauri edition
This commit is contained in:
1 parent
e9a0d21758
commit
a3dba0c6ed
311 files changed
+31748
-14897
No files matched your search
+30
-2
@@ -2,10 +2,11 @@ import { create } from 'zustand'
|
||||
import { persist } from 'zustand/middleware'
|
||||
import { createLogger } from '../utils/logger'
|
||||
import type { SSHConnectionConfig } from '../../shared/types/session.types'
|
||||
import type { SerialConfig } from '../../shared/types/serial.types'
|
||||
|
||||
const logger = createLogger('TabStore')
|
||||
|
||||
export type TabType = 'welcome' | 'terminal' | 'sftp' | 'portforward' | 'settings'
|
||||
export type TabType = 'welcome' | 'terminal' | 'serial' | 'sftp' | 'portforward' | 'settings'
|
||||
export type ConnectionStatus = 'disconnected' | 'connecting' | 'connected' | 'error'
|
||||
|
||||
// 连接实例信息
|
||||
@@ -15,6 +16,15 @@ export interface ConnectionInstance {
|
||||
sftpId?: string // SFTP 会话 ID(仅 sftp 类型)
|
||||
}
|
||||
|
||||
/** Terminal split layout (persisted without shell ids) */
|
||||
export interface SplitLayout {
|
||||
direction: 'horizontal' | 'vertical'
|
||||
/** Number of panes 1–4 */
|
||||
paneCount: number
|
||||
/** Ratio used when paneCount === 2 (first pane share 0.2–0.8) */
|
||||
ratio?: number
|
||||
}
|
||||
|
||||
export interface Tab {
|
||||
id: string
|
||||
title: string
|
||||
@@ -25,6 +35,18 @@ export interface Tab {
|
||||
isActive: boolean
|
||||
connectionStatus?: ConnectionStatus
|
||||
needsReconnect?: boolean // 从持久化恢复后需要重新连接
|
||||
/** Batch actions can establish inactive terminal tabs immediately. */
|
||||
connectOnMount?: boolean
|
||||
/** Terminal multi-pane layout */
|
||||
splitLayout?: SplitLayout
|
||||
/** Host local shell (node-pty), not SSH */
|
||||
isLocal?: boolean
|
||||
/** Local shell kind for tab badge: zsh | bash | fish | ... */
|
||||
localShellKind?: string
|
||||
/** Explicit shell binary path e.g. /bin/zsh */
|
||||
localShellPath?: string
|
||||
/** Native serial terminal configuration. */
|
||||
serialConfig?: SerialConfig
|
||||
}
|
||||
|
||||
// 用于持久化的序列化 Tab 数据(排除敏感字段和运行时状态)
|
||||
@@ -33,6 +55,9 @@ interface PersistedTab {
|
||||
title: string
|
||||
type: TabType
|
||||
sessionId?: string
|
||||
splitLayout?: SplitLayout
|
||||
isLocal?: boolean
|
||||
serialConfig?: SerialConfig
|
||||
// 注意:不持久化 connectionConfig(可能包含密码/密钥)
|
||||
// 注意:不持久化 connectionInstance(运行时状态)
|
||||
// 注意:不持久化 connectionStatus(运行时状态)
|
||||
@@ -295,13 +320,16 @@ export const useTabStore = create<TabState>()(
|
||||
const tabsToPersist = state.tabs
|
||||
.filter(tab => {
|
||||
// 持久化有 sessionId 的标签或非 welcome/settings 类型
|
||||
return tab.type === 'terminal' || tab.type === 'sftp' || tab.type === 'portforward'
|
||||
return tab.type === 'terminal' || tab.type === 'serial' || tab.type === 'sftp' || tab.type === 'portforward'
|
||||
})
|
||||
.map(tab => ({
|
||||
id: tab.id,
|
||||
title: tab.title,
|
||||
type: tab.type,
|
||||
sessionId: tab.sessionId,
|
||||
splitLayout: tab.splitLayout,
|
||||
isLocal: tab.isLocal,
|
||||
serialConfig: tab.serialConfig,
|
||||
// 不保存 connectionConfig(含密码等敏感信息)
|
||||
// 不保存 connectionInstance(运行时状态)
|
||||
// 不保存 connectionStatus(运行时状态)
|
||||
|
||||
Reference in new issue
Block a user