mirror of
https://github.com/ansible/awx.git
synced 2026-03-04 10:11:05 -03:30
Merge pull request #891 from mabashian/activity-stream-dropdown-nav
Added activity stream navigation dropdown
This commit is contained in:
@@ -173,6 +173,12 @@ table, tbody {
|
|||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-top: -10px;
|
margin-top: -10px;
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.List-auxAction {
|
||||||
|
justify-content: flex-end;
|
||||||
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
.List-buttonSubmit {
|
.List-buttonSubmit {
|
||||||
|
|||||||
@@ -7,10 +7,13 @@
|
|||||||
import activityStreamRoute from './activitystream.route';
|
import activityStreamRoute from './activitystream.route';
|
||||||
import activityStreamController from './activitystream.controller';
|
import activityStreamController from './activitystream.controller';
|
||||||
|
|
||||||
|
import streamDropdownNav from './streamDropdownNav/stream-dropdown-nav.directive';
|
||||||
|
|
||||||
import streamDetailModal from './streamDetailModal/main';
|
import streamDetailModal from './streamDetailModal/main';
|
||||||
|
|
||||||
export default angular.module('activityStream', [streamDetailModal.name])
|
export default angular.module('activityStream', [streamDetailModal.name])
|
||||||
.controller('activityStreamController', activityStreamController)
|
.controller('activityStreamController', activityStreamController)
|
||||||
|
.directive('streamDropdownNav', streamDropdownNav)
|
||||||
.run(['$stateExtender', function($stateExtender) {
|
.run(['$stateExtender', function($stateExtender) {
|
||||||
$stateExtender.addState(activityStreamRoute);
|
$stateExtender.addState(activityStreamRoute);
|
||||||
}]);
|
}]);
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
/*************************************************
|
||||||
|
* Copyright (c) 2016 Ansible, Inc.
|
||||||
|
*
|
||||||
|
* All Rights Reserved
|
||||||
|
*************************************************/
|
||||||
|
|
||||||
|
export default [function() {
|
||||||
|
return {
|
||||||
|
restrict: 'E',
|
||||||
|
scope: true,
|
||||||
|
replace: true,
|
||||||
|
template: '<select class="form-control" ng-model="streamTarget" ng-options="opt.value as opt.label for opt in options" ng-change="changeStreamTarget()"></select>',
|
||||||
|
controller: ['$scope', '$state', function($scope, $state) {
|
||||||
|
|
||||||
|
$scope.streamTarget = ($state.params && $state.params.target) ? $state.params.target : 'dashboard';
|
||||||
|
|
||||||
|
$scope.options = [
|
||||||
|
{label: 'Credentials', value: 'credential'},
|
||||||
|
{label: 'Dashboard', value: 'dashboard'},
|
||||||
|
{label: 'Hosts', value: 'host'},
|
||||||
|
{label: 'Inventories', value: 'inventory'},
|
||||||
|
{label: 'Inventory Scripts', value: 'inventory_script'},
|
||||||
|
{label: 'Job Templates', value: 'job_template'},
|
||||||
|
{label: 'Management Jobs', value: 'management_job'},
|
||||||
|
{label: 'Organizations', value: 'organization'},
|
||||||
|
{label: 'Projects', value: 'project'},
|
||||||
|
{label: 'Schedules', value: 'schedule'},
|
||||||
|
{label: 'Teams', value: 'team'},
|
||||||
|
{label: 'Users', value: 'user'}
|
||||||
|
];
|
||||||
|
|
||||||
|
$scope.changeStreamTarget = function(){
|
||||||
|
|
||||||
|
if($scope.streamTarget && $scope.streamTarget == 'dashboard') {
|
||||||
|
// Just navigate to the base activity stream
|
||||||
|
$state.go('activityStream', {}, {inherit: false, reload: true});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// Attach the taget to the query parameters
|
||||||
|
$state.go('activityStream', {target: $scope.streamTarget});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}],
|
||||||
|
};
|
||||||
|
}];
|
||||||
@@ -19,6 +19,7 @@ export default
|
|||||||
hover: true,
|
hover: true,
|
||||||
"class": "table-condensed",
|
"class": "table-condensed",
|
||||||
searchWidgets: 3,
|
searchWidgets: 3,
|
||||||
|
toolbarAuxAction: "<stream-dropdown-nav></stream-dropdown-nav>",
|
||||||
|
|
||||||
fields: {
|
fields: {
|
||||||
timestamp: {
|
timestamp: {
|
||||||
|
|||||||
@@ -315,6 +315,11 @@ export default ['$location', '$compile', '$rootScope', 'SearchWidget', 'Paginate
|
|||||||
}
|
}
|
||||||
|
|
||||||
html += "</div>";
|
html += "</div>";
|
||||||
|
if(list.toolbarAuxAction) {
|
||||||
|
html += "<div class=\"List-auxAction\">";
|
||||||
|
html += list.toolbarAuxAction;
|
||||||
|
html += "</div>";
|
||||||
|
}
|
||||||
html += "<div class=\"List-actions\">";
|
html += "<div class=\"List-actions\">";
|
||||||
html += "<div class=\"list-actions\" ng-include=\"'" +
|
html += "<div class=\"list-actions\" ng-include=\"'" +
|
||||||
templateUrl('shared/list-generator/list-actions') +
|
templateUrl('shared/list-generator/list-actions') +
|
||||||
|
|||||||
Reference in New Issue
Block a user