Big fix for kill button and autoRefresh button on server_status_processes.php page.

Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
This commit is contained in:
Piyush Vijay 2018-07-27 22:08:56 +05:30
parent b7ee22a203
commit 84d0e8045b
No known key found for this signature in database
GPG Key ID: FC77A75558658D35
2 changed files with 7 additions and 9 deletions

View File

@ -51,11 +51,11 @@ class ProcessList {
*
* @return void
*/
killProcessHandler (event) {
killProcessHandler (event, elementRef) {
event.preventDefault();
var url = $(this).attr('href');
var url = $(elementRef).attr('href');
// Get row element of the process to be killed.
var $tr = $(this).closest('tr');
var $tr = $(elementRef).closest('tr');
$.getJSON(url, function (data) {
// Check if process was killed or not.
if (data.hasOwnProperty('success') && data.success) {
@ -104,7 +104,7 @@ class ProcessList {
this.refresh,
interval
);
});
}.bind(this));
}
}

View File

@ -8,11 +8,9 @@ import processList from './classes/Server/ProcessList';
export function onload1 () {
processList.init();
// Bind event handler for kill_process
$('#tableprocesslist').on(
'click',
'a.kill_process',
processList.killProcessHandler
);
$('#tableprocesslist').on('click', 'a.kill_process', function (event) {
processList.killProcessHandler(event, this);
});
// Bind event handler for toggling refresh of process list
$('a#toggleRefresh').on('click', function (event) {
event.preventDefault();