Skip to content

Commit

Permalink
Big fix for kill button and autoRefresh button on server_status_proce…
Browse files Browse the repository at this point in the history
…sses.php page.

Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
  • Loading branch information
Piyush3079 committed Jul 28, 2018
1 parent b7ee22a commit 84d0e80
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
8 changes: 4 additions & 4 deletions js/src/classes/Server/ProcessList.js
Expand Up @@ -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) {
Expand Down Expand Up @@ -104,7 +104,7 @@ class ProcessList {
this.refresh,
interval
);
});
}.bind(this));
}
}

Expand Down
8 changes: 3 additions & 5 deletions js/src/server_status_processes.js
Expand Up @@ -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();
Expand Down

0 comments on commit 84d0e80

Please sign in to comment.