mirror of
https://github.com/ansible/awx.git
synced 2026-03-13 23:17:32 -02:30
Added tooltips for jobs page name columns
This commit is contained in:
@@ -505,8 +505,11 @@ angular.module('SchedulesHelper', [ 'Utilities', 'RestServices', 'SchedulesHelpe
|
||||
list = params.list,
|
||||
choices = params.choices;
|
||||
scope[list.name].forEach(function(item, item_idx) {
|
||||
var fld, field,
|
||||
itm = scope[list.name][item_idx];
|
||||
var fld,
|
||||
field,
|
||||
itm = scope[list.name][item_idx],
|
||||
job = item.summary_fields.unified_job_template;
|
||||
|
||||
itm.enabled = (itm.enabled) ? true : false;
|
||||
if (itm.enabled) {
|
||||
itm.play_tip = 'Schedule is active. Click to stop.';
|
||||
@@ -518,7 +521,17 @@ angular.module('SchedulesHelper', [ 'Utilities', 'RestServices', 'SchedulesHelpe
|
||||
itm.status = 'stopped';
|
||||
itm.status_tip = 'Schedule is stopped. Click to activate.';
|
||||
}
|
||||
itm.nameTip = item.name + " schedule. Click to edit.";
|
||||
itm.nameTip = item.name;
|
||||
// include the word schedule if the schedule name does not include the word schedule
|
||||
if (item.name.indexOf("schedule") == -1 && item.name.indexOf("Schedule") == -1) {
|
||||
itm.nameTip += " schedule";
|
||||
}
|
||||
itm.nameTip += " for "
|
||||
if (job.name.indexOf("job") == -1 && job.name.indexOf("Job") == -1) {
|
||||
itm.nameTip += "job ";
|
||||
}
|
||||
itm.nameTip += job.name;
|
||||
itm.nameTip += ". Click to edit schedule.";
|
||||
// Copy summary_field values
|
||||
for (field in list.fields) {
|
||||
fld = list.fields[field];
|
||||
|
||||
@@ -69,7 +69,8 @@ angular.module('CompletedJobsDefinition', [])
|
||||
label: 'Name',
|
||||
columnClass: 'col-md-3 col-sm-4 col-xs-4',
|
||||
ngClick: "viewJobLog(completed_job.id, completed_job.nameHref)",
|
||||
defaultSearchField: true
|
||||
defaultSearchField: true,
|
||||
awToolTipEllipses: "{{ completed_job.name }}"
|
||||
},
|
||||
failed: {
|
||||
label: 'Job failed?',
|
||||
|
||||
@@ -61,7 +61,8 @@ angular.module('QueuedJobsDefinition', [])
|
||||
label: 'Name',
|
||||
columnClass: 'col-md-3 col-sm-4 col-xs-4',
|
||||
ngClick: "viewJobLog(queued_job.id, queued_job.nameHref)",
|
||||
defaultSearchField: true
|
||||
defaultSearchField: true,
|
||||
awToolTipEllipses: "{{ queued_job.name }}"
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -62,7 +62,8 @@ angular.module('RunningJobsDefinition', [])
|
||||
label: 'Name',
|
||||
columnClass: 'col-md-3 col-sm-4 col-xs-4',
|
||||
ngClick: "viewJobLog(running_job.id, running_job.nameHref)",
|
||||
defaultSearchField: true
|
||||
defaultSearchField: true,
|
||||
awToolTipEllipses: "{{ running_job.name }}"
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -435,6 +435,45 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'AuthService', 'Job
|
||||
};
|
||||
})
|
||||
|
||||
/*
|
||||
* This is a copy of awToolTip currently.
|
||||
* TODO: only display these tool tips if the length of the anchor *as interpolated* to be larger than the table cell
|
||||
*/
|
||||
.directive('awToolTipEllipses', [ function() {
|
||||
return {
|
||||
link: function(scope, element, attrs) {
|
||||
|
||||
var delay = (attrs.delay !== undefined && attrs.delay !== null) ? attrs.delay : ($AnsibleConfig) ? $AnsibleConfig.tooltip_delay : {show: 500, hide: 100},
|
||||
placement;
|
||||
|
||||
if (attrs.awTipPlacement) {
|
||||
placement = attrs.awTipPlacement;
|
||||
}
|
||||
else {
|
||||
placement = (attrs.placement !== undefined && attrs.placement !== null) ? attrs.placement : 'left';
|
||||
}
|
||||
|
||||
$(element).on('hidden.bs.tooltip', function( ) {
|
||||
// TB3RC1 is leaving behind tooltip <div> elements. This will remove them
|
||||
// after a tooltip fades away. If not, they lay overtop of other elements and
|
||||
// honk up the page.
|
||||
$('.tooltip').each(function() {
|
||||
$(this).remove();
|
||||
});
|
||||
});
|
||||
|
||||
$(element).tooltip({
|
||||
placement: placement,
|
||||
delay: delay,
|
||||
html: true,
|
||||
title: attrs.awToolTipEllipses,
|
||||
container: 'body',
|
||||
trigger: 'hover focus'
|
||||
});
|
||||
}
|
||||
}
|
||||
}])
|
||||
|
||||
/*
|
||||
* Enable TB pop-overs. To add a pop-over to an element, include the following directive in
|
||||
* the element's attributes:
|
||||
|
||||
@@ -504,6 +504,12 @@ angular.module('GeneratorHelpers', [])
|
||||
html += (field.dataTipWatch) ? Attr(field, 'dataTipWatch') : "";
|
||||
html += (field.awTipPlacement) ? Attr(field, 'awTipPlacement') : "";
|
||||
}
|
||||
if (field.awToolTipEllipses) {
|
||||
html += Attr(field, 'awToolTipEllipses');
|
||||
html += (field.dataPlacement && !field.awPopOver) ? Attr(field, 'dataPlacement') : "";
|
||||
html += (field.dataTipWatch) ? Attr(field, 'dataTipWatch') : "";
|
||||
html += (field.awTipPlacement) ? Attr(field, 'awTipPlacement') : "";
|
||||
}
|
||||
if (field.awPopOver) {
|
||||
html += "aw-pop-over=\"" + field.awPopOver + "\" ";
|
||||
html += (field.dataPlacement) ? "data-placement=\"" + field.dataPlacement + "\" " : "";
|
||||
|
||||
Reference in New Issue
Block a user