diff options
| author | ARC <arjunrc@gmail.com> | 2015-05-12 16:21:03 -0400 |
|---|---|---|
| committer | ARC <arjunrc@gmail.com> | 2015-05-12 16:21:03 -0400 |
| commit | 1d89f4873a603392fb16096b3816b6b232b38a63 (patch) | |
| tree | f7544c00478e6e0c22c5c93d0695f67662ce10bd /www/js/LoginCtrl.js | |
| parent | b2367f35e32fad3f2383b9e124df87211f669b59 (diff) | |
Added ZM state control - start/stop/restart
Diffstat (limited to 'www/js/LoginCtrl.js')
| -rw-r--r-- | www/js/LoginCtrl.js | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/www/js/LoginCtrl.js b/www/js/LoginCtrl.js index 7a4c7695..728c8b9c 100644 --- a/www/js/LoginCtrl.js +++ b/www/js/LoginCtrl.js @@ -32,7 +32,7 @@ angular.module('zmApp.controllers').controller('zmApp.LoginCtrl', ['$scope', '$r $scope.loginData.url = $scope.loginData.url.trim(); $scope.loginData.apiurl = $scope.loginData.apiurl.trim(); $scope.loginData.username = $scope.loginData.username.trim(); - $scope.loginData.alias = $scope.loginData.alias.trim(); + $scope.loginData.streamingurl = $scope.loginData.streamingurl.trim(); if ($scope.loginData.url.slice(-1) == '/') { @@ -47,23 +47,28 @@ angular.module('zmApp.controllers').controller('zmApp.LoginCtrl', ['$scope', '$r } - if ($scope.loginData.alias.slice(-1) == '/') + if ($scope.loginData.streamingurl.slice(-1) == '/') { - $scope.loginData.alias = $scope.loginData.alias.slice(0,-1); + $scope.loginData.streamingurl = $scope.loginData.streamingurl.slice(0,-1); } - // take off leading "/" in alias too - if ($scope.loginData.alias[0] == '/') - { - $scope.loginData.alias = $scope.loginData.alias.substring(1); + // strip cgi-bin if it is there but only at the end + if ($scope.loginData.streamingurl.slice(-7).toLowerCase() == 'cgi-bin') + { + $scope.loginData.streamingurl = $scope.loginData.streamingurl.slice(0,-7); } + // FIXME:: Do a login id check too var apiurl = $scope.loginData.apiurl + '/host/getVersion.json'; - var portalurl = $scope.loginData.url + '/' + $scope.loginData.alias + '/index.php'; - console.log("API: " + apiurl + " PORTAL: " + portalurl); + var portalurl = $scope.loginData.url + '/index.php'; + var streamingurl = $scope.loginData.streamingurl + + '/cgi-bin/zms?user='+$scope.loginData.username+"&pass="+$scope.loginData.password; + + + console.log("Checking API: " + apiurl + " PORTAL: " + portalurl + " CGI-BIN: "+streamingurl); // Let's do a sanity check to see if the URLs are ok @@ -80,7 +85,8 @@ angular.module('zmApp.controllers').controller('zmApp.LoginCtrl', ['$scope', '$r $q.all([ $http.get(apiurl), - $http.get(portalurl) + $http.get(portalurl), + //$http.get(streamingurl), ]).then( function (results) { $ionicLoading.hide(); |
