developmentConfig: New option to ignore server config
Change-Id: If8357cc815abd53fd0667bf9539b4df3259f8434
This commit is contained in:
parent
7e1d9c1260
commit
2bc37edc3f
@ -63,7 +63,7 @@ angular.module('bansho.authentication', [])
|
|||||||
session.create(data.access.token.id, data.access.token.expires);
|
session.create(data.access.token.id, data.access.token.expires);
|
||||||
$http.defaults.headers.common['X-Auth-Token'] = session.sessionId;
|
$http.defaults.headers.common['X-Auth-Token'] = session.sessionId;
|
||||||
|
|
||||||
configManager.fetchConfig().then(function () {
|
configManager.fetchConfig(configManager.getDevelopmentConfig().useStoredConfig).then(function () {
|
||||||
$location.path('/view');
|
$location.path('/view');
|
||||||
}, function (message) {
|
}, function (message) {
|
||||||
throw new Error(message);
|
throw new Error(message);
|
||||||
|
@ -40,12 +40,12 @@ angular.module('bansho.config', [])
|
|||||||
return config.data;
|
return config.data;
|
||||||
};
|
};
|
||||||
|
|
||||||
this.fetchConfig = function () {
|
this.fetchConfig = function (useStoredConfig) {
|
||||||
var responsePromise = $q.defer();
|
var responsePromise = $q.defer();
|
||||||
|
|
||||||
$http.get('surveil/v2/bansho/config')
|
$http.get('surveil/v2/bansho/config')
|
||||||
.success(function (conf) {
|
.success(function (conf) {
|
||||||
if (jQuery.isEmptyObject(conf)) {
|
if (!useStoredConfig || jQuery.isEmptyObject(conf)) {
|
||||||
|
|
||||||
$http.get('components/config/config.json')
|
$http.get('components/config/config.json')
|
||||||
.success(function (conf) {
|
.success(function (conf) {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"env": "production",
|
"env": "production",
|
||||||
"username":"",
|
"username":"",
|
||||||
"password":""
|
"password":"",
|
||||||
|
"useStoredConfig": true
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user