Update runnable list after uninstall
[src/app-framework-demo.git] / afm-client / app / Frontend / widgets / ActionButtons / AppliButton.js
index 7a32873..f717225 100644 (file)
                     scope.runstatus = "stop";
                     scope.clicked = function () {
 
-                        var notifyError = function(api, response) {
-                            Notification.error ({message: "Fail /api/afm-main" + api + "=" + scope.label + " RunID="+ scope.appID, delay: 5000});
+                        var notifyError = function(action, response) {
+                            Notification.error ({message: "Fail /api/afm-main" + action + "=" + scope.label + " RunID="+ scope.appID, delay: 5000});
                             elem.addClass ("fail");
                             elem.removeClass ("success");
-                            scope.callback (scope.appID, api, response);
+                            scope.callback (scope.appID, action, response);
                         };
                         
-                        var notifySuccess = function (api, response) {
+                        var notifySuccess = function (action, response) {
                             elem.removeClass ("fail");
                             scope.runID = response.data.response.runid;
-                            scope.callback (scope.appID, "/api/afm-main/start", response);
+                            scope.callback (scope.appID, action, response);
                         };
                         
                         var closeModal = function() {
@@ -87,7 +87,7 @@
                                             return;
                                         }
                                         scope.runstatus="start";
-                                        notifySuccess ("start", response);
+                                        notifySuccess (action, response);
                                        if(response.data.response.uri)
                                                $window.open(response.data.response.uri.replace("%h", $location.host()));
                                     });
                                             return;
                                         }
                                         scope.runstatus="stop";
-                                        notifySuccess ("stop", response);
+                                        notifySuccess (action, response);
                                     });
                                     break;
                                         
                                             return;
                                         }
                                         
-                                        notifySuccess ("uninstall", response);
+                                        notifySuccess (action, response);
                                     });
                                     break;