feat(edge-stacks): add refresh to edit stack page (#3835)

pull/3844/head
Chaim Lev-Ari 2020-05-18 11:05:00 +03:00 committed by GitHub
parent 42e7db0ae7
commit 2260107811
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 4 deletions

View File

@ -66,6 +66,9 @@ angular.module('portainer.edge', []).config(function config($stateRegistryProvid
component: 'editEdgeStackView',
},
},
params: {
tab: 0,
},
};
$stateRegistryProvider.register(edge);

View File

@ -1,5 +1,9 @@
<rd-header>
<rd-header-title title-text="Edit Edge stack"></rd-header-title>
<rd-header-title title-text="Edit Edge stack">
<a data-toggle="tooltip" title="Refresh" ui-sref="edge.stacks.edit({stackId:$ctrl.stack.Id, tab: $ctrl.state.activeTab})" ui-sref-opts="{reload: true}">
<i class="fa fa-sync" aria-hidden="true"></i>
</a>
</rd-header-title>
<rd-header-content> <a ui-sref="edge.stacks">Edge Stacks</a> &gt; {{ $ctrl.stack.Name }} </rd-header-content>
</rd-header>
@ -7,8 +11,7 @@
<div class="col-sm-12">
<rd-widget>
<rd-widget-body classes="no-padding">
<uib-tabset active="state.activeTab" justified="true" type="pills">
<uib-tabset active="$ctrl.state.activeTab" justified="true" type="pills">
<uib-tab index="0" classes="btn-sm">
<uib-tab-heading> <i class="fa fa-layer-group space-right" aria-hidden="true"></i> Stack</uib-tab-heading>

View File

@ -15,6 +15,7 @@ class EditEdgeStackViewController {
this.state = {
actionInProgress: false,
activeTab: 0,
};
this.deployStack = this.deployStack.bind(this);
@ -24,7 +25,8 @@ class EditEdgeStackViewController {
}
async $onInit() {
const { stackId } = this.$state.params;
const { stackId, tab } = this.$state.params;
this.state.activeTab = tab;
try {
const [edgeGroups, model, file] = await Promise.all([this.EdgeGroupService.groups(), this.EdgeStackService.stack(stackId), this.EdgeStackService.stackFile(stackId)]);
this.edgeGroups = edgeGroups;