[EAGLE-852] Application start button should be disabled when it's running, and the same for stop button.
EAGLE-852 Application start button should be disabled when it's running, and the same for stop button.
- Add disabled judgment logic.
executable | status | start button | stop button
---|--- | --- | ---
Y | INITIALIZED | Y | N
Y | STARTING | N | N
Y | RUNNING | N | Y
Y | STOPPING | N | N
Y | STOPPED | N | N
N | INITIALIZED | N | N
https://issues.apache.org/jira/browse/EAGLE-852
Author: chitin <chitin1027@gmail.com>
Closes #767 from chitin/EAGLE-852-startbutton.
diff --git a/eagle-server/src/main/webapp/app/dev/partials/integration/site.html b/eagle-server/src/main/webapp/app/dev/partials/integration/site.html
index a13599d..57a9b8d 100644
--- a/eagle-server/src/main/webapp/app/dev/partials/integration/site.html
+++ b/eagle-server/src/main/webapp/app/dev/partials/integration/site.html
@@ -62,10 +62,16 @@
<td class="text-center">
<div class="btn-group btn-group-xs" ng-if="app.installed">
<!--button class="btn btn-default btn-sm">Monitor</button-->
- <button class="btn btn-default btn-sm" ng-click="startApp(app)" ng-if="app.descriptor.executable">
+ <button class="btn btn-default btn-sm" ng-click="startApp(app)" ng-if="app.descriptor.executable && app.status === 'INITIALIZED'">
<span class="fa fa-play"></span>
</button>
- <button class="btn btn-default btn-sm" ng-click="stopApp(app)" ng-if="app.descriptor.executable">
+ <button class="btn btn-default btn-sm" disabled="disabled" ng-if="app.descriptor.executable && app.status !== 'INITIALIZED'">
+ <span class="fa fa-play"></span>
+ </button>
+ <button class="btn btn-default btn-sm" ng-click="stopApp(app)" ng-if="app.descriptor.executable && app.status === 'RUNNING'">
+ <span class="fa fa-stop"></span>
+ </button>
+ <button class="btn btn-default btn-sm" disabled="disabled" ng-if="app.descriptor.executable && app.status !== 'RUNNING'">
<span class="fa fa-stop"></span>
</button>
<button class="btn btn-default btn-sm" disabled="disabled" ng-if="!app.descriptor.executable">