##// END OF EJS Templates
process-management: show helper for CMDLINE.
marcink -
r1886:50952b7b default
parent child Browse files
Show More
@@ -1,83 +1,89 b''
1 1
2 2 <div id="update_notice" style="display: none; margin: -40px 0px 20px 0px">
3 3 <div>${_('Checking for updates...')}</div>
4 4 </div>
5 5
6 6
7 7 <div class="panel panel-default">
8 8 <div class="panel-heading">
9 9 <h3 class="panel-title">${_('Gunicorn process management')}</h3>
10 10
11 11 </div>
12 12 <div class="panel-body" id="app">
13 13 <h3>List of Gunicorn processes on this machine</h3>
14 14 <table>
15 15 % for proc in c.gunicorn_processes:
16 16 <% mem = proc.memory_info()%>
17 17
18 18 <tr>
19 19 <td>
20 20 <code>
21 21 ${proc.pid} - ${proc.name()}
22 22 </code>
23 23 </td>
24 24 <td>
25 <a href="#showCommand" onclick="$('#pid'+${proc.pid}).toggle();return false"> command </a>
26 <code id="pid${proc.pid}" style="display: none">
27 ${''.join(proc.cmdline())}
28 </code>
29 </td>
30 <td>
25 31 RSS:${h.format_byte_size_binary(mem.rss)}
26 32 </td>
27 33 <td>
28 34 VMS:${h.format_byte_size_binary(mem.vms)}
29 35 </td>
30 36 <td>
31 37 <% is_master = proc.children(recursive=True) %>
32 38 % if is_master:
33 39 MASTER
34 40 % else:
35 41 <a href="#restartProcess" onclick="restart(this, ${proc.pid});return false">
36 42 restart
37 43 </a>
38 44 % endif
39 45 </td>
40 46 </tr>
41 47 % endfor
42 48 </table>
43 49 </div>
44 50 </div>
45 51
46 52
47 53 <script>
48 54
49 55
50 56 restart = function(elem, pid) {
51 57
52 58 if ($(elem).hasClass('disabled')){
53 59 return;
54 60 }
55 61 $(elem).addClass('disabled');
56 62 $(elem).html('processing...');
57 63
58 64 $.ajax({
59 65 url: pyroutes.url('admin_settings_process_management_signal'),
60 66 headers: {
61 67 "X-CSRF-Token": CSRF_TOKEN,
62 68 },
63 69 data: JSON.stringify({'pids': [pid]}),
64 70 dataType: 'json',
65 71 type: 'POST',
66 72 contentType: "application/json; charset=utf-8",
67 73 success: function (data) {
68 74 $(elem).html(data.result);
69 75 $(elem).removeClass('disabled');
70 76 },
71 77 failure: function (data) {
72 78 $(elem).text('FAILED TO LOAD RESULT');
73 79 $(elem).removeClass('disabled');
74 80 },
75 81 error: function (data) {
76 82 $(elem).text('FAILED TO LOAD RESULT');
77 83 $(elem).removeClass('disabled');
78 84 }
79 85 })
80 86 }
81 87
82 88
83 89 </script>
General Comments 0
You need to be logged in to leave comments. Login now