|
@@ -32,6 +32,8 @@ export default Ember.Controller.extend({
|
|
|
|
|
|
tableSearchResults: Ember.Object.create(),
|
|
tableSearchResults: Ember.Object.create(),
|
|
|
|
|
|
|
|
+ isDatabaseRefreshInProgress: false,
|
|
|
|
+
|
|
tableControls: [
|
|
tableControls: [
|
|
{
|
|
{
|
|
icon: 'fa-list',
|
|
icon: 'fa-list',
|
|
@@ -157,6 +159,8 @@ export default Ember.Controller.extend({
|
|
var self = this;
|
|
var self = this;
|
|
var selectedDatabase = this.get('selectedDatabase.name') || 'default';
|
|
var selectedDatabase = this.get('selectedDatabase.name') || 'default';
|
|
|
|
|
|
|
|
+ this.set('isDatabaseRefreshInProgress', true);
|
|
|
|
+
|
|
this.set('isLoading', true);
|
|
this.set('isLoading', true);
|
|
|
|
|
|
this.get('databaseService').getDatabases().then(function (databases) {
|
|
this.get('databaseService').getDatabases().then(function (databases) {
|
|
@@ -168,12 +172,13 @@ export default Ember.Controller.extend({
|
|
if(error.status == 401) {
|
|
if(error.status == 401) {
|
|
self.send('passwordLDAPDB');
|
|
self.send('passwordLDAPDB');
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ }).finally(function() {
|
|
|
|
+ self.set('isDatabaseRefreshInProgress', false);
|
|
});
|
|
});
|
|
}.on('init'),
|
|
}.on('init'),
|
|
|
|
|
|
syncDatabases: function() {
|
|
syncDatabases: function() {
|
|
|
|
+ this.set('isDatabaseRefreshInProgress', true);
|
|
var oldDatabaseNames = this.store.all('database').mapBy('name');
|
|
var oldDatabaseNames = this.store.all('database').mapBy('name');
|
|
var self = this;
|
|
var self = this;
|
|
return this.get('databaseService').getDatabasesFromServer().then(function(data) {
|
|
return this.get('databaseService').getDatabasesFromServer().then(function(data) {
|
|
@@ -194,6 +199,8 @@ export default Ember.Controller.extend({
|
|
});
|
|
});
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+ }).finally(function() {
|
|
|
|
+ self.set('isDatabaseRefreshInProgress', false);
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
|
|
@@ -201,8 +208,10 @@ export default Ember.Controller.extend({
|
|
// This was required so that the unit test would not stall
|
|
// This was required so that the unit test would not stall
|
|
if(ENV.environment !== "test") {
|
|
if(ENV.environment !== "test") {
|
|
Ember.run.later(this, function() {
|
|
Ember.run.later(this, function() {
|
|
- this.syncDatabases();
|
|
|
|
- this.initiateDatabaseSync();
|
|
|
|
|
|
+ if (this.get('isDatabaseRefreshInProgress') === false) {
|
|
|
|
+ this.syncDatabases();
|
|
|
|
+ this.initiateDatabaseSync();
|
|
|
|
+ }
|
|
}, 15000);
|
|
}, 15000);
|
|
}
|
|
}
|
|
}.on('init'),
|
|
}.on('init'),
|
|
@@ -222,8 +231,12 @@ export default Ember.Controller.extend({
|
|
|
|
|
|
actions: {
|
|
actions: {
|
|
refreshDatabaseExplorer: function () {
|
|
refreshDatabaseExplorer: function () {
|
|
- this.getDatabases();
|
|
|
|
- this.resetSearch();
|
|
|
|
|
|
+ if (this.get('isDatabaseRefreshInProgress') === false) {
|
|
|
|
+ this.getDatabases();
|
|
|
|
+ this.resetSearch();
|
|
|
|
+ } else {
|
|
|
|
+ console.log("Databases refresh is in progress. Skipping this request.");
|
|
|
|
+ }
|
|
},
|
|
},
|
|
|
|
|
|
passwordLDAPDB: function(){
|
|
passwordLDAPDB: function(){
|