fix(kube): make app autorefresh and show system settings stay [EE-6771] (#11256)

pull/11269/head
Matt Hook 9 months ago committed by GitHub
parent f5fbcd4d9d
commit f6b2c879bc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -169,20 +169,22 @@ angular.module('portainer.kubernetes').controller('KubernetesApplicationsDatatab
};
this.$onChanges = function (changes) {
// when the table is visible, sync the show system setting with the stack show system setting
if (changes.isVisible && changes.isVisible.currentValue) {
const storedStacksSettings = DatatableService.getDataTableSettings('kubernetes.applications.stacks');
if (storedStacksSettings && storedStacksSettings.state) {
this.settings.showSystem = storedStacksSettings.state.showSystemResources;
if (this.settingsLoaded) {
// when the table is visible, sync the show system setting with the stack show system setting
if (changes.isVisible && changes.isVisible.currentValue) {
const storedStacksSettings = DatatableService.getDataTableSettings('kubernetes.applications.stacks');
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);
}
} else if (typeof this.isSystemResources !== 'undefined') {
this.settings.showSystem = this.isSystemResources;
DatatableService.setDataTableSettings(this.settingsKey, this.settings);
this.state.namespace = this.namespace;
this.updateNamespace();
this.prepareTableFromDataset();
}
this.state.namespace = this.namespace;
this.updateNamespace();
this.prepareTableFromDataset();
};
this.$onInit = function () {
@ -226,7 +228,7 @@ angular.module('portainer.kubernetes').controller('KubernetesApplicationsDatatab
// make show system in sync with the stack show system settings
const storedStacksSettings = DatatableService.getDataTableSettings('kubernetes.applications.stacks');
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);

Loading…
Cancel
Save