mirror of
https://github.com/ansible/awx.git
synced 2026-01-26 16:11:30 -03:30
Merge pull request #766 from mabashian/activity-stream
Added activity stream route and view
This commit is contained in:
commit
6242df1a07
@ -1713,33 +1713,6 @@ tr td button i {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Activity Stream Widget */
|
|
||||||
|
|
||||||
#stream-container {
|
|
||||||
display: none;
|
|
||||||
border-radius: 8px;
|
|
||||||
z-index: 20; /* has to be greater than tree selector */
|
|
||||||
|
|
||||||
.nav-path {
|
|
||||||
margin-bottom: 15px;
|
|
||||||
margin-top: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
padding-left: 10px;
|
|
||||||
padding-right: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#stream-content {
|
|
||||||
border: 1px solid @grey;
|
|
||||||
border-radius: 8px;
|
|
||||||
padding: 8px;
|
|
||||||
|
|
||||||
h5 {
|
|
||||||
margin-top: 0;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* job stdout */
|
/* job stdout */
|
||||||
|
|
||||||
#pre-container {
|
#pre-container {
|
||||||
|
|||||||
@ -0,0 +1,21 @@
|
|||||||
|
/*************************************************
|
||||||
|
* Copyright (c) 2016 Ansible, Inc.
|
||||||
|
*
|
||||||
|
* All Rights Reserved
|
||||||
|
*************************************************/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ngdoc function
|
||||||
|
* @name controllers.function:Activity Stream
|
||||||
|
* @description This controller controls the activity stream.
|
||||||
|
*/
|
||||||
|
function activityStreamController($scope, Stream) {
|
||||||
|
|
||||||
|
// Open the stream
|
||||||
|
Stream({
|
||||||
|
scope: $scope
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export default ['$scope', 'Stream', activityStreamController];
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
<div class="Panel" id="stream-container">
|
||||||
|
<div id="stream-content"></div>
|
||||||
|
</div>
|
||||||
17
awx/ui/client/src/activity-stream/activitystream.route.js
Normal file
17
awx/ui/client/src/activity-stream/activitystream.route.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
/*************************************************
|
||||||
|
* Copyright (c) 2016 Ansible, Inc.
|
||||||
|
*
|
||||||
|
* All Rights Reserved
|
||||||
|
*************************************************/
|
||||||
|
|
||||||
|
import {templateUrl} from '../shared/template-url/template-url.factory';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'activityStream',
|
||||||
|
route: '/activity_stream?target&id',
|
||||||
|
templateUrl: templateUrl('activity-stream/activitystream'),
|
||||||
|
controller: 'activityStreamController',
|
||||||
|
ncyBreadcrumb: {
|
||||||
|
label: "ACTIVITY STREAM"
|
||||||
|
},
|
||||||
|
};
|
||||||
14
awx/ui/client/src/activity-stream/main.js
Normal file
14
awx/ui/client/src/activity-stream/main.js
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
/*************************************************
|
||||||
|
* Copyright (c) 2016 Ansible, Inc.
|
||||||
|
*
|
||||||
|
* All Rights Reserved
|
||||||
|
*************************************************/
|
||||||
|
|
||||||
|
import activityStreamRoute from './activitystream.route';
|
||||||
|
import activityStreamController from './activitystream.controller';
|
||||||
|
|
||||||
|
export default angular.module('activityStream', [])
|
||||||
|
.controller('activityStreamController', activityStreamController)
|
||||||
|
.run(['$stateExtender', function($stateExtender) {
|
||||||
|
$stateExtender.addState(activityStreamRoute);
|
||||||
|
}]);
|
||||||
@ -42,6 +42,7 @@ import moment from './shared/moment/main';
|
|||||||
import templateUrl from './shared/template-url/main';
|
import templateUrl from './shared/template-url/main';
|
||||||
import adhoc from './adhoc/main';
|
import adhoc from './adhoc/main';
|
||||||
import login from './login/main';
|
import login from './login/main';
|
||||||
|
import activityStream from './activity-stream/main';
|
||||||
import {JobDetailController} from './controllers/JobDetail';
|
import {JobDetailController} from './controllers/JobDetail';
|
||||||
import {JobStdoutController} from './controllers/JobStdout';
|
import {JobStdoutController} from './controllers/JobStdout';
|
||||||
import {JobTemplatesList, JobTemplatesAdd, JobTemplatesEdit} from './controllers/JobTemplates';
|
import {JobTemplatesList, JobTemplatesAdd, JobTemplatesEdit} from './controllers/JobTemplates';
|
||||||
@ -91,6 +92,7 @@ var tower = angular.module('Tower', [
|
|||||||
templateUrl.name,
|
templateUrl.name,
|
||||||
adhoc.name,
|
adhoc.name,
|
||||||
login.name,
|
login.name,
|
||||||
|
activityStream.name,
|
||||||
footer.name,
|
footer.name,
|
||||||
'templates',
|
'templates',
|
||||||
'Utilities',
|
'Utilities',
|
||||||
@ -209,6 +211,9 @@ var tower = angular.module('Tower', [
|
|||||||
url: '/home',
|
url: '/home',
|
||||||
templateUrl: urlPrefix + 'partials/home.html',
|
templateUrl: urlPrefix + 'partials/home.html',
|
||||||
controller: Home,
|
controller: Home,
|
||||||
|
data: {
|
||||||
|
activityStream: true
|
||||||
|
},
|
||||||
ncyBreadcrumb: {
|
ncyBreadcrumb: {
|
||||||
label: "DASHBOARD"
|
label: "DASHBOARD"
|
||||||
},
|
},
|
||||||
@ -241,6 +246,10 @@ var tower = angular.module('Tower', [
|
|||||||
url: '/home/hosts?has_active_failures',
|
url: '/home/hosts?has_active_failures',
|
||||||
templateUrl: urlPrefix + 'partials/subhome.html',
|
templateUrl: urlPrefix + 'partials/subhome.html',
|
||||||
controller: HomeHosts,
|
controller: HomeHosts,
|
||||||
|
data: {
|
||||||
|
activityStream: true,
|
||||||
|
activityStreamTarget: 'host'
|
||||||
|
},
|
||||||
ncyBreadcrumb: {
|
ncyBreadcrumb: {
|
||||||
parent: 'dashboard',
|
parent: 'dashboard',
|
||||||
label: "HOSTS"
|
label: "HOSTS"
|
||||||
@ -361,6 +370,10 @@ var tower = angular.module('Tower', [
|
|||||||
url: '/job_templates',
|
url: '/job_templates',
|
||||||
templateUrl: urlPrefix + 'partials/job_templates.html',
|
templateUrl: urlPrefix + 'partials/job_templates.html',
|
||||||
controller: JobTemplatesList,
|
controller: JobTemplatesList,
|
||||||
|
data: {
|
||||||
|
activityStream: true,
|
||||||
|
activityStreamTarget: 'job_template'
|
||||||
|
},
|
||||||
ncyBreadcrumb: {
|
ncyBreadcrumb: {
|
||||||
label: "JOB TEMPLATES"
|
label: "JOB TEMPLATES"
|
||||||
},
|
},
|
||||||
@ -390,6 +403,9 @@ var tower = angular.module('Tower', [
|
|||||||
url: '/:template_id',
|
url: '/:template_id',
|
||||||
templateUrl: urlPrefix + 'partials/job_templates.html',
|
templateUrl: urlPrefix + 'partials/job_templates.html',
|
||||||
controller: JobTemplatesEdit,
|
controller: JobTemplatesEdit,
|
||||||
|
data: {
|
||||||
|
activityStreamId: 'template_id'
|
||||||
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
features: ['FeaturesService', function(FeaturesService) {
|
features: ['FeaturesService', function(FeaturesService) {
|
||||||
return FeaturesService.get();
|
return FeaturesService.get();
|
||||||
@ -401,6 +417,10 @@ var tower = angular.module('Tower', [
|
|||||||
url: '/job_templates/:id/schedules',
|
url: '/job_templates/:id/schedules',
|
||||||
templateUrl: urlPrefix + 'partials/schedule_detail.html',
|
templateUrl: urlPrefix + 'partials/schedule_detail.html',
|
||||||
controller: ScheduleEditController,
|
controller: ScheduleEditController,
|
||||||
|
data: {
|
||||||
|
activityStream: true,
|
||||||
|
activityStreamTarget: 'schedule'
|
||||||
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
features: ['FeaturesService', function(FeaturesService) {
|
features: ['FeaturesService', function(FeaturesService) {
|
||||||
return FeaturesService.get();
|
return FeaturesService.get();
|
||||||
@ -412,6 +432,10 @@ var tower = angular.module('Tower', [
|
|||||||
url: '/projects',
|
url: '/projects',
|
||||||
templateUrl: urlPrefix + 'partials/projects.html',
|
templateUrl: urlPrefix + 'partials/projects.html',
|
||||||
controller: ProjectsList,
|
controller: ProjectsList,
|
||||||
|
data: {
|
||||||
|
activityStream: true,
|
||||||
|
activityStreamTarget: 'project'
|
||||||
|
},
|
||||||
ncyBreadcrumb: {
|
ncyBreadcrumb: {
|
||||||
label: "PROJECTS"
|
label: "PROJECTS"
|
||||||
},
|
},
|
||||||
@ -441,6 +465,9 @@ var tower = angular.module('Tower', [
|
|||||||
url: '/:id',
|
url: '/:id',
|
||||||
templateUrl: urlPrefix + 'partials/projects.html',
|
templateUrl: urlPrefix + 'partials/projects.html',
|
||||||
controller: ProjectsEdit,
|
controller: ProjectsEdit,
|
||||||
|
data: {
|
||||||
|
activityStreamId: 'id'
|
||||||
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
features: ['FeaturesService', function(FeaturesService) {
|
features: ['FeaturesService', function(FeaturesService) {
|
||||||
return FeaturesService.get();
|
return FeaturesService.get();
|
||||||
@ -452,6 +479,10 @@ var tower = angular.module('Tower', [
|
|||||||
url: '/projects/:id/schedules',
|
url: '/projects/:id/schedules',
|
||||||
templateUrl: urlPrefix + 'partials/schedule_detail.html',
|
templateUrl: urlPrefix + 'partials/schedule_detail.html',
|
||||||
controller: ScheduleEditController,
|
controller: ScheduleEditController,
|
||||||
|
data: {
|
||||||
|
activityStream: true,
|
||||||
|
activityStreamTarget: 'schedule'
|
||||||
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
features: ['FeaturesService', function(FeaturesService) {
|
features: ['FeaturesService', function(FeaturesService) {
|
||||||
return FeaturesService.get();
|
return FeaturesService.get();
|
||||||
@ -485,6 +516,10 @@ var tower = angular.module('Tower', [
|
|||||||
url: '/inventories',
|
url: '/inventories',
|
||||||
templateUrl: urlPrefix + 'partials/inventories.html',
|
templateUrl: urlPrefix + 'partials/inventories.html',
|
||||||
controller: InventoriesList,
|
controller: InventoriesList,
|
||||||
|
data: {
|
||||||
|
activityStream: true,
|
||||||
|
activityStreamTarget: 'inventory'
|
||||||
|
},
|
||||||
ncyBreadcrumb: {
|
ncyBreadcrumb: {
|
||||||
label: "INVENTORIES"
|
label: "INVENTORIES"
|
||||||
},
|
},
|
||||||
@ -514,6 +549,9 @@ var tower = angular.module('Tower', [
|
|||||||
url: '/:inventory_id',
|
url: '/:inventory_id',
|
||||||
templateUrl: urlPrefix + 'partials/inventories.html',
|
templateUrl: urlPrefix + 'partials/inventories.html',
|
||||||
controller: InventoriesEdit,
|
controller: InventoriesEdit,
|
||||||
|
data: {
|
||||||
|
activityStreamId: 'inventory_id'
|
||||||
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
features: ['FeaturesService', function(FeaturesService) {
|
features: ['FeaturesService', function(FeaturesService) {
|
||||||
return FeaturesService.get();
|
return FeaturesService.get();
|
||||||
@ -558,6 +596,10 @@ var tower = angular.module('Tower', [
|
|||||||
url: '/organizations',
|
url: '/organizations',
|
||||||
templateUrl: urlPrefix + 'partials/organizations.html',
|
templateUrl: urlPrefix + 'partials/organizations.html',
|
||||||
controller: OrganizationsList,
|
controller: OrganizationsList,
|
||||||
|
data: {
|
||||||
|
activityStream: true,
|
||||||
|
activityStreamTarget: 'organization'
|
||||||
|
},
|
||||||
ncyBreadcrumb: {
|
ncyBreadcrumb: {
|
||||||
parent: function($scope) {
|
parent: function($scope) {
|
||||||
$scope.$parent.$emit("ReloadOrgListView");
|
$scope.$parent.$emit("ReloadOrgListView");
|
||||||
@ -591,6 +633,9 @@ var tower = angular.module('Tower', [
|
|||||||
url: '/:organization_id',
|
url: '/:organization_id',
|
||||||
templateUrl: urlPrefix + 'partials/organizations.crud.html',
|
templateUrl: urlPrefix + 'partials/organizations.crud.html',
|
||||||
controller: OrganizationsEdit,
|
controller: OrganizationsEdit,
|
||||||
|
data: {
|
||||||
|
activityStreamId: 'organization_id'
|
||||||
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
features: ['FeaturesService', function(FeaturesService) {
|
features: ['FeaturesService', function(FeaturesService) {
|
||||||
return FeaturesService.get();
|
return FeaturesService.get();
|
||||||
@ -646,6 +691,10 @@ var tower = angular.module('Tower', [
|
|||||||
url: '/teams',
|
url: '/teams',
|
||||||
templateUrl: urlPrefix + 'partials/teams.html',
|
templateUrl: urlPrefix + 'partials/teams.html',
|
||||||
controller: TeamsList,
|
controller: TeamsList,
|
||||||
|
data: {
|
||||||
|
activityStream: true,
|
||||||
|
activityStreamTarget: 'team'
|
||||||
|
},
|
||||||
ncyBreadcrumb: {
|
ncyBreadcrumb: {
|
||||||
parent: 'setup',
|
parent: 'setup',
|
||||||
label: 'TEAMS'
|
label: 'TEAMS'
|
||||||
@ -676,6 +725,9 @@ var tower = angular.module('Tower', [
|
|||||||
url: '/:team_id',
|
url: '/:team_id',
|
||||||
templateUrl: urlPrefix + 'partials/teams.html',
|
templateUrl: urlPrefix + 'partials/teams.html',
|
||||||
controller: TeamsEdit,
|
controller: TeamsEdit,
|
||||||
|
data: {
|
||||||
|
activityStreamId: 'team_id'
|
||||||
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
features: ['FeaturesService', function(FeaturesService) {
|
features: ['FeaturesService', function(FeaturesService) {
|
||||||
return FeaturesService.get();
|
return FeaturesService.get();
|
||||||
@ -775,6 +827,10 @@ var tower = angular.module('Tower', [
|
|||||||
url: '/credentials',
|
url: '/credentials',
|
||||||
templateUrl: urlPrefix + 'partials/credentials.html',
|
templateUrl: urlPrefix + 'partials/credentials.html',
|
||||||
controller: CredentialsList,
|
controller: CredentialsList,
|
||||||
|
data: {
|
||||||
|
activityStream: true,
|
||||||
|
activityStreamTarget: 'credential'
|
||||||
|
},
|
||||||
ncyBreadcrumb: {
|
ncyBreadcrumb: {
|
||||||
parent: 'setup',
|
parent: 'setup',
|
||||||
label: 'CREDENTIALS'
|
label: 'CREDENTIALS'
|
||||||
@ -805,6 +861,9 @@ var tower = angular.module('Tower', [
|
|||||||
url: '/:credential_id',
|
url: '/:credential_id',
|
||||||
templateUrl: urlPrefix + 'partials/credentials.html',
|
templateUrl: urlPrefix + 'partials/credentials.html',
|
||||||
controller: CredentialsEdit,
|
controller: CredentialsEdit,
|
||||||
|
data: {
|
||||||
|
activityStreamId: 'credential_id'
|
||||||
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
features: ['FeaturesService', function(FeaturesService) {
|
features: ['FeaturesService', function(FeaturesService) {
|
||||||
return FeaturesService.get();
|
return FeaturesService.get();
|
||||||
@ -816,6 +875,10 @@ var tower = angular.module('Tower', [
|
|||||||
url: '/users',
|
url: '/users',
|
||||||
templateUrl: urlPrefix + 'partials/users.html',
|
templateUrl: urlPrefix + 'partials/users.html',
|
||||||
controller: UsersList,
|
controller: UsersList,
|
||||||
|
data: {
|
||||||
|
activityStream: true,
|
||||||
|
activityStreamTarget: 'user'
|
||||||
|
},
|
||||||
ncyBreadcrumb: {
|
ncyBreadcrumb: {
|
||||||
parent: 'setup',
|
parent: 'setup',
|
||||||
label: 'USERS'
|
label: 'USERS'
|
||||||
@ -846,6 +909,9 @@ var tower = angular.module('Tower', [
|
|||||||
url: '/:user_id',
|
url: '/:user_id',
|
||||||
templateUrl: urlPrefix + 'partials/users.html',
|
templateUrl: urlPrefix + 'partials/users.html',
|
||||||
controller: UsersEdit,
|
controller: UsersEdit,
|
||||||
|
data: {
|
||||||
|
activityStreamId: 'user_id'
|
||||||
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
features: ['FeaturesService', function(FeaturesService) {
|
features: ['FeaturesService', function(FeaturesService) {
|
||||||
return FeaturesService.get();
|
return FeaturesService.get();
|
||||||
@ -925,9 +991,9 @@ var tower = angular.module('Tower', [
|
|||||||
}]);
|
}]);
|
||||||
}])
|
}])
|
||||||
|
|
||||||
.run(['$q', '$compile', '$cookieStore', '$rootScope', '$log', 'CheckLicense', '$location', 'Authorization', 'LoadBasePaths', 'Timer', 'ClearScope', 'HideStream', 'Socket',
|
.run(['$q', '$compile', '$cookieStore', '$rootScope', '$log', 'CheckLicense', '$location', 'Authorization', 'LoadBasePaths', 'Timer', 'ClearScope', 'Socket',
|
||||||
'LoadConfig', 'Store', 'ShowSocketHelp', 'AboutAnsibleHelp', 'pendoService',
|
'LoadConfig', 'Store', 'ShowSocketHelp', 'AboutAnsibleHelp', 'pendoService',
|
||||||
function ($q, $compile, $cookieStore, $rootScope, $log, CheckLicense, $location, Authorization, LoadBasePaths, Timer, ClearScope, HideStream, Socket,
|
function ($q, $compile, $cookieStore, $rootScope, $log, CheckLicense, $location, Authorization, LoadBasePaths, Timer, ClearScope, Socket,
|
||||||
LoadConfig, Store, ShowSocketHelp, AboutAnsibleHelp, pendoService) {
|
LoadConfig, Store, ShowSocketHelp, AboutAnsibleHelp, pendoService) {
|
||||||
|
|
||||||
|
|
||||||
@ -1068,11 +1134,6 @@ var tower = angular.module('Tower', [
|
|||||||
$location.replace($location.search('').$$url);
|
$location.replace($location.search('').$$url);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Before navigating away from current tab, make sure the primary view is visible
|
|
||||||
if ($('#stream-container').is(':visible')) {
|
|
||||||
HideStream();
|
|
||||||
}
|
|
||||||
|
|
||||||
// remove any lingering intervals
|
// remove any lingering intervals
|
||||||
if ($rootScope.jobDetailInterval) {
|
if ($rootScope.jobDetailInterval) {
|
||||||
window.clearInterval($rootScope.jobDetailInterval);
|
window.clearInterval($rootScope.jobDetailInterval);
|
||||||
|
|||||||
@ -6,15 +6,39 @@ export default
|
|||||||
restrict: 'E',
|
restrict: 'E',
|
||||||
templateUrl: templateUrl('bread-crumb/bread-crumb'),
|
templateUrl: templateUrl('bread-crumb/bread-crumb'),
|
||||||
link: function(scope, element, attrs) {
|
link: function(scope, element, attrs) {
|
||||||
scope.activityStreamActive = 0;
|
|
||||||
|
|
||||||
scope.toggleActivityStreamActive = function(){
|
var streamConfig = {};
|
||||||
scope.activityStreamActive = !scope.activityStreamActive;
|
|
||||||
};
|
scope.showActivityStreamButton = false;
|
||||||
|
|
||||||
|
scope.openActivityStream = function() {
|
||||||
|
|
||||||
|
var stateGoParams = {};
|
||||||
|
|
||||||
|
if(streamConfig && streamConfig.activityStream) {
|
||||||
|
if(streamConfig.activityStreamTarget) {
|
||||||
|
stateGoParams['target'] = streamConfig.activityStreamTarget;
|
||||||
|
}
|
||||||
|
if(streamConfig.activityStreamId) {
|
||||||
|
stateGoParams['id'] = $state.params[streamConfig.activityStreamId];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$state.go('activityStream', stateGoParams);
|
||||||
|
}
|
||||||
|
|
||||||
|
scope.$on("$stateChangeSuccess", function updateActivityStreamButton(event, toState) {
|
||||||
|
|
||||||
|
streamConfig = (toState && toState.data) ? toState.data : {};
|
||||||
|
|
||||||
|
if(streamConfig && streamConfig.activityStream) {
|
||||||
|
scope.showActivityStreamButton = true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
scope.showActivityStreamButton = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
scope.isActive = function (path) {
|
|
||||||
return $state.is(path);
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}];
|
}];
|
||||||
|
|||||||
@ -7,8 +7,8 @@
|
|||||||
data-trigger="hover"
|
data-trigger="hover"
|
||||||
data-container="body"
|
data-container="body"
|
||||||
ng-class="{'BreadCrumb-menuLinkActive' : activityStreamActive}"
|
ng-class="{'BreadCrumb-menuLinkActive' : activityStreamActive}"
|
||||||
ng-if="isActive('dashboard')"
|
ng-if="showActivityStreamButton"
|
||||||
ng-click="toggleActivityStreamActive()">
|
ng-click="openActivityStream()">
|
||||||
<i class="BreadCrumb-menuLinkImage icon-activity-stream"
|
<i class="BreadCrumb-menuLinkImage icon-activity-stream"
|
||||||
alt="Activity Stream">
|
alt="Activity Stream">
|
||||||
</i>
|
</i>
|
||||||
@ -20,7 +20,7 @@
|
|||||||
data-placement="left"
|
data-placement="left"
|
||||||
data-trigger="hover"
|
data-trigger="hover"
|
||||||
data-container="body"
|
data-container="body"
|
||||||
ng-if="!isActive('dashboard')">
|
ng-if="!showActivityStreamButton">
|
||||||
<i class="BreadCrumb-menuLinkImage fa fa-tachometer"
|
<i class="BreadCrumb-menuLinkImage fa fa-tachometer"
|
||||||
alt="Dashboard">
|
alt="Dashboard">
|
||||||
</i>
|
</i>
|
||||||
|
|||||||
@ -11,6 +11,10 @@ export default {
|
|||||||
route: '/inventory_scripts',
|
route: '/inventory_scripts',
|
||||||
templateUrl: templateUrl('inventory-scripts/list/list'),
|
templateUrl: templateUrl('inventory-scripts/list/list'),
|
||||||
controller: 'inventoryScriptsListController',
|
controller: 'inventoryScriptsListController',
|
||||||
|
data: {
|
||||||
|
activityStream: true,
|
||||||
|
activityStreamTarget: 'inventory_script'
|
||||||
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
features: ['FeaturesService', function(FeaturesService) {
|
features: ['FeaturesService', function(FeaturesService) {
|
||||||
return FeaturesService.get();
|
return FeaturesService.get();
|
||||||
|
|||||||
@ -12,6 +12,7 @@ export default
|
|||||||
name: 'activities',
|
name: 'activities',
|
||||||
iterator: 'activity',
|
iterator: 'activity',
|
||||||
editTitle: 'Activity Stream',
|
editTitle: 'Activity Stream',
|
||||||
|
listTitle: 'Activity Stream',
|
||||||
selectInstructions: '',
|
selectInstructions: '',
|
||||||
index: false,
|
index: false,
|
||||||
hover: true,
|
hover: true,
|
||||||
@ -252,13 +253,6 @@ export default
|
|||||||
},
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
close: {
|
|
||||||
mode: 'all',
|
|
||||||
awToolTip: "Close Activity Stream view",
|
|
||||||
ngClick: "closeStream()",
|
|
||||||
actionClass: 'btn List-buttonDefault',
|
|
||||||
buttonContent: 'CLOSE'
|
|
||||||
},
|
|
||||||
refresh: {
|
refresh: {
|
||||||
mode: 'all',
|
mode: 'all',
|
||||||
id: 'activity-stream-refresh-btn',
|
id: 'activity-stream-refresh-btn',
|
||||||
|
|||||||
@ -11,6 +11,10 @@ export default {
|
|||||||
route: '/management_jobs',
|
route: '/management_jobs',
|
||||||
templateUrl: templateUrl('management-jobs/list/list'),
|
templateUrl: templateUrl('management-jobs/list/list'),
|
||||||
controller: 'managementJobsListController',
|
controller: 'managementJobsListController',
|
||||||
|
data: {
|
||||||
|
activityStream: true,
|
||||||
|
activityStreamTarget: 'management_job'
|
||||||
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
features: ['FeaturesService', function(FeaturesService) {
|
features: ['FeaturesService', function(FeaturesService) {
|
||||||
return FeaturesService.get();
|
return FeaturesService.get();
|
||||||
|
|||||||
@ -11,6 +11,10 @@ export default {
|
|||||||
route: '/management_jobs/:management_job_id/schedules',
|
route: '/management_jobs/:management_job_id/schedules',
|
||||||
templateUrl: templateUrl('management-jobs/schedule/schedule'),
|
templateUrl: templateUrl('management-jobs/schedule/schedule'),
|
||||||
controller: 'managementJobsScheduleController',
|
controller: 'managementJobsScheduleController',
|
||||||
|
data: {
|
||||||
|
activityStream: true,
|
||||||
|
activityStreamTarget: 'schedule'
|
||||||
|
},
|
||||||
params: {management_job: null},
|
params: {management_job: null},
|
||||||
resolve: {
|
resolve: {
|
||||||
features: ['FeaturesService', function(FeaturesService) {
|
features: ['FeaturesService', function(FeaturesService) {
|
||||||
|
|||||||
@ -13,15 +13,6 @@
|
|||||||
icon-name="refresh"
|
icon-name="refresh"
|
||||||
toolbar="true">
|
toolbar="true">
|
||||||
</button>
|
</button>
|
||||||
<button
|
|
||||||
toolbar-button
|
|
||||||
mode="all"
|
|
||||||
ng-click="showActivity()"
|
|
||||||
aw-tool-tip="View Activity Stream"
|
|
||||||
icon-name="stream"
|
|
||||||
toolbar="true"
|
|
||||||
aw-feature="activity_streams">
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -9,6 +9,7 @@ export default function($stateProvider){
|
|||||||
templateUrl: state.templateUrl,
|
templateUrl: state.templateUrl,
|
||||||
resolve: state.resolve,
|
resolve: state.resolve,
|
||||||
params: state.params,
|
params: state.params,
|
||||||
|
data: state.data,
|
||||||
ncyBreadcrumb: state.ncyBreadcrumb
|
ncyBreadcrumb: state.ncyBreadcrumb
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,65 +37,6 @@ angular.module('StreamWidget', ['RestServices', 'Utilities', 'StreamListDefiniti
|
|||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
.factory('ShowStream', ['setStreamHeight', 'Authorization',
|
|
||||||
function (setStreamHeight) {
|
|
||||||
return function () {
|
|
||||||
// Slide in the Stream widget
|
|
||||||
|
|
||||||
// Make some style/position adjustments adjustments
|
|
||||||
var stream = $('#stream-container');
|
|
||||||
stream.css({
|
|
||||||
position: 'absolute',
|
|
||||||
top: 0,
|
|
||||||
left: 0,
|
|
||||||
width: '100%',
|
|
||||||
'min-height': '100%',
|
|
||||||
'background-color': '#FFF'
|
|
||||||
});
|
|
||||||
|
|
||||||
setStreamHeight();
|
|
||||||
|
|
||||||
// Slide in stream
|
|
||||||
stream.show('slide', {
|
|
||||||
'direction': 'left'
|
|
||||||
}, {
|
|
||||||
'duration': 500,
|
|
||||||
'queue': false
|
|
||||||
});
|
|
||||||
|
|
||||||
};
|
|
||||||
}
|
|
||||||
])
|
|
||||||
|
|
||||||
.factory('HideStream', [
|
|
||||||
function () {
|
|
||||||
return function () {
|
|
||||||
// Remove the stream widget
|
|
||||||
|
|
||||||
var stream = $('#stream-container');
|
|
||||||
stream.hide('slide', {
|
|
||||||
'direction': 'left'
|
|
||||||
}, {
|
|
||||||
'duration': 500,
|
|
||||||
'queue': false
|
|
||||||
});
|
|
||||||
|
|
||||||
// Completely destroy the container so we don't experience random flashes of it later.
|
|
||||||
// There was some sort of weirdness with the tab 'show' causing the stream to slide in when
|
|
||||||
// a tab was clicked, after the stream had been hidden. Seemed like timing- wait long enough
|
|
||||||
// before clicking a tab, and it would not happen.
|
|
||||||
setTimeout(function () {
|
|
||||||
stream.detach();
|
|
||||||
stream.empty();
|
|
||||||
stream.unbind();
|
|
||||||
$('#main-view').css({
|
|
||||||
'min-height': 0
|
|
||||||
}); //let the parent height go back to normal
|
|
||||||
}, 500);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
])
|
|
||||||
|
|
||||||
.factory('FixUrl', [
|
.factory('FixUrl', [
|
||||||
function () {
|
function () {
|
||||||
return function (u) {
|
return function (u) {
|
||||||
@ -335,11 +276,11 @@ angular.module('StreamWidget', ['RestServices', 'Utilities', 'StreamListDefiniti
|
|||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
.factory('Stream', ['$rootScope', '$location', 'Rest', 'GetBasePath', 'ProcessErrors', 'Wait', 'StreamList', 'SearchInit',
|
.factory('Stream', ['$rootScope', '$location', '$state', 'Rest', 'GetBasePath', 'ProcessErrors', 'Wait', 'StreamList', 'SearchInit',
|
||||||
'PaginateInit', 'generateList', 'FormatDate', 'ShowStream', 'HideStream', 'BuildDescription', 'FixUrl', 'BuildUrl',
|
'PaginateInit', 'generateList', 'FormatDate', 'BuildDescription', 'FixUrl', 'BuildUrl',
|
||||||
'ShowDetail', 'setStreamHeight', 'Find', 'Store',
|
'ShowDetail', 'setStreamHeight', 'Find', 'Store',
|
||||||
function ($rootScope, $location, Rest, GetBasePath, ProcessErrors, Wait, StreamList, SearchInit, PaginateInit, GenerateList,
|
function ($rootScope, $location, $state, Rest, GetBasePath, ProcessErrors, Wait, StreamList, SearchInit, PaginateInit, GenerateList,
|
||||||
FormatDate, ShowStream, HideStream, BuildDescription, FixUrl, BuildUrl, ShowDetail, setStreamHeight,
|
FormatDate, BuildDescription, FixUrl, BuildUrl, ShowDetail, setStreamHeight,
|
||||||
Find, Store) {
|
Find, Store) {
|
||||||
return function (params) {
|
return function (params) {
|
||||||
|
|
||||||
@ -361,63 +302,25 @@ angular.module('StreamWidget', ['RestServices', 'Utilities', 'StreamListDefiniti
|
|||||||
if (url) {
|
if (url) {
|
||||||
defaultUrl = url;
|
defaultUrl = url;
|
||||||
} else {
|
} else {
|
||||||
if ($location.path() !== '/home') {
|
|
||||||
// Restrict what we're looking at based on the path
|
if($state.params && $state.params.target) {
|
||||||
type = (base === 'inventories') ? 'inventory' : base.replace(/s$/, '');
|
if($state.params.id) {
|
||||||
paths = $location.path().split('/');
|
// We have a type and an ID
|
||||||
paths.splice(0, 1);
|
defaultUrl += '?' + $state.params.target + '__id=' + $state.params.id;
|
||||||
if (paths.length > 1 && /^\d+/.test(paths[paths.length - 1])) {
|
}
|
||||||
type = paths[paths.length - 2];
|
else {
|
||||||
type = (type === 'inventories') ? 'inventory' : type.replace(/s$/, '');
|
// We just have a type
|
||||||
//defaultUrl += '?object1=' + type + '&object1__id=' +
|
defaultUrl += '?or__object1=' + $state.params.target + '&or__object2=' + $state.params.target;
|
||||||
defaultUrl += '?' + type + '__id=' + paths[paths.length - 1];
|
|
||||||
} else if (paths.length > 1) {
|
|
||||||
type = paths[paths.length - 1];
|
|
||||||
type = (type === 'inventories') ? 'inventory' : type.replace(/s$/, '');
|
|
||||||
defaultUrl += '?or__object1=' + type + '&or__object2=' + type;
|
|
||||||
} else {
|
|
||||||
defaultUrl += '?or__object1=' + type + '&or__object2=' + type;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add a container for the stream widget
|
|
||||||
$('#main-view').append("<div id=\"stream-container\"><div id=\"stream-content\"></div></div><!-- Stream widget -->");
|
|
||||||
|
|
||||||
ShowStream();
|
|
||||||
|
|
||||||
// Generate the list
|
// Generate the list
|
||||||
view.inject(list, { mode: 'edit', id: 'stream-content', searchSize: 'col-lg-3', secondWidget: true, activityStream: true, scope: scope });
|
view.inject(list, { mode: 'edit', id: 'stream-content', searchSize: 'col-lg-3', secondWidget: true, activityStream: true, scope: scope });
|
||||||
|
|
||||||
// descriptive title describing what AS is showing
|
// descriptive title describing what AS is showing
|
||||||
scope.streamTitle = (params && params.title) ? params.title : null;
|
scope.streamTitle = (params && params.title) ? params.title : null;
|
||||||
|
|
||||||
scope.closeStream = function (inUrl) {
|
|
||||||
HideStream();
|
|
||||||
if (scope.searchCleanup) {
|
|
||||||
scope.searchCleanup();
|
|
||||||
}
|
|
||||||
// Restore prior search state
|
|
||||||
if (PreviousSearchParams) {
|
|
||||||
SearchInit({
|
|
||||||
scope: parent_scope,
|
|
||||||
set: PreviousSearchParams.set,
|
|
||||||
list: PreviousSearchParams.list,
|
|
||||||
url: PreviousSearchParams.defaultUrl,
|
|
||||||
iterator: PreviousSearchParams.iterator,
|
|
||||||
sort_order: PreviousSearchParams.sort_order,
|
|
||||||
setWidgets: false
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (inUrl) {
|
|
||||||
$location.path(inUrl);
|
|
||||||
}
|
|
||||||
else if (onClose) {
|
|
||||||
parent_scope.$emit(onClose);
|
|
||||||
}
|
|
||||||
scope.$destroy();
|
|
||||||
};
|
|
||||||
|
|
||||||
scope.refreshStream = function () {
|
scope.refreshStream = function () {
|
||||||
scope.search(list.iterator);
|
scope.search(list.iterator);
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user