get lines()

in src/components/application/details/controls/logs/details-log.js [79:114]


  get lines() {
    const {
      ansiUp,
      stdout,
      stderr,
      predefinedLogs,
    } = this.props;
    let lines = [
      predefinedLogs.length > 0 ? 'EXECUTION EVENTS:' : false,
      ...predefinedLogs,
    ].filter(Boolean);
    if (stdout?.loaded && (stdout.value || []).length > 0) {
      lines = [
        ...lines,
        'STDOUT LOG:',
        ...stdout.value,
      ];
    }
    if (stderr?.loaded && (stderr.value || []).length > 0) {
      lines = [
        ...lines,
        'STDERR LOG:',
        ...stderr.value,
      ];
    }
    if (lines.length === 0) {
      lines = ['No data'];
    }
    return lines.map((line, index) => ({
      error: hightlight.isError(line),
      lineIndex: index,
      log: line,
      logText: ansiUp.ansi_to_text(line),
      warning: hightlight.isWarning(line),
    }));
  }