MrTerm: SSH/SFTP/RDP-Client im Termius-Stil (Electron)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-25 14:43:32 +02:00
co-authored by Claude Opus 5.5
commit a5eccc7764
13 changed files with 6133 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
const { contextBridge, ipcRenderer } = require('electron');
async function call(channel, ...args) {
const r = await ipcRenderer.invoke(channel, ...args);
if (!r.ok) throw new Error(r.error);
return r.value;
}
function on(channel, fn) {
const h = (_e, ...a) => fn(...a);
ipcRenderer.on(channel, h);
return () => ipcRenderer.removeListener(channel, h);
}
contextBridge.exposeInMainWorld('api', {
platform: process.platform,
call,
on,
win: {
min: () => ipcRenderer.send('win:min'),
max: () => ipcRenderer.send('win:max'),
close: () => ipcRenderer.send('win:close'),
},
ssh: {
write: (id, d) => ipcRenderer.send('ssh:write', id, d),
resize: (id, c, r) => ipcRenderer.send('ssh:resize', id, c, r),
close: (id) => ipcRenderer.send('ssh:close', id),
},
replySecret: (reqId, v) => ipcRenderer.send('secret:reply', reqId, v),
});