fix(templates): redirect to home if endpoint not yet selected #2709 (#2710)

pull/2712/head
linquize 2019-02-14 07:08:46 +08:00 committed by Anthony Lapenna
parent fdc11dbe3a
commit 8f32d58fae
1 changed files with 10 additions and 0 deletions

View File

@ -457,6 +457,16 @@ angular.module('portainer.app', [])
var templates = {
name: 'portainer.templates',
url: '/templates',
resolve: {
endpointID: ['EndpointProvider', '$state',
function (EndpointProvider, $state) {
var id = EndpointProvider.endpointID();
if (!id) {
return $state.go('portainer.home');
}
}
]
},
views: {
'content@': {
templateUrl: 'app/portainer/views/templates/templates.html',