diff --git a/js/kiri.js b/js/kiri.js index ee2b42ee..32944229 100644 --- a/js/kiri.js +++ b/js/kiri.js @@ -2092,17 +2092,13 @@ self.kiri.license = exports.LICENSE; } function modalShowing() { - var showing = false; - ["modal","catalog","devices","tools"].forEach(function(dialog) { - var state = UI[dialog].style.display - showing = showing || state !== 'none'; - }); + var showing = $('modal').style.display !== 'none'; return showing || UC.isPopped(); } function showModal(which) { UI.modal.style.display = 'block'; - ["print","help"].forEach(function(modal) { + ["print","help","local"].forEach(function(modal) { UI[modal].style.display = (modal === which ? 'block' : 'none'); }); } @@ -2267,6 +2263,37 @@ self.kiri.license = exports.LICENSE; }); } + function showLocal() { + $('local-close').onclick = hideModal; + showModal('local'); + fetch("/api/grid_local") + .then(r => r.json()) + .then(j => { + let bind = []; + let html = ['
| device | type | status | |
|---|---|---|---|
| ${r.device.name} | `); + html.push(`${r.device.mode} | `); + html.push(`${r.state} | `); + html.push(``); + html.push(` |