diff options
Diffstat (limited to 'applications/luci-app-ttyd/htdocs/luci-static/resources/view/ttyd/term.js')
-rw-r--r-- | applications/luci-app-ttyd/htdocs/luci-static/resources/view/ttyd/term.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/applications/luci-app-ttyd/htdocs/luci-static/resources/view/ttyd/term.js b/applications/luci-app-ttyd/htdocs/luci-static/resources/view/ttyd/term.js new file mode 100644 index 000000000..4725f7a5b --- /dev/null +++ b/applications/luci-app-ttyd/htdocs/luci-static/resources/view/ttyd/term.js @@ -0,0 +1,21 @@ +'use strict'; +'require uci'; + +return L.view.extend({ + load: function() { + return uci.load('ttyd'); + }, + render: function() { + var port = uci.get_first('ttyd', 'ttyd', 'port') || '7681'; + if (port === '0') + return E('div', { class: 'alert-message warning' }, + _('Random ttyd port (port=0) is not supported.<br>Change to a fixed port and try again.')); + return E('iframe', { + src: window.location.protocol + '//' + window.location.hostname + ':' + port, + style: 'width: 100%; min-height: 500px; border: none; border-radius: 3px; resize: vertical;' + }); + }, + handleSaveApply: null, + handleSave: null, + handleReset: null +}); |