1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 15:59:41 +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

@ -21,7 +21,7 @@ export default class HelmAddRepositoryController {
try {
await this.HelmService.addHelmRepository(this.EndpointProvider.currentEndpoint().Id, { url: this.state.repository });
this.Notifications.success('Helm repository added successfully');
this.$state.reload();
this.$state.reload(this.$state.current);
} catch (err) {
this.Notifications.error('Installation error', err);
} finally {

View file

@ -1,11 +1,6 @@
<rd-header id="view-top">
<rd-header-title title-text="Helm">
<a data-toggle="tooltip" title="Refresh" ui-sref="kubernetes.templates.helm" ui-sref-opts="{reload: true}">
<i class="fa fa-sync" aria-hidden="true"></i>
</a>
</rd-header-title>
<rd-header-content>Charts</rd-header-content>
</rd-header>
<kubernetes-view-header title="Helm" state="kubernetes.templates.helm" view-ready="true">
Charts
</kubernetes-view-header>
<information-panel title-text="Information" ng-if="!$ctrl.state.chart">
<span class="small text-muted">

View file

@ -10,6 +10,12 @@ export default class KubectlShellController {
this.EndpointProvider = EndpointProvider;
this.LocalStorage = LocalStorage;
this.Notifications = Notifications;
$window.onbeforeunload = () => {
if (this.state.shell.connected) {
return '';
}
};
}
disconnect() {

View file

@ -1,6 +1,6 @@
<rd-header ng-if="$ctrl.viewReady">
<rd-header-title title-text="{{ $ctrl.title }}">
<a data-toggle="tooltip" title="refresh the view" ui-sref="{{ $ctrl.state }}" ui-sref-opts="{reload: true}" ng-if="$ctrl.viewReady">
<a data-toggle="tooltip" title="refresh the view" ui-sref="{{ $ctrl.state }}" ui-sref-opts="{reload: $ctrl.state}" ng-if="$ctrl.viewReady">
<i class="fa fa-sm fa-sync" aria-hidden="true" data-cy="component-refreshTableButton"></i>
</a>
</rd-header-title>