1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-02 12:25:22 +02:00

feat(kubectl-shell): page state refreshes in k8s endpoint do not close shell EE-1628 (#5685)

* converting all kubernetes view reload to partial state heirarchy refresh

* updated helm and kube kustom templates headers to use the reusable k8s page header component
This commit is contained in:
zees-dev 2021-09-24 20:21:50 +12:00 committed by GitHub
parent d4f581a596
commit 7d40a83d03
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 34 additions and 38 deletions

View file

@ -45,7 +45,7 @@ class KubernetesApplicationsController {
} finally {
--actionCount;
if (actionCount === 0) {
this.$state.reload();
this.$state.reload(this.$state.current);
}
}
}
@ -79,7 +79,7 @@ class KubernetesApplicationsController {
} finally {
--actionCount;
if (actionCount === 0) {
this.$state.reload();
this.$state.reload(this.$state.current);
}
}
}

View file

@ -169,7 +169,7 @@ class KubernetesCreateApplicationController {
this.state.updateWebEditorInProgress = true;
await this.StackService.updateKubeStack({ EndpointId: this.endpoint.Id, Id: this.application.StackId }, this.stackFileContent, null);
this.state.isEditorDirty = false;
await this.$state.reload();
await this.$state.reload(this.$state.current);
} catch (err) {
this.Notifications.error('Failure', err, 'Failed redeploying application');
} finally {

View file

@ -215,7 +215,7 @@ class KubernetesApplicationController {
const revision = _.nth(this.application.Revisions, -2);
await this.KubernetesApplicationService.rollback(this.application, revision);
this.Notifications.success('Application successfully rolled back');
this.$state.reload();
this.$state.reload(this.$state.current);
} catch (err) {
this.Notifications.error('Failure', err, 'Unable to rollback the application');
}
@ -236,7 +236,7 @@ class KubernetesApplicationController {
const promises = _.map(this.application.Pods, (item) => this.KubernetesPodService.delete(item));
await Promise.all(promises);
this.Notifications.success('Application successfully redeployed');
this.$state.reload();
this.$state.reload(this.$state.current);
} catch (err) {
this.Notifications.error('Failure', err, 'Unable to redeploy the application');
}
@ -259,7 +259,7 @@ class KubernetesApplicationController {
application.Note = this.formValues.Note;
await this.KubernetesApplicationService.patch(this.application, application, true);
this.Notifications.success('Application successfully updated');
this.$state.reload();
this.$state.reload(this.$state.current);
} catch (err) {
this.Notifications.error('Failure', err, 'Unable to update application');
}

View file

@ -20,7 +20,7 @@ export default class KubernetesHelmApplicationController {
if (releases.length > 0) {
this.state.release = releases[0];
} else {
throw PortainerError(`Release ${this.state.params.name} not found`);
throw new PortainerError(`Release ${this.state.params.name} not found`);
}
} catch (err) {
this.Notifications.error('Failure', err, 'Unable to retrieve helm application details');

View file

@ -253,7 +253,7 @@ class KubernetesNodeController {
await this.drainNode();
}
this.Notifications.success('Node updated successfully');
this.$state.reload();
this.$state.reload(this.$state.current);
} catch (err) {
this.Notifications.error('Failure', err, 'Unable to update node');
}

View file

@ -51,7 +51,7 @@ class KubernetesConfigurationsController {
} finally {
--actionCount;
if (actionCount === 0) {
this.$state.reload();
this.$state.reload(this.$state.current);
}
}
}

View file

@ -107,7 +107,7 @@ class KubernetesConfigurationController {
} else {
await this.KubernetesConfigurationService.update(this.formValues, this.configuration);
this.Notifications.success('Configuration succesfully updated');
this.$state.reload();
this.$state.reload(this.$state.current);
}
} catch (err) {
this.Notifications.error('Failure', err, 'Unable to update configuration');

View file

@ -98,7 +98,7 @@ class KubernetesResourcePoolAccessController {
const accessConfigMap = KubernetesConfigMapHelper.modifiyNamespaceAccesses(angular.copy(this.accessConfigMap), this.pool.Namespace.Name, newAccesses);
await this.KubernetesConfigMapService.updateAccess(accessConfigMap);
this.Notifications.success('Access successfully created');
this.$state.reload();
this.$state.reload(this.$state.current);
} catch (err) {
this.Notifications.error('Failure', err, 'Unable to create accesses');
}
@ -118,7 +118,7 @@ class KubernetesResourcePoolAccessController {
const accessConfigMap = KubernetesConfigMapHelper.modifiyNamespaceAccesses(angular.copy(this.accessConfigMap), this.pool.Namespace.Name, newAccesses);
await this.KubernetesConfigMapService.updateAccess(accessConfigMap);
this.Notifications.success('Access successfully removed');
this.$state.reload();
this.$state.reload(this.$state.current);
} catch (err) {
this.Notifications.error('Failure', err, 'Unable to remove accesses');
} finally {

View file

@ -176,7 +176,7 @@ class KubernetesResourcePoolController {
this.checkDefaults();
await this.KubernetesResourcePoolService.patch(oldFormValues, newFormValues);
this.Notifications.success('Namespace successfully updated', this.pool.Namespace.Name);
this.$state.reload();
this.$state.reload(this.$state.current);
} catch (err) {
this.Notifications.error('Failure', err, 'Unable to create namespace');
} finally {
@ -238,7 +238,7 @@ class KubernetesResourcePoolController {
await this.KubernetesResourcePoolService.toggleSystem(this.endpoint.Id, namespaceName, !this.isSystem);
this.Notifications.success('Namespace successfully updated', namespaceName);
this.$state.reload();
this.$state.reload(this.$state.current);
} catch (err) {
this.Notifications.error('Failure', err, 'Unable to create namespace');
} finally {

View file

@ -29,7 +29,7 @@ class KubernetesResourcePoolsController {
} finally {
--actionCount;
if (actionCount === 0) {
this.$state.reload();
this.$state.reload(this.$state.current);
}
}
}

View file

@ -96,7 +96,7 @@ class KubernetesVolumeController {
this.Notifications.success('Applications successfully redeployed');
}
this.$state.reload();
this.$state.reload(this.$state.current);
} catch (err) {
this.Notifications.error('Failure', err, 'Unable to update volume.');
}

View file

@ -68,7 +68,7 @@ class KubernetesVolumesController {
} finally {
--actionCount;
if (actionCount === 0) {
this.$state.reload();
this.$state.reload(this.$state.current);
}
}
}