mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-07-28 01:11:21 +08:00
27 lines
831 B
JavaScript
27 lines
831 B
JavaScript
'use strict';
|
|
'require view';
|
|
'require uci';
|
|
|
|
return view.extend({
|
|
handleSaveApply: null,
|
|
handleSave: null,
|
|
handleReset: null,
|
|
|
|
load() {
|
|
return uci.load('netdata');
|
|
},
|
|
|
|
render() {
|
|
var port = uci.get_first('netdata', 'netdata', 'port') || '19999',
|
|
ssl = uci.get_first('netdata', 'netdata', 'enable_ssl') || '0',
|
|
nginx = uci.get_first('netdata', 'netdata', 'nginx_support') || '0';
|
|
if (port === '0')
|
|
return E('div', { class: 'alert-message warning' },
|
|
_('Port 0 is not supported.<br />Change to a other port and try again.'));
|
|
return E('iframe', {
|
|
src: (nginx === '1' ? window.location.protocol : ssl === '1' ? 'https:' : 'http:') + '//' + window.location.hostname + (nginx === '1' ? '/netdata/' : ':' + port),
|
|
style: 'width: 100%; min-height: 100vh; border: none; border-radius: 3px;'
|
|
});
|
|
}
|
|
});
|