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