feat: make ops cards collapsible, hide notice and user display, increase button sizes
All checks were successful
Build & Push Docker Image to Gitea Registry / build-and-push (push) Successful in 12s
All checks were successful
Build & Push Docker Image to Gitea Registry / build-and-push (push) Successful in 12s
This commit is contained in:
27
admin.js
27
admin.js
@@ -695,6 +695,32 @@ function startOpsAutoRefresh() {
|
||||
}, 60000);
|
||||
}
|
||||
|
||||
function initCollapsibleCards() {
|
||||
document.querySelectorAll('.ops-card-head').forEach((head) => {
|
||||
const card = head.closest('.ops-card');
|
||||
if (!card) return;
|
||||
|
||||
const bodyEl = card.querySelector('.services-status-board, .ops-list');
|
||||
const id = bodyEl ? bodyEl.id : null;
|
||||
const storageKey = id ? `ops-card-collapsed-${id}` : null;
|
||||
|
||||
if (storageKey) {
|
||||
const isCollapsed = localStorage.getItem(storageKey) === 'true';
|
||||
card.classList.toggle('is-collapsed', isCollapsed);
|
||||
}
|
||||
|
||||
head.addEventListener('click', (event) => {
|
||||
if (event.target.closest('button')) {
|
||||
return;
|
||||
}
|
||||
card.classList.toggle('is-collapsed');
|
||||
if (storageKey) {
|
||||
localStorage.setItem(storageKey, card.classList.contains('is-collapsed'));
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
async function boot() {
|
||||
await handleCallback();
|
||||
tokenSet = getStoredTokens();
|
||||
@@ -717,6 +743,7 @@ async function boot() {
|
||||
logoutButton.hidden = false;
|
||||
adminUser.textContent = `Angemeldet als ${claims.preferred_username || claims.email}`;
|
||||
renderEditor();
|
||||
initCollapsibleCards();
|
||||
refreshOps();
|
||||
startOpsAutoRefresh();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user