From 9bd23d89edbc2dad7f5da8088fa788a7632eade2 Mon Sep 17 00:00:00 2001 From: José Bollo Date: Sun, 14 Feb 2016 15:09:32 +0100 Subject: appli: integrates mode local/remote MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Bollo --- afm-client/app/Frontend/widgets/ActionButtons/AppliButton.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'afm-client/app/Frontend') 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; -- cgit 1.2.3-korg