Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5ae6fe5313 | ||
| ab97899d3b | |||
|
|
8bf7f47186 | ||
|
|
781820d5a1 | ||
|
|
fb80838a1c | ||
|
|
e88e798eb4 | ||
|
|
32eeba859e | ||
|
|
60a685fdda |
@@ -1,205 +0,0 @@
|
||||
#!/bin/bash
|
||||
##############################################################################
|
||||
# CREATE_COMPLETE_FILES.sh
|
||||
#
|
||||
# Dieses Script erstellt die vollständigen renderer.js und main.js Dateien
|
||||
# mit allen notwendigen Änderungen für Auto-Login und persistente Settings.
|
||||
#
|
||||
# VERWENDUNG:
|
||||
# 1. Speichere dieses Script in deinem Projekt-Ordner
|
||||
# 2. Mache es ausführbar: chmod +x CREATE_COMPLETE_FILES.sh
|
||||
# 3. Führe es aus: ./CREATE_COMPLETE_FILES.sh
|
||||
# 4. Die neuen Dateien werden erstellt: renderer_NEW.js und main_NEW.js
|
||||
# 5. Ersetze deine alten Dateien mit den neuen
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
echo "========================================="
|
||||
echo "Erstelle vollständige Dateien..."
|
||||
echo "========================================="
|
||||
echo ""
|
||||
|
||||
# Prüfe ob Original-Dateien existieren
|
||||
if [ ! -f "renderer.js" ]; then
|
||||
echo "❌ FEHLER: renderer.js nicht gefunden!"
|
||||
echo "Bitte führe dieses Script im Projekt-Ordner aus."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f "main.js" ]; then
|
||||
echo "❌ FEHLER: main.js nicht gefunden!"
|
||||
echo "Bitte führe dieses Script im Projekt-Ordner aus."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✅ Original-Dateien gefunden"
|
||||
echo ""
|
||||
|
||||
# Backup erstellen
|
||||
echo "📦 Erstelle Backups..."
|
||||
cp renderer.js renderer.js.backup
|
||||
cp main.js main.js.backup
|
||||
echo "✅ Backups erstellt: renderer.js.backup, main.js.backup"
|
||||
echo ""
|
||||
|
||||
# RENDERER.JS - Patch anwenden
|
||||
echo "🔧 Patche renderer.js..."
|
||||
|
||||
# Erstelle temporäre Datei mit der neuen DOMContentLoaded Funktion
|
||||
cat > /tmp/new_domcontentloaded.js << 'NEWFUNC'
|
||||
window.addEventListener('DOMContentLoaded', async () => {
|
||||
// Prevent default drag/drop on document (except in repo view)
|
||||
document.addEventListener('dragover', e => {
|
||||
if (currentState.view !== 'gitea-repo') {
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
document.addEventListener('drop', e => {
|
||||
if (currentState.view !== 'gitea-repo') {
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
// Load credentials and auto-login if available
|
||||
try {
|
||||
const creds = await window.electronAPI.loadCredentials();
|
||||
if (creds) {
|
||||
// Fülle Settings-Felder
|
||||
if ($('githubToken')) $('githubToken').value = creds.githubToken || '';
|
||||
if ($('giteaToken')) $('giteaToken').value = creds.giteaToken || '';
|
||||
if ($('giteaURL')) $('giteaURL').value = creds.giteaURL || '';
|
||||
|
||||
// AUTO-LOGIN: Wenn Gitea-Credentials vorhanden sind, lade sofort die Repos
|
||||
if (creds.giteaToken && creds.giteaURL) {
|
||||
console.log('✅ Credentials gefunden - Auto-Login wird gestartet...');
|
||||
setStatus('Lade deine Projekte...');
|
||||
|
||||
// Kurze Verzögerung damit UI fertig geladen ist
|
||||
setTimeout(() => {
|
||||
loadGiteaRepos();
|
||||
}, 500);
|
||||
} else {
|
||||
console.log('ℹ️ Keine vollständigen Gitea-Credentials - bitte in Settings eintragen');
|
||||
setStatus('Bereit - bitte Settings konfigurieren');
|
||||
}
|
||||
} else {
|
||||
console.log('ℹ️ Keine Credentials gespeichert');
|
||||
setStatus('Bereit - bitte Settings konfigurieren');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error loading credentials:', error);
|
||||
setStatus('Fehler beim Laden der Einstellungen');
|
||||
}
|
||||
NEWFUNC
|
||||
|
||||
# Nutze sed um die alte Funktion zu ersetzen
|
||||
# (Dies ist komplex - nutze Python für robusteres Replacement)
|
||||
python3 << 'PYSCRIPT'
|
||||
import re
|
||||
|
||||
# Lese Original-Datei
|
||||
with open('renderer.js', 'r', encoding='utf-8') as f:
|
||||
content = f.read()
|
||||
|
||||
# Lese neue Funktion
|
||||
with open('/tmp/new_domcontentloaded.js', 'r') as f:
|
||||
new_func_start = f.read()
|
||||
|
||||
# Finde die alte DOMContentLoaded Funktion und ersetze nur den Anfang
|
||||
# Der Rest (Event Handlers) bleibt gleich
|
||||
pattern = r"(window\.addEventListener\('DOMContentLoaded', async \(\) => \{.*?// Load credentials.*?try \{.*?\} catch \(error\) \{.*?console\.error\('Error loading credentials:', error\);.*?\})"
|
||||
|
||||
# Suche nach dem Pattern
|
||||
match = re.search(pattern, content, re.DOTALL)
|
||||
if match:
|
||||
# Ersetze nur den Credentials-Loading Teil
|
||||
old_section = match.group(1)
|
||||
content = content.replace(old_section, new_func_start)
|
||||
|
||||
# Schreibe neue Datei
|
||||
with open('renderer_NEW.js', 'w', encoding='utf-8') as f:
|
||||
f.write(content)
|
||||
print("✅ renderer_NEW.js erstellt")
|
||||
else:
|
||||
print("⚠️ Konnte Funktion nicht automatisch patchen")
|
||||
print(" Bitte nutze die manuellen Patches")
|
||||
PYSCRIPT
|
||||
|
||||
echo ""
|
||||
|
||||
# MAIN.JS - Patch anwenden
|
||||
echo "🔧 Patche main.js..."
|
||||
|
||||
python3 << 'PYSCRIPT2'
|
||||
import re
|
||||
|
||||
# Lese Original
|
||||
with open('main.js', 'r', encoding='utf-8') as f:
|
||||
content = f.read()
|
||||
|
||||
# ÄNDERUNG 1: Entferne getDataDir, ändere getCredentialsFilePath
|
||||
old_funcs = r"function getDataDir\(\) \{[^}]+\}\s*function getCredentialsFilePath\(\) \{[^}]+\}"
|
||||
new_func = """function getCredentialsFilePath() {
|
||||
return ppath.join(app.getPath('userData'), 'credentials.json');
|
||||
}"""
|
||||
|
||||
content = re.sub(old_funcs, new_func, content)
|
||||
|
||||
# ÄNDERUNG 2: Patche save-credentials Handler
|
||||
old_handler = r"(ipcMain\.handle\('save-credentials', async \(event, data\) => \{[\s\S]*?const DATA_DIR = getDataDir\(\);[\s\S]*?ensureDir\(DATA_DIR\);[^}]+)\}"
|
||||
|
||||
new_handler = """ipcMain.handle('save-credentials', async (event, data) => {
|
||||
try {
|
||||
const CREDENTIALS_FILE = getCredentialsFilePath();
|
||||
const userDataDir = app.getPath('userData');
|
||||
if (!fs.existsSync(userDataDir)) {
|
||||
fs.mkdirSync(userDataDir, { recursive: true });
|
||||
}
|
||||
|
||||
const json = JSON.stringify(data);
|
||||
const cipher = crypto.createCipheriv(ALGORITHM, SECRET_KEY, IV);
|
||||
const encrypted = Buffer.concat([cipher.update(json, 'utf8'), cipher.final()]);
|
||||
fs.writeFileSync(CREDENTIALS_FILE, encrypted);
|
||||
|
||||
console.log('✅ Credentials saved to:', CREDENTIALS_FILE);
|
||||
return { ok: true };
|
||||
} catch (e) {
|
||||
console.error('save-credentials error', e);
|
||||
return { ok: false, error: String(e) };
|
||||
}
|
||||
});"""
|
||||
|
||||
content = re.sub(old_handler, new_handler, content, flags=re.DOTALL)
|
||||
|
||||
# Schreibe neue Datei
|
||||
with open('main_NEW.js', 'w', encoding='utf-8') as f:
|
||||
f.write(content)
|
||||
|
||||
print("✅ main_NEW.js erstellt")
|
||||
PYSCRIPT2
|
||||
|
||||
echo ""
|
||||
echo "========================================="
|
||||
echo "✅ FERTIG!"
|
||||
echo "========================================="
|
||||
echo ""
|
||||
echo "Neue Dateien erstellt:"
|
||||
echo " 📄 renderer_NEW.js"
|
||||
echo " 📄 main_NEW.js"
|
||||
echo ""
|
||||
echo "Backups erstellt:"
|
||||
echo " 💾 renderer.js.backup"
|
||||
echo " 💾 main.js.backup"
|
||||
echo ""
|
||||
echo "Nächste Schritte:"
|
||||
echo " 1. Prüfe die neuen Dateien"
|
||||
echo " 2. Ersetze die alten:"
|
||||
echo " mv renderer_NEW.js renderer.js"
|
||||
echo " mv main_NEW.js main.js"
|
||||
echo " 3. Starte die App neu"
|
||||
echo ""
|
||||
echo "Bei Problemen: Backups wiederherstellen"
|
||||
echo " mv renderer.js.backup renderer.js"
|
||||
echo " mv main.js.backup main.js"
|
||||
echo ""
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "git-manager-gui",
|
||||
"version": "2.0.9",
|
||||
"version": "2.1.3",
|
||||
"description": "Git Manager GUI - Verwaltung von Git Repositories",
|
||||
"author": "M_Viper",
|
||||
"main": "main.js",
|
||||
|
||||
16
preload.js
16
preload.js
@@ -28,9 +28,9 @@ contextBridge.exposeInMainWorld('electronAPI', {
|
||||
getGithubCurrentUser: () => ipcRenderer.invoke('get-github-current-user'),
|
||||
getGithubUserHeatmap: (data) => ipcRenderer.invoke('get-github-user-heatmap', data),
|
||||
getGiteaRepoContents: (data) => ipcRenderer.invoke('get-gitea-repo-contents', data),
|
||||
listGiteaTrash: (data) => ipcRenderer.invoke('list-gitea-trash', data),
|
||||
purgeGiteaTrash: (data) => ipcRenderer.invoke('purge-gitea-trash', data),
|
||||
restoreGiteaTrashItem: (data) => ipcRenderer.invoke('restore-gitea-trash-item', data),
|
||||
listGiteaTrash: () => ({ ok: true, items: [] }),
|
||||
purgeGiteaTrash: () => ({ ok: true }),
|
||||
restoreGiteaTrashItem: () => ({ ok: false, error: 'Papierkorb deaktiviert' }),
|
||||
getGiteaFileContent: (data) => ipcRenderer.invoke('get-gitea-file-content', data),
|
||||
readGiteaFile: (data) => ipcRenderer.invoke('read-gitea-file', data),
|
||||
writeGiteaFile: (data) => ipcRenderer.invoke('write-gitea-file', data),
|
||||
@@ -43,11 +43,15 @@ contextBridge.exposeInMainWorld('electronAPI', {
|
||||
saveCredentials: (data) => ipcRenderer.invoke('save-credentials', data),
|
||||
loadCredentials: () => ipcRenderer.invoke('load-credentials'),
|
||||
getCredentialsStatus: () => ipcRenderer.invoke('get-credentials-status'),
|
||||
exportSettingsBundle: () => ipcRenderer.invoke('export-settings-bundle'),
|
||||
importSettingsBundle: () => ipcRenderer.invoke('import-settings-bundle'),
|
||||
createDiagnosticsPackage: () => ipcRenderer.invoke('create-diagnostics-package'),
|
||||
testGiteaConnection: (data) => ipcRenderer.invoke('test-gitea-connection', data),
|
||||
testGithubConnection: (data) => ipcRenderer.invoke('test-github-connection', data),
|
||||
updateGiteaAvatar: (data) => ipcRenderer.invoke('update-gitea-avatar', data),
|
||||
updateGiteaRepoAvatar: (data) => ipcRenderer.invoke('update-gitea-repo-avatar', data),
|
||||
updateGiteaRepoVisibility: (data) => ipcRenderer.invoke('update-gitea-repo-visibility', data),
|
||||
updateRepoArchived: (data) => ipcRenderer.invoke('update-repo-archived', data),
|
||||
updateGiteaRepoTopics: (data) => ipcRenderer.invoke('update-gitea-repo-topics', data),
|
||||
getGiteaTopicsCatalog: () => ipcRenderer.invoke('get-gitea-topics-catalog'),
|
||||
migrateRepoToGitea: (data) => ipcRenderer.invoke('migrate-repo-to-gitea', data),
|
||||
@@ -136,6 +140,12 @@ contextBridge.exposeInMainWorld('electronAPI', {
|
||||
return () => ipcRenderer.removeListener('update-progress', listener);
|
||||
},
|
||||
|
||||
onUpdateError: (cb) => {
|
||||
const listener = (event, payload) => cb(payload);
|
||||
ipcRenderer.on('update-error', listener);
|
||||
return () => ipcRenderer.removeListener('update-error', listener);
|
||||
},
|
||||
|
||||
onPushProgress: (cb) => {
|
||||
const listener = (event, percent) => { try { cb(percent); } catch (_) {} };
|
||||
ipcRenderer.on('push-progress', listener);
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
<button id="btnOpenRepoActions" title="Neues Repository erstellen">🚀 New Repo</button>
|
||||
<button id="btnOpenMigration" title="Repository von GitHub/GitLab zu Gitea migrieren">📥 Migrieren</button>
|
||||
<button id="btnPush" title="Projekt pushen">⬆️ Push</button>
|
||||
<button id="btnGlobalTrash" class="hidden" title="Globalen Papierkorb über alle Repositories anzeigen">🗂️ Global Trash</button>
|
||||
<button id="btnGlobalTrash" class="hidden" style="display:none" title=""><!-- removed --></button>
|
||||
</div>
|
||||
|
||||
<div class="tool-group tool-group--utility">
|
||||
@@ -82,8 +82,8 @@
|
||||
</div>
|
||||
<button id="btnCommits" class="hidden" title="Commit History anzeigen">📊 Commits</button>
|
||||
<button id="btnReleases" class="hidden" title="Releases anzeigen">📦 Releases</button>
|
||||
<button id="btnTrash" class="hidden" title="Papierkorb anzeigen">🗑️ Papierkorb</button>
|
||||
<button id="btnPurgeTrash" class="hidden" title="Papierkorb älter als 7 Tage leeren">🧹 Purge 7d</button>
|
||||
<button id="btnTrash" class="hidden" style="display:none" title=""><!-- removed --></button>
|
||||
<button id="btnPurgeTrash" class="hidden" style="display:none" title=""><!-- removed --></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -104,7 +104,7 @@
|
||||
<h4>Projektinformationen</h4>
|
||||
<div class="settings-watermark-row"><span>Ersteller:</span><strong>M_Viper</strong></div>
|
||||
<div class="settings-watermark-row"><span>Webseite:</span><a href="https://m-viper.de" target="_blank" rel="noopener noreferrer">https://m-viper.de</a></div>
|
||||
<div class="settings-watermark-row"><span>Discord:</span><a id="watermarkDiscord" href="https://discord.com/invite/FdRs4BRd8D" target="_blank" rel="noopener noreferrer">discord.com/invite/FdRs4BRd8D</a></div>
|
||||
<div class="settings-watermark-row"><span>Discord:</span><a id="watermarkDiscord" href="http://discord.viper-network.de" target="_blank" rel="noopener noreferrer">discord.com/invite/FdRs4BRd8D</a></div>
|
||||
<div class="settings-watermark-row"><span>E-Mail:</span><a id="watermarkMail" href="mailto:admin@m-viper.de">admin@m-viper.de</a></div>
|
||||
<div class="settings-watermark-row"><span>Version:</span><strong id="watermarkVersion">-</strong></div>
|
||||
<div class="settings-watermark-row"><span>Copyright:</span><strong id="watermarkCopyright">-</strong></div>
|
||||
@@ -226,6 +226,18 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="settings-panel settings-panel--diagnostics">
|
||||
<div class="settings-panel-header">
|
||||
<div>
|
||||
<h3>Diagnose</h3>
|
||||
<p>Erstellt ein Diagnosepaket mit Logs, Plattform und letzten Fehlern für schnelles Debugging.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="settings-diagnostics-card">
|
||||
<button id="btnCreateDiagnostics" class="settings-action-btn" type="button">🧪 Diagnose erstellen</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="settings-column settings-column--right">
|
||||
@@ -284,6 +296,25 @@
|
||||
<button id="btnCheckUpdates" class="settings-update-btn">🔄 Nach Updates suchen</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="settings-panel settings-panel--backup">
|
||||
<div class="settings-panel-header">
|
||||
<div>
|
||||
<h3>Backup & Transfer</h3>
|
||||
<p>Einstellungen, Favoriten und Verlauf exportieren oder auf einem anderen PC importieren.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="settings-backup-card">
|
||||
<div class="settings-tools-grid">
|
||||
<button id="btnExportSettingsBundle" class="settings-action-btn" type="button">📦 Backup exportieren</button>
|
||||
<button id="btnImportSettingsBundle" class="settings-action-btn" type="button">📥 Backup importieren</button>
|
||||
</div>
|
||||
<div class="settings-inline-hint">
|
||||
Export enthält Tokens nur verschlüsselt, nie als Klartext. Der Import ist für andere PCs geeignet.
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -651,8 +651,7 @@ body {
|
||||
}
|
||||
|
||||
#btnOpenRepoActions,
|
||||
#btnPush,
|
||||
#btnGlobalTrash {
|
||||
#btnPush {
|
||||
min-width: 92px;
|
||||
}
|
||||
|
||||
@@ -1759,6 +1758,18 @@ input[type="checkbox"] {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.settings-version-field .settings-readonly-input {
|
||||
height: 40px;
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
font-size: 16px;
|
||||
font-weight: 400;
|
||||
letter-spacing: 0.01em;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.settings-readonly-input {
|
||||
background: rgba(255,255,255,0.05);
|
||||
color: var(--text-secondary);
|
||||
@@ -1767,15 +1778,17 @@ input[type="checkbox"] {
|
||||
|
||||
.settings-update-btn {
|
||||
min-width: 210px;
|
||||
height: 42px;
|
||||
padding: 0 16px;
|
||||
height: 40px;
|
||||
padding: 0 12px;
|
||||
border-radius: var(--radius-md);
|
||||
border: 1px solid rgba(88, 213, 255, 0.3);
|
||||
background: linear-gradient(135deg, rgba(88, 213, 255, 0.94), rgba(92, 135, 255, 0.9));
|
||||
color: #08111f;
|
||||
font-size: 13px;
|
||||
font-weight: 800;
|
||||
letter-spacing: 0.01em;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0;
|
||||
white-space: nowrap;
|
||||
line-height: 1;
|
||||
cursor: pointer;
|
||||
transition: transform var(--transition-normal), box-shadow var(--transition-normal), filter var(--transition-normal);
|
||||
box-shadow: 0 16px 28px rgba(24, 136, 255, 0.26);
|
||||
@@ -1791,6 +1804,121 @@ input[type="checkbox"] {
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
.settings-tools-grid {
|
||||
margin-top: 0;
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.settings-backup-card {
|
||||
margin-top: 6px;
|
||||
}
|
||||
|
||||
.settings-diagnostics-card {
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.settings-backup-title {
|
||||
margin: 0 0 8px;
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.settings-action-btn {
|
||||
height: 40px;
|
||||
border-radius: var(--radius-md);
|
||||
padding: 0 14px;
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.15px;
|
||||
cursor: pointer;
|
||||
border: 1px solid rgba(255, 255, 255, 0.18);
|
||||
background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(0, 212, 255, 0.08) 100%);
|
||||
color: var(--text-primary);
|
||||
transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal), background var(--transition-normal);
|
||||
}
|
||||
|
||||
.settings-action-btn:hover {
|
||||
transform: translateY(-1px);
|
||||
border-color: rgba(88, 213, 255, 0.5);
|
||||
background: linear-gradient(135deg, rgba(88, 213, 255, 0.17) 0%, rgba(92, 135, 255, 0.15) 100%);
|
||||
box-shadow: 0 10px 20px rgba(8, 20, 40, 0.24);
|
||||
}
|
||||
|
||||
.settings-action-btn:active {
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
.settings-tools-grid .settings-action-btn {
|
||||
width: 100%;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.settings-panel--app {
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
.settings-panel--app .settings-panel-header {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.settings-panel--app .settings-version-card {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 8px;
|
||||
align-items: end;
|
||||
}
|
||||
|
||||
.settings-panel--app .settings-update-btn {
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.settings-panel--app .settings-inline-hint {
|
||||
margin-top: 6px;
|
||||
}
|
||||
|
||||
.settings-panel--backup .settings-inline-hint {
|
||||
margin-top: 6px;
|
||||
}
|
||||
|
||||
.settings-panel--backup .settings-tools-grid {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.settings-panel--diagnostics {
|
||||
padding: 11px;
|
||||
height: 140px;
|
||||
}
|
||||
|
||||
.settings-panel--backup {
|
||||
padding: 11px;
|
||||
height: 165px;
|
||||
}
|
||||
|
||||
.settings-panel--diagnostics .settings-panel-header {
|
||||
margin-bottom: 7px;
|
||||
}
|
||||
|
||||
.settings-panel--backup .settings-panel-header {
|
||||
margin-bottom: 7px;
|
||||
}
|
||||
|
||||
.settings-panel--diagnostics .settings-panel-header p {
|
||||
font-size: 10px;
|
||||
line-height: 1.25;
|
||||
}
|
||||
|
||||
.settings-panel--backup .settings-panel-header p {
|
||||
font-size: 10px;
|
||||
line-height: 1.25;
|
||||
}
|
||||
|
||||
.settings-modal-actions {
|
||||
margin-top: 12px;
|
||||
}
|
||||
@@ -1987,6 +2115,84 @@ input[type="checkbox"] {
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.repo-pinboard-wrap {
|
||||
border: 1px solid rgba(88, 213, 255, 0.22);
|
||||
background: linear-gradient(135deg, rgba(88, 213, 255, 0.07), rgba(92, 135, 255, 0.08));
|
||||
border-radius: 14px;
|
||||
padding: 10px 12px;
|
||||
}
|
||||
|
||||
.repo-pinboard-title {
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
color: #d8f7ff;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.repo-pinboard-row {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.repo-pinboard-chip {
|
||||
appearance: none;
|
||||
border: 1px solid rgba(255, 255, 255, 0.16);
|
||||
background: rgba(7, 17, 31, 0.56);
|
||||
color: var(--text-primary);
|
||||
border-radius: 999px;
|
||||
min-height: 30px;
|
||||
padding: 0 10px;
|
||||
font-size: 12px;
|
||||
cursor: pointer;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 7px;
|
||||
transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
|
||||
}
|
||||
|
||||
.repo-pinboard-chip:hover {
|
||||
border-color: rgba(88, 213, 255, 0.6);
|
||||
background: rgba(88, 213, 255, 0.12);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.repo-pinboard-chip-icon {
|
||||
font-size: 11px;
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
.repo-pinboard-chip-label {
|
||||
font-weight: 700;
|
||||
max-width: 150px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.repo-pinboard-chip-owner {
|
||||
color: var(--text-muted);
|
||||
font-size: 11px;
|
||||
max-width: 120px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.repo-pinboard-chip-missing {
|
||||
color: #fca5a5;
|
||||
font-size: 10px;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.repo-pinboard-chip.is-missing {
|
||||
border-color: rgba(248, 113, 113, 0.4);
|
||||
background: rgba(127, 29, 29, 0.2);
|
||||
}
|
||||
|
||||
.repo-owner-tab {
|
||||
appearance: none;
|
||||
border: 1px solid rgba(255, 255, 255, 0.18);
|
||||
@@ -2021,59 +2227,8 @@ input[type="checkbox"] {
|
||||
}
|
||||
|
||||
/* ===========================
|
||||
TRASH VIEW
|
||||
(trash view removed)
|
||||
=========================== */
|
||||
.item-card .trash-card-meta {
|
||||
font-size: 11px;
|
||||
opacity: 0.84;
|
||||
margin-top: 8px;
|
||||
line-height: 1.45;
|
||||
word-break: break-all;
|
||||
color: rgba(226, 232, 240, 0.9);
|
||||
}
|
||||
|
||||
.item-card .trash-card-actions {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
margin-top: 12px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.item-card button.trash-restore-btn {
|
||||
appearance: none;
|
||||
-webkit-appearance: none;
|
||||
border: 1px solid rgba(56, 189, 248, 0.45);
|
||||
background: linear-gradient(135deg, rgba(10, 88, 122, 0.58), rgba(30, 64, 175, 0.55));
|
||||
color: #e0f2fe;
|
||||
border-radius: 9px;
|
||||
padding: 7px 12px;
|
||||
min-height: 32px;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
line-height: 1;
|
||||
letter-spacing: 0.2px;
|
||||
cursor: pointer;
|
||||
box-shadow: 0 8px 18px rgba(3, 19, 42, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12);
|
||||
transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease, background 0.12s ease;
|
||||
}
|
||||
|
||||
.item-card button.trash-restore-btn:hover {
|
||||
border-color: rgba(56, 189, 248, 0.78);
|
||||
background: linear-gradient(135deg, rgba(14, 116, 144, 0.64), rgba(37, 99, 235, 0.62));
|
||||
box-shadow: 0 10px 22px rgba(7, 42, 90, 0.3), 0 0 0 2px rgba(56, 189, 248, 0.16);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.item-card button.trash-restore-btn:active {
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
.item-card button.trash-restore-btn:disabled {
|
||||
opacity: 0.62;
|
||||
cursor: wait;
|
||||
transform: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.repo-owner-tab.active {
|
||||
border-color: rgba(88, 213, 255, 0.65);
|
||||
@@ -3567,6 +3722,14 @@ progress::-moz-progress-bar {
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.settings-panel--diagnostics {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.settings-panel--backup {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.settings-credentials-grid {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
}
|
||||
@@ -3591,11 +3754,13 @@ progress::-moz-progress-bar {
|
||||
.settings-credentials-grid,
|
||||
.settings-connection-tools,
|
||||
.settings-version-card,
|
||||
.settings-tools-grid,
|
||||
.modal-buttons {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
}
|
||||
|
||||
.settings-update-btn,
|
||||
.settings-action-btn,
|
||||
#btnTestGiteaConnection,
|
||||
#btnTestGithubConnection {
|
||||
width: 100%;
|
||||
@@ -3681,10 +3846,38 @@ body.compact-mode .file-type-badge {
|
||||
.repo-size-badge {
|
||||
font-size: 10px;
|
||||
color: var(--text-muted);
|
||||
margin-top: 4px;
|
||||
margin-top: 0;
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.repo-card-footer {
|
||||
margin-top: auto;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.repo-archived-badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-top: 0;
|
||||
font-size: 10px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.02em;
|
||||
color: #fcd34d;
|
||||
background: rgba(120, 53, 15, 0.32);
|
||||
border: 1px solid rgba(245, 158, 11, 0.55);
|
||||
border-radius: 999px;
|
||||
padding: 2px 8px;
|
||||
pointer-events: none;
|
||||
text-transform: uppercase;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* ===========================
|
||||
FAVORITEN DRAG-REORDER
|
||||
=========================== */
|
||||
|
||||
@@ -1310,6 +1310,24 @@ async function updateGiteaRepoTopics({ token, url, owner, repo, topics }) {
|
||||
}
|
||||
}
|
||||
|
||||
async function updateGiteaRepoArchived({ token, url, owner, repo, archived }) {
|
||||
const base = normalizeAndValidateBaseUrl(url);
|
||||
const endpoint = `${base}/api/v1/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}`;
|
||||
const res = await axiosInstance.patch(
|
||||
endpoint,
|
||||
{ archived: !!archived },
|
||||
{
|
||||
headers: {
|
||||
Authorization: `token ${token}`,
|
||||
'Content-Type': 'application/json',
|
||||
'User-Agent': 'Git-Manager-GUI'
|
||||
},
|
||||
timeout: 15000
|
||||
}
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
/* ====================================================
|
||||
GITHUB API FUNCTIONS
|
||||
==================================================== */
|
||||
@@ -1949,6 +1967,30 @@ async function updateGithubRepoTopics({ token, owner, repo, topics }) {
|
||||
return response.data;
|
||||
}
|
||||
|
||||
async function updateGithubRepoArchived({ token, owner, repo, archived }) {
|
||||
const repoPath = `${encodeURIComponent(owner)}/${encodeURIComponent(repo)}`;
|
||||
const archiveEndpoint = `${GITHUB_API}/repos/${repoPath}/archive`;
|
||||
|
||||
if (archived) {
|
||||
await axiosInstance.put(
|
||||
archiveEndpoint,
|
||||
{},
|
||||
{ headers: githubHeaders(token), timeout: 15000 }
|
||||
);
|
||||
} else {
|
||||
await axiosInstance.delete(
|
||||
archiveEndpoint,
|
||||
{ headers: githubHeaders(token), timeout: 15000 }
|
||||
);
|
||||
}
|
||||
|
||||
const response = await axiosInstance.get(
|
||||
`${GITHUB_API}/repos/${repoPath}`,
|
||||
{ headers: githubHeaders(token), timeout: 15000 }
|
||||
);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
async function deleteGithubRepo({ token, owner, repo }) {
|
||||
await axiosInstance.delete(
|
||||
`${GITHUB_API}/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}`,
|
||||
@@ -1988,6 +2030,7 @@ module.exports = {
|
||||
updateGiteaRepoAvatar,
|
||||
updateGiteaRepoVisibility,
|
||||
updateGiteaRepoTopics,
|
||||
updateGiteaRepoArchived,
|
||||
migrateRepoToGitea,
|
||||
listGiteaTopicsCatalog,
|
||||
getGiteaCurrentUser,
|
||||
@@ -2032,5 +2075,6 @@ module.exports = {
|
||||
updateGithubRepoVisibility,
|
||||
updateGithubRepoDefaultBranch,
|
||||
updateGithubRepoTopics,
|
||||
updateGithubRepoArchived,
|
||||
deleteGithubRepo
|
||||
};
|
||||
@@ -13,7 +13,7 @@ const ppath = require('path');
|
||||
const LOG_LEVELS = { DEBUG: 0, INFO: 1, WARN: 2, ERROR: 3 };
|
||||
let currentLogLevel = process.env.NODE_ENV === 'production' ? LOG_LEVELS.INFO : LOG_LEVELS.DEBUG;
|
||||
let logQueue = [];
|
||||
const MAX_LOG_BUFFER = 100;
|
||||
const MAX_LOG_BUFFER = 2000;
|
||||
|
||||
function formatLog(level, context, message, details = null) {
|
||||
const timestamp = new Date().toISOString();
|
||||
|
||||
65
updater.js
65
updater.js
@@ -15,6 +15,22 @@ class Updater {
|
||||
this.checkingForUpdates = false;
|
||||
}
|
||||
|
||||
emitUpdateError(message, details = {}) {
|
||||
const payload = {
|
||||
message: String(message || 'Update-Fehler'),
|
||||
details,
|
||||
timestamp: new Date().toISOString()
|
||||
};
|
||||
|
||||
try {
|
||||
if (this.mainWindow && this.mainWindow.webContents) {
|
||||
this.mainWindow.webContents.send('update-error', payload);
|
||||
}
|
||||
} catch (_) {
|
||||
// no-op: update errors should never crash the app
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Hauptfunktion zur Prüfung auf Updates
|
||||
*/
|
||||
@@ -58,6 +74,11 @@ class Updater {
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('[Updater] Fehler beim Update-Check:', error);
|
||||
this.emitUpdateError('Update-Pruefung fehlgeschlagen.', {
|
||||
phase: 'check',
|
||||
silent: !!silent,
|
||||
error: String(error?.message || error)
|
||||
});
|
||||
} finally {
|
||||
this.checkingForUpdates = false;
|
||||
}
|
||||
@@ -67,6 +88,10 @@ class Updater {
|
||||
return new Promise((resolve, reject) => {
|
||||
const options = { headers: { 'User-Agent': 'GitManager-GUI-Updater' } };
|
||||
https.get(GITEA_API_URL, options, (res) => {
|
||||
if (res.statusCode !== 200) {
|
||||
reject(new Error(`Release-API antwortete mit HTTP ${res.statusCode}`));
|
||||
return;
|
||||
}
|
||||
let data = '';
|
||||
res.on('data', chunk => data += chunk);
|
||||
res.on('end', () => {
|
||||
@@ -212,11 +237,19 @@ class Updater {
|
||||
async startDownload(asset) {
|
||||
if (!asset || !asset.browser_download_url) {
|
||||
console.error("[Updater] Kein gültiges Asset gefunden!");
|
||||
this.emitUpdateError('Update-Download fehlgeschlagen: Kein gueltiges Installer-Asset gefunden.', {
|
||||
phase: 'download',
|
||||
reason: 'invalid-asset'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.isTrustedDownloadUrl(asset.browser_download_url)) {
|
||||
console.error('[Updater] Unsichere Download-URL blockiert.');
|
||||
this.emitUpdateError('Update blockiert: Unsichere Download-URL.', {
|
||||
phase: 'download',
|
||||
reason: 'untrusted-download-url'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -228,11 +261,20 @@ class Updater {
|
||||
expectedSha256 = await this.resolveExpectedSha256(asset);
|
||||
} catch (e) {
|
||||
console.error('[Updater] Konnte erwartete Checksumme nicht laden:', e?.message || e);
|
||||
this.emitUpdateError('Update-Download fehlgeschlagen: Checksumme konnte nicht geladen werden.', {
|
||||
phase: 'download',
|
||||
reason: 'checksum-load-failed',
|
||||
error: String(e?.message || e)
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!expectedSha256) {
|
||||
console.error('[Updater] Kein SHA-256-Checksum-Wert gefunden. Update wurde aus Sicherheitsgruenden blockiert.');
|
||||
this.emitUpdateError('Update blockiert: Keine gueltige SHA-256 Checksumme gefunden.', {
|
||||
phase: 'download',
|
||||
reason: 'checksum-missing'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -242,6 +284,10 @@ class Updater {
|
||||
if (!this.isTrustedDownloadUrl(url)) {
|
||||
console.error('[Updater] Unsicherer Redirect/Download blockiert.');
|
||||
fs.unlink(tempPath, () => {});
|
||||
this.emitUpdateError('Update blockiert: Unsicherer Redirect oder Download-Host.', {
|
||||
phase: 'download',
|
||||
reason: 'untrusted-redirect'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -253,6 +299,11 @@ class Updater {
|
||||
|
||||
if (res.statusCode !== 200) {
|
||||
console.error(`[Updater] Download-Fehler: Status ${res.statusCode}`);
|
||||
this.emitUpdateError(`Update-Download fehlgeschlagen: HTTP ${res.statusCode}.`, {
|
||||
phase: 'download',
|
||||
reason: 'http-error',
|
||||
statusCode: res.statusCode
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -265,11 +316,20 @@ class Updater {
|
||||
if (actualSha256 !== expectedSha256) {
|
||||
console.error('[Updater] Checksum-Validierung fehlgeschlagen. Installation wurde blockiert.');
|
||||
fs.unlink(tempPath, () => {});
|
||||
this.emitUpdateError('Update blockiert: Checksum-Validierung fehlgeschlagen.', {
|
||||
phase: 'download',
|
||||
reason: 'checksum-mismatch'
|
||||
});
|
||||
return;
|
||||
}
|
||||
} catch (verifyErr) {
|
||||
console.error('[Updater] Checksum-Validierung konnte nicht ausgeführt werden:', verifyErr?.message || verifyErr);
|
||||
fs.unlink(tempPath, () => {});
|
||||
this.emitUpdateError('Update-Download fehlgeschlagen: Checksum-Validierung nicht moeglich.', {
|
||||
phase: 'download',
|
||||
reason: 'checksum-verify-failed',
|
||||
error: String(verifyErr?.message || verifyErr)
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -279,6 +339,11 @@ class Updater {
|
||||
}).on('error', (err) => {
|
||||
fs.unlink(tempPath, () => {});
|
||||
console.error("[Updater] Netzwerkfehler beim Download:", err);
|
||||
this.emitUpdateError('Update-Download fehlgeschlagen: Netzwerkfehler.', {
|
||||
phase: 'download',
|
||||
reason: 'network-error',
|
||||
error: String(err?.message || err)
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user