🎨 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-subscribe { background: #007bff; color: white; }
|
||||||
.btn-unsubscribe { background: #dc3545; color: white; }
|
.btn-unsubscribe { background: #dc3545; color: white; }
|
||||||
.btn-push { background: #28a745; color: white; }
|
.btn-push { background: #28a745; color: white; }
|
||||||
|
.btn-changes { background: #ffc107; color: white; }
|
||||||
.status-ok { color: #28a745; font-size: 13px; }
|
.status-ok { color: #28a745; font-size: 13px; }
|
||||||
.status-warn { color: #dc3545; font-size: 13px; }
|
.status-warn { color: #dc3545; font-size: 13px; }
|
||||||
hr { border: none; border-top: 1px solid #ccc; margin: 20px 0; }
|
hr { border: none; border-top: 1px solid #ccc; margin: 20px 0; }
|
||||||
@@ -68,6 +69,17 @@ async function loadProjects() {
|
|||||||
const writeStatus = proj.can_write ?
|
const writeStatus = proj.can_write ?
|
||||||
'<span class="status-ok">✅ Schreibfrei</span>' :
|
'<span class="status-ok">✅ Schreibfrei</span>' :
|
||||||
'<span class="status-warn">❌ Nur Lesen</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 = `
|
card.innerHTML = `
|
||||||
<div style="display: flex; justify-content: space-between; align-items: center;">
|
<div style="display: flex; justify-content: space-between; align-items: center;">
|
||||||
@@ -75,9 +87,11 @@ async function loadProjects() {
|
|||||||
<small style="color:#666">${writeStatus}</small>
|
<small style="color:#666">${writeStatus}</small>
|
||||||
</div>
|
</div>
|
||||||
${proj.has_git ? '<span style="font-size:12px;color:#007bff;margin-top:5px;display:block">📦 Git Repository</span>' : ''}
|
${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;">
|
<div style="margin-top: 8px; font-size: 13px;">
|
||||||
<button class="btn-push" onclick="pushProject('${proj.name}')">📤 Änderungen pushen</button>
|
${(proj.has_changes && proj.can_write) ? '<button class="btn-push" onclick="pushProject(\'' + proj.name + '\')">📤 Änderungen pushen</button>' : ''}
|
||||||
<button class="btn-unsubscribe" onclick="unsubscribe('${proj.name}')">🗑️ Deabonieren</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>
|
<a href="${API_BASE}/projects/${proj.name}" target="_blank"><button class="btn-check">📁 Öffnen</button></a>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|||||||
Reference in New Issue
Block a user