Dash
Items
User
Switch User
Custom JavaScript
Save
Cancel
$(document).ready(function () { const base = (document.querySelector("base") || {}).href || '/'; const container = $("#sortable"); const liveStats = () => { let hidden, visibilityChange; if (typeof document.hidden !== "undefined") { hidden = "hidden"; visibilityChange = "visibilitychange"; } else if (typeof document.msHidden !== "undefined") { hidden = "msHidden"; visibilityChange = "msvisibilitychange"; } else if (typeof document.webkitHidden !== "undefined") { hidden = "webkitHidden"; visibilityChange = "webkitvisibilitychange"; } const livestatsRefreshTimeouts = []; const livestatsFuncs = []; const livestatsContainers = $(".livestats-container"); function stopLivestatsRefresh() { livestatsRefreshTimeouts.forEach(id => clearTimeout(id)); } function startLivestatsRefresh() { livestatsFuncs.forEach(fun => fun()); } if (livestatsContainers.length > 0) { if (document.addEventListener && hidden !== undefined) { document.addEventListener(visibilityChange, () => { document[hidden] ? stopLivestatsRefresh() : startLivestatsRefresh(); }); } livestatsContainers.each(function (index) { const id = $(this).data("id"); const dataonly = $(this).data("dataonly"); const increaseby = dataonly == 1 ? 20000 : 1000; const container = $(this); const max_timer = 30000; let timer = 5000; const worker = function () { $.ajax({ url: base + "get_stats/" + id, dataType: "json", success: function (data) { if (data?.html) { container.html(data.html); timer = data.status === "active" ? increaseby : Math.min(timer + 2000, max_timer); } }, complete: function () { livestatsRefreshTimeouts[index] = setTimeout(worker, timer); } }); }; livestatsFuncs[index] = worker; worker(); }); } }; const customMain = () => { if (window.location.pathname !== "/") return; if (!container.length) return; const existingContent = container.children().not('.add-item'); const wrapper = document.createElement("div"); wrapper.classList.add("tags-container"); $(wrapper).append(existingContent); container.empty() .append(wrapper) .append($('.add-item')) .css("opacity", "1"); liveStats(); }; customMain(); }); /* ---------- Background ---------- */ document.addEventListener('DOMContentLoaded', function () { const bgContainer = document.createElement('div'); bgContainer.className = 'background-container'; const appElement = document.getElementById('app'); if (appElement?.style?.backgroundImage) { bgContainer.style.backgroundImage = appElement.style.backgroundImage; } document.body.insertBefore(bgContainer, document.body.firstChild); }); /* ---------- HEIMDALL SECURITY BREACH ---------- */ document.addEventListener("DOMContentLoaded", function () { // Heimdall-specific detection (menu item unique to gherton.io Heimdall) const isHeimdall = document.querySelector('a[href*="Application list"]'); if (!isHeimdall) return; if (sessionStorage.getItem("heimdallScareShown")) return; sessionStorage.setItem("heimdallScareShown", "1"); setTimeout(() => { const overlay = document.createElement("div"); overlay.innerHTML = ` <div style=" background:#0b0b0b; border:3px solid red; padding:40px; max-width:640px; text-align:center; box-shadow:0 0 40px red; "> <h1 style="color:red; margin-bottom:20px;">⚠ SECURITY BREACH DETECTED ⚠</h1> <p>Heimdall has detected anomalous access behavior.</p> <p>Status: <b>LOCKDOWN INITIATED</b></p> <p>Response Level: <b>CRITICAL</b></p> <p style="margin-top:20px; opacity:0.7;">Do not refresh.</p> </div> `; overlay.style.cssText = ` position:fixed; inset:0; background:rgba(0,0,0,0.96); display:flex; align-items:center; justify-content:center; z-index:999999; font-family:monospace; color:white; `; document.body.appendChild(overlay); try { new Audio("https://actions.google.com/sounds/v1/alarms/beep_short.ogg").play(); } catch {} document.body.style.cursor = "wait"; setTimeout(() => { overlay.innerHTML = ` <div style="text-align:center"> <h1 style="letter-spacing:4px;">REMAIN VIGILANT</h1> <p style="opacity:0.5; margin-top:10px;">👁️</p> </div> `; document.body.style.cursor = ""; setTimeout(() => overlay.remove(), 2500); }, 3000); }, 2000); });
Home dashboard
Application list
Tags list
Settings