核心功能: - SSH终端: 密码/密钥认证、XTerm.js终端、多主题配色、IP高亮 - SFTP管理: 双栏文件管理、上传下载、传输队列 - 端口转发: 本地/远程转发、SOCKS5动态代理、规则管理 架构改进: - 拆分大型组件 (SFTPView/TabBar/Sidebar) - 添加统一日志和错误处理 - 修复React严格模式下的终端黑屏问题 UI更新: - 新增端口转发视图 - 更新UI预览文档 - 左侧栏右键菜单支持SFTP快捷打开
25 lines
550 B
TypeScript
25 lines
550 B
TypeScript
/**
|
|
* App IPC Handlers
|
|
* 处理应用级别信息
|
|
*/
|
|
|
|
import { ipcMain, IpcMainInvokeEvent, app } from 'electron'
|
|
|
|
// IPC channel names
|
|
export const APP_CHANNELS = {
|
|
GET_VERSION: 'app:getVersion',
|
|
GET_DOWNLOADS_PATH: 'app:getDownloadsPath',
|
|
} as const
|
|
|
|
export function registerAppIPCHandlers(): void {
|
|
// Get app version
|
|
ipcMain.handle(APP_CHANNELS.GET_VERSION, () => {
|
|
return app.getVersion()
|
|
})
|
|
|
|
// Get downloads directory path
|
|
ipcMain.handle(APP_CHANNELS.GET_DOWNLOADS_PATH, () => {
|
|
return app.getPath('downloads')
|
|
})
|
|
}
|