Smooth dashboard refresh.
This commit is contained in:
parent
083bde64ee
commit
f98c537ec2
3 changed files with 14 additions and 2 deletions
|
@ -21,6 +21,7 @@
|
||||||
"angular-ui-router": "^0.3.1",
|
"angular-ui-router": "^0.3.1",
|
||||||
"animate.css": "^3.4.0",
|
"animate.css": "^3.4.0",
|
||||||
"bootstrap": "^3.3.6",
|
"bootstrap": "^3.3.6",
|
||||||
|
"lodash": "^4.17.5",
|
||||||
"moment": "^2.14.1",
|
"moment": "^2.14.1",
|
||||||
"nvd3": "^1.8.4"
|
"nvd3": "^1.8.4"
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
var _ = require('lodash');
|
||||||
|
|
||||||
/** @ngInject */
|
/** @ngInject */
|
||||||
function ProvidersController($scope, $interval, $log, Providers) {
|
function ProvidersController($scope, $interval, $log, Providers) {
|
||||||
const vm = this;
|
const vm = this;
|
||||||
|
@ -7,7 +9,12 @@ function ProvidersController($scope, $interval, $log, Providers) {
|
||||||
function loadProviders() {
|
function loadProviders() {
|
||||||
Providers
|
Providers
|
||||||
.get()
|
.get()
|
||||||
.then(providers => vm.providers = providers)
|
.then(providers => {
|
||||||
|
if (!_.isEqual(vm.previousProviders, providers)) {
|
||||||
|
vm.providers = providers;
|
||||||
|
vm.previousProviders = _.cloneDeep(providers);
|
||||||
|
}
|
||||||
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
vm.providers = {};
|
vm.providers = {};
|
||||||
$log.error(error);
|
$log.error(error);
|
||||||
|
|
|
@ -1105,7 +1105,7 @@ camelcase@^1.0.2, camelcase@^1.2.1:
|
||||||
version "1.2.1"
|
version "1.2.1"
|
||||||
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39"
|
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39"
|
||||||
|
|
||||||
camelcase@^2.0.0, camelcase@^2.0.1:
|
camelcase@^2.0.0:
|
||||||
version "2.1.1"
|
version "2.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f"
|
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f"
|
||||||
|
|
||||||
|
@ -3925,6 +3925,10 @@ lodash@^4.17.2:
|
||||||
version "4.17.4"
|
version "4.17.4"
|
||||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"
|
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"
|
||||||
|
|
||||||
|
lodash@^4.17.5:
|
||||||
|
version "4.17.5"
|
||||||
|
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.5.tgz#99a92d65c0272debe8c96b6057bc8fbfa3bed511"
|
||||||
|
|
||||||
lodash@~4.16.4:
|
lodash@~4.16.4:
|
||||||
version "4.16.6"
|
version "4.16.6"
|
||||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.16.6.tgz#d22c9ac660288f3843e16ba7d2b5d06cca27d777"
|
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.16.6.tgz#d22c9ac660288f3843e16ba7d2b5d06cca27d777"
|
||||||
|
|
Loading…
Reference in a new issue