mirror of https://github.com/portainer/portainer
fix(kube): make app autorefresh and show system settings stay [EE-6771] (#11256)
parent
f5fbcd4d9d
commit
f6b2c879bc
|
@ -169,20 +169,22 @@ angular.module('portainer.kubernetes').controller('KubernetesApplicationsDatatab
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$onChanges = function (changes) {
|
this.$onChanges = function (changes) {
|
||||||
// when the table is visible, sync the show system setting with the stack show system setting
|
if (this.settingsLoaded) {
|
||||||
if (changes.isVisible && changes.isVisible.currentValue) {
|
// when the table is visible, sync the show system setting with the stack show system setting
|
||||||
const storedStacksSettings = DatatableService.getDataTableSettings('kubernetes.applications.stacks');
|
if (changes.isVisible && changes.isVisible.currentValue) {
|
||||||
if (storedStacksSettings && storedStacksSettings.state) {
|
const storedStacksSettings = DatatableService.getDataTableSettings('kubernetes.applications.stacks');
|
||||||
this.settings.showSystem = storedStacksSettings.state.showSystemResources;
|
if (storedStacksSettings && storedStacksSettings.state) {
|
||||||
|
this.settings.showSystem = storedStacksSettings.state.showSystemResources;
|
||||||
|
DatatableService.setDataTableSettings(this.settingsKey, this.settings);
|
||||||
|
}
|
||||||
|
} else if (typeof this.isSystemResources !== 'undefined') {
|
||||||
|
this.settings.showSystem = this.isSystemResources;
|
||||||
DatatableService.setDataTableSettings(this.settingsKey, this.settings);
|
DatatableService.setDataTableSettings(this.settingsKey, this.settings);
|
||||||
}
|
}
|
||||||
} else if (typeof this.isSystemResources !== 'undefined') {
|
this.state.namespace = this.namespace;
|
||||||
this.settings.showSystem = this.isSystemResources;
|
this.updateNamespace();
|
||||||
DatatableService.setDataTableSettings(this.settingsKey, this.settings);
|
this.prepareTableFromDataset();
|
||||||
}
|
}
|
||||||
this.state.namespace = this.namespace;
|
|
||||||
this.updateNamespace();
|
|
||||||
this.prepareTableFromDataset();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$onInit = function () {
|
this.$onInit = function () {
|
||||||
|
@ -226,7 +228,7 @@ angular.module('portainer.kubernetes').controller('KubernetesApplicationsDatatab
|
||||||
// make show system in sync with the stack show system settings
|
// make show system in sync with the stack show system settings
|
||||||
const storedStacksSettings = DatatableService.getDataTableSettings('kubernetes.applications.stacks');
|
const storedStacksSettings = DatatableService.getDataTableSettings('kubernetes.applications.stacks');
|
||||||
if (storedStacksSettings && storedStacksSettings.state) {
|
if (storedStacksSettings && storedStacksSettings.state) {
|
||||||
this.settings.showSystem = storedStacksSettings.state.showSystemResources;
|
this.settings.showSystem = storedStacksSettings.state.showSystemResources || this.settings.showSystem;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setSystemResources && this.setSystemResources(this.settings.showSystem);
|
this.setSystemResources && this.setSystemResources(this.settings.showSystem);
|
||||||
|
|
Loading…
Reference in New Issue