diff options
author | José Bollo <jose.bollo@iot.bzh> | 2016-02-14 15:09:32 +0100 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2016-02-15 10:45:19 +0100 |
commit | 9bd23d89edbc2dad7f5da8088fa788a7632eade2 (patch) | |
tree | 474ccd28bd1eb95d6216e5cb6193afa6c5814856 /afm-client/app/Frontend | |
parent | 366fed15806599678b05929f54318983def6001b (diff) |
appli: integrates mode local/remote
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'afm-client/app/Frontend')
-rw-r--r-- | afm-client/app/Frontend/widgets/ActionButtons/AppliButton.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/afm-client/app/Frontend/widgets/ActionButtons/AppliButton.js b/afm-client/app/Frontend/widgets/ActionButtons/AppliButton.js index 69e61b6..7a32873 100644 --- a/afm-client/app/Frontend/widgets/ActionButtons/AppliButton.js +++ b/afm-client/app/Frontend/widgets/ActionButtons/AppliButton.js @@ -50,10 +50,10 @@ ''; angular.module('AppliButton', []) - .directive('appliButton', function (AppConfig, AppCall, ModalFactory, Notification, $timeout) { + .directive('appliButton', function (AppConfig, AppCall, ModalFactory, Notification, $timeout, $window, $location) { function mymethods(scope, elem, attrs) { - scope.runstatus = "stop" + scope.runstatus = "stop"; scope.clicked = function () { var notifyError = function(api, response) { @@ -81,13 +81,15 @@ 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: "remote"}, function(response) { if (response.status !== 200 || response.data.jtype !== "AJB_reply") { notifyError ("start", response); return; } scope.runstatus="start"; notifySuccess ("start", response); + if(response.data.response.uri) + $window.open(response.data.response.uri.replace("%h", $location.host())); }); break; |