mirror of
https://github.com/ansible/awx.git
synced 2026-03-01 08:48:46 -03:30
add basic colormap for output lines
This commit is contained in:
@@ -13,6 +13,24 @@ export const JOB_STATUS_INCOMPLETE = ['canceled', 'error'];
|
|||||||
export const JOB_STATUS_UNSUCCESSFUL = ['failed'].concat(JOB_STATUS_INCOMPLETE);
|
export const JOB_STATUS_UNSUCCESSFUL = ['failed'].concat(JOB_STATUS_INCOMPLETE);
|
||||||
export const JOB_STATUS_FINISHED = JOB_STATUS_COMPLETE.concat(JOB_STATUS_INCOMPLETE);
|
export const JOB_STATUS_FINISHED = JOB_STATUS_COMPLETE.concat(JOB_STATUS_INCOMPLETE);
|
||||||
|
|
||||||
|
export const OUTPUT_ANSI_COLORMAP = {
|
||||||
|
0: '#000',
|
||||||
|
1: '#A00',
|
||||||
|
2: '#0A0',
|
||||||
|
3: '#F0AD4E',
|
||||||
|
4: '#00A',
|
||||||
|
5: '#A0A',
|
||||||
|
6: '#0AA',
|
||||||
|
7: '#AAA',
|
||||||
|
8: '#555',
|
||||||
|
9: '#F55',
|
||||||
|
10: '#5F5',
|
||||||
|
11: '#FF5',
|
||||||
|
12: '#55F',
|
||||||
|
13: '#F5F',
|
||||||
|
14: '#5FF',
|
||||||
|
15: '#FFF'
|
||||||
|
};
|
||||||
export const OUTPUT_ELEMENT_CONTAINER = '.at-Stdout-container';
|
export const OUTPUT_ELEMENT_CONTAINER = '.at-Stdout-container';
|
||||||
export const OUTPUT_ELEMENT_TBODY = '#atStdoutResultTable';
|
export const OUTPUT_ELEMENT_TBODY = '#atStdoutResultTable';
|
||||||
export const OUTPUT_ELEMENT_LAST = '#atStdoutMenuLast';
|
export const OUTPUT_ELEMENT_LAST = '#atStdoutMenuLast';
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import {
|
|||||||
EVENT_START_PLAY,
|
EVENT_START_PLAY,
|
||||||
EVENT_STATS_PLAY,
|
EVENT_STATS_PLAY,
|
||||||
EVENT_START_TASK,
|
EVENT_START_TASK,
|
||||||
|
OUTPUT_ANSI_COLORMAP,
|
||||||
OUTPUT_ELEMENT_TBODY,
|
OUTPUT_ELEMENT_TBODY,
|
||||||
OUTPUT_EVENT_LIMIT,
|
OUTPUT_EVENT_LIMIT,
|
||||||
} from './constants';
|
} from './constants';
|
||||||
@@ -20,7 +21,7 @@ const TIME_EVENTS = [
|
|||||||
EVENT_STATS_PLAY,
|
EVENT_STATS_PLAY,
|
||||||
];
|
];
|
||||||
|
|
||||||
const ansi = new Ansi();
|
const ansi = new Ansi({ stream: true, colors: OUTPUT_ANSI_COLORMAP });
|
||||||
const entities = new Entities.AllHtmlEntities();
|
const entities = new Entities.AllHtmlEntities();
|
||||||
|
|
||||||
// https://github.com/chalk/ansi-regex
|
// https://github.com/chalk/ansi-regex
|
||||||
|
|||||||
Reference in New Issue
Block a user