Git-Status: success-Property entfernt, Tooltips mit Datei-Info an Dashboard-Badges
This commit is contained in:
1 parent
ac150af4c5
commit
6b7df138de
2 files changed
+24
-10
No files matched your search
@@ -40,7 +40,7 @@ registerPage('dashboard', {
|
||||
// Git-Status asynchron laden
|
||||
if (s.workspace) {
|
||||
apiGitStatus(s.sessionId).then(status => {
|
||||
if (!status || !status.success) return;
|
||||
if (!status || status.error) return;
|
||||
const addCount = (status.add || []).length;
|
||||
const editCount = (status.edit || []).length;
|
||||
const deleteCount = (status.delete || []).length;
|
||||
@@ -51,13 +51,27 @@ registerPage('dashboard', {
|
||||
if (!metaEl) return;
|
||||
|
||||
const parts = [];
|
||||
if (addCount > 0) parts.push(`<span class="git-badge git-add">+${addCount}</span>`);
|
||||
if (editCount > 0) parts.push(`<span class="git-badge git-edit">~${editCount}</span>`);
|
||||
if (deleteCount > 0) parts.push(`<span class="git-badge git-delete">-${deleteCount}</span>`);
|
||||
if (outgoing > 0) parts.push(`<span class="git-badge git-outgoing"><i class="fa fa-arrow-up"></i> ${outgoing}</span>`);
|
||||
const tooltipParts = [];
|
||||
if (addCount > 0) {
|
||||
parts.push(`<span class="git-badge git-add">+${addCount}</span>`);
|
||||
tooltipParts.push(`${addCount} ${addCount === 1 ? 'Datei' : 'Dateien'} hinzugefügt`);
|
||||
}
|
||||
if (editCount > 0) {
|
||||
parts.push(`<span class="git-badge git-edit">~${editCount}</span>`);
|
||||
tooltipParts.push(`${editCount} ${editCount === 1 ? 'Datei' : 'Dateien'} geändert`);
|
||||
}
|
||||
if (deleteCount > 0) {
|
||||
parts.push(`<span class="git-badge git-delete">-${deleteCount}</span>`);
|
||||
tooltipParts.push(`${deleteCount} ${deleteCount === 1 ? 'Datei' : 'Dateien'} gelöscht`);
|
||||
}
|
||||
if (outgoing > 0) {
|
||||
parts.push(`<span class="git-badge git-outgoing"><i class="fa fa-arrow-up"></i> ${outgoing}</span>`);
|
||||
tooltipParts.push(`${outgoing} ${outgoing === 1 ? 'Commit muss' : 'Commits müssen'} noch gepusht werden`);
|
||||
}
|
||||
|
||||
const gitEl = document.createElement('span');
|
||||
gitEl.className = 'card-meta-item card-git-status';
|
||||
gitEl.title = tooltipParts.join('\n');
|
||||
gitEl.innerHTML = `<i class="fa fa-code-fork"></i> ${parts.join(' ')}`;
|
||||
metaEl.appendChild(gitEl);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user