summaryrefslogtreecommitdiff
path: root/www/js
diff options
context:
space:
mode:
Diffstat (limited to 'www/js')
-rw-r--r--www/js/DataModel.js12
-rw-r--r--www/js/LoginCtrl.js26
-rw-r--r--www/js/app.js1
3 files changed, 35 insertions, 4 deletions
diff --git a/www/js/DataModel.js b/www/js/DataModel.js
index b62af980..f948e38b 100644
--- a/www/js/DataModel.js
+++ b/www/js/DataModel.js
@@ -24,7 +24,8 @@ angular.module('zmApp.controllers')
var monitors = [];
var oldevents = [];
-
+ var serverGroupList={};
+
var loginData = {
'username': '',
'password': '',
@@ -105,7 +106,12 @@ angular.module('zmApp.controllers')
zmLog("Saving all parameters to storage");
zmDebug ("DataModel/setLogin: writing " + JSON.stringify(newLogin));
- $localstorage.setObject('defaultServer', loginData);
+ $localstorage.setObject($rootScope.currentServerGroup, loginData);
+ serverGroupList[$rootScope.currentServerGroup]=loginData;
+ console.log (JSON.stringify(serverGroupList));
+ $localstorage.setObject("serverlist", serverGroupList);
+
+
}
// separate out a debug so we don't do this if comparison for normal logs
@@ -175,7 +181,7 @@ angular.module('zmApp.controllers')
zmLog("ZMData init: checking for stored variables & setting up log file");
- var loadedData = $localstorage.getObject('defaultServer');
+ var loadedData = $localstorage.getObject($rootScope.currentServerGroup);
if (!isEmpty(loadedData))
{
loginData = loadedData;
diff --git a/www/js/LoginCtrl.js b/www/js/LoginCtrl.js
index 6c9234c4..1199d78a 100644
--- a/www/js/LoginCtrl.js
+++ b/www/js/LoginCtrl.js
@@ -2,7 +2,7 @@
/* jslint browser: true*/
/* global cordova,StatusBar,angular,console */
-angular.module('zmApp.controllers').controller('zmApp.LoginCtrl', ['$scope', '$rootScope', 'zm', '$ionicModal', 'ZMDataModel', '$ionicSideMenuDelegate', '$ionicPopup', '$http', '$q', '$ionicLoading', 'zmAutoLogin', '$cordovaPinDialog', 'EventServer', '$ionicHistory', '$state', function ($scope, $rootScope, zm, $ionicModal, ZMDataModel, $ionicSideMenuDelegate, $ionicPopup, $http, $q, $ionicLoading, zmAutoLogin, $cordovaPinDialog, EventServer, $ionicHistory, $state) {
+angular.module('zmApp.controllers').controller('zmApp.LoginCtrl', ['$scope', '$rootScope', 'zm', '$ionicModal', 'ZMDataModel', '$ionicSideMenuDelegate', '$ionicPopup', '$http', '$q', '$ionicLoading', 'zmAutoLogin', '$cordovaPinDialog', 'EventServer', '$ionicHistory', '$state', '$ionicActionSheet', function ($scope, $rootScope, zm, $ionicModal, ZMDataModel, $ionicSideMenuDelegate, $ionicPopup, $http, $q, $ionicLoading, zmAutoLogin, $cordovaPinDialog, EventServer, $ionicHistory, $state, $ionicActionSheet) {
$scope.openMenu = function () {
$ionicSideMenuDelegate.toggleLeft();
};
@@ -31,6 +31,30 @@ angular.module('zmApp.controllers').controller('zmApp.LoginCtrl', ['$scope', '$r
$scope.check.isUseEventServer = ($scope.loginData.isUseEventServer == '1') ? true : false;
+ $scope.serverActionSheet = function () {
+ var hideSheet = $ionicActionSheet.show({
+ buttons: [
+ {
+ text: 'New Group...'
+ },
+
+ {
+ text: 'Rename'
+ },
+
+
+ ],
+ destructiveText: 'Delete',
+ titleText: 'Manage Server Groups',
+ cancelText: 'Cancel',
+ cancel: function () {
+ // add cancel code..
+ },
+ buttonClicked: function (index) {
+ return true;
+ }
+ });
+ };
//----------------------------------------------------------------
diff --git a/www/js/app.js b/www/js/app.js
index b51578a0..f52f3bab 100644
--- a/www/js/app.js
+++ b/www/js/app.js
@@ -545,6 +545,7 @@ angular.module('zmApp', [
//var eventsToDisplay=[];
$rootScope.alarmCount="0";
$rootScope.platformOS="desktop";
+ $rootScope.currentServerGroup = "defaultServer";
// This is a global exception interceptor