2 title: L.tr('Startup'),
4 var allow_write = this.options.acls.startup;
7 L.system.initList(function(list) {
8 /* filter init scripts with no start prio */
9 for (var i = 0; i < list.length; i++)
11 if (typeof(list[i].start) != 'undefined')
17 var initTable = new L.ui.table({
19 caption: L.tr('Start priority'),
22 caption: L.tr('Initscript'),
26 caption: L.trc('Init script table heading', 'Enable'),
28 format: function(v, n) {
29 return $('<button />')
30 .attr('disabled', !allow_write)
31 .attr('name', list[n].name)
32 .addClass('cbi-button')
33 .addClass(v ? 'cbi-button-apply' : 'cbi-button-reset')
34 .text(v ? L.trc('Init script state', 'Enabled') : L.trc('Init script state', 'Disabled'))
38 L.system.initDisable(this.getAttribute('name')).then(renderInitlist);
40 L.system.initEnable(this.getAttribute('name')).then(renderInitlist);
44 caption: L.trc('Init script table heading', 'Restart'),
46 format: function(v, n) {
47 return $('<button />')
48 .attr('disabled', !allow_write)
49 .attr('name', list[n].name)
50 .addClass('cbi-button')
51 .addClass('cbi-button-reload')
52 .text(L.trc('Init script action', 'Restart'))
55 L.system.initRestart(this.getAttribute('name')).then(renderInitlist)
59 caption: L.trc('Init script table heading', 'Stop'),
61 format: function(v, n) {
62 return $('<button />')
63 .attr('disabled', !allow_write)
64 .attr('name', list[n].name)
65 .addClass('cbi-button')
66 .addClass('cbi-button-remove')
67 .text(L.trc('Init script action', 'Stop'))
70 L.system.initStop(this.getAttribute('name')).then(renderInitlist)
77 initTable.insertInto('#init_table');
81 L.system.getRcLocal(function(data) {
82 $('#maps').accordion({ heightStyle: 'content' });
84 $('textarea').val(data).attr('disabled', !allow_write);
85 $('input.cbi-button-save').attr('disabled', !allow_write).click(function() {
86 var data = ($('textarea').val() || '').replace(/\r/g, '').replace(/\n?$/, '\n');
88 L.system.setRcLocal(data, function() {
89 $('textarea').val(data);