Merge pull request #3202 from ysc3839/ttyd
[oweals/luci.git] / applications / luci-app-ttyd / htdocs / luci-static / resources / view / ttyd / term.js
1 'use strict';
2 'require uci';
3
4 return L.view.extend({
5         load: function() {
6                 return uci.load('ttyd');
7         },
8         render: function() {
9                 var port = uci.get_first('ttyd', 'ttyd', 'port') || '7681';
10                 if (port === '0')
11                         return E('div', { class: 'alert-message warning' },
12                                         _('Random ttyd port (port=0) is not supported.<br>Change to a fixed port and try again.'));
13                 return E('iframe', {
14                         src: window.location.protocol + '//' + window.location.hostname + ':' + port,
15                         style: 'width: 100%; min-height: 500px; border: none; border-radius: 3px; resize: vertical;'
16                 });
17         },
18         handleSaveApply: null,
19         handleSave: null,
20         handleReset: null
21 });