mirror of
https://github.com/ansible/awx.git
synced 2026-05-09 10:27:37 -02:30
remove has-ansi dependency
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
import Ansi from 'ansi-to-html';
|
import Ansi from 'ansi-to-html';
|
||||||
import hasAnsi from 'has-ansi';
|
|
||||||
import Entities from 'html-entities';
|
import Entities from 'html-entities';
|
||||||
|
|
||||||
const ELEMENT_TBODY = '#atStdoutResultTable';
|
const ELEMENT_TBODY = '#atStdoutResultTable';
|
||||||
@@ -21,6 +20,15 @@ const TIME_EVENTS = [
|
|||||||
const ansi = new Ansi();
|
const ansi = new Ansi();
|
||||||
const entities = new Entities.AllHtmlEntities();
|
const entities = new Entities.AllHtmlEntities();
|
||||||
|
|
||||||
|
// https://github.com/chalk/ansi-regex
|
||||||
|
const pattern = [
|
||||||
|
'[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\\u0007)',
|
||||||
|
'(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))'
|
||||||
|
].join('|');
|
||||||
|
|
||||||
|
const re = new RegExp(pattern);
|
||||||
|
const hasAnsi = input => re.test(input);
|
||||||
|
|
||||||
function JobRenderService ($q, $sce, $window) {
|
function JobRenderService ($q, $sce, $window) {
|
||||||
this.init = ({ compile, apply, isStreamActive }) => {
|
this.init = ({ compile, apply, isStreamActive }) => {
|
||||||
this.parent = null;
|
this.parent = null;
|
||||||
|
|||||||
@@ -114,7 +114,6 @@
|
|||||||
"codemirror": "^5.17.0",
|
"codemirror": "^5.17.0",
|
||||||
"components-font-awesome": "^4.6.1",
|
"components-font-awesome": "^4.6.1",
|
||||||
"d3": "~3.3.13",
|
"d3": "~3.3.13",
|
||||||
"has-ansi": "^3.0.0",
|
|
||||||
"html-entities": "^1.2.1",
|
"html-entities": "^1.2.1",
|
||||||
"javascript-detect-element-resize": "^0.5.3",
|
"javascript-detect-element-resize": "^0.5.3",
|
||||||
"jquery": "~2.2.4",
|
"jquery": "~2.2.4",
|
||||||
|
|||||||
Reference in New Issue
Block a user