luci-mod-system: system.js: rework local time widget markup

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2020-03-23 21:58:25 +01:00
parent 90990df3b6
commit 3afe606743

View file

@ -48,15 +48,14 @@ callTimezone = rpc.declare({
CBILocalTime = form.DummyValue.extend({ CBILocalTime = form.DummyValue.extend({
renderWidget: function(section_id, option_id, cfgvalue) { renderWidget: function(section_id, option_id, cfgvalue) {
return E([], [ return E([], [
E('span', {}, [
E('input', { E('input', {
'id': 'localtime', 'id': 'localtime',
'type': 'text', 'type': 'text',
'readonly': true, 'readonly': true,
'value': new Date(cfgvalue * 1000).toLocaleString() 'value': new Date(cfgvalue * 1000).toLocaleString()
}) }),
]), E('br'),
' ', E('span', { 'class': 'control-group' }, [
E('button', { E('button', {
'class': 'cbi-button cbi-button-apply', 'class': 'cbi-button cbi-button-apply',
'click': ui.createHandlerFn(this, function() { 'click': ui.createHandlerFn(this, function() {
@ -70,6 +69,7 @@ CBILocalTime = form.DummyValue.extend({
return callInitAction('sysntpd', 'restart'); return callInitAction('sysntpd', 'restart');
}) })
}, _('Sync with NTP-Server')) : '' }, _('Sync with NTP-Server')) : ''
])
]); ]);
}, },
}); });