Code Review
/
src
/
app-framework-demo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Added runmode=remote|local
[src/app-framework-demo.git]
/
afm-client
/
app
/
Frontend
/
widgets
/
ActionButtons
/
AppliButton.js
diff --git
a/afm-client/app/Frontend/widgets/ActionButtons/AppliButton.js
b/afm-client/app/Frontend/widgets/ActionButtons/AppliButton.js
index
69e61b6
..
014fe4d
100644
(file)
--- a/
afm-client/app/Frontend/widgets/ActionButtons/AppliButton.js
+++ b/
afm-client/app/Frontend/widgets/ActionButtons/AppliButton.js
@@
-50,23
+50,24
@@
'';
angular.module('AppliButton', [])
'';
angular.module('AppliButton', [])
- .directive('appliButton', function (AppConfig, AppCall, ModalFactory, Notification, $timeout) {
+ .directive('appliButton', function (AppConfig, AppCall, ModalFactory, Notification, $timeout
, $window, $location, urlquery
) {
function mymethods(scope, elem, attrs) {
function mymethods(scope, elem, attrs) {
- scope.runstatus = "stop"
+ scope.runstatus = "stop";
+ scope.runmode = urlquery.runmode || "auto";
scope.clicked = function () {
scope.clicked = function () {
- var notifyError = function(a
pi
, response) {
- Notification.error ({message: "Fail /api/afm-main" + a
pi
+ "=" + scope.label + " RunID="+ scope.appID, delay: 5000});
+ var notifyError = function(a
ction
, response) {
+ Notification.error ({message: "Fail /api/afm-main" + a
ction
+ "=" + scope.label + " RunID="+ scope.appID, delay: 5000});
elem.addClass ("fail");
elem.removeClass ("success");
elem.addClass ("fail");
elem.removeClass ("success");
- scope.callback (scope.appID, a
pi
, response);
+ scope.callback (scope.appID, a
ction
, response);
};
};
- var notifySuccess = function (a
pi
, response) {
+ var notifySuccess = function (a
ction
, response) {
elem.removeClass ("fail");
scope.runID = response.data.response.runid;
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() {
};
var closeModal = function() {
@@
-81,13
+82,15
@@
case "start":
if (scope.runstatus !== "stop") return;
case "start":
if (scope.runstatus !== "stop") return;
- AppCall.get ("afm-main", "start", {id: scope.appID}, function(response) {
+ AppCall.get ("afm-main", "start", {id: scope.appID
, mode: scope.runmode
}, function(response) {
if (response.status !== 200 || response.data.jtype !== "AJB_reply") {
notifyError ("start", response);
return;
}
scope.runstatus="start";
if (response.status !== 200 || response.data.jtype !== "AJB_reply") {
notifyError ("start", response);
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()));
});
break;
});
break;
@@
-100,7
+103,7
@@
return;
}
scope.runstatus="stop";
return;
}
scope.runstatus="stop";
- notifySuccess (
"stop"
, response);
+ notifySuccess (
action
, response);
});
break;
});
break;
@@
-137,7
+140,7
@@
return;
}
return;
}
- notifySuccess (
"uninstall"
, response);
+ notifySuccess (
action
, response);
});
break;
});
break;