Skip to content

Commit

Permalink
improve service status display on stopping
Browse files Browse the repository at this point in the history
  • Loading branch information
hobbyquaker committed Aug 5, 2018
1 parent 0c6fc8f commit e0381d5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions addon_files/redmatic/www/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ $(document).ready(() => {
});

$restart.click(() => {
clearTimeout(psTimeout);
$restart.addClass('disabled');
$stop.addClass('disabled');
$start.addClass('disabled');
Expand All @@ -336,7 +337,9 @@ $(document).ready(() => {
success: data => {
if (data.match(/Starting Node-RED: OK/)) {
psInterval = 2000;
ps();
setTimeout(() => {
ps();
}, 3000);
alert($alertExec);
} else {
alert($alertError);
Expand Down Expand Up @@ -366,6 +369,7 @@ $(document).ready(() => {
});

$stop.click(() => {
clearTimeout(psTimeout);
$restart.addClass('disabled');
$stop.addClass('disabled');
$start.addClass('disabled');
Expand All @@ -377,7 +381,9 @@ $(document).ready(() => {
if (data.match(/Stopping Node-RED: OK/)) {
alert($alertExec);
psInterval = 2000;
ps();
setTimeout(() => {
ps();
}, 3000);
} else {
alert($alertError);
}
Expand Down

0 comments on commit e0381d5

Please sign in to comment.