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