From 20935966efdae847023680217a4c109648698340 Mon Sep 17 00:00:00 2001 From: Javier Sánchez Parra Date: Thu, 29 Sep 2022 17:21:00 +0200 Subject: WIP Make scopes tree async --- ogcp/static/js/ogcp.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'ogcp/static/js') diff --git a/ogcp/static/js/ogcp.js b/ogcp/static/js/ogcp.js index 61d828d..d267e5b 100644 --- a/ogcp/static/js/ogcp.js +++ b/ogcp/static/js/ogcp.js @@ -3,6 +3,18 @@ const macs = new Map(); const Interval = 1000; let updateTimeoutId = null; +async function buildScopesTree() { + const resp = await fetch('/ogservers'); + const servers = await resp.json(); + const scopes = document.getElementById("scopes") + + for (const s of servers) { + const resp = await fetch('/scopes-tree?server=' + s); + const htmlText = await resp.text(); + scopes.innerHTML += htmlText; + } +} + async function show_client_mac(pill_id) { const pill = $('#' +pill_id); const ip = pill.html().split('
')[1] -- cgit v1.2.3-18-g5258