mirror-cockpit-project-cockpit/pkg/playground/notifications-receiver.js
Martin Pitt 07cf7634ea pkg: Add missing license declarations
Update static code test accordingly.
2026-02-04 10:24:11 +01:00

25 lines
633 B
JavaScript

// SPDX-License-Identifier: LGPL-2.1-or-later
import { page_status } from "notifications";
function id(sel) {
return document.getElementById(sel);
}
function update() {
const status = page_status.get("playground");
if (status) {
id("received-type").innerText = status.type;
id("received-title").innerText = status.title;
} else if (status !== undefined) {
id("received-type").innerText = "-";
id("received-title").innerText = "-";
}
}
function init () {
page_status.addEventListener("changed", update);
update();
}
document.addEventListener("DOMContentLoaded", init);