luci-app-ttyd: use correct http protocol
Signed-off-by: Richard Yu <yurichard3839@gmail.com>
This commit is contained in:
parent
e994f8ae31
commit
fe51dbe735
1 changed files with 3 additions and 2 deletions
|
@ -7,12 +7,13 @@ return view.extend({
|
||||||
return uci.load('ttyd');
|
return uci.load('ttyd');
|
||||||
},
|
},
|
||||||
render: function() {
|
render: function() {
|
||||||
var port = uci.get_first('ttyd', 'ttyd', 'port') || '7681';
|
var port = uci.get_first('ttyd', 'ttyd', 'port') || '7681',
|
||||||
|
ssl = uci.get_first('ttyd', 'ttyd', 'ssl') || '0';
|
||||||
if (port === '0')
|
if (port === '0')
|
||||||
return E('div', { class: 'alert-message warning' },
|
return E('div', { class: 'alert-message warning' },
|
||||||
_('Random ttyd port (port=0) is not supported.<br>Change to a fixed port and try again.'));
|
_('Random ttyd port (port=0) is not supported.<br>Change to a fixed port and try again.'));
|
||||||
return E('iframe', {
|
return E('iframe', {
|
||||||
src: window.location.protocol + '//' + window.location.hostname + ':' + port,
|
src: (ssl === '1' ? 'https' : 'http') + '://' + window.location.hostname + ':' + port,
|
||||||
style: 'width: 100%; min-height: 500px; border: none; border-radius: 3px; resize: vertical;'
|
style: 'width: 100%; min-height: 500px; border: none; border-radius: 3px; resize: vertical;'
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue