|
@@ -17,7 +17,7 @@
|
|
|
*/
|
|
|
var App = require('app');
|
|
|
App.db = {};
|
|
|
-var InitialData = {
|
|
|
+var InitialData = {
|
|
|
'app': {
|
|
|
'loginName': '',
|
|
|
'authenticated': false,
|
|
@@ -31,12 +31,12 @@ var InitialData = {
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- 'Installer' : {},
|
|
|
- 'AddHost' : {},
|
|
|
- 'AddService' : {},
|
|
|
- 'WidgetWizard' : {},
|
|
|
+ 'Installer': {},
|
|
|
+ 'AddHost': {},
|
|
|
+ 'AddService': {},
|
|
|
+ 'WidgetWizard': {},
|
|
|
'KerberosWizard': {},
|
|
|
- 'ReassignMaster' : {},
|
|
|
+ 'ReassignMaster': {},
|
|
|
'AddSecurity': {},
|
|
|
'AddAlertDefinition': {
|
|
|
content: {}
|
|
@@ -51,16 +51,17 @@ var InitialData = {
|
|
|
|
|
|
};
|
|
|
|
|
|
-if (typeof Storage !== 'undefined') {
|
|
|
- Storage.prototype.setObject = function (key, value) {
|
|
|
- this.setItem(key, JSON.stringify(value));
|
|
|
- };
|
|
|
+function checkNamespace(namespace) {
|
|
|
+ if (!namespace) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (Em.isNone(Em.get(App.db.data, namespace))) {
|
|
|
+ Em.setFullPath(App.db.data, namespace, {});
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+}
|
|
|
|
|
|
- Storage.prototype.getObject = function (key) {
|
|
|
- var value = this.getItem(key);
|
|
|
- return value && JSON.parse(value);
|
|
|
- };
|
|
|
-} else {
|
|
|
+if (typeof Storage === 'undefined') {
|
|
|
// stub for unit testing purposes
|
|
|
window.localStorage = {};
|
|
|
localStorage.setItem = function (key, val) {
|
|
@@ -72,64 +73,68 @@ if (typeof Storage !== 'undefined') {
|
|
|
window.localStorage.setObject = function (key, value) {
|
|
|
this[key] = value;
|
|
|
};
|
|
|
- window.localStorage.getObject = function (key, value) {
|
|
|
+ window.localStorage.getObject = function (key) {
|
|
|
return this[key];
|
|
|
};
|
|
|
}
|
|
|
+else {
|
|
|
+ Storage.prototype.setObject = function (key, value) {
|
|
|
+ this.setItem(key, JSON.stringify(value));
|
|
|
+ };
|
|
|
+
|
|
|
+ Storage.prototype.getObject = function (key) {
|
|
|
+ var value = this.getItem(key);
|
|
|
+ return value && JSON.parse(value);
|
|
|
+ };
|
|
|
+}
|
|
|
|
|
|
App.db.cleanUp = function () {
|
|
|
- console.log('TRACE: Entering db:cleanup function');
|
|
|
App.db.data = InitialData;
|
|
|
- console.log("In cleanup./..");
|
|
|
localStorage.setObject('ambari', App.db.data);
|
|
|
};
|
|
|
|
|
|
-App.db.cleanTmp = function() {
|
|
|
+App.db.cleanTmp = function () {
|
|
|
App.db.data.tmp = {};
|
|
|
localStorage.setObject('ambari', App.db.data);
|
|
|
};
|
|
|
|
|
|
-App.db.cleanAddHost = function() {
|
|
|
- App.db.data.AddHost = {};
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
-};
|
|
|
-
|
|
|
-App.db.updateStorage = function() {
|
|
|
+App.db.updateStorage = function () {
|
|
|
App.db.data = localStorage.getObject('ambari');
|
|
|
- if (App.db.data && App.db.data.app && App.db.data.app.tables && App.db.data.app.configs) {
|
|
|
+ if (Em.get(App, 'db.data.app.tables') && Em.get(App, 'db.data.app.configs')) {
|
|
|
return true;
|
|
|
}
|
|
|
- console.warn("local storage is deprecated!");
|
|
|
App.db.cleanUp();
|
|
|
return false;
|
|
|
};
|
|
|
|
|
|
/*
|
|
|
- Initialize wizard namespaces if they are not initialized on login.
|
|
|
- This will be required during upgrade.
|
|
|
+ Initialize wizard namespaces if they are not initialized on login.
|
|
|
+ This will be required during upgrade.
|
|
|
*/
|
|
|
-App.db.mergeStorage = function() {
|
|
|
+App.db.mergeStorage = function () {
|
|
|
if (localStorage.getObject('ambari') == null) {
|
|
|
- console.log('doing a cleanup');
|
|
|
App.db.cleanUp();
|
|
|
} else {
|
|
|
- localStorage.setObject('ambari', $.extend(true,{}, InitialData, App.db.data));
|
|
|
+ localStorage.setObject('ambari', $.extend(true, {}, InitialData, App.db.data));
|
|
|
}
|
|
|
};
|
|
|
|
|
|
// called whenever user logs in
|
|
|
if (localStorage.getObject('ambari') == null) {
|
|
|
- console.log('doing a cleanup');
|
|
|
App.db.cleanUp();
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ *
|
|
|
+ * @param {string} namespace
|
|
|
+ * @param {string} key
|
|
|
+ * @returns {*}
|
|
|
+ */
|
|
|
App.db.get = function (namespace, key) {
|
|
|
- console.log('TRACE: Entering db:get' + key);
|
|
|
App.db.data = localStorage.getObject('ambari');
|
|
|
- if (!App.db.data[namespace]) {
|
|
|
- App.db.data[namespace] = {};
|
|
|
- }
|
|
|
- return App.db.data[namespace][key];
|
|
|
+ Em.assert('`namespace` should be defined', !!namespace);
|
|
|
+ checkNamespace(namespace);
|
|
|
+ return Em.get(Em.get(App.db.data, namespace), key);
|
|
|
};
|
|
|
|
|
|
/**
|
|
@@ -140,23 +145,22 @@ App.db.get = function (namespace, key) {
|
|
|
*/
|
|
|
App.db.getProperties = function (namespace, listOfProperties) {
|
|
|
App.db.data = localStorage.getObject('ambari');
|
|
|
- if (!App.db.data[namespace]) {
|
|
|
- App.db.data[namespace] = {};
|
|
|
- }
|
|
|
- var ret = {};
|
|
|
- listOfProperties.forEach(function (k) {
|
|
|
- ret[k] = App.db.data[namespace][k];
|
|
|
- });
|
|
|
- return ret;
|
|
|
+ Em.assert('`namespace` should be defined', !!namespace);
|
|
|
+ checkNamespace(namespace);
|
|
|
+ return Em.getProperties(Em.get(App.db.data, namespace), listOfProperties);
|
|
|
};
|
|
|
|
|
|
+/**
|
|
|
+ *
|
|
|
+ * @param {string} namespace
|
|
|
+ * @param {string} key
|
|
|
+ * @param {*} value
|
|
|
+ */
|
|
|
App.db.set = function (namespace, key, value) {
|
|
|
- console.log('TRACE: Entering db:set' + key + ';value: ', value);
|
|
|
App.db.data = localStorage.getObject('ambari');
|
|
|
- if (!App.db.data[namespace]) {
|
|
|
- App.db.data[namespace] = {};
|
|
|
- }
|
|
|
- App.db.data[namespace][key] = value;
|
|
|
+ Em.assert('`namespace` should be defined', !!namespace);
|
|
|
+ checkNamespace(namespace);
|
|
|
+ Em.set(Em.get(App.db.data, namespace), key, value);
|
|
|
localStorage.setObject('ambari', App.db.data);
|
|
|
};
|
|
|
|
|
@@ -167,25 +171,14 @@ App.db.set = function (namespace, key, value) {
|
|
|
*/
|
|
|
App.db.setProperties = function (namespace, hash) {
|
|
|
App.db.data = localStorage.getObject('ambari');
|
|
|
- if (!App.db.data[namespace]) {
|
|
|
- App.db.data[namespace] = {};
|
|
|
- }
|
|
|
- for (var k in hash) {
|
|
|
- if (hash.hasOwnProperty(k)) {
|
|
|
- App.db.data[namespace][k] = hash[k];
|
|
|
- }
|
|
|
- }
|
|
|
+ Em.assert('`namespace` should be defined', !!namespace);
|
|
|
+ checkNamespace(namespace);
|
|
|
+ Em.setProperties(Em.get(App.db.data, namespace), hash);
|
|
|
localStorage.setObject('ambari', App.db.data);
|
|
|
};
|
|
|
-/*
|
|
|
- * setter methods
|
|
|
- */
|
|
|
|
|
|
App.db.setLoginName = function (name) {
|
|
|
- console.log('TRACE: Entering db:setLoginName function');
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- App.db.data.app.loginName = name;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
+ App.db.set('app', 'loginName', name);
|
|
|
};
|
|
|
|
|
|
/**
|
|
@@ -193,199 +186,60 @@ App.db.setLoginName = function (name) {
|
|
|
* @param user
|
|
|
*/
|
|
|
App.db.setUser = function (user) {
|
|
|
- console.log('TRACE: Entering db:setUser function');
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- App.db.data.app.user = user;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
+ App.db.set('app', 'user', user);
|
|
|
};
|
|
|
|
|
|
App.db.setAuthenticated = function (authenticated) {
|
|
|
- console.log('TRACE: Entering db:setAuthenticated function');
|
|
|
-
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- console.log('present value of authentication is: ' + App.db.data.app.authenticated);
|
|
|
- console.log('desired value of authentication is: ' + authenticated);
|
|
|
- App.db.data.app.authenticated = authenticated;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
+ App.db.set('app', 'authenticated', authenticated);
|
|
|
App.db.data = localStorage.getObject('ambari');
|
|
|
- console.log('Now present value of authentication is: ' + App.db.data.app.authenticated);
|
|
|
};
|
|
|
|
|
|
-App.db.setFilterConditions = function(name, filterConditions) {
|
|
|
- console.log('TRACE: Entering db:setFilterConditions function');
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- if (!App.db.data.app.tables.filterConditions) {
|
|
|
- App.db.data.app.tables.filterConditions = {};
|
|
|
- }
|
|
|
- App.db.data.app.tables.filterConditions[name] = filterConditions;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
+App.db.setFilterConditions = function (name, filterConditions) {
|
|
|
+ App.db.set('app.tables.filterConditions', name, filterConditions);
|
|
|
};
|
|
|
|
|
|
-App.db.setDisplayLength = function(name, displayLength) {
|
|
|
- console.log('TRACE: Entering db:setDisplayLength function');
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- if (!App.db.data.app.tables.displayLength) {
|
|
|
- App.db.data.app.tables.displayLength = {};
|
|
|
- }
|
|
|
- App.db.data.app.tables.displayLength[name] = displayLength;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
+App.db.setDisplayLength = function (name, displayLength) {
|
|
|
+ App.db.set('app.tables.displayLength', name, displayLength);
|
|
|
};
|
|
|
|
|
|
-App.db.setStartIndex = function(name, startIndex) {
|
|
|
- console.log('TRACE: Entering db:setStartIndex function');
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- if (!App.db.data.app.tables.startIndex) {
|
|
|
- App.db.data.app.tables.startIndex = {};
|
|
|
- }
|
|
|
- App.db.data.app.tables.startIndex[name] = startIndex;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
+App.db.setStartIndex = function (name, startIndex) {
|
|
|
+ App.db.set('app.tables.startIndex', name, startIndex);
|
|
|
};
|
|
|
|
|
|
-App.db.setSortingStatuses = function(name, sortingConditions) {
|
|
|
- console.log('TRACE: Entering db:setSortingConditions function');
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- if (!App.db.data.app.tables.sortingConditions) {
|
|
|
- App.db.data.app.tables.sortingConditions = {};
|
|
|
- }
|
|
|
- App.db.data.app.tables.sortingConditions[name] = sortingConditions;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
-};
|
|
|
-
|
|
|
-App.db.setSelectedHosts = function(name, selectedHosts) {
|
|
|
- console.log('TRACE: Entering db:setSelectedHosts function');
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- if (!App.db.data.app.tables.selectedItems) {
|
|
|
- App.db.data.app.tables.selectedItems = {};
|
|
|
- }
|
|
|
- App.db.data.app.tables.selectedItems[name] = selectedHosts;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
-};
|
|
|
-
|
|
|
-App.db.setAllHostNames = function (hostNames) {
|
|
|
- console.log('TRACE: Entering db:setAllHostNames function');
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- App.db.data.Installer.hostNames = hostNames;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
+App.db.setSortingStatuses = function (name, sortingConditions) {
|
|
|
+ App.db.set('app.tables.sortingConditions', name, sortingConditions);
|
|
|
};
|
|
|
|
|
|
-App.db.setAllHostNamesPattern = function (hostNames) {
|
|
|
- console.log('TRACE: Entering db:setAllHostNamesPattern function');
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- App.db.data.Installer.hostNamesPattern = hostNames;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
+App.db.setSelectedHosts = function (name, selectedHosts) {
|
|
|
+ App.db.set('app.tables.selectedItems', name, selectedHosts);
|
|
|
};
|
|
|
|
|
|
App.db.setHosts = function (hostInfo) {
|
|
|
- console.log('TRACE: Entering db:setHosts function');
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- App.db.data.Installer.hostInfo = hostInfo;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
-};
|
|
|
-
|
|
|
-App.db.setInstallOptions = function (installOptions) {
|
|
|
- console.log('TRACE: Entering db:setInstallOptions function');
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- App.db.data.Installer.installOptions = installOptions;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
-};
|
|
|
-
|
|
|
-App.db.setBootStatus = function (status) {
|
|
|
- console.log('TRACE: Entering db:setBootStatus function');
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- App.db.data.Installer.bootStatus = status;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
-};
|
|
|
-
|
|
|
-App.db.setService = function (serviceInfo) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- App.db.data.Installer.serviceInfo = serviceInfo;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
-};
|
|
|
-
|
|
|
-App.db.setSelectedServiceNames = function (serviceNames) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- App.db.data.Installer.selectedServiceNames = serviceNames;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
-};
|
|
|
-
|
|
|
-App.db.setClientsForSelectedServices = function (clientInfo) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- App.db.data.Installer.clientInfo = clientInfo;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
+ App.db.set('Installer', 'hostInfo', hostInfo);
|
|
|
};
|
|
|
|
|
|
App.db.setMasterComponentHosts = function (masterComponentHosts) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- App.db.data.Installer.masterComponentHosts = masterComponentHosts;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
-};
|
|
|
-
|
|
|
-App.db.setSlaveComponentHosts = function (slaveComponentHosts) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- App.db.data.Installer.slaveComponentHosts = slaveComponentHosts;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
-};
|
|
|
-
|
|
|
-App.db.setServiceConfigs = function (serviceConfigs) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- App.db.data.Installer.serviceConfigs = serviceConfigs;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
-};
|
|
|
-
|
|
|
-App.db.setServiceConfigProperties = function (configProperties) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- App.db.data.Installer.configProperties = configProperties;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
-};
|
|
|
-
|
|
|
-App.db.setCluster = function (status) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- App.db.data.Installer.clusterStatus = status;
|
|
|
- console.log('db.setClusterStatus called: ' + JSON.stringify(status));
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
-};
|
|
|
-
|
|
|
-App.db.setUpgradeOptions = function (upgradeOptions) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- App.db.data.StackUpgrade.upgradeOptions = upgradeOptions;
|
|
|
- console.log('db.setUpgradeOptions called: ' + JSON.stringify(upgradeOptions));
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
+ App.db.set('Installer', 'masterComponentHosts', masterComponentHosts);
|
|
|
};
|
|
|
|
|
|
App.db.setMasterToReassign = function (masterComponent) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- App.db.data.ReassignMaster.masterComponent = masterComponent;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
+ App.db.set('ReassignMaster', 'masterComponent', masterComponent);
|
|
|
};
|
|
|
|
|
|
App.db.setReassignTasksStatuses = function (tasksStatuses) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- App.db.data.ReassignMaster.tasksStatuses = tasksStatuses;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
+ App.db.set('ReassignMaster', 'tasksStatuses', tasksStatuses);
|
|
|
};
|
|
|
|
|
|
App.db.setReassignTasksRequestIds = function (requestIds) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- App.db.data.ReassignMaster.tasksRequestIds = requestIds;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
+ App.db.set('ReassignMaster', 'tasksRequestIds', requestIds);
|
|
|
};
|
|
|
|
|
|
App.db.setStacks = function (stacks) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- App.db.data.Installer.stacksVersions = stacks;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
-};
|
|
|
-
|
|
|
-App.db.setServices = function (services) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- App.db.data.app.services = services;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
+ App.db.set('Installer', 'stacksVersions', stacks);
|
|
|
};
|
|
|
|
|
|
App.db.setConfigs = function (configs) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- App.db.data.app.configs = configs;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
+ App.db.set('app', 'configs', configs);
|
|
|
};
|
|
|
|
|
|
/**
|
|
@@ -394,10 +248,7 @@ App.db.setConfigs = function (configs) {
|
|
|
* @param currentStep
|
|
|
*/
|
|
|
App.db.setWizardCurrentStep = function (wizardType, currentStep) {
|
|
|
- console.log('TRACE: Entering db:setWizardCurrentStep function');
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- App.db.data[wizardType.capitalize()].currentStep = currentStep;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
+ App.db.set(wizardType.capitalize(), 'currentStep', currentStep);
|
|
|
};
|
|
|
|
|
|
/**
|
|
@@ -408,237 +259,119 @@ App.db.setLocalStorage = function () {
|
|
|
};
|
|
|
|
|
|
App.db.setSecurityWizardStatus = function (status) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- if (!App.db.data.AddSecurity) {
|
|
|
- App.db.data.AddSecurity = {};
|
|
|
- }
|
|
|
- App.db.data.AddSecurity.status = status;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
+ App.db.set('AddSecurity', 'status', status);
|
|
|
};
|
|
|
|
|
|
App.db.setDisableSecurityStatus = function (status) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- if (!App.db.data.AddSecurity) {
|
|
|
- App.db.data.AddSecurity = {};
|
|
|
- }
|
|
|
- App.db.data.AddSecurity.disableSecurityStatus = status;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
+ App.db.set('AddSecurity', 'disableSecurityStatus', status);
|
|
|
};
|
|
|
|
|
|
App.db.setSecurityDeployCommands = function (commands) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- if (!App.db.data.AddSecurity) {
|
|
|
- App.db.data.AddSecurity = {};
|
|
|
- }
|
|
|
- App.db.data.AddSecurity.securityDeployCommands = commands;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
-};
|
|
|
-
|
|
|
-App.db.setSecureConfigProperties = function (secureConfigs) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- if (!App.db.data.AddSecurity) {
|
|
|
- App.db.data.AddSecurity = {};
|
|
|
- }
|
|
|
- App.db.data.AddSecurity.secureConfigProperties = secureConfigs;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
-};
|
|
|
-
|
|
|
-App.db.setSecureUserInfo = function (userInfo) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- if (!App.db.data.AddSecurity) {
|
|
|
- App.db.data.AddSecurity = {};
|
|
|
- }
|
|
|
- App.db.data.AddSecurity.secureUserInfo = userInfo;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
-};
|
|
|
-
|
|
|
-App.db.setIsNameNodeHa = function (haStatus) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- if (!App.db.data.AddSecurity) {
|
|
|
- App.db.data.AddSecurity = {};
|
|
|
- }
|
|
|
- App.db.data.AddSecurity.haStatus = haStatus;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
+ App.db.set('AddSecurity', 'securityDeployCommands', commands);
|
|
|
};
|
|
|
|
|
|
App.db.setHighAvailabilityWizardConfigTag = function (tag) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- App.db.data.HighAvailabilityWizard[tag.name] = tag.value;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
+ App.db.set('HighAvailabilityWizard', tag.name, tag.value);
|
|
|
};
|
|
|
|
|
|
App.db.setHighAvailabilityWizardHdfsClientHosts = function (hostNames) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- App.db.data.HighAvailabilityWizard.hdfsClientHostNames = hostNames;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
+ App.db.set('HighAvailabilityWizard', 'hdfsClientHostNames', hostNames);
|
|
|
};
|
|
|
|
|
|
App.db.setHighAvailabilityWizardTasksStatuses = function (tasksStatuses) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- App.db.data.HighAvailabilityWizard.tasksStatuses = tasksStatuses;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
+ App.db.set('HighAvailabilityWizard', 'tasksStatuses', tasksStatuses);
|
|
|
};
|
|
|
|
|
|
App.db.setHighAvailabilityWizardTasksRequestIds = function (requestIds) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- App.db.data.HighAvailabilityWizard.tasksRequestIds = requestIds;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
+ App.db.set('HighAvailabilityWizard', 'tasksRequestIds', requestIds);
|
|
|
};
|
|
|
|
|
|
App.db.setHighAvailabilityWizardHdfsUser = function (hdfsUser) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- App.db.data.HighAvailabilityWizard.hdfsUser = hdfsUser;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
+ App.db.set('HighAvailabilityWizard', 'hdfsUser', hdfsUser);
|
|
|
};
|
|
|
|
|
|
App.db.setHighAvailabilityWizardRequestIds = function (requestIds) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- App.db.data.HighAvailabilityWizard.requestIds = requestIds;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
+ App.db.set('HighAvailabilityWizard', 'requestIds', requestIds);
|
|
|
};
|
|
|
|
|
|
App.db.setHighAvailabilityWizardNameServiceId = function (nameServiceId) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- App.db.data.HighAvailabilityWizard.nameServiceId = nameServiceId;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
+ App.db.set('HighAvailabilityWizard', 'nameServiceId', nameServiceId);
|
|
|
};
|
|
|
|
|
|
-
|
|
|
App.db.setRollBackHighAvailabilityWizardAddNNHost = function (host) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- App.db.data.RollbackHighAvailabilityWizard.addNNHost = host;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
+ App.db.set('RollbackHighAvailabilityWizard', 'addNNHost', host);
|
|
|
};
|
|
|
|
|
|
App.db.setRollBackHighAvailabilityWizardSNNHost = function (host) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- App.db.data.RollbackHighAvailabilityWizard.sNNHost = host;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
+ App.db.set('RollbackHighAvailabilityWizard', 'sNNHost', host);
|
|
|
};
|
|
|
|
|
|
App.db.setRollBackHighAvailabilityWizardSelectedAddNN = function (host) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- App.db.data.RollbackHighAvailabilityWizard.selectedAddNN = host;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
+ App.db.set('RollbackHighAvailabilityWizard', 'selectedAddNN', host);
|
|
|
};
|
|
|
|
|
|
App.db.setRollBackHighAvailabilityWizardSelectedSNN = function (host) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- App.db.data.RollbackHighAvailabilityWizard.selectedSNNH = host;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
+ App.db.set('RollbackHighAvailabilityWizard', 'selectedSNNH', host);
|
|
|
};
|
|
|
|
|
|
App.db.setRollbackHighAvailabilityWizardTasksStatuses = function (tasksStatuses) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- App.db.data.RollbackHighAvailabilityWizard.tasksStatuses = tasksStatuses;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
-};
|
|
|
-
|
|
|
-App.db.setRollbackHighAvailabilityWizardTasksRequestIds = function (requestIds) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- App.db.data.RollbackHighAvailabilityWizard.tasksRequestIds = requestIds;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
+ App.db.set('RollbackHighAvailabilityWizard', 'tasksStatuses', tasksStatuses);
|
|
|
};
|
|
|
|
|
|
App.db.setRollbackHighAvailabilityWizardRequestIds = function (requestIds) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- App.db.data.RollbackHighAvailabilityWizard.requestIds = requestIds;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
+ App.db.set('RollbackHighAvailabilityWizard', 'requestIds', requestIds);
|
|
|
};
|
|
|
|
|
|
App.db.setReassignMasterWizardRequestIds = function (requestIds) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- App.db.data.ReassignMaster.requestIds = requestIds;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
+ App.db.set('ReassignMaster', 'requestIds', requestIds);
|
|
|
};
|
|
|
|
|
|
App.db.setReassignMasterWizardComponentDir = function (componentDir) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- App.db.data.ReassignMaster.componentDir = componentDir;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
+ App.db.set('ReassignMaster', 'componentDir', componentDir);
|
|
|
};
|
|
|
|
|
|
App.db.setReassignMasterWizardReassignHosts = function (reassignHosts) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- App.db.data.ReassignMaster.reassignHosts = reassignHosts;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
+ App.db.set('ReassignMaster', 'reassignHosts', reassignHosts);
|
|
|
};
|
|
|
|
|
|
App.db.setKerberosWizardConfigTag = function (tag) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- App.db.data.KerberosWizard[tag.name] = tag.value;
|
|
|
- localStorage.setObject('ambari', App.db.data);
|
|
|
+ App.db.set('KerberosWizard', tag.name, tag.value);
|
|
|
};
|
|
|
|
|
|
-/*
|
|
|
- * getter methods
|
|
|
- */
|
|
|
-
|
|
|
/**
|
|
|
* Get user model from db
|
|
|
* @return {*}
|
|
|
*/
|
|
|
App.db.getUser = function () {
|
|
|
- console.log('TRACE: Entering db:getUser function');
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.app.user;
|
|
|
+ return App.db.get('app', 'user');
|
|
|
};
|
|
|
|
|
|
App.db.getLoginName = function () {
|
|
|
- console.log('Trace: Entering db:getLoginName function');
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.app.loginName;
|
|
|
+ return App.db.get('app', 'loginName');
|
|
|
};
|
|
|
|
|
|
App.db.getAuthenticated = function () {
|
|
|
- console.log('Trace: Entering db:getAuthenticated function');
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return Boolean(App.db.data.app.authenticated);
|
|
|
+ return Boolean(App.db.get('app', 'authenticated'));
|
|
|
};
|
|
|
|
|
|
-App.db.getFilterConditions = function(name) {
|
|
|
- console.log('TRACE: Entering db:getFilterConditions function');
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- if (App.db.data.app.tables.filterConditions[name]) {
|
|
|
- return App.db.data.app.tables.filterConditions[name];
|
|
|
- }
|
|
|
- return null;
|
|
|
+App.db.getFilterConditions = function (name) {
|
|
|
+ return name ? App.db.get('app.tables.filterConditions', name) : null;
|
|
|
};
|
|
|
|
|
|
-App.db.getDisplayLength = function(name) {
|
|
|
- console.log('TRACE: Entering db:getDisplayLength function');
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- if (App.db.data.app.tables.displayLength[name]) {
|
|
|
- return App.db.data.app.tables.displayLength[name];
|
|
|
- }
|
|
|
- return null;
|
|
|
+App.db.getDisplayLength = function (name) {
|
|
|
+ return name ? App.db.get('app.tables.displayLength', name) : null;
|
|
|
};
|
|
|
|
|
|
-App.db.getStartIndex = function(name) {
|
|
|
- console.log('TRACE: Entering db:getStartIndex function');
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- if (App.db.data.app.tables.startIndex[name]) {
|
|
|
- return App.db.data.app.tables.startIndex[name];
|
|
|
- }
|
|
|
- return null;
|
|
|
+App.db.getStartIndex = function (name) {
|
|
|
+ return name ? App.db.get('app.tables.startIndex', name): null;
|
|
|
};
|
|
|
|
|
|
-App.db.getSortingStatuses = function(name) {
|
|
|
- console.log('TRACE: Entering db:getSortingConditions function');
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- if (App.db.data.app.tables.sortingConditions[name]) {
|
|
|
- return App.db.data.app.tables.sortingConditions[name];
|
|
|
- }
|
|
|
- return null;
|
|
|
+App.db.getSortingStatuses = function (name) {
|
|
|
+ return name ? App.db.get('app.tables.sortingConditions', name): null;
|
|
|
};
|
|
|
|
|
|
-App.db.getSelectedHosts = function(name) {
|
|
|
- console.log('TRACE: Entering db:getSelectedHosts function');
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- if (App.db.data.app.tables.selectedItems[name]) {
|
|
|
- return App.db.data.app.tables.selectedItems[name];
|
|
|
- }
|
|
|
- return [];
|
|
|
+App.db.getSelectedHosts = function (name) {
|
|
|
+ return App.db.get('app.tables.selectedItems', name) || [];
|
|
|
};
|
|
|
|
|
|
/**
|
|
@@ -647,243 +380,103 @@ App.db.getSelectedHosts = function(name) {
|
|
|
* @return {*}
|
|
|
*/
|
|
|
App.db.getWizardCurrentStep = function (wizardType) {
|
|
|
- console.log('Trace: Entering db:getWizardCurrentStep function for ', wizardType);
|
|
|
- if (App.db.data[wizardType.capitalize()]) {
|
|
|
- return App.db.data[wizardType.capitalize()].currentStep;
|
|
|
- }
|
|
|
- return 0;
|
|
|
+ return App.db.get(wizardType.capitalize(), 'currentStep') || 0;
|
|
|
};
|
|
|
|
|
|
App.db.getAllHostNames = function () {
|
|
|
- console.log('TRACE: Entering db:getHostNames function');
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.Installer.hostNames;
|
|
|
-};
|
|
|
-
|
|
|
-App.db.getAllHostNamesPattern = function () {
|
|
|
- console.log('TRACE: Entering db:getHostNamesPattern function');
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.Installer.hostNamesPattern;
|
|
|
-};
|
|
|
-App.db.getInstallOptions = function () {
|
|
|
- console.log('TRACE: Entering db:getInstallOptions function');
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.Installer.installOptions;
|
|
|
-};
|
|
|
-
|
|
|
-App.db.isCompleted = function () {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.Installer.completed;
|
|
|
+ return App.db.get('Installer', 'hostNames');
|
|
|
};
|
|
|
|
|
|
App.db.getHosts = function () {
|
|
|
- console.log('TRACE: Entering db:getHosts function');
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.Installer.hostInfo;
|
|
|
-};
|
|
|
-
|
|
|
-App.db.getBootStatus = function () {
|
|
|
- console.log('TRACE: Entering db:getBootStatus function');
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.Installer.bootStatus;
|
|
|
-};
|
|
|
-
|
|
|
-App.db.getService = function () {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.Installer.serviceInfo;
|
|
|
-};
|
|
|
-
|
|
|
-App.db.getSelectedServiceNames = function () {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.Installer.selectedServiceNames;
|
|
|
-};
|
|
|
-
|
|
|
-App.db.getClientsForSelectedServices = function () {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.Installer.clientInfo;
|
|
|
-};
|
|
|
-
|
|
|
-App.db.getMasterComponentHosts = function () {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.Installer.masterComponentHosts;
|
|
|
-};
|
|
|
-
|
|
|
-App.db.getSlaveComponentHosts = function () {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.Installer.slaveComponentHosts;
|
|
|
-};
|
|
|
-
|
|
|
-App.db.getServiceConfigs = function () {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.Installer.serviceConfigs;
|
|
|
-};
|
|
|
-
|
|
|
-App.db.getServiceConfigProperties = function () {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.Installer.configProperties;
|
|
|
-};
|
|
|
-
|
|
|
-App.db.getCluster = function () {
|
|
|
- console.log('TRACE: Entering db:getClusterStatus function');
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.Installer.clusterStatus;
|
|
|
+ return App.db.get('Installer', 'hostInfo');
|
|
|
};
|
|
|
|
|
|
App.db.getMasterToReassign = function () {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.ReassignMaster.masterComponent;
|
|
|
+ return App.db.get('ReassignMaster', 'masterComponent');
|
|
|
};
|
|
|
|
|
|
App.db.getReassignTasksStatuses = function () {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.ReassignMaster.tasksStatuses;
|
|
|
+ return App.db.get('ReassignMaster', 'tasksStatuses');
|
|
|
};
|
|
|
|
|
|
App.db.getReassignTasksRequestIds = function () {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.ReassignMaster.tasksRequestIds;
|
|
|
-};
|
|
|
-
|
|
|
-App.db.getUpgradeOptions = function () {
|
|
|
- console.log('TRACE: Entering db:getUpgradeOptions function');
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.StackUpgrade.upgradeOptions;
|
|
|
+ return App.db.get('ReassignMaster', 'tasksRequestIds');
|
|
|
};
|
|
|
|
|
|
App.db.getSecurityWizardStatus = function () {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- if (!App.db.data.AddSecurity) {
|
|
|
- App.db.data.AddSecurity = {};
|
|
|
- }
|
|
|
- return App.db.data.AddSecurity.status;
|
|
|
+ return App.db.get('AddSecurity', 'status');
|
|
|
};
|
|
|
|
|
|
App.db.getDisableSecurityStatus = function () {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- if (!App.db.data.AddSecurity) {
|
|
|
- App.db.data.AddSecurity = {};
|
|
|
- }
|
|
|
- return App.db.data.AddSecurity.disableSecurityStatus;
|
|
|
-};
|
|
|
-
|
|
|
-App.db.getSecurityDeployCommands = function () {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.AddSecurity.securityDeployCommands;
|
|
|
-};
|
|
|
-
|
|
|
-App.db.getSecureConfigProperties = function () {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.AddSecurity.secureConfigProperties;
|
|
|
-};
|
|
|
-
|
|
|
-App.db.getSecureUserInfo = function () {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.AddSecurity.secureUserInfo;
|
|
|
-};
|
|
|
-
|
|
|
-App.db.getIsNameNodeHa = function (haStatus) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.AddSecurity.haStatus;
|
|
|
+ return App.db.get('AddSecurity', 'disableSecurityStatus');
|
|
|
};
|
|
|
|
|
|
App.db.getStacks = function () {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.Installer.stacksVersions;
|
|
|
-};
|
|
|
-
|
|
|
-App.db.getServices = function () {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.app.services;
|
|
|
+ return App.db.get('Installer', 'stacksVersions');
|
|
|
};
|
|
|
|
|
|
App.db.getHighAvailabilityWizardHdfsUser = function () {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.HighAvailabilityWizard.hdfsUser;
|
|
|
+ return App.db.get('HighAvailabilityWizard', 'hdfsUser');
|
|
|
};
|
|
|
|
|
|
App.db.getHighAvailabilityWizardTasksStatuses = function () {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.HighAvailabilityWizard.tasksStatuses;
|
|
|
+ return App.db.get('HighAvailabilityWizard', 'tasksStatuses');
|
|
|
};
|
|
|
|
|
|
App.db.getHighAvailabilityWizardTasksRequestIds = function () {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.HighAvailabilityWizard.tasksRequestIds;
|
|
|
+ return App.db.get('HighAvailabilityWizard', 'tasksRequestIds');
|
|
|
};
|
|
|
|
|
|
App.db.getHighAvailabilityWizardFailedTask = function () {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.HighAvailabilityWizard.failedTask;
|
|
|
+ return App.db.get('HighAvailabilityWizard', 'failedTask');
|
|
|
};
|
|
|
|
|
|
App.db.getHighAvailabilityWizardHdfsClientHosts = function () {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.HighAvailabilityWizard.hdfsClientHostNames;
|
|
|
+ return App.db.get('HighAvailabilityWizard', 'hdfsClientHostNames');
|
|
|
};
|
|
|
|
|
|
App.db.getHighAvailabilityWizardConfigTag = function (tag) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.HighAvailabilityWizard[tag];
|
|
|
+ return App.db.get('HighAvailabilityWizard', tag);
|
|
|
};
|
|
|
|
|
|
App.db.getHighAvailabilityWizardRequestIds = function () {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.HighAvailabilityWizard.requestIds;
|
|
|
+ return App.db.get('HighAvailabilityWizard', 'requestIds');
|
|
|
};
|
|
|
|
|
|
App.db.getHighAvailabilityWizardNameServiceId = function () {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.HighAvailabilityWizard.nameServiceId;
|
|
|
+ return App.db.get('HighAvailabilityWizard', 'nameServiceId');
|
|
|
};
|
|
|
|
|
|
App.db.getRollbackHighAvailabilityWizardTasksStatuses = function () {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.RollbackHighAvailabilityWizard.tasksStatuses;
|
|
|
-};
|
|
|
-
|
|
|
-App.db.getRollbackHighAvailabilityWizardTasksRequestIds = function () {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.ReassignMaster.tasksRequestIds;
|
|
|
+ return App.db.get('RollbackHighAvailabilityWizard', 'tasksStatuses');
|
|
|
};
|
|
|
|
|
|
App.db.getRollbackHighAvailabilityWizardRequestIds = function () {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.RollbackHighAvailabilityWizard.requestIds;
|
|
|
+ return App.db.get('RollbackHighAvailabilityWizard', 'requestIds');
|
|
|
};
|
|
|
|
|
|
-App.db.getRollBackHighAvailabilityWizardAddNNHost = function (host) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.RollbackHighAvailabilityWizard.addNNHost;
|
|
|
+App.db.getRollBackHighAvailabilityWizardAddNNHost = function () {
|
|
|
+ return App.db.get('RollbackHighAvailabilityWizard', 'addNNHost');
|
|
|
};
|
|
|
|
|
|
-App.db.getRollBackHighAvailabilityWizardSNNHost = function (host) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.RollbackHighAvailabilityWizard.sNNHost;
|
|
|
+App.db.getRollBackHighAvailabilityWizardSNNHost = function () {
|
|
|
+ return App.db.get('RollbackHighAvailabilityWizard', 'sNNHost');
|
|
|
};
|
|
|
|
|
|
App.db.getReassignMasterWizardRequestIds = function () {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.ReassignMaster.requestIds;
|
|
|
+ return App.db.get('ReassignMaster', 'requestIds');
|
|
|
};
|
|
|
|
|
|
App.db.getReassignMasterWizardComponentDir = function () {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.ReassignMaster.componentDir;
|
|
|
+ return App.db.get('ReassignMaster', 'componentDir');
|
|
|
};
|
|
|
|
|
|
App.db.getConfigs = function () {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.app.configs;
|
|
|
+ return App.db.get('app', 'configs');
|
|
|
};
|
|
|
|
|
|
App.db.getReassignMasterWizardReassignHosts = function () {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.ReassignMaster.reassignHosts;
|
|
|
-};
|
|
|
-
|
|
|
-App.db.getKerberosWizardConfigTag = function (tag) {
|
|
|
- App.db.data = localStorage.getObject('ambari');
|
|
|
- return App.db.data.KerberosWizard[tag];
|
|
|
+ return App.db.get('ReassignMaster', 'reassignHosts');
|
|
|
};
|
|
|
|
|
|
module.exports = App.db;
|