🎨 UI: Push Button nur zeigen wenn Changes vorhanden sind + has_changes Status
docker-build-and-push / build (push) Successful in 17s
docker-build-and-push / build (push) Successful in 17s
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
.btn-subscribe { background: #007bff; color: white; }
|
||||
.btn-unsubscribe { background: #dc3545; color: white; }
|
||||
.btn-push { background: #28a745; color: white; }
|
||||
.btn-changes { background: #ffc107; color: white; }
|
||||
.status-ok { color: #28a745; font-size: 13px; }
|
||||
.status-warn { color: #dc3545; font-size: 13px; }
|
||||
hr { border: none; border-top: 1px solid #ccc; margin: 20px 0; }
|
||||
@@ -69,15 +70,28 @@ async function loadProjects() {
|
||||
'<span class="status-ok">✅ Schreibfrei</span>' :
|
||||
'<span class="status-warn">❌ Nur Lesen</span>';
|
||||
|
||||
// ✅ NEU: Zeige Changes an wenn vorhanden!
|
||||
let changesHtml = '';
|
||||
if (proj.has_changes && proj.uncommitted_files) {
|
||||
const fileCount = proj.uncommitted_files.filter(f => f && !f.startsWith('??')).length;
|
||||
if (fileCount > 0) {
|
||||
changesHtml = `<span style="display:block;color:#dc3545;margin:5px 0;font-weight:bold">⚠️ ${fileCount} Datei(en) geändert (nicht committed)</span>`;
|
||||
} else {
|
||||
changesHtml = '<span style="display:block;color:#ffc107;margin:5px 0;">⚠️ Neuer Inhalt erkannt</span>';
|
||||
}
|
||||
}
|
||||
|
||||
card.innerHTML = `
|
||||
<div style="display: flex; justify-content: space-between; align-items: center;">
|
||||
<strong>${proj.name}</strong>
|
||||
<small style="color:#666">${writeStatus}</small>
|
||||
</div>
|
||||
${proj.has_git ? '<span style="font-size:12px;color:#007bff;margin-top:5px;display:block">📦 Git Repository</span>' : ''}
|
||||
${changesHtml}
|
||||
<div style="margin-top: 8px; font-size: 13px;">
|
||||
<button class="btn-push" onclick="pushProject('${proj.name}')">📤 Änderungen pushen</button>
|
||||
<button class="btn-unsubscribe" onclick="unsubscribe('${proj.name}')">🗑️ Deabonieren</button>
|
||||
${(proj.has_changes && proj.can_write) ? '<button class="btn-push" onclick="pushProject(\'' + proj.name + '\')">📤 Änderungen pushen</button>' : ''}
|
||||
${!proj.can_write && !proj.has_changes ? '<small style="color:#999; font-size:12px;">Push nur bei Berechtigung & Changes möglich</small>' : ''}
|
||||
<button class="btn-unsubscribe" onclick="unsubscribe(\'' + proj.name + '\')">🗑️ Deabonieren</button>
|
||||
<a href="${API_BASE}/projects/${proj.name}" target="_blank"><button class="btn-check">📁 Öffnen</button></a>
|
||||
</div>
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user