mirror of
https://github.com/ansible/awx.git
synced 2026-05-16 05:47:38 -02:30
Activity stream: implemented new search. Fixed a bunch of things related to the new data structure. Fixed /home/groups page.
This commit is contained in:
@@ -95,7 +95,7 @@ Home.$inject=['$scope', '$compile', '$routeParams', '$rootScope', '$location', '
|
|||||||
|
|
||||||
|
|
||||||
function HomeGroups ($location, $routeParams, HomeGroupList, GenerateList, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope,
|
function HomeGroups ($location, $routeParams, HomeGroupList, GenerateList, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope,
|
||||||
GetBasePath, SearchInit, PaginateInit, FormatDate, HostsStatusMsg, GetSyncStatusMsg, ViewUpdateStatus, Stream) {
|
GetBasePath, SearchInit, PaginateInit, FormatDate, GetHostsStatusMsg, GetSyncStatusMsg, ViewUpdateStatus, Stream) {
|
||||||
|
|
||||||
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
||||||
//scope.
|
//scope.
|
||||||
@@ -122,7 +122,7 @@ function HomeGroups ($location, $routeParams, HomeGroupList, GenerateList, Proce
|
|||||||
// Set values for Failed Hosts column
|
// Set values for Failed Hosts column
|
||||||
scope.home_groups[i].failed_hosts = scope.home_groups[i].hosts_with_active_failures + ' / ' + scope.home_groups[i].total_hosts;
|
scope.home_groups[i].failed_hosts = scope.home_groups[i].hosts_with_active_failures + ' / ' + scope.home_groups[i].total_hosts;
|
||||||
|
|
||||||
msg = HostsStatusMsg({
|
msg = GetHostsStatusMsg({
|
||||||
active_failures: scope.home_groups[i].hosts_with_active_failures,
|
active_failures: scope.home_groups[i].hosts_with_active_failures,
|
||||||
total_hosts: scope.home_groups[i].total_hosts,
|
total_hosts: scope.home_groups[i].total_hosts,
|
||||||
inventory_id: scope.home_groups[i].inventory,
|
inventory_id: scope.home_groups[i].inventory,
|
||||||
@@ -135,7 +135,8 @@ function HomeGroups ($location, $routeParams, HomeGroupList, GenerateList, Proce
|
|||||||
scope.home_groups[i].failed_hosts_link = msg['url'];
|
scope.home_groups[i].failed_hosts_link = msg['url'];
|
||||||
scope.home_groups[i].failed_hosts_class = msg['class'];
|
scope.home_groups[i].failed_hosts_class = msg['class'];
|
||||||
scope.home_groups[i].status = update_status['status'];
|
scope.home_groups[i].status = update_status['status'];
|
||||||
scope.home_groups[i].source = scope.groups[i].summary_fields.inventory_source.source;
|
scope.home_groups[i].source = (scope.home_groups[i].summary_fields.inventory_source) ?
|
||||||
|
scope.home_groups[i].summary_fields.inventory_source.source : null;
|
||||||
scope.home_groups[i].last_updated = last_update;
|
scope.home_groups[i].last_updated = last_update;
|
||||||
scope.home_groups[i].status_badge_class = update_status['class'];
|
scope.home_groups[i].status_badge_class = update_status['class'];
|
||||||
scope.home_groups[i].status_badge_tooltip = update_status['tooltip'];
|
scope.home_groups[i].status_badge_tooltip = update_status['tooltip'];
|
||||||
@@ -205,12 +206,17 @@ function HomeGroups ($location, $routeParams, HomeGroupList, GenerateList, Proce
|
|||||||
LoadBreadCrumbs();
|
LoadBreadCrumbs();
|
||||||
|
|
||||||
scope.showActivity = function() { Stream(); }
|
scope.showActivity = function() { Stream(); }
|
||||||
scope.viewUpdateStatus = function(id) { ViewUpdateStatus({ scope: scope, group_id: id }) };
|
|
||||||
|
scope.viewUpdateStatus = function(id) {
|
||||||
|
scope.groups = scope.home_groups;
|
||||||
|
ViewUpdateStatus({ scope: scope, tree_id: id })
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HomeGroups.$inject = [ '$location', '$routeParams', 'HomeGroupList', 'GenerateList', 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller',
|
HomeGroups.$inject = [ '$location', '$routeParams', 'HomeGroupList', 'GenerateList', 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller',
|
||||||
'ClearScope', 'GetBasePath', 'SearchInit', 'PaginateInit', 'FormatDate', 'HostsStatusMsg', 'GetSyncStatusMsg', 'ViewUpdateStatus', 'Stream'
|
'ClearScope', 'GetBasePath', 'SearchInit', 'PaginateInit', 'FormatDate', 'GetHostsStatusMsg', 'GetSyncStatusMsg', 'ViewUpdateStatus',
|
||||||
|
'Stream'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -93,7 +93,10 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', '
|
|||||||
var found = false;
|
var found = false;
|
||||||
var group = Find({ list: scope.groups, key: 'id', val: tree_id });
|
var group = Find({ list: scope.groups, key: 'id', val: tree_id });
|
||||||
|
|
||||||
scope.showHosts(tree_id, group_id, false);
|
if (scope.showHosts) {
|
||||||
|
if (scope.selected_tree_id !== tree_id)
|
||||||
|
scope.showHosts(tree_id, group_id, false);
|
||||||
|
}
|
||||||
|
|
||||||
if (group) {
|
if (group) {
|
||||||
if (Empty(group.source)) {
|
if (Empty(group.source)) {
|
||||||
@@ -141,9 +144,7 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', '
|
|||||||
// Return values for use on host status indicator
|
// Return values for use on host status indicator
|
||||||
|
|
||||||
if (active_failures > 0) {
|
if (active_failures > 0) {
|
||||||
tip = active_failures +
|
tip = total_hosts + ( (total_hosts == 1) ? ' host' : ' hosts' ) + '. ' + active_failures + ' with failed jobs.';
|
||||||
[ (active_failures == 1) ? ' host' : ' hosts' ] + ' with failed jobs.' +
|
|
||||||
[ (active_failures == 1) ? ' host' : ' hosts' ] + '.';
|
|
||||||
html_class = 'true';
|
html_class = 'true';
|
||||||
failures = true;
|
failures = true;
|
||||||
}
|
}
|
||||||
@@ -156,7 +157,7 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', '
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// many hosts with 0 failures
|
// many hosts with 0 failures
|
||||||
tip = 'No job failures';
|
tip = total_hosts + ( (total_hosts == 1) ? ' host' : ' hosts' ) + '. No job failures';
|
||||||
html_class = 'false';
|
html_class = 'false';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -250,6 +250,7 @@ angular.module('SearchHelper', ['RestServices', 'Utilities', 'RefreshHelper'])
|
|||||||
Refresh({ scope: scope, set: set, iterator: iterator, url: url });
|
Refresh({ scope: scope, set: set, iterator: iterator, url: url });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
if (scope.removeFoundObject) {
|
if (scope.removeFoundObject) {
|
||||||
scope.removeFoundObject();
|
scope.removeFoundObject();
|
||||||
}
|
}
|
||||||
@@ -269,8 +270,9 @@ angular.module('SearchHelper', ['RestServices', 'Utilities', 'RefreshHelper'])
|
|||||||
scope.$emit('prepareSearch2', iterator, page, load, spin);
|
scope.$emit('prepareSearch2', iterator, page, load, spin);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
|
|
||||||
if (scope.removeResultWarning) {
|
/*if (scope.removeResultWarning) {
|
||||||
scope.removeResultWarning();
|
scope.removeResultWarning();
|
||||||
}
|
}
|
||||||
scope.removeResultWarning = scope.$on('resultWarning', function(e, objs, length) {
|
scope.removeResultWarning = scope.$on('resultWarning', function(e, objs, length) {
|
||||||
@@ -278,6 +280,7 @@ angular.module('SearchHelper', ['RestServices', 'Utilities', 'RefreshHelper'])
|
|||||||
var label = (objs == 'inventory') ? 'inventories' : objs.replace(/s$/,'');
|
var label = (objs == 'inventory') ? 'inventories' : objs.replace(/s$/,'');
|
||||||
Alert('Warning', 'The number of matching ' + label + ' was too large. We limited your search to the first 30.', 'alert-info');
|
Alert('Warning', 'The number of matching ' + label + ' was too large. We limited your search to the first 30.', 'alert-info');
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
|
|
||||||
if (scope.removePrepareSearch) {
|
if (scope.removePrepareSearch) {
|
||||||
scope.removePrepareSearch();
|
scope.removePrepareSearch();
|
||||||
@@ -293,6 +296,7 @@ angular.module('SearchHelper', ['RestServices', 'Utilities', 'RefreshHelper'])
|
|||||||
var modifier;
|
var modifier;
|
||||||
|
|
||||||
// Determine how many object values we're dealing with.
|
// Determine how many object values we're dealing with.
|
||||||
|
/*
|
||||||
expected_objects = 0;
|
expected_objects = 0;
|
||||||
found_objects = 0;
|
found_objects = 0;
|
||||||
for (var i=1; i <= widgets; i++) {
|
for (var i=1; i <= widgets; i++) {
|
||||||
@@ -305,18 +309,27 @@ angular.module('SearchHelper', ['RestServices', 'Utilities', 'RefreshHelper'])
|
|||||||
expected_objects++;
|
expected_objects++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
for (var i=1; i <= widgets; i++) {
|
for (var i=1; i <= widgets; i++) {
|
||||||
var modifier = (i == 1) ? '' : i;
|
var modifier = (i == 1) ? '' : i;
|
||||||
if ( $('#search-widget-container' + modifier) ) {
|
if ( $('#search-widget-container' + modifier) ) {
|
||||||
if (list.fields[scope[iterator + 'SearchField' + modifier]] &&
|
if (list.fields[scope[iterator + 'SearchField' + modifier]] &&
|
||||||
list.fields[scope[iterator + 'SearchField' + modifier]].searchObject) {
|
list.fields[scope[iterator + 'SearchField' + modifier]].searchObject) {
|
||||||
|
// Search field of object type
|
||||||
if (list.fields[scope[iterator + 'SearchField' + modifier]].searchObject !== 'all') {
|
if (list.fields[scope[iterator + 'SearchField' + modifier]].searchObject !== 'all') {
|
||||||
|
// An object type is selected
|
||||||
scope[iterator + 'HideAllStartBtn' + modifier] = false;
|
scope[iterator + 'HideAllStartBtn' + modifier] = false;
|
||||||
if (scope[iterator + 'SearchValue' + modifier]) {
|
if (scope[iterator + 'SearchValue' + modifier]) {
|
||||||
|
// A search value was entered
|
||||||
scope[iterator + 'ShowStartBtn' + modifier] = false;
|
scope[iterator + 'ShowStartBtn' + modifier] = false;
|
||||||
var objs = list.fields[scope[iterator + 'SearchField' + modifier]].searchObject;
|
scope[iterator + 'SearchParams'] += '&' +
|
||||||
var objUrl = GetBasePath('base') + objs + '/?name__icontains=' + scope[iterator + 'SearchValue' + modifier];
|
list.fields[scope[iterator + 'SearchField' + modifier]].searchObject +
|
||||||
|
'__name__icontains=' +
|
||||||
|
scope[iterator + 'SearchValue' + modifier];
|
||||||
|
|
||||||
|
//var objUrl = GetBasePath('base') + objs + '/?name__icontains=' + scope[iterator + 'SearchValue' + modifier];
|
||||||
|
/*
|
||||||
Rest.setUrl(objUrl);
|
Rest.setUrl(objUrl);
|
||||||
Rest.setHeader({ widget: i });
|
Rest.setHeader({ widget: i });
|
||||||
Rest.setHeader({ object: objs });
|
Rest.setHeader({ object: objs });
|
||||||
@@ -340,10 +353,11 @@ angular.module('SearchHelper', ['RestServices', 'Utilities', 'RefreshHelper'])
|
|||||||
{ hdr: 'Error!', msg: 'Retrieving list of ' + objs + ' where name contains: ' + scope[iterator + 'SearchValue' + modifier] +
|
{ hdr: 'Error!', msg: 'Retrieving list of ' + objs + ' where name contains: ' + scope[iterator + 'SearchValue' + modifier] +
|
||||||
' GET returned status: ' + status });
|
' GET returned status: ' + status });
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
scope[iterator + 'ShowStartBtn' + modifier] = true;
|
scope[iterator + 'ShowStartBtn' + modifier] = true;
|
||||||
scope.$emit('foundObject', iterator, page, load, spin, i, null);
|
//scope.$emit('foundObject', iterator, page, load, spin, i, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -353,10 +367,11 @@ angular.module('SearchHelper', ['RestServices', 'Utilities', 'RefreshHelper'])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (expected_objects == 0) {
|
scope.$emit('prepareSearch2', iterator, page, load, spin);
|
||||||
|
//if (expected_objects == 0) {
|
||||||
// No search widgets contain objects
|
// No search widgets contain objects
|
||||||
scope.$emit('prepareSearch2', iterator, page, load, spin);
|
// scope.$emit('prepareSearch2', iterator, page, load, spin);
|
||||||
}
|
//}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (scope.removePrepareSearch2) {
|
if (scope.removePrepareSearch2) {
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ angular.module('HomeGroupListDefinition', [])
|
|||||||
label: 'Group',
|
label: 'Group',
|
||||||
ngClick: "\{\{ 'GroupsEdit(' + group.id + ')' \}\}",
|
ngClick: "\{\{ 'GroupsEdit(' + group.id + ')' \}\}",
|
||||||
columnClass: 'col-lg-3 col-md3 col-sm-2',
|
columnClass: 'col-lg-3 col-md3 col-sm-2',
|
||||||
linkTo: "\{\{ '/#/inventories/' + group.inventory + '/groups/?name=' + group.name \}\}"
|
linkTo: "\{\{ '/#/inventories/' + group.inventory + '/' \}\}"
|
||||||
},
|
},
|
||||||
inventory_name: {
|
inventory_name: {
|
||||||
label: 'Inventory',
|
label: 'Inventory',
|
||||||
@@ -36,7 +36,7 @@ angular.module('HomeGroupListDefinition', [])
|
|||||||
failed_hosts: {
|
failed_hosts: {
|
||||||
label: 'Failed Hosts',
|
label: 'Failed Hosts',
|
||||||
ngHref: "\{\{ group.failed_hosts_link \}\}",
|
ngHref: "\{\{ group.failed_hosts_link \}\}",
|
||||||
badgeIcon: "\{\{ 'icon-failures-' + group.failed_hosts_class \}\}",
|
badgeIcon: "\{\{ 'fa icon-failures-' + group.failed_hosts_class \}\}",
|
||||||
badgeNgHref: "\{\{ group.failed_hosts_link \}\}",
|
badgeNgHref: "\{\{ group.failed_hosts_link \}\}",
|
||||||
badgePlacement: 'left',
|
badgePlacement: 'left',
|
||||||
badgeToolTip: "\{\{ group.failed_hosts_tip \}\}",
|
badgeToolTip: "\{\{ group.failed_hosts_tip \}\}",
|
||||||
@@ -51,7 +51,7 @@ angular.module('HomeGroupListDefinition', [])
|
|||||||
label: 'Status',
|
label: 'Status',
|
||||||
ngClick: "viewUpdateStatus(\{\{ group.id \}\})",
|
ngClick: "viewUpdateStatus(\{\{ group.id \}\})",
|
||||||
searchType: 'select',
|
searchType: 'select',
|
||||||
badgeIcon: "\{\{ 'icon-cloud-' + group.status_badge_class \}\}",
|
badgeIcon: "\{\{ 'fa fa-cloud ' + group.status_badge_class \}\}",
|
||||||
badgeToolTip: "\{\{ group.status_badge_tooltip \}\}",
|
badgeToolTip: "\{\{ group.status_badge_tooltip \}\}",
|
||||||
awToolTip: "\{\{ group.status_badge_tooltip \}\}",
|
awToolTip: "\{\{ group.status_badge_tooltip \}\}",
|
||||||
dataPlacement: 'top',
|
dataPlacement: 'top',
|
||||||
@@ -117,9 +117,6 @@ angular.module('HomeGroupListDefinition', [])
|
|||||||
mode: 'all',
|
mode: 'all',
|
||||||
ngShow: "user_is_superuser"
|
ngShow: "user_is_superuser"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
|
|
||||||
fieldActions: {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -29,12 +29,12 @@ angular.module('StreamListDefinition', [])
|
|||||||
},
|
},
|
||||||
user: {
|
user: {
|
||||||
label: 'Initiated by',
|
label: 'Initiated by',
|
||||||
ngBindHtml: 'activity.user',
|
//ngBindHtml: 'activity.user',
|
||||||
sourceModel: 'user',
|
sourceModel: 'actor',
|
||||||
sourceField: 'username',
|
sourceField: 'username',
|
||||||
awToolTip: "\{\{ userToolTip \}\}",
|
//awToolTip: "\{\{ userToolTip \}\}",
|
||||||
dataPlacement: 'top',
|
//dataPlacement: 'top',
|
||||||
searchPlaceholder: 'Initiated by username',
|
searchPlaceholder: 'Username',
|
||||||
searchWidget: 1
|
searchWidget: 1
|
||||||
},
|
},
|
||||||
description: {
|
description: {
|
||||||
@@ -47,7 +47,7 @@ angular.module('StreamListDefinition', [])
|
|||||||
label: 'System event',
|
label: 'System event',
|
||||||
searchOnly: true,
|
searchOnly: true,
|
||||||
searchType: 'isnull',
|
searchType: 'isnull',
|
||||||
sourceModel: 'user',
|
sourceModel: 'actor',
|
||||||
sourceField: 'username',
|
sourceField: 'username',
|
||||||
searchWidget: 1
|
searchWidget: 1
|
||||||
},
|
},
|
||||||
@@ -60,12 +60,11 @@ angular.module('StreamListDefinition', [])
|
|||||||
searchObject: 'all',
|
searchObject: 'all',
|
||||||
searchPlaceholder: 'All resources',
|
searchPlaceholder: 'All resources',
|
||||||
searchWidget: 2,
|
searchWidget: 2,
|
||||||
searchField: 'object1'
|
|
||||||
},
|
},
|
||||||
credential_search: {
|
credential_search: {
|
||||||
label: 'Credential',
|
label: 'Credential',
|
||||||
searchOnly: true,
|
searchOnly: true,
|
||||||
searchObject: 'credentials',
|
searchObject: 'credential',
|
||||||
searchPlaceholder: 'Credential name',
|
searchPlaceholder: 'Credential name',
|
||||||
searchWidget: 2,
|
searchWidget: 2,
|
||||||
searchField: 'object1'
|
searchField: 'object1'
|
||||||
@@ -73,7 +72,7 @@ angular.module('StreamListDefinition', [])
|
|||||||
group_search: {
|
group_search: {
|
||||||
label: 'Group',
|
label: 'Group',
|
||||||
searchOnly: true,
|
searchOnly: true,
|
||||||
searchObject: 'groups',
|
searchObject: 'group',
|
||||||
searchPlaceholder: 'Group name',
|
searchPlaceholder: 'Group name',
|
||||||
searchWidget: 2,
|
searchWidget: 2,
|
||||||
searchField: 'object1'
|
searchField: 'object1'
|
||||||
@@ -81,7 +80,7 @@ angular.module('StreamListDefinition', [])
|
|||||||
host_search: {
|
host_search: {
|
||||||
label: 'Host',
|
label: 'Host',
|
||||||
searchOnly: true,
|
searchOnly: true,
|
||||||
searchObject: 'hosts',
|
searchObject: 'host',
|
||||||
searchPlaceholder: 'Host name',
|
searchPlaceholder: 'Host name',
|
||||||
searchWidget: 2,
|
searchWidget: 2,
|
||||||
searchField: 'object1'
|
searchField: 'object1'
|
||||||
@@ -89,7 +88,7 @@ angular.module('StreamListDefinition', [])
|
|||||||
inventory_search: {
|
inventory_search: {
|
||||||
label: 'Inventory',
|
label: 'Inventory',
|
||||||
searchOnly: true,
|
searchOnly: true,
|
||||||
searchObject: 'inventories',
|
searchObject: 'inventory',
|
||||||
searchPlaceholder: 'Inventory name',
|
searchPlaceholder: 'Inventory name',
|
||||||
searchWidget: 2,
|
searchWidget: 2,
|
||||||
searchField: 'object1'
|
searchField: 'object1'
|
||||||
@@ -97,7 +96,7 @@ angular.module('StreamListDefinition', [])
|
|||||||
job_template_search: {
|
job_template_search: {
|
||||||
label: 'Job Template',
|
label: 'Job Template',
|
||||||
searchOnly: true,
|
searchOnly: true,
|
||||||
searchObject: 'job_templates',
|
searchObject: 'job_template',
|
||||||
searchPlaceholder: 'Job template name',
|
searchPlaceholder: 'Job template name',
|
||||||
searchWidget: 2,
|
searchWidget: 2,
|
||||||
searchField: 'object1'
|
searchField: 'object1'
|
||||||
@@ -105,7 +104,7 @@ angular.module('StreamListDefinition', [])
|
|||||||
organization_search: {
|
organization_search: {
|
||||||
label: 'Organization',
|
label: 'Organization',
|
||||||
searchOnly: true,
|
searchOnly: true,
|
||||||
searchObject: 'organizations',
|
searchObject: 'organization',
|
||||||
searchPlaceholder: 'Organization name',
|
searchPlaceholder: 'Organization name',
|
||||||
searchWidget: 2,
|
searchWidget: 2,
|
||||||
searchField: 'object1'
|
searchField: 'object1'
|
||||||
@@ -113,7 +112,7 @@ angular.module('StreamListDefinition', [])
|
|||||||
project_search: {
|
project_search: {
|
||||||
label: 'Project',
|
label: 'Project',
|
||||||
searchOnly: true,
|
searchOnly: true,
|
||||||
searchObject: 'projects',
|
searchObject: 'project',
|
||||||
searchPlaceholder: 'Project name',
|
searchPlaceholder: 'Project name',
|
||||||
searchWidget: 2,
|
searchWidget: 2,
|
||||||
searchField: 'object1'
|
searchField: 'object1'
|
||||||
@@ -121,7 +120,7 @@ angular.module('StreamListDefinition', [])
|
|||||||
user_search: {
|
user_search: {
|
||||||
label: 'User',
|
label: 'User',
|
||||||
searchOnly: true,
|
searchOnly: true,
|
||||||
searchObject: 'users',
|
searchObject: 'user',
|
||||||
searchPlaceholder: 'Primary username',
|
searchPlaceholder: 'Primary username',
|
||||||
searchWidget: 2,
|
searchWidget: 2,
|
||||||
searchField: 'object1'
|
searchField: 'object1'
|
||||||
@@ -140,7 +139,7 @@ angular.module('StreamListDefinition', [])
|
|||||||
credential_search3: {
|
credential_search3: {
|
||||||
label: 'Credential',
|
label: 'Credential',
|
||||||
searchOnly: true,
|
searchOnly: true,
|
||||||
searchObject: 'credentials',
|
searchObject: 'credential',
|
||||||
searchPlaceholder: 'Related credential name',
|
searchPlaceholder: 'Related credential name',
|
||||||
searchWidget: 3,
|
searchWidget: 3,
|
||||||
searchField: 'object2'
|
searchField: 'object2'
|
||||||
@@ -148,7 +147,7 @@ angular.module('StreamListDefinition', [])
|
|||||||
group_search3: {
|
group_search3: {
|
||||||
label: 'Group',
|
label: 'Group',
|
||||||
searchOnly: true,
|
searchOnly: true,
|
||||||
searchObject: 'groups',
|
searchObject: 'group',
|
||||||
searchPlaceholder: 'Related group name',
|
searchPlaceholder: 'Related group name',
|
||||||
searchWidget: 3,
|
searchWidget: 3,
|
||||||
searchField: 'object2'
|
searchField: 'object2'
|
||||||
@@ -156,7 +155,7 @@ angular.module('StreamListDefinition', [])
|
|||||||
host_search3: {
|
host_search3: {
|
||||||
label: 'Host',
|
label: 'Host',
|
||||||
searchOnly: true,
|
searchOnly: true,
|
||||||
searchObject: 'hosts',
|
searchObject: 'host',
|
||||||
searchPlaceholder: 'Related host name',
|
searchPlaceholder: 'Related host name',
|
||||||
searchWidget: 3,
|
searchWidget: 3,
|
||||||
searchField: 'object2'
|
searchField: 'object2'
|
||||||
@@ -164,7 +163,7 @@ angular.module('StreamListDefinition', [])
|
|||||||
inventory_search3: {
|
inventory_search3: {
|
||||||
label: 'Inventory',
|
label: 'Inventory',
|
||||||
searchOnly: true,
|
searchOnly: true,
|
||||||
searchObject: 'inventories',
|
searchObject: 'inventory',
|
||||||
searchPlaceholder: 'Related inventory name',
|
searchPlaceholder: 'Related inventory name',
|
||||||
searchWidget: 3,
|
searchWidget: 3,
|
||||||
searchField: 'object2'
|
searchField: 'object2'
|
||||||
@@ -172,7 +171,7 @@ angular.module('StreamListDefinition', [])
|
|||||||
job_template_search3: {
|
job_template_search3: {
|
||||||
label: 'Job Template',
|
label: 'Job Template',
|
||||||
searchOnly: true,
|
searchOnly: true,
|
||||||
searchObject: 'job_templates',
|
searchObject: 'job_template',
|
||||||
searchPlaceholder: 'Related job template name',
|
searchPlaceholder: 'Related job template name',
|
||||||
searchWidget: 3,
|
searchWidget: 3,
|
||||||
searchField: 'object2'
|
searchField: 'object2'
|
||||||
@@ -180,7 +179,7 @@ angular.module('StreamListDefinition', [])
|
|||||||
organization_search3: {
|
organization_search3: {
|
||||||
label: 'Organization',
|
label: 'Organization',
|
||||||
searchOnly: true,
|
searchOnly: true,
|
||||||
searchObject: 'organizations',
|
searchObject: 'organization',
|
||||||
searchPlaceholder: 'Related organization name',
|
searchPlaceholder: 'Related organization name',
|
||||||
searchWidget: 3,
|
searchWidget: 3,
|
||||||
searchField: 'object2'
|
searchField: 'object2'
|
||||||
@@ -188,7 +187,7 @@ angular.module('StreamListDefinition', [])
|
|||||||
project_search3: {
|
project_search3: {
|
||||||
label: 'Project',
|
label: 'Project',
|
||||||
searchOnly: true,
|
searchOnly: true,
|
||||||
searchObject: 'projects',
|
searchObject: 'project',
|
||||||
searchPlaceholder: 'Related project name',
|
searchPlaceholder: 'Related project name',
|
||||||
searchWidget: 3,
|
searchWidget: 3,
|
||||||
searchField: 'object2'
|
searchField: 'object2'
|
||||||
@@ -196,7 +195,7 @@ angular.module('StreamListDefinition', [])
|
|||||||
user_search3: {
|
user_search3: {
|
||||||
label: 'User',
|
label: 'User',
|
||||||
searchOnly: true,
|
searchOnly: true,
|
||||||
searchObject: 'users',
|
searchObject: 'user',
|
||||||
searchPlaceholder: 'Related username',
|
searchPlaceholder: 'Related username',
|
||||||
searchWidget: 3,
|
searchWidget: 3,
|
||||||
searchField: 'object2'
|
searchField: 'object2'
|
||||||
|
|||||||
@@ -146,16 +146,20 @@ angular.module('StreamWidget', ['RestServices', 'Utilities', 'StreamListDefiniti
|
|||||||
}*/
|
}*/
|
||||||
descr += activity.operation;
|
descr += activity.operation;
|
||||||
descr += (/e$/.test(activity.operation)) ? 'd ' : 'ed ';
|
descr += (/e$/.test(activity.operation)) ? 'd ' : 'ed ';
|
||||||
if (activity.summary_fields.object2 && activity.summary_fields.object2.name) {
|
var obj1 = activity.object1;
|
||||||
descr += activity.summary_fields.object2.base + ' <a href=\"' + BuildUrl(activity.summary_fields.object2) + '\">'
|
var obj2 = activity.object2;
|
||||||
+ activity.summary_fields.object2.name + '</a>' + [ (activity.operation == 'disassociate') ? ' from ' : ' to '];
|
if (activity.summary_fields[obj2] && activity.summary_fields[obj2][0].name) {
|
||||||
|
activity.summary_fields[obj2][0].base = obj2;
|
||||||
|
descr += obj2 + ' <a href=\"' + BuildUrl(activity.summary_fields[obj2]) + '\">'
|
||||||
|
+ activity.summary_fields[obj2][0].name + '</a>' + ( (activity.operation == 'disassociate') ? ' from ' : ' to ' );
|
||||||
}
|
}
|
||||||
else if (activity.object2) {
|
else if (activity.object2) {
|
||||||
descr += activity.object2 + [ (activity.operation == 'disassociate') ? ' from ' : ' to '];
|
descr += activity.object2[0] + ( (activity.operation == 'disassociate') ? ' from ' : ' to ' );
|
||||||
}
|
}
|
||||||
if (activity.summary_fields.object1 && activity.summary_fields.object1.name) {
|
if (activity.summary_fields[obj1] && activity.summary_fields[obj1][0].name) {
|
||||||
descr += activity.summary_fields.object1.base + ' <a href=\"' + BuildUrl(activity.summary_fields.object1) + '\">'
|
activity.summary_fields[obj1][0].base = obj2;
|
||||||
+ activity.summary_fields.object1.name + '</a>';
|
descr += obj1 + ' <a href=\"' + BuildUrl(activity.summary_fields[obj1]) + '\">'
|
||||||
|
+ activity.summary_fields[obj1][0].name + '</a>';
|
||||||
}
|
}
|
||||||
else if (activity.object1) {
|
else if (activity.object1) {
|
||||||
descr += activity.object1;
|
descr += activity.object1;
|
||||||
@@ -222,8 +226,6 @@ angular.module('StreamWidget', ['RestServices', 'Utilities', 'StreamListDefiniti
|
|||||||
scope.formModalCancelShow = false;
|
scope.formModalCancelShow = false;
|
||||||
scope.formModalInfo = false;
|
scope.formModalInfo = false;
|
||||||
//scope.formModalHeader = results.summary_fields.project.name + '<span class="subtitle"> - SCM Status</span>';
|
//scope.formModalHeader = results.summary_fields.project.name + '<span class="subtitle"> - SCM Status</span>';
|
||||||
$('#form-modal .btn-success').removeClass('btn-success').addClass('btn-none');
|
|
||||||
$('#form-modal').addClass('skinny-modal');
|
|
||||||
if (!scope.$$phase) {
|
if (!scope.$$phase) {
|
||||||
scope.$digest();
|
scope.$digest();
|
||||||
}
|
}
|
||||||
@@ -311,40 +313,48 @@ angular.module('StreamWidget', ['RestServices', 'Utilities', 'StreamListDefiniti
|
|||||||
scope['activities'][i].timestamp = FormatDate(cDate);
|
scope['activities'][i].timestamp = FormatDate(cDate);
|
||||||
|
|
||||||
// Display username
|
// Display username
|
||||||
scope['activities'][i].user = (scope['activities'][i].summary_fields.user) ? scope['activities'][i].summary_fields.user.username :
|
/*scope['activities'][i].user = (scope['activities'][i].summary_fields.user) ? scope['activities'][i].summary_fields.user.username :
|
||||||
'system';
|
'system';
|
||||||
if (scope['activities'][i].user !== 'system') {
|
if (scope['activities'][i].user !== 'system') {
|
||||||
// turn user into a link when not 'system'
|
// turn user into a link when not 'system'
|
||||||
scope['activities'][i].user = "<a href=\"" + FixUrl(scope['activities'][i].related.user) + "\">" +
|
scope['activities'][i].user = "<a href=\"" + FixUrl(scope['activities'][i].related.user) + "\">" +
|
||||||
scope['activities'][i].user + "</a>";
|
scope['activities'][i].user + "</a>";
|
||||||
|
}*/
|
||||||
|
if (scope['activities'][i]['summary_fields']['actor']) {
|
||||||
|
scope['activities'][i]['user'] = scope['activities'][i]['summary_fields']['actor']['username'];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
scope['activities'][i]['user'] = 'system';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Objects
|
// Objects
|
||||||
var href;
|
var href;
|
||||||
var deleted = /^\_delete/;
|
var deleted = /^\_delete/;
|
||||||
if (scope['activities'][i].summary_fields.object1 && scope['activities'][i].summary_fields.object1.name) {
|
var obj1 = scope['activities'][i].object1;
|
||||||
if ( !deleted.test(scope['activities'][i].summary_fields.object1.name) ) {
|
var obj2 = scope['activities'][i].object2;
|
||||||
|
if ( obj1 && scope['activities'][i].summary_fields[obj1] && scope['activities'][i].summary_fields[obj1].name) {
|
||||||
|
if ( !deleted.test(scope['activities'][i].summary_fields[obj1].name) ) {
|
||||||
href = BuildUrl(scope['activities'][i].summary_fields.object1);
|
href = BuildUrl(scope['activities'][i].summary_fields.object1);
|
||||||
scope['activities'][i].objects = "<a href=\"" + href + "\">" + scope['activities'][i].summary_fields.object1.name + "</a>";
|
scope['activities'][i].objects = "<a href=\"" + href + "\">" + scope['activities'][i].summary_fields[obj1].name + "</a>";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
scope['activities'][i].objects = scope['activities'][i].summary_fields.object1.name;
|
scope['activities'][i].objects = scope['activities'][i].summary_fields[obj1].name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (scope['activities'][i].object1) {
|
else if (scope['activities'][i].object1) {
|
||||||
scope['activities'][i].objects = scope['activities'][i].object1;
|
scope['activities'][i].objects = scope['activities'][i].object1;
|
||||||
}
|
}
|
||||||
if (scope['activities'][i].summary_fields.object2 && scope['activities'][i].summary_fields.object2.name) {
|
if (obj2 && scope['activities'][i].summary_fields[obj2] && scope['activities'][i].summary_fields[obj2].name) {
|
||||||
if ( !deleted.test(scope['activities'][i].summary_fields.object2.name) ) {
|
if ( !deleted.test(scope['activities'][i].summary_fields.object2.name) ) {
|
||||||
href = BuildUrl(scope['activities'][i].summary_fields.object2);
|
href = BuildUrl(scope['activities'][i].summary_fields.object2);
|
||||||
scope['activities'][i].objects += ", <a href=\"" + href + "\">" + scope['activities'][i].summary_fields.object2.name + "</a>";
|
scope['activities'][i].objects += ", <a href=\"" + href + "\">" + scope['activities'][i].summary_fields[obj2].name + "</a>";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
scope['activities'][i].objects += "," + scope['activities'][i].summary_fields.object2.name;
|
scope['activities'][i].objects += "," + scope['activities'][i].summary_fields[obj2].name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (scope['activities'][i].object2) {
|
else if (scope['activities'][i].object2) {
|
||||||
scope['activities'][i].objects += ", " + scope['activities'][i].object1;
|
scope['activities'][i].objects += ", " + scope['activities'][i].object2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Description
|
// Description
|
||||||
|
|||||||
@@ -959,6 +959,7 @@ input[type="checkbox"].checkbox-no-label {
|
|||||||
|
|
||||||
.field-badge {
|
.field-badge {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
|
margin-right: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.license-warning,
|
.license-warning,
|
||||||
|
|||||||
@@ -289,7 +289,7 @@ angular.module('ListGenerator', ['GeneratorHelpers'])
|
|||||||
if (options.mode == 'select' || options.mode == 'lookup') {
|
if (options.mode == 'select' || options.mode == 'lookup') {
|
||||||
html += "<th>Select</th>";
|
html += "<th>Select</th>";
|
||||||
}
|
}
|
||||||
else if (options.mode == 'edit') {
|
else if (options.mode == 'edit' && list.fieldActions) {
|
||||||
html += "<th class=\"actions-column";
|
html += "<th class=\"actions-column";
|
||||||
html += (list.fieldActions && list.fieldActions.columnClass) ? " " + list.fieldActions.columnClass : "";
|
html += (list.fieldActions && list.fieldActions.columnClass) ? " " + list.fieldActions.columnClass : "";
|
||||||
html += "\">Actions</th>\n";
|
html += "\">Actions</th>\n";
|
||||||
|
|||||||
Reference in New Issue
Block a user