Compare commits

..
8 Commits
Author SHA1 Message Date
MrBlakeandClaude Opus 5.5 b578a6c7ec Release-Skript: fragt Version ab, baut Windows + Arch/CachyOS und lädt nach Gitea hoch
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-25 18:06:27 +02:00
MrBlakeandClaude Opus 5.5 4b1738aae8 Linux: Neustart mit --ozone-platform=x11 statt appendSwitch (GPU-Prozess stürzte ab, kein Fenster im installierten Paket)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-25 16:44:12 +02:00
MrBlakeandClaude Opus 5.5 6222a3ba6e Linux-Build: Install-Skript von cpu-features erlauben (fehlende buildcheck.gypi), homepage für pacman-Paket ergänzt
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-25 16:32:05 +02:00
MrBlake 04b65a2c61 Add: gitignore 2026-09-25 16:31:12 +02:00
MrBlakeandClaude Opus 5.5 d52f08647b README: Hilfe bei EACCES-Fehler (root-eigene Dateien in node_modules) beim Linux-Build
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-25 16:29:16 +02:00
MrBlakeandClaude Opus 5.5 b6b93aa240 Sidebar: Menü ein-/ausklappbar (eingeklappt als Symbolleiste, Zustand wird gemerkt)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-25 15:45:55 +02:00
MrBlakeandClaude Opus 5.5 b81a7bd794 Sidebar: Verzeichnisbaum mit Ordnern und Verbindungen (auf-/zuklappbar, Doppelklick verbindet, Drag & Drop in Ordner)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-25 15:44:36 +02:00
MrBlakeandClaude Opus 5.5 4361d747f3 Drawer-Schatten ragte im geschlossenen Zustand ins Fenster
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-25 15:36:25 +02:00
8 changed files with 195 additions and 5 deletions

No files matched your search

+2
View File
@@ -1,2 +1,4 @@
node_modules/
dist/
package.json
.gitea-token
+11
View File
@@ -30,11 +30,22 @@ npm start
Abhängigkeiten unter Arch/CachyOS: `sudo pacman -S freerdp gnome-keyring` (oder `kwallet` unter KDE) für RDP bzw. Vault-Verschlüsselung.
**Build bricht mit `EACCES: permission denied, unlink 'build/config.gypi'` ab** (z. B. bei `cpu-features`): Dateien in `node_modules` gehören root, meist nach einem `npm install` oder Build mit `sudo`. Besitz zurückholen und erneut bauen:
```sh
sudo chown -R $USER: node_modules
npm run dist:linux
```
npm und die Builds danach nicht mehr mit `sudo` ausführen – nur `pacman -U` zum Installieren braucht root.
## Release veröffentlichen (für Auto-Update)
1. Version in `package.json` erhöhen
2. Auf jeder Plattform bauen (`npm run dist:win` bzw. `npm run dist:linux`)
3. `GITEA_TOKEN=<token> npm run release -- --notes "Was ist neu"` – legt das Release `v<version>` an und lädt die Pakete hoch
Oder alles in einem Schritt unter Linux (Windows-Build per `wine`): `./scripts/release-all.sh` – fragt nach Version und Notizen, committet/pusht die Version, baut Windows + Arch/CachyOS und lädt hoch. Token aus `GITEA_TOKEN` oder `.gitea-token` (nicht eingecheckt).
Installierte Clients prüfen beim Start (und über Einstellungen → Updates) und installieren das passende Paket. Für ein privates Repo in den Einstellungen ein Lese-Token hinterlegen.
Icons neu erzeugen nach Logo-Änderung: `npx electron scripts/make-icons.js`
+1
View File
@@ -5,6 +5,7 @@
"description": "Moderner SSH-, SFTP- und RDP-Client",
"main": "src/main/main.js",
"author": "MrBlake",
"homepage": "https://git.mrblake.cc/MrBlake/MrTerm",
"license": "MIT",
"scripts": {
"start": "electron .",
+33
View File
@@ -0,0 +1,33 @@
#!/usr/bin/env bash
# Fragt nach der Version, baut Windows (Setup + Portable, per wine) und Arch/CachyOS (pacman + AppImage)
# und lädt alles als Release v<version> nach Gitea hoch.
# Token: Umgebungsvariable GITEA_TOKEN oder Datei .gitea-token im Projektordner (nicht eingecheckt).
set -euo pipefail
cd "$(dirname "$0")/.."
unset ELECTRON_RUN_AS_NODE
if [[ -z "${GITEA_TOKEN:-}" && -f .gitea-token ]]; then GITEA_TOKEN="$(tr -d '[:space:]' < .gitea-token)"; fi
if [[ -z "${GITEA_TOKEN:-}" ]]; then read -rsp "Gitea-Token: " GITEA_TOKEN; echo; fi
export GITEA_TOKEN
current="$(node -p "require('./package.json').version")"
read -rp "Release-Version [${current}]: " version
version="${version:-$current}"
version="${version#v}"
[[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.]+)?$ ]] || { echo "Ungültige Version: $version"; exit 1; }
read -rp "Release-Notizen: " notes
prerelease=()
[[ "$version" == *-* ]] && prerelease=(--prerelease)
if [[ "$version" != "$current" ]]; then
npm version "$version" --no-git-tag-version >/dev/null
git add package.json package-lock.json
git commit -m "Version ${version}"
fi
git push origin HEAD
rm -rf dist
npm run dist:linux
npm run dist:win
npm run release -- --notes "$notes" "${prerelease[@]}"
+6 -1
View File
@@ -17,7 +17,12 @@ const store = new Store();
// Die Wahl wird unverschlüsselt in launch.json gespeichert, weil sie vor dem Start des Fensters gebraucht wird.
const launchFile = path.join(app.getPath('userData'), 'launch.json');
function readLaunch() { try { return JSON.parse(fs.readFileSync(launchFile, 'utf8')); } catch { return {}; } }
if (process.platform === 'linux' && readLaunch().x11 !== false) app.commandLine.appendSwitch('ozone-platform', 'x11');
// appendSwitch kommt für ozone-platform zu spät (Browser läuft schon unter Wayland, GPU-Prozess stürzt ab),
// daher einmalig mit dem Schalter auf der Kommandozeile neu starten.
if (process.platform === 'linux' && readLaunch().x11 !== false && !process.argv.some(a => a.startsWith('--ozone-platform'))) {
app.relaunch({ args: process.argv.slice(1).concat('--ozone-platform=x11') });
app.exit(0);
}
const pendingSecrets = new Map();
function send(channel, ...args) {
+105 -1
View File
@@ -154,6 +154,108 @@ $$('#sidebar .nav[data-view]').forEach((n) => n.addEventListener('click', () =>
render();
}));
// ============================================================ Einklappbares Menü (Sidebar)
(() => {
const KEY = 'mrterm.nav.collapsed';
const sb = $('#sidebar');
// Tooltips für die Symbolansicht
$$('#navMenu .nav').forEach((n) => { n.title = n.querySelector('span')?.textContent || ''; });
const apply = (collapsed) => {
sb.classList.toggle('nav-collapsed', collapsed);
$('#navToggle').title = collapsed ? 'Menü ausklappen' : 'Menü einklappen';
};
let collapsed = false;
try { collapsed = localStorage.getItem(KEY) === '1'; } catch {}
apply(collapsed);
$('#navToggle').onclick = () => {
collapsed = !collapsed;
apply(collapsed);
try { localStorage.setItem(KEY, collapsed ? '1' : '0'); } catch {}
};
})();
// ============================================================ Verzeichnisbaum (Sidebar)
const TREE_KEY = 'mrterm.tree.open';
const treeOpen = new Set((() => { try { return JSON.parse(localStorage.getItem(TREE_KEY) || '[]'); } catch { return []; } })());
const saveTreeOpen = () => { try { localStorage.setItem(TREE_KEY, JSON.stringify([...treeOpen])); } catch {} };
const CHEV = '<svg viewBox="0 0 24 24"><path d="M9 6l6 6-6 6"/></svg>';
function goGroup(id) {
S.view = 'hosts'; S.group = id; S.search = ''; S.tag = null;
$$('#sidebar .nav[data-view]').forEach((x) => x.classList.toggle('active', x.dataset.view === 'hosts'));
closeDrawer();
activateTab('home');
render();
}
async function moveHostToGroup(hostId, groupId) {
const hst = S.vault.hosts.find((x) => x.id === hostId);
if (!hst || (hst.groupId || null) === groupId) return;
await call('vault:upsert', 'hosts', { ...hst, groupId });
if (groupId) { treeOpen.add(groupId); saveTreeOpen(); }
reload();
}
function dropTarget(el, groupId) {
el.addEventListener('dragover', (e) => { if (e.dataTransfer.types.includes('mrterm/host')) { e.preventDefault(); el.classList.add('drop'); } });
el.addEventListener('dragleave', () => el.classList.remove('drop'));
el.addEventListener('drop', (e) => {
e.preventDefault(); el.classList.remove('drop');
const id = e.dataTransfer.getData('mrterm/host');
if (id) moveHostToGroup(id, groupId);
});
}
function renderTree() {
const box = $('#tree');
if (!box || !S.vault) return;
const scroll = box.scrollTop;
box.innerHTML = '';
const { groups, hosts } = S.vault;
const byLabel = (x, y) => (x.label || x.address || '').localeCompare(y.label || y.address || '', undefined, { numeric: true });
const countIn = (gid) => hosts.filter((x) => x.groupId === gid).length + groups.filter((g) => g.parentId === gid).reduce((n, g) => n + countIn(g.id), 0);
const head = h(`<div class="tree-head"><span>Verbindungen</span><button title="Alle einklappen">${ICONS.up}</button></div>`);
$('button', head).onclick = () => { treeOpen.clear(); saveTreeOpen(); renderTree(); };
dropTarget(head, null); // auf die Überschrift ziehen = Stammebene
box.append(head);
if (!groups.length && !hosts.length) { box.append(h('<div class="tree-empty">Noch keine Hosts</div>')); return; }
const pad = (depth) => `padding-left:${4 + depth * 14}px`;
const walk = (parentId, depth) => {
for (const g of groups.filter((x) => (x.parentId || null) === parentId).sort(byLabel)) {
const open = treeOpen.has(g.id);
const active = S.view === 'hosts' && S.group === g.id && S.active === 'home';
const row = h(`<div class="tree-row group ${active ? 'active' : ''}" style="${pad(depth)}" title="${esc(g.label)}">
<span class="chev ${open ? 'open' : ''}">${CHEV}</span><span class="ti" style="color:${g.color || 'var(--folder)'}">${ICONS.folder}</span><span class="tl">${esc(g.label)}</span><span class="tc">${countIn(g.id)}</span></div>`);
const toggle = () => { if (open) treeOpen.delete(g.id); else treeOpen.add(g.id); saveTreeOpen(); renderTree(); };
$('.chev', row).onclick = (e) => { e.stopPropagation(); toggle(); };
row.onclick = () => { if (!open) { treeOpen.add(g.id); saveTreeOpen(); } goGroup(g.id); };
row.oncontextmenu = (e) => ctxMenu(e.clientX, e.clientY, [
{ label: 'Öffnen', icon: 'folder', run: () => goGroup(g.id) },
{ label: 'Host hinzufügen', icon: 'plus', run: () => { goGroup(g.id); editHost({ groupId: g.id }); } },
{ label: 'Unterordner anlegen', icon: 'newdir', run: () => { goGroup(g.id); editGroup({ parentId: g.id }); } },
{ label: 'Bearbeiten', icon: 'edit', run: () => { goGroup(g.id); editGroup(g); } },
'-',
{ label: 'Löschen', icon: 'trash', danger: true, run: async () => { if (await confirmBox('Gruppe löschen?', `„${g.label}“ wird gelöscht. Hosts bleiben erhalten.`)) { await call('vault:remove', 'groups', g.id); reload(); } } },
]);
dropTarget(row, g.id);
box.append(row);
if (open) walk(g.id, depth + 1);
}
for (const x of hosts.filter((y) => (y.groupId || null) === parentId).sort(byLabel)) {
const live = S.tabs.some((t) => t.host?.id === x.id);
const row = h(`<div class="tree-row host" style="${pad(depth)}" draggable="true" title="${esc(hostSub(x))}">
<span class="chev"></span><span class="ti" style="background:${colorFor(x)}">${x.protocol === 'rdp' ? ICONS.screen : ICONS.term}</span><span class="tl">${esc(x.label || x.address)}</span>${live ? '<span class="tc" style="color:var(--green)">●</span>' : ''}</div>`);
row.ondblclick = () => connectHost(x);
row.oncontextmenu = (e) => ctxMenu(e.clientX, e.clientY, hostMenu(x));
row.ondragstart = (e) => { e.dataTransfer.setData('mrterm/host', x.id); e.dataTransfer.effectAllowed = 'move'; };
box.append(row);
}
};
walk(null, 0);
box.scrollTop = scroll;
}
function render() {
const page = $('#homeView');
const views = { hosts: viewHosts, sftp: viewSftpPicker, keys: viewKeys, forwards: viewForwards, snippets: viewSnippets, known: viewKnown, history: viewHistory, settings: viewSettings };
@@ -161,6 +263,7 @@ function render() {
page.innerHTML = '';
views[S.view](page);
page.scrollTop = scroll;
renderTree();
}
function toolbar(placeholder, buttons = []) {
@@ -845,7 +948,8 @@ function activateTab(id) {
if (t.id === id) requestAnimationFrame(() => t.onShow?.());
else t.onHide?.();
});
$$('.tab.active')[0]?.scrollIntoView({ block: 'nearest', inline: 'nearest' });
$('.tab.active')[0]?.scrollIntoView({ block: 'nearest', inline: 'nearest' });
renderTree();
}
function closeTab(id) {
const i = S.tabs.findIndex((t) => t.id === id);
+5 -1
View File
@@ -27,6 +27,8 @@
<div id="body">
<nav id="sidebar">
<div id="navHead" class="tree-head nav-head"><span>Menü</span><button id="navToggle" title="Menü einklappen"><svg viewBox="0 0 24 24"><path d="M6 15l6-6 6 6"/></svg></button></div>
<div id="navMenu" class="nav-menu">
<button class="nav active" data-view="hosts"><svg viewBox="0 0 24 24"><rect x="3" y="4" width="18" height="7" rx="2"/><rect x="3" y="13" width="18" height="7" rx="2"/><circle cx="7" cy="7.5" r="1"/><circle cx="7" cy="16.5" r="1"/></svg><span>Hosts</span></button>
<button class="nav" data-view="sftp"><svg viewBox="0 0 24 24"><path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/></svg><span>SFTP</span></button>
<button class="nav" data-view="keys"><svg viewBox="0 0 24 24"><circle cx="8" cy="15" r="4"/><path d="M11 12l9-9M16 7l3 3M14 9l2 2"/></svg><span>Keychain</span></button>
@@ -34,7 +36,9 @@
<button class="nav" data-view="snippets"><svg viewBox="0 0 24 24"><path d="M8 7l-5 5 5 5M16 7l5 5-5 5"/></svg><span>Snippets</span></button>
<button class="nav" data-view="known"><svg viewBox="0 0 24 24"><path d="M12 3l8 3v6c0 5-3.5 8-8 9-4.5-1-8-4-8-9V6z"/><path d="M9 12l2 2 4-4"/></svg><span>Known Hosts</span></button>
<button class="nav" data-view="history"><svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/></svg><span>Verlauf</span></button>
<div class="spacer"></div>
</div>
<div class="nav-sep"></div>
<div id="tree" class="tree"></div>
<button id="updateBadge" class="nav update-badge" style="display:none"><svg viewBox="0 0 24 24"><path d="M12 4v12M6 10l6 6 6-6M4 20h16"/></svg><span>Update</span></button>
<div id="vaultBadge" class="vault-badge"></div>
<button class="nav" data-view="settings"><svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z"/></svg><span>Einstellungen</span></button>
+32 -2
View File
@@ -112,6 +112,27 @@ svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width:
#body { flex: 1; display: flex; min-height: 0; position: relative; }
#sidebar { width: 212px; background: var(--chrome); padding: 10px 10px 12px; display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--chrome-line); flex: none; }
#sidebar .spacer { flex: 1; }
#sidebar { min-height: 0; }
.nav-sep { border-top: 1px solid var(--chrome-line); margin: 8px 4px 6px; flex: none; }
.tree { flex: 1; min-height: 60px; overflow: auto; margin: 0 -4px; padding: 0 4px; user-select: none; }
.tree-head { display: flex; align-items: center; justify-content: space-between; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; color: var(--faint); padding: 4px 6px 6px; border-radius: 6px; }
.tree-head button { border: none; background: none; color: var(--faint); padding: 2px; border-radius: 4px; display: flex; }
.tree-head button:hover { color: var(--text); background: var(--hover); }
.tree-head button svg { width: 14px; height: 14px; }
.tree-row { display: flex; align-items: center; gap: 6px; height: 26px; padding-right: 6px; border-radius: 6px; color: var(--muted); cursor: pointer; white-space: nowrap; font-size: 12.5px; }
.tree-row:hover { background: var(--hover); color: var(--text); }
.tree-row.active { background: var(--nav-active); color: var(--text); }
.tree-row .chev { width: 14px; display: flex; justify-content: center; color: var(--faint); flex: none; }
.tree-row .chev svg { width: 12px; height: 12px; transition: transform .12s; }
.tree-row .chev.open svg { transform: rotate(90deg); }
.tree-row .ti { display: flex; flex: none; }
.tree-row .ti svg { width: 15px; height: 15px; }
.tree-row .tl { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.tree-row .tc { font-size: 10px; color: var(--faint); }
.tree-row.host .ti { width: 16px; height: 16px; border-radius: 4px; align-items: center; justify-content: center; color: white; }
.tree-row.host .ti svg { width: 11px; height: 11px; stroke-width: 2.2; }
.tree-row.drop, .tree-head.drop { outline: 1px dashed var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.tree-empty { color: var(--faint); font-size: 12px; padding: 4px 8px; }
.nav { display: flex; align-items: center; gap: 12px; border: none; background: none; padding: 9px 12px; border-radius: 8px; color: var(--muted); text-align: left; font-weight: 500; }
.nav:hover { background: var(--hover); color: var(--text); }
.nav.active { background: var(--nav-active); color: var(--text); }
@@ -181,8 +202,8 @@ body.in-session #sidebar { display: none; }
.status-pill.on { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); }
/* ---------- Drawer (Editor) ---------- */
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: 400px; background: var(--bg-2); border-left: 1px solid var(--border); transform: translateX(100%); transition: transform .18s ease; z-index: 20; display: flex; flex-direction: column; box-shadow: -20px 0 40px #0006; }
.drawer.open { transform: translateX(0); }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: 400px; background: var(--bg-2); border-left: 1px solid var(--border); transform: translateX(100%); visibility: hidden; transition: transform .18s ease, box-shadow .18s ease, visibility 0s linear .18s; z-index: 20; display: flex; flex-direction: column; box-shadow: none; }
.drawer.open { transform: translateX(0); visibility: visible; box-shadow: -20px 0 40px #0006; transition: transform .18s ease, box-shadow .18s ease, visibility 0s; }
.drawer header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.drawer header h2 { margin: 0; font-size: 15px; }
.drawer .form { flex: 1; overflow: auto; padding: 16px 20px 20px; }
@@ -311,3 +332,12 @@ kbd { background: var(--card); border: 1px solid var(--border); border-bottom-wi
[data-theme='light'] .brand-term { color: #14a37a; }
.rdp-area { background: #000; }
.rdp-area .rdp-hint { margin: auto; color: var(--faint); font-size: 12px; }
/* ---------- Einklappbares Menü in der Sidebar ---------- */
.nav-head { padding-top: 0; }
.nav-head button svg { transition: transform .15s; }
.nav-menu { display: flex; flex-direction: column; gap: 2px; flex: none; }
#sidebar.nav-collapsed .nav-head button svg { transform: rotate(180deg); }
#sidebar.nav-collapsed .nav-menu { flex-direction: row; flex-wrap: wrap; gap: 2px; }
#sidebar.nav-collapsed .nav-menu .nav { padding: 7px; flex: 0 0 auto; }
#sidebar.nav-collapsed .nav-menu .nav span { display: none; }