X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?p=src%2Fapp-framework-demo.git;a=blobdiff_plain;f=afm-client%2Fapp%2FFrontend%2Fwidgets%2FActionButtons%2FAppliButton.js;fp=afm-client%2Fapp%2FFrontend%2Fwidgets%2FActionButtons%2FAppliButton.js;h=7a32873c118b7434618729f663674bcf745b2d83;hp=69e61b6fea3aac750f7b9076e9c2c006ab1c9838;hb=9bd23d89edbc2dad7f5da8088fa788a7632eade2;hpb=366fed15806599678b05929f54318983def6001b 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;