feat: replace online status metric with favorites counter, ordered Dienste first
All checks were successful
Build & Push Docker Image to Gitea Registry / build-and-push (push) Successful in 13s

This commit is contained in:
Kroonk
2026-05-22 00:20:59 +02:00
parent 57b39f8771
commit b0bcc8abbd
4 changed files with 19 additions and 15 deletions

13
app.js
View File

@@ -25,7 +25,7 @@ const searchInput = document.querySelector('#serviceSearch');
const segments = [...document.querySelectorAll('.segment')];
const viewOptions = [...document.querySelectorAll('.view-option')];
const emptyState = document.querySelector('#emptyState');
const onlineCount = document.querySelector('#onlineCount');
const favoriteCount = document.querySelector('#favoriteCount');
const serviceCount = document.querySelector('#serviceCount');
const lastChecked = document.querySelector('#lastChecked');
const dashboardSections = document.querySelector('#dashboardSections');
@@ -218,6 +218,10 @@ function createFavoriteCard(favorite) {
}
function renderFavorites() {
if (favoriteCount) {
favoriteCount.textContent = String(favorites.length);
}
if (!favoritesSections) return;
if (!MischLabsAuth.isAuthenticated()) {
@@ -466,9 +470,7 @@ async function probeService(card) {
async function refreshStatus() {
const results = await Promise.allSettled(cards.map(probeService));
const online = results.filter((result) => result.status === 'fulfilled' && result.value).length;
const unknown = results.filter((result) => result.status === 'fulfilled' && result.value === null).length;
onlineCount.textContent = String(online);
lastChecked.textContent = `Status geprueft: ${new Date().toLocaleTimeString('de-DE', {
hour: '2-digit',
minute: '2-digit'
@@ -477,7 +479,6 @@ async function refreshStatus() {
function scheduleStatusRefresh() {
const run = () => refreshStatus().catch(() => {
onlineCount.textContent = '--';
lastChecked.textContent = 'Status aktuell nicht verfuegbar.';
});
@@ -598,7 +599,9 @@ MischLabsAuth.handleCallback()
})
.catch(() => {
dashboardSections.innerHTML = '<p class="empty-state">Dashboard-Konfiguration konnte nicht geladen werden.</p>';
onlineCount.textContent = '--';
if (favoriteCount) {
favoriteCount.textContent = '--';
}
});
// ==========================================================================