mirror of
https://github.com/cockpit-project/cockpit.git
synced 2026-11-03 21:49:50 -09:00
25 lines
633 B
JavaScript
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);
|