add basic colormap for output lines

This commit is contained in:
Jake McDermott 2018-08-29 13:20:28 -04:00
parent a549bea815
commit cddceb0e06
No known key found for this signature in database
GPG Key ID: 9A6F084352C3A0B7
2 changed files with 20 additions and 1 deletions

View File

@ -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_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_TBODY = '#atStdoutResultTable';
export const OUTPUT_ELEMENT_LAST = '#atStdoutMenuLast';

View File

@ -5,6 +5,7 @@ import {
EVENT_START_PLAY,
EVENT_STATS_PLAY,
EVENT_START_TASK,
OUTPUT_ANSI_COLORMAP,
OUTPUT_ELEMENT_TBODY,
OUTPUT_EVENT_LIMIT,
} from './constants';
@ -20,7 +21,7 @@ const TIME_EVENTS = [
EVENT_STATS_PLAY,
];
const ansi = new Ansi();
const ansi = new Ansi({ stream: true, colors: OUTPUT_ANSI_COLORMAP });
const entities = new Entities.AllHtmlEntities();
// https://github.com/chalk/ansi-regex