diff options
author | Devaev Maxim <[email protected]> | 2021-04-17 15:41:05 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2021-04-17 15:41:05 +0300 |
commit | be012fd38d6f6f2d269dcbffd3aafe59a2a9a40c (patch) | |
tree | 0742bf1e2934f8d882e9e7b3c81360d7204285ee /web/share/js/kvm | |
parent | 3a2ffcfd5c0591160333d1b347880f09eb2ee056 (diff) |
terminal window
Diffstat (limited to 'web/share/js/kvm')
-rw-r--r-- | web/share/js/kvm/session.js | 21 |
1 files changed, 21 insertions, 0 deletions
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; |