diff options
Diffstat (limited to 'web/share')
-rw-r--r-- | web/share/js/index/main.js | 2 | ||||
-rw-r--r-- | web/share/js/kvm/session.js | 21 | ||||
-rw-r--r-- | web/share/js/wm.js | 3 |
3 files changed, 25 insertions, 1 deletions
diff --git a/web/share/js/index/main.js b/web/share/js/index/main.js index ee829480..5f715007 100644 --- a/web/share/js/index/main.js +++ b/web/share/js/index/main.js @@ -80,7 +80,7 @@ function __loadKvmdInfo() { } for (let app of apps) { - if (app.enabled) { + if (app.enabled || app.started) { $("apps").innerHTML += __makeApp(null, app.path, app.icon, app.name); } } diff --git a/web/share/js/kvm/session.js b/web/share/js/kvm/session.js index b278dd06..3dd59d12 100644 --- a/web/share/js/kvm/session.js +++ b/web/share/js/kvm/session.js @@ -107,6 +107,26 @@ export function Session() { } }; + var __setExtras = function(state) { + let show_hook = null; + let close_hook = null; + let has_webterm = (state.webterm && state.webterm.started); + if (has_webterm) { + let path = "/" + state.webterm.path; + show_hook = function() { + tools.info("Terminal opened: ", path); + $("webterm-iframe").src = path; + }; + close_hook = function() { + tools.info("Terminal closed"); + $("webterm-iframe").src = ""; + }; + } + tools.featureSetEnabled($("webterm"), has_webterm); + $("webterm-window").show_hook = show_hook; + $("webterm-window").close_hook = close_hook; + }; + var __formatTemp = function(temp) { let pairs = []; for (let field of Object.keys(temp).sort()) { @@ -218,6 +238,7 @@ export function Session() { case "info_meta_state": __setAboutInfoMeta(data.event); break; case "info_hw_state": __setAboutInfoHw(data.event); break; case "info_system_state": __setAboutInfoSystem(data.event); break; + case "info_extras_state": __setExtras(data.event); break; case "wol_state": __wol.setState(data.event); break; case "gpio_model_state": __gpio.setModel(data.event); break; case "gpio_state": __gpio.setState(data.event); break; diff --git a/web/share/js/wm.js b/web/share/js/wm.js index 7e4105da..44238447 100644 --- a/web/share/js/wm.js +++ b/web/share/js/wm.js @@ -263,6 +263,9 @@ function __WindowManager() { el_window.focus(); el_window.blur(); el_window.style.visibility = "hidden"; + if (el_window.close_hook) { + el_window.close_hook(); + } }; var __toggleMenu = function(el_a) { |