<table style="width:auto">
<tr>
<td>
- <select id="tool"></select>
+ <input type="text" id="host" value="openwrt.org" class="form-control" />
</td>
<td>
- <input type="text" id="host" value="openwrt.org" />
- </td>
- <td>
- <input type="button" class="cbi-button cbi-button-apply" id="run" value="<%:Test%>" />
+ <div class="input-group">
+ <select id="tool" class="form-control"></select>
+ <div class="input-group-btn">
+ <button type="button" class="btn btn-primary" id="run"><%:Test%></button>
+ </div>
+ </div>
</td>
</tr>
</table>
-<textarea readonly="readonly" wrap="off" id="syslog"><%:Collecting data...%></textarea>
+<textarea readonly="readonly" wrap="off" id="syslog" class="form-control"><%:Collecting data...%></textarea>
-<textarea readonly="readonly" wrap="off" id="syslog"><%:Collecting data...%></textarea>
+<textarea readonly="readonly" wrap="off" id="syslog" class="form-control"><%:Collecting data...%></textarea>
-<div class="cbi-form" id="tabs" style="display:none">
- <ul class="cbi-tabmenu">
- <li><a href="#status"><%:Packages%></a></li>
- <li><a href="#config"><%:Configuration%></a></li>
- </ul>
- <fieldset id="status" class="cbi-section-node">
- <div class="cbi-value">
- <label class="cbi-value-title"><%:Used space%></label>
- <div class="cbi-value-field">
- <div id="package_space" style="padding-top: 7px"></div>
+<ul class="nav nav-tabs">
+ <li class="active"><a href="#status" data-toggle="tab"><%:Packages%></a></li>
+ <li><a href="#config" data-toggle="tab"><%:Configuration%></a></li>
+</ul>
+
+<div class="tab-content">
+ <div class="tab-pane active" id="status">
+ <div class="form-horizontal">
+ <div class="form-group">
+ <label class="col-lg-2 control-label"><%:Used space%></label>
+ <div class="col-lg-5">
+ <div id="package_space" class="form-control-static"></div>
+ </div>
+ <div class="col-lg-5"></div>
</div>
- </div>
- <div class="cbi-value">
- <label class="cbi-value-title"><%:Update package lists%></label>
- <div class="cbi-value-field">
- <input id="package_update" type="button" class="cbi-button cbi-button-reload" value="<%:Start update …%>" />
+ <div class="form-group">
+ <label class="col-lg-2 control-label"><%:Update package lists%></label>
+ <div class="col-lg-5">
+ <button id="package_update" type="button" class="btn btn-default"><%:Start update …%></button>
+ </div>
+ <div class="col-lg-5"></div>
</div>
- </div>
- <div class="cbi-value">
- <label class="cbi-value-title"><%:Install package directly%></label>
- <div class="cbi-value-field">
- <div class="cbi-splitbutton">
- <input id="package_url" type="text" class="cbi-input-text" placeholder="<%:Enter URL or name …%>"
- /><img id="package_install" src="<%=resource%>/icons/cbi/apply.gif" class="cbi-button" title="<%:Install …%>" />
+ <div class="form-group">
+ <label class="col-lg-2 control-label"><%:Install package directly%></label>
+ <div class="col-lg-5">
+ <div class="input-group">
+ <input id="package_url" type="text" class="form-control" placeholder="<%:Enter URL or name …%>" />
+ <span class="input-group-btn">
+ <button id="package_install" type="button" class="btn btn-info">»</button>
+ </span>
+ </div>
</div>
+ <div class="col-lg-5"></div>
</div>
- </div>
- <div class="cbi-value">
- <label class="cbi-value-title"><%:Filter packages%></label>
- <div class="cbi-value-field">
- <div class="cbi-splitbutton">
- <input id="package_filter" type="text" class="cbi-input-text" placeholder="<%:Filter packages …%>"
- /><img src="<%=resource%>/icons/cbi/find.gif" class="cbi-button" />
+ <div class="form-group">
+ <label class="col-lg-2 control-label"><%:Filter packages%></label>
+ <div class="col-lg-5">
+ <div class="input-group">
+ <input id="package_filter" type="text" class="form-control" placeholder="<%:Filter packages …%>" />
+ <span class="input-group-btn">
+ <button" type="button" class="btn btn-default">×</button>
+ </span>
+ </div>
+ <label><input type="checkbox" id="package_which" style="vertical-align: middle; margin-top: 0" /> <%:Display only installed packages%></label>
</div>
- <label><input type="checkbox" id="package_which" style="vertical-align: middle; margin-top: 0" /> <%:Display only installed packages%></label>
+ <div class="col-lg-5"></div>
</div>
</div>
- <div>
- <input id="package_prev" type="button" class="cbi-button" value="« 0 - 0" />
- <input id="package_next" type="button" class="cbi-button" value="0 - 0 »" />
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ <div class="btn-group">
+ <button id="package_prev" type="button" class="btn btn-default">« 0 - 0</button>
+ <button id="package_next" type="button" class="btn btn-default">0 - 0 »</button>
+ </div>
+ </div>
+
+ <div class="panel-body" id="package_table"></div>
</div>
+ </div>
- <div id="package_table"></div>
- </fieldset>
- <div id="config">
- <textarea style="width:100%"></textarea>
- <div class="cbi-page-actions">
- <input class="cbi-button cbi-button-save" type="button" value="<%:Save%>" />
+ <div class="tab-pane" id="config">
+ <div class="panel panel-default">
+ <textarea class="form-control"></textarea>
+ </div>
+ <div class="text-right">
+ <button class="btn btn-primary" type="button"><%:Save%></button>
</div>
</div>
+
</div>
-<fieldset class="cbi-map" id="maps">
- <div>
- <legend><%:Local Startup%></legend>
- <div class="cbi-map-descr"><%:This is the content of /etc/rc.local. Insert your own commands here (in front of 'exit 0') to execute them at the end of the boot process.%></div>
- </div>
- <div>
- <textarea id="rc_local" class="cbi-input-textarea" style="width:100%" rows="10"></textarea>
- <div class="cbi-page-actions">
- <input class="cbi-button cbi-button-save" type="button" value="<%:Save%>" />
+<ul class="nav nav-tabs">
+ <li class="active"><a href="#rclocal" data-toggle="tab"><%:Local Startup%></a></li>
+ <li><a href="#initscripts" data-toggle="tab"><%:Initscripts%></a></li>
+</ul>
+
+<div class="tab-content">
+ <div class="tab-pane active" id="rclocal">
+ <p><%:This is the content of /etc/rc.local. Insert your own commands here (in front of 'exit 0') to execute them at the end of the boot process.%></p>
+ <div class="panel panel-default">
+ <textarea id="rc_local" class="form-control" style="width:100%" rows="10"></textarea>
+ </div>
+ <div class="text-right">
+ <button type="button" class="btn btn-primary"><%:Save%></button>
</div>
</div>
- <div>
- <legend><%:Initscripts%></legend>
- <div class="cbi-map-descr"><%:You can enable or disable installed init scripts here. Changes will applied after a device reboot. Warning: If you disable essential init scripts like "network", your device might become inaccessible!%></div>
+ <div class="tab-pane" id="initscripts">
+ <p><%:You can enable or disable installed init scripts here. Changes will applied after a device reboot. Warning: If you disable essential init scripts like "network", your device might become inaccessible!%></p>
+ <div id="init_table"></div>
</div>
- <div id="init_table"></div>
-</fieldset>
+</div>
<div class="cbi-form" id="tabs" style="display:none">
- <ul class="cbi-tabmenu">
- <li><a href="#actions"><%:Actions%></a></li>
- <li><a href="#config"><%:Configuration%></a></li>
+ <ul class="nav nav-tabs">
+ <li class="active"><a data-toggle="tab" href="#actions"><%:Actions%></a></li>
+ <li><a data-toggle="tab" href="#config"><%:Configuration%></a></li>
</ul>
- <div id="actions">
- <h3><%:Backup / Restore%></h3>
- <p><%:Click "Generate archive" to download a tar archive of the current configuration files. To reset the firmware to its initial state, click "Perform reset" (only possible with squashfs images).%></p>
- <p>
- <form action="/cgi-bin/luci-backup" method="post" style="display:inline">
- <input type="hidden" name="sessionid" />
- <input class="cbi-button cbi-button-apply" type="button" id="btn_backup" value="<%:Generate archive%>" />
- </form>
- <input class="cbi-button cbi-button-reset" type="button" id="btn_reset" value="<%:Perform reset%>" />
- </p>
- <br />
+ <div class="tab-content">
+ <div class="tab-pane active" id="actions">
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ <h3 class="panel-title"><%:Backup / Restore%></h3>
+ </div>
+ <div class="panel-body">
+ <p><%:Click "Generate archive" to download a tar archive of the current configuration files. To reset the firmware to its initial state, click "Perform reset" (only possible with squashfs images).%></p>
+ <p>
+ <form action="/cgi-bin/luci-backup" method="post" style="display:inline">
+ <input type="hidden" name="sessionid" />
+ <input class="btn btn-primary" type="button" id="btn_backup" value="<%:Generate archive%>" />
+ </form>
+ <input class="btn btn-danger" type="button" id="btn_reset" value="<%:Perform reset%>" />
+ </p>
- <p><%:To restore configuration files, you can upload a previously generated backup archive here.%></p>
- <p>
- <input class="cbi-button cbi-input-apply" type="button" id="btn_restore" value="<%:Upload archive...%>" />
- </p>
- <br />
+ <p><%:To restore configuration files, you can upload a previously generated backup archive here.%></p>
+ <p>
+ <input class="btn btn-primary" type="button" id="btn_restore" value="<%:Upload archive...%>" />
+ </p>
+ </div>
+ </div>
- <h3><%:Flash new firmware image%></h3>
- <p><%:Upload a sysupgrade-compatible image here to replace the running firmware. Check "Keep settings" to retain the current configuration (requires an OpenWrt compatible firmware image).%></p>
- <p>
- <input class="cbi-button cbi-input-apply" type="button" id="btn_flash" value="<%:Flash image...%>" />
- </p>
- </div>
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ <h3 class="panel-title"><%:Flash new firmware image%></h3>
+ </div>
+ <div class="panel-body">
+ <p><%:Upload a sysupgrade-compatible image here to replace the running firmware. Check "Keep settings" to retain the current configuration (requires an OpenWrt compatible firmware image).%></p>
+ <p>
+ <input class="btn btn-primary" type="button" id="btn_flash" value="<%:Flash image...%>" />
+ </p>
+ </div>
+ </div>
+ </div>
- <div id="config">
- <textarea style="width:100%"></textarea>
- <div class="cbi-page-actions">
- <input class="cbi-button cbi-button-save" type="button" id="btn_save" value="<%:Save%>" />
- <input class="cbi-button cbi-button-apply" type="button" id="btn_list" value="<%:Show current backup file list …%>" />
+ <div class="tab-pane" id="config">
+ <div class="panel">
+ <textarea class="form-control"></textarea>
+ </div>
+ <div class="pull-right">
+ <input class="btn btn-primary" type="button" id="btn_save" value="<%:Save%>" />
+ <input class="btn btn-default" type="button" id="btn_list" value="<%:Show current backup file list …%>" />
+ </div>
</div>
</div>
</div>
caption: L.tr('Static IPv4 Routes'),
anonymous: true,
addremove: true,
+ sortable: true,
add_caption: L.tr('Add new route'),
remove_caption: L.tr('Remove route')
});
caption: L.tr('Static IPv6 Routes'),
anonymous: true,
addremove: true,
+ sortable: true,
add_caption: L.tr('Add new route'),
remove_caption: L.tr('Remove route')
});
used_vids[v] = true;
}
- v = parseInt(v, 10);
-
- if (isNaN(v))
+ if (val.match(/[^0-9]/))
return L.tr('Invalid VLAN ID');
- if (v < 1 || v > max_vid)
- return L.tr('VLAN ID must be value between %u and %u').format(1, max_vid);
+ val = parseInt(val, 10);
+
+ if (val < 1 || val > max_vid)
+ return L.tr('VLAN ID must be a value between %u and %u').format(1, max_vid);
return true;
}
}
}
- m.insertInto('#map');
-
- self.repeat(function() {
- return L.network.getSwitchStatus(swname).then(function(ports) {
- for (var j = 0; j < ports.length; j++)
- {
- var s = L.tr('No link');
- var d = ' ';
-
- if (ports[j].link)
- {
- s = '%dbaseT'.format(ports[j].speed);
- d = ports[j].full_duplex ? L.tr('Full-duplex') : L.tr('Half-duplex');
- }
-
- $('#portstatus-%s-%d'.format(swname, j))
- .empty().append(s + '<br />' + d);
- }
- });
- }, 5000);
+ return m.insertInto('#map').then(function() {
+ self.repeat(function() {
+ return L.network.getSwitchStatus(swname).then(function(ports) {
+ for (var j = 0; j < ports.length; j++)
+ {
+ var s = L.tr('No link');
+ var d = ' ';
+
+ if (ports[j].link)
+ {
+ s = '%dbaseT'.format(ports[j].speed);
+ d = ports[j].full_duplex ? L.tr('Full-duplex') : L.tr('Half-duplex');
+ }
+
+ $('#portstatus-%s-%d'.format(swname, j))
+ .empty().append(s + '<br />' + d);
+ }
+ });
+ }, 5000);
+ });
});
}
});
}, {
key: 'pid',
format: function(v, n) {
- return $('<button />')
- .attr('disabled', !allow_signals)
- .addClass('cbi-button')
- .addClass('cbi-button-reload')
- .text(L.tr('Hang Up'))
- .click(function() { L.system.sendSignal(v, 1).then(status) });
- }
- }, {
- key: 'pid',
- format: function(v, n) {
- return $('<button />')
- .attr('disabled', !allow_signals)
- .addClass('cbi-button')
- .addClass('cbi-button-remove')
- .text(L.tr('Terminate'))
- .click(function() { L.system.sendSignal(v, 15).then(status) });
- }
- }, {
- key: 'pid',
- format: function(v, n) {
- return $('<button />')
- .attr('disabled', !allow_signals)
- .addClass('cbi-button')
- .addClass('cbi-button-reset')
- .text(L.tr('Kill'))
- .click(function() { L.system.sendSignal(v, 9).then(status); });
+ return $('<div />')
+ .addClass('btn-group')
+ .append($('<button />')
+ .addClass('btn btn-primary btn-sm dropdown-toggle')
+ .attr('data-toggle', 'dropdown')
+ .text(L.tr('Signal…')))
+ .append($('<ul />')
+ .addClass('dropdown-menu pull-right')
+ .append($('<li />')
+ .append($('<a />')
+ .attr('href', '#')
+ .html('%s (<code>%s</code>)'.format(L.trc('UNIX signal', 'Reload'), 'HUP'))
+ .click(function(ev) { L.system.sendSignal(v, 1).then(status); ev.preventDefault(); })))
+ .append($('<li />')
+ .append($('<a />')
+ .attr('href', '#')
+ .html('%s (<code>%s</code>)'.format(L.trc('UNIX signal', 'Terminate'), 'TERM'))
+ .click(function(ev) { L.system.sendSignal(v, 15).then(status); ev.preventDefault(); })))
+ .append($('<li />')
+ .append($('<a />')
+ .attr('href', '#')
+ .html('%s (<code>%s</code>)'.format(L.trc('UNIX signal', 'Kill immediately'), 'KILL'))
+ .click(function(ev) { L.system.sendSignal(v, 9).then(status); ev.preventDefault(); }))))
}
} ]
});
var form = $('<div />')
.append($('<p />')
.text(L.tr('Paste the public key line into the field below and press "%s" to continue.').format(L.tr('Ok'))))
+ .append($('<p />')
+ .text(L.tr('Unrecognized public key! Please add only RSA or DSA keys.'))
+ .addClass('alert alert-danger')
+ .hide())
.append($('<p />')
.append($('<input />')
.attr('type', 'text')
.attr('placeholder', L.tr('Paste key here'))
- .css('width', '100%')))
- .append($('<p />')
- .text(L.tr('Unrecognized public key! Please add only RSA or DSA keys.'))
- .addClass('alert-message')
- .hide());
+ .addClass('form-control')));
L.ui.dialog(L.tr('Add new public key'), form, {
style: 'confirm',
if (!key)
{
form.find('input').val('');
- form.find('.alert-message').show();
+ form.find('.alert').show();
return;
}
continue;
$('<div />')
- .addClass('cbi-input-dynlist')
+ .addClass('input-group')
.append($('<input />')
+ .addClass('form-control')
.attr('type', 'text')
.prop('readonly', true)
.click({ self: this, index: i }, this._show)
.val('%dBit %s - %s'.format(k.bits, k.type, k.comment || '?')))
- .append($('<img />')
- .attr('src', L.globals.resource + '/icons/cbi/remove.gif')
- .attr('title', L.tr('Remove public key'))
- .click({ self: this, div: div, index: i }, this._remove)
- .addClass('cbi-button'))
+ .append($('<span />')
+ .addClass('input-group-btn')
+ .append($('<button />')
+ .addClass('btn btn-danger')
+ .attr('title', L.tr('Remove public key'))
+ .text('–')
+ .click({ self: this, div: div, index: i }, this._remove)))
.appendTo(div);
}
if (this._keys.length > 0)
$('<br />').appendTo(div);
- $('<input />')
- .attr('type', 'button')
- .val(L.tr('Add public key …'))
+ L.ui.button(L.tr('Add public key …'), 'success')
.click({ self: this, div: div }, this._add)
- .addClass('cbi-button')
- .addClass('cbi-button-apply')
.appendTo(div);
},
return L.system.getSSHKeys().then(function(keys) {
var m = new L.cbi.Map('dropbear', {
caption: L.tr('SSH Access'),
- description: L.tr('Dropbear offers SSH network shell access and an integrated SCP server')
+ description: L.tr('Dropbear offers SSH network shell access and an integrated SCP server'),
+ tabbed: true
});
var s1 = m.section(L.cbi.DummySection, '__password', {
});
var s = m.section(L.cbi.TypedSection, 'led', {
- caption: function(sid) { return sid ? (this.fields.name.textvalue(sid) || L.tr('Unnamed LED')) : '' },
- teasers: [ 'sysfs', 'default', 'trigger', '_net_dev', 'mode', '_usb_dev', 'delayon', 'delayoff' ],
+ caption: L.tr('LED Definitions'),
+ teasers: [ 'name', 'sysfs', 'default', 'trigger', '_net_dev', 'mode', '_usb_dev', 'delayon', 'delayoff' ],
collabsible: true,
addremove: true,
add_caption: L.tr('Add new LED defintion'),
L.ui.view.extend({
+ title: L.tr('Package management'),
+
updateDiskSpace: function()
{
return L.system.getDiskInfo().then(function(info) {
width: '120px',
format: function(v, n) {
var inst = self.installedList[list[n][0]];
- return $('<button />')
+ return L.ui.button(inst ? L.trc('Package state', 'Installed') : L.trc('Package state', 'Not installed'), inst ? 'success' : 'danger')
.css('width', '100%')
.attr('disabled', install_disabled)
.attr('pkgname', list[n][0])
.attr('installed', inst)
- .addClass('cbi-button')
- .addClass(inst ? 'cbi-button-apply' : 'cbi-button-reset')
- .text(inst ? L.trc('Package state', 'Installed') : L.trc('Package state', 'Not installed'))
.click(function() {
self.installRemovePackage(this.getAttribute('pkgname'), this.getAttribute('installed') == 'true');
});
$('#package_prev')
.attr('offset', offset - 100)
.attr('disabled', false)
- .val('« %d - %d'.format(offset - 100 + 1, offset));
+ .text('« %d - %d'.format(offset - 100 + 1, offset));
else
$('#package_prev')
.attr('disabled', true)
- .val('« %d - %d'.format(1, Math.min(100, list.total)));
+ .text('« %d - %d'.format(1, Math.min(100, list.total)));
if ((offset + 100) < list.total)
$('#package_next')
.attr('offset', offset + 100)
.attr('disabled', false)
- .val('%d - %d »'.format(offset + 100 + 1, Math.min(offset + 200, list.total)));
+ .text('%d - %d »'.format(offset + 100 + 1, Math.min(offset + 200, list.total)));
else
$('#package_next')
.attr('disabled', true)
- .val('%d - %d »'.format(list.total - (list.total % 100) + 1, list.total));
+ .text('%d - %d »'.format(list.total - (list.total % 100) + 1, list.total));
if (interactive)
L.ui.loading(false);
return $.when(
L.opkg.getConfig().then(function(config) {
- $('textarea')
+ $('#config textarea')
.attr('rows', (config.match(/\n/g) || [ ]).length + 1)
.val(config);
- $('input.cbi-button-save')
+ $('#config button')
.click(function() {
- var data = ($('textarea').val() || '').replace(/\r/g, '').replace(/\n?$/, '\n');
+ var data = ($('#config textarea').val() || '').replace(/\r/g, '').replace(/\n?$/, '\n');
L.ui.loading(true);
L.opkg.setConfig(data).then(function() {
- $('textarea')
+ $('#config textarea')
.attr('rows', (data.match(/\n/g) || [ ]).length + 1)
.val(data);
self.fetchInstalledList(),
self.updateDiskSpace()
).then(function() {
- $('#tabs').show().tabs();
-
$('#package_prev, #package_next').click(function(ev) {
if (!this.getAttribute('disabled'))
{
});
$('#package_filter').next().click(function(ev) {
- if (this.getAttribute('src').indexOf('remove.gif') > -1)
- $('#package_filter').val('');
-
+ $('#package_filter').val('');
self.fetchPackageList(0, true);
});
key: 'start'
}, {
caption: L.tr('Initscript'),
- key: 'name',
- width: '90%'
+ key: 'name'
}, {
- caption: L.trc('Init script table heading', 'Enable'),
key: 'enabled',
- format: function(v, n) {
- return $('<button />')
- .attr('disabled', !allow_write)
- .attr('name', list[n].name)
- .addClass('cbi-button')
- .addClass(v ? 'cbi-button-apply' : 'cbi-button-reset')
- .text(v ? L.trc('Init script state', 'Enabled') : L.trc('Init script state', 'Disabled'))
- .click(function() {
- L.ui.loading(true);
- if (v)
- L.system.initDisable(this.getAttribute('name')).then(redraw);
- else
- L.system.initEnable(this.getAttribute('name')).then(redraw);
- });
- }
- }, {
- caption: L.trc('Init script table heading', 'Restart'),
- key: 'enabled',
- format: function(v, n) {
- return $('<button />')
- .attr('disabled', !allow_write)
- .attr('name', list[n].name)
- .addClass('cbi-button')
- .addClass('cbi-button-reload')
- .text(L.trc('Init script action', 'Restart'))
- .click(function() {
- L.ui.loading(true);
- L.system.initRestart(this.getAttribute('name')).then(redraw)
- });
- }
- }, {
- caption: L.trc('Init script table heading', 'Stop'),
- key: 'enabled',
- format: function(v, n) {
- return $('<button />')
- .attr('disabled', !allow_write)
- .attr('name', list[n].name)
- .addClass('cbi-button')
- .addClass('cbi-button-remove')
- .text(L.trc('Init script action', 'Stop'))
- .click(function() {
- L.ui.loading(true);
- L.system.initStop(this.getAttribute('name')).then(redraw)
- });
+ format: function(v, n) {
+ return [
+ $('<div />')
+ .addClass('btn-group pull-right')
+ .append($('<button />')
+ .attr('disabled', !allow_write)
+ .attr('name', list[n].name)
+ .addClass('btn btn-sm')
+ .addClass(v ? 'btn-success' : 'btn-danger')
+ .text(v ? L.trc('Init script state', 'Enabled') : L.trc('Init script state', 'Disabled'))
+ .click(function() {
+ L.ui.loading(true);
+ if (v)
+ L.system.initDisable(this.getAttribute('name')).then(redraw);
+ else
+ L.system.initEnable(this.getAttribute('name')).then(redraw);
+ }))
+ .append($('<button />')
+ .addClass('btn btn-primary btn-sm dropdown-toggle')
+ .attr('data-toggle', 'dropdown')
+ .attr('disabled', !allow_write)
+ .text(L.tr('Action…')))
+ .append($('<ul />')
+ .addClass('dropdown-menu pull-right')
+ .append($('<li />')
+ .append($('<a />')
+ .attr('href', '#')
+ .text(L.tr('Reload'))
+ .click(function(ev) { L.system.initReload(v).then(redraw); ev.preventDefault(); })))
+ .append($('<li />')
+ .append($('<a />')
+ .attr('href', '#')
+ .text(L.tr('Restart'))
+ .click(function(ev) { L.system.initRestart(v).then(redraw); ev.preventDefault(); })))
+ .append($('<li />')
+ .append($('<a />')
+ .attr('href', '#')
+ .text(L.tr('Stop'))
+ .click(function(ev) { L.system.initStop(v).then(redraw); ev.preventDefault(); }))))
+ ];
}
} ]
});
L.ui.loading(false);
}),
L.system.getRcLocal().then(function(data) {
- $('#maps').accordion({ heightStyle: 'content' });
-
$('textarea').val(data).attr('disabled', !allow_write);
$('input.cbi-button-save').attr('disabled', !allow_write).click(function() {
var data = ($('textarea').val() || '').replace(/\r/g, '').replace(/\n?$/, '\n');
.css('width', '100%')
.attr('rows', list.length)
.prop('readonly', true)
+ .addClass('form-control')
.val(list.join('\n')),
{ style: 'close' }
);
widget: function(sid)
{
var t = $('<table />')
+ .addClass('table table-condensed table-hover')
.attr('id', this.id(sid))
.append($('<tr />')
.append($('<th />')
{
$(r.insertCell(-1))
.append($('<input />')
+ .addClass('form-control')
.attr('type', 'radio')
.attr('name', '%s_%s'.format(this.id(sid), this.choices[i][0]))
.attr('value', j)
execute: function() {
var self = this;
- L.ui.listAvailableACLs().then(function(acls) {
+ return L.ui.listAvailableACLs().then(function(acls) {
var m = new L.cbi.Map('rpcd', {
caption: L.tr('Guest Logins'),
description: L.tr('Manage user accounts and permissions for accessing the LuCI ui.'),
});
var s = m.section(L.cbi.TypedSection, 'login', {
- caption: function(sid) {
- var u = sid ? this.fields.username.textvalue(sid) : undefined;
- return u ? L.tr('Login "%s"').format(u) : L.tr('New login');
- },
+ caption: L.tr('Accounts'),
collabsible: true,
addremove: true,
- add_caption: L.tr('Add new user …'),
- teasers: [ '__shadow', '__acls' ]
+ add_caption: L.tr('Add account …'),
+ teasers: [ 'username', '__shadow', '__acls' ]
});
s.option(L.cbi.InputValue, 'username', {