mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 19:30:39 -03:30
Add breadcrumbs to system tracking page
This commit is contained in:
parent
0507fd74b9
commit
657b41510c
@ -11,10 +11,11 @@ export default
|
||||
|
||||
$scope.breadcrumbs = [];
|
||||
|
||||
this.addBreadcrumb = function(title, path) {
|
||||
this.addBreadcrumb = function(title, path, isCurrent) {
|
||||
var breadcrumb =
|
||||
{ title: title,
|
||||
path: path
|
||||
path: path,
|
||||
isCurrent: isCurrent
|
||||
};
|
||||
|
||||
if ($rootScope.enteredPath === path) {
|
||||
|
||||
@ -4,10 +4,16 @@
|
||||
* All Rights Reserved
|
||||
*************************************************/
|
||||
|
||||
import {wrapDelegate} from './route-params.decorator';
|
||||
|
||||
export default
|
||||
[ '$rootScope',
|
||||
'$routeParams',
|
||||
function($rootScope, $routeParams) {
|
||||
$rootScope.$on('$routeChangeStart', function(e, newRoute) {
|
||||
wrapDelegate(newRoute.params);
|
||||
});
|
||||
|
||||
$rootScope.$on('$routeChangeSuccess', function(e, newRoute) {
|
||||
if (angular.isUndefined(newRoute.model)) {
|
||||
var keys = Object.keys(newRoute.params);
|
||||
|
||||
@ -19,6 +19,10 @@ function controller($rootScope,
|
||||
_) {
|
||||
// var inventoryId = $routeParams.id;
|
||||
var hostIds = $routeParams.hosts.split(',');
|
||||
var hosts = $routeParams.model.hosts;
|
||||
|
||||
$scope.hostIds = $routeParams.hosts;
|
||||
$scope.inventory = $routeParams.model.inventory;
|
||||
|
||||
$scope.factModulePickersLabelLeft = "Compare facts collected on";
|
||||
$scope.factModulePickersLabelRight = "To facts collected on";
|
||||
@ -68,8 +72,8 @@ function controller($rootScope,
|
||||
$scope.comparisonLeftHeader = $scope.leftDate;
|
||||
$scope.comparisonRightHeader = $scope.rightDate;
|
||||
} else {
|
||||
$scope.comparisonLeftHeader = hostIds[0];
|
||||
$scope.comparisonRightHeader = hostIds[1];
|
||||
$scope.comparisonLeftHeader = hosts[0].name;
|
||||
$scope.comparisonRightHeader = hosts[1].name;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,3 +1,9 @@
|
||||
<breadcrumbs>
|
||||
<breadcrumb path="/inventories" title="Inventories"></breadcrumb>
|
||||
<breadcrumb path="/inventories/{{inventory.id}}/manage" title="{{inventory.name}}"></breadcrumb>
|
||||
<breadcrumb path="/inventories/{{inventory.id}}/system-tracking/{{hostIds}}" title="System Tracking" current="true"></breadcrumb>
|
||||
</breadcrumbs>
|
||||
|
||||
<div class="FactModulePickers">
|
||||
<div class="FactModulePickers-dateContainer FactModulePickers-dateContainer--left">
|
||||
<span class="FactModulePickers-label">{{ factModulePickersLabelLeft }}</span>
|
||||
|
||||
@ -48,8 +48,8 @@ export default {
|
||||
'Rest',
|
||||
'GetBasePath',
|
||||
function($route, $q, rest, getBasePath) {
|
||||
if ($route.current.params.inventory) {
|
||||
return $q.when(true);
|
||||
if ($route.current.params.hasModelKey('inventory')) {
|
||||
return $q.when($route.current.params.model.inventory);
|
||||
}
|
||||
|
||||
var inventoryId = $route.current.params.inventory;
|
||||
@ -62,17 +62,17 @@ export default {
|
||||
});
|
||||
}
|
||||
],
|
||||
filters:
|
||||
hosts:
|
||||
[ '$route',
|
||||
'$q',
|
||||
'Rest',
|
||||
'GetBasePath',
|
||||
function($route, $q, rest, getBasePath) {
|
||||
if ($route.current.params.hosts) {
|
||||
return $q.when(true);
|
||||
if ($route.current.params.hasModelKey('hosts')) {
|
||||
return $q.when($route.current.params.model.hosts);
|
||||
}
|
||||
|
||||
var hostIds = $route.current.params.filters.split(',');
|
||||
var hostIds = $route.current.params.hosts.split(',');
|
||||
|
||||
var hosts =
|
||||
hostIds.map(function(hostId) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user