mirror of
https://github.com/ansible/awx.git
synced 2026-03-01 00:38:45 -03:30
Merge pull request #4313 from ryanpetrello/fix-4162
Remove tooltips from host events in output Reviewed-by: https://github.com/softwarefactory-project-zuul[bot]
This commit is contained in:
@@ -17,15 +17,12 @@ function OutputStrings (BaseString) {
|
|||||||
ARTIFACTS: t.s('Read-only view of artifacts added to the job template'),
|
ARTIFACTS: t.s('Read-only view of artifacts added to the job template'),
|
||||||
CANCEL: t.s('Cancel'),
|
CANCEL: t.s('Cancel'),
|
||||||
COLLAPSE_OUTPUT: t.s('Collapse Output'),
|
COLLAPSE_OUTPUT: t.s('Collapse Output'),
|
||||||
CREDENTIAL: t.s('View the Credential'),
|
|
||||||
DETAILS: t.s('Click for details'),
|
|
||||||
DELETE: t.s('Delete'),
|
DELETE: t.s('Delete'),
|
||||||
DOWNLOAD_OUTPUT: t.s('Download Output'),
|
DOWNLOAD_OUTPUT: t.s('Download Output'),
|
||||||
EVENT_ID: t.s('Event ID:'),
|
CREDENTIAL: t.s('View the Credential'),
|
||||||
EXPAND_OUTPUT: t.s('Expand Output'),
|
EXPAND_OUTPUT: t.s('Expand Output'),
|
||||||
EXTRA_VARS: t.s('Read-only view of extra variables added to the job template'),
|
EXTRA_VARS: t.s('Read-only view of extra variables added to the job template'),
|
||||||
HOST_LIMIT: t.s('When this field is true, the job\'s inventory belongs to an organization that has exceeded it\'s limit of hosts as defined by the system administrator.'),
|
HOST_LIMIT: t.s('When this field is true, the job\'s inventory belongs to an organization that has exceeded it\'s limit of hosts as defined by the system administrator.'),
|
||||||
HOST_STATUS: t.s('Status:'),
|
|
||||||
INVENTORY: t.s('View the Inventory'),
|
INVENTORY: t.s('View the Inventory'),
|
||||||
INVENTORY_SCM: t.s('View the Project'),
|
INVENTORY_SCM: t.s('View the Project'),
|
||||||
INVENTORY_SCM_JOB: t.s('View Project checkout results'),
|
INVENTORY_SCM_JOB: t.s('View Project checkout results'),
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ const hasAnsi = input => re.test(input);
|
|||||||
|
|
||||||
let $scope;
|
let $scope;
|
||||||
|
|
||||||
function JobRenderService ($q, $compile, $sce, $window, strings) {
|
function JobRenderService ($q, $compile, $sce, $window) {
|
||||||
this.init = (_$scope_, { toggles }) => {
|
this.init = (_$scope_, { toggles }) => {
|
||||||
$scope = _$scope_;
|
$scope = _$scope_;
|
||||||
this.setScope();
|
this.setScope();
|
||||||
@@ -132,7 +132,7 @@ function JobRenderService ($q, $compile, $sce, $window, strings) {
|
|||||||
return { html: '', count: 0 };
|
return { html: '', count: 0 };
|
||||||
}
|
}
|
||||||
|
|
||||||
const html = this.buildRowHTML(this.records[uuid], null, null, event);
|
const html = this.buildRowHTML(this.records[uuid]);
|
||||||
const count = 1;
|
const count = 1;
|
||||||
|
|
||||||
return { html, count };
|
return { html, count };
|
||||||
@@ -193,7 +193,7 @@ function JobRenderService ($q, $compile, $sce, $window, strings) {
|
|||||||
return { html: '', count: 0 };
|
return { html: '', count: 0 };
|
||||||
}
|
}
|
||||||
|
|
||||||
const html = this.buildRowHTML(this.records[uuid], null, null, event);
|
const html = this.buildRowHTML(this.records[uuid]);
|
||||||
const count = 1;
|
const count = 1;
|
||||||
|
|
||||||
return { html, count };
|
return { html, count };
|
||||||
@@ -226,10 +226,10 @@ function JobRenderService ($q, $compile, $sce, $window, strings) {
|
|||||||
const line = lines[i];
|
const line = lines[i];
|
||||||
const isLastLine = i === lines.length - 1;
|
const isLastLine = i === lines.length - 1;
|
||||||
|
|
||||||
let row = this.buildRowHTML(record, ln, line, event);
|
let row = this.buildRowHTML(record, ln, line);
|
||||||
|
|
||||||
if (record && record.isTruncated && isLastLine) {
|
if (record && record.isTruncated && isLastLine) {
|
||||||
row += this.buildRowHTML(record, null, null, event);
|
row += this.buildRowHTML(record);
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -350,14 +350,14 @@ function JobRenderService ($q, $compile, $sce, $window, strings) {
|
|||||||
return list;
|
return list;
|
||||||
};
|
};
|
||||||
|
|
||||||
this.buildRowHTML = (record, ln, content, event) => {
|
this.buildRowHTML = (record, ln, content) => {
|
||||||
let id = '';
|
let id = '';
|
||||||
let icon = '';
|
let icon = '';
|
||||||
let timestamp = '';
|
let timestamp = '';
|
||||||
let tdToggle = '';
|
let tdToggle = '';
|
||||||
let tdEvent = '';
|
let tdEvent = '';
|
||||||
let classList = '';
|
let classList = '';
|
||||||
let directives = `aw-tool-tip="${this.createToolTip(event, record)}" aw-tip-placement="top"`;
|
let directives = '';
|
||||||
|
|
||||||
if (record.isMissing) {
|
if (record.isMissing) {
|
||||||
return `<div id="${record.uuid}" class="at-Stdout-row">
|
return `<div id="${record.uuid}" class="at-Stdout-row">
|
||||||
@@ -413,9 +413,9 @@ function JobRenderService ($q, $compile, $sce, $window, strings) {
|
|||||||
|
|
||||||
if (record && record.isClickable) {
|
if (record && record.isClickable) {
|
||||||
classList += ' at-Stdout-row--clickable';
|
classList += ' at-Stdout-row--clickable';
|
||||||
directives += ` ng-click="vm.showHostDetails('${record.id}', '${record.uuid}')"
|
directives = `ng-click="vm.showHostDetails('${record.id}', '${record.uuid}')"`;
|
||||||
`;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return `
|
return `
|
||||||
<div id="${id}" class="at-Stdout-row ${classList}" ${directives}>
|
<div id="${id}" class="at-Stdout-row ${classList}" ${directives}>
|
||||||
${tdToggle}
|
${tdToggle}
|
||||||
@@ -426,16 +426,6 @@ function JobRenderService ($q, $compile, $sce, $window, strings) {
|
|||||||
`;
|
`;
|
||||||
};
|
};
|
||||||
|
|
||||||
this.createToolTip = (event, record) => {
|
|
||||||
const status = strings.get('tooltips.HOST_STATUS');
|
|
||||||
const eventID = strings.get('tooltips.EVENT_ID');
|
|
||||||
const clickForDetails = strings.get('tooltips.DETAILS');
|
|
||||||
|
|
||||||
return record.isClickable
|
|
||||||
? `${status} ${event.event_display}<br />${eventID} ${event.id}<br />${clickForDetails}`
|
|
||||||
: `${status} ${event.event_display}<br />${eventID} ${event.id}`;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getTimestamp = created => {
|
this.getTimestamp = created => {
|
||||||
const date = new Date(created);
|
const date = new Date(created);
|
||||||
const hour = date.getHours() < 10 ? `0${date.getHours()}` : date.getHours();
|
const hour = date.getHours() < 10 ? `0${date.getHours()}` : date.getHours();
|
||||||
@@ -629,6 +619,6 @@ function JobRenderService ($q, $compile, $sce, $window, strings) {
|
|||||||
this.getCapacity = () => OUTPUT_EVENT_LIMIT - (this.getTailCounter() - this.getHeadCounter());
|
this.getCapacity = () => OUTPUT_EVENT_LIMIT - (this.getTailCounter() - this.getHeadCounter());
|
||||||
}
|
}
|
||||||
|
|
||||||
JobRenderService.$inject = ['$q', '$compile', '$sce', '$window', 'OutputStrings'];
|
JobRenderService.$inject = ['$q', '$compile', '$sce', '$window'];
|
||||||
|
|
||||||
export default JobRenderService;
|
export default JobRenderService;
|
||||||
|
|||||||
Reference in New Issue
Block a user