luci2: adapt views to changed luci2 framework
[project/luci2/ui.git] / luci2 / htdocs / luci2 / view / status.processes.js
index a30a092..9c80d89 100644 (file)
@@ -25,32 +25,29 @@ L.ui.view.extend({
                 }, {
                     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(); }))))
                     }
                 } ]
             });