mirror of https://github.com/portainer/portainer
feat(frontend): show endpoint.name in page title (#4363)
* feat(frontend): show endpoint.name in page title * feat(frontend): show endpoint.name in page title - use rootscope for defaultTitlepull/4409/head
parent
bb5c2c2875
commit
74429d6d46
|
@ -16,6 +16,7 @@ angular.module('portainer').run([
|
||||||
EndpointProvider.initialize();
|
EndpointProvider.initialize();
|
||||||
|
|
||||||
$rootScope.$state = $state;
|
$rootScope.$state = $state;
|
||||||
|
$rootScope.defaultTitle = document.title;
|
||||||
|
|
||||||
// Workaround to prevent the loading bar from going backward
|
// Workaround to prevent the loading bar from going backward
|
||||||
// https://github.com/chieffancypants/angular-loading-bar/issues/273
|
// https://github.com/chieffancypants/angular-loading-bar/issues/273
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
angular.module('portainer.app').controller('SidebarController', [
|
angular.module('portainer.app').controller('SidebarController', [
|
||||||
|
'$rootScope',
|
||||||
'$q',
|
'$q',
|
||||||
'$scope',
|
'$scope',
|
||||||
'$transitions',
|
'$transitions',
|
||||||
|
@ -7,7 +8,7 @@ angular.module('portainer.app').controller('SidebarController', [
|
||||||
'Authentication',
|
'Authentication',
|
||||||
'UserService',
|
'UserService',
|
||||||
'EndpointProvider',
|
'EndpointProvider',
|
||||||
function ($q, $scope, $transitions, StateManager, Notifications, Authentication, UserService, EndpointProvider) {
|
function ($rootScope, $q, $scope, $transitions, StateManager, Notifications, Authentication, UserService, EndpointProvider) {
|
||||||
function checkPermissions(memberships) {
|
function checkPermissions(memberships) {
|
||||||
var isLeader = false;
|
var isLeader = false;
|
||||||
angular.forEach(memberships, function (membership) {
|
angular.forEach(memberships, function (membership) {
|
||||||
|
@ -52,6 +53,10 @@ angular.module('portainer.app').controller('SidebarController', [
|
||||||
|
|
||||||
$transitions.onEnter({}, async () => {
|
$transitions.onEnter({}, async () => {
|
||||||
$scope.showStacks = await shouldShowStacks();
|
$scope.showStacks = await shouldShowStacks();
|
||||||
|
|
||||||
|
if ($scope.applicationState.endpoint.name) {
|
||||||
|
document.title = `${$rootScope.defaultTitle} | ${$scope.applicationState.endpoint.name}`;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
Loading…
Reference in New Issue