<commit_before>import React, { PropTypes } from 'react';
import UITable from '../common/table/UITable';
import Column from '../common/table/Column';
import { Glyphicon } from 'react-bootstrap';
import Utils from '../../utils';

function getStatusTextColor(driverStatus) {
  switch (driverStatus) {
    case 'SUBSCRIBED': return 'color-success';
    case 'NOT_STARTED': return 'text-muted';
    default: return '';
  }
}

function HostStates(props) {
  return (
    <div>
      <h2>Singularity scheduler instances</h2>
      <UITable
        data={props.hosts || []}
        paginated={true}
        rowChunkSize={100}
        keyGetter={(host) => host.hostname}
      >
        <Column
          label="Hostname"
          id="hostname"
          key="hostname"
          cellData={(host) => host.hostname}
          sortable={true}
        />
        <Column
          label="Scheduler Client Status"
          id="driverStatus"
          key="driverStatus"
          cellData={(host) => host.driverStatus}
          className={(driverStatus) => getStatusTextColor(driverStatus)}
          cellRender={(driverStatus) => Utils.humanizeText(driverStatus)}
          sortable={true}
        />
        <Column
          label="Connected"
          id="mesosConnected"
          key="mesosConnected"
          cellData={(host) => host.driverStatus === 'SUBSCRIBED' && host.mesosConnected}
          cellRender={(mesosConnected) => (
            <Glyphicon
              className={mesosConnected ? 'color-success' : 'color-error'}
              glyph={mesosConnected ? 'ok' : 'remove'}
            />
          )}
          sortable={true}
        />
        <Column
          label="Uptime"
          id="uptime"
          key="uptime"<commit_msg>Add zk leader indicator on status ui<commit_after>import React, { PropTypes } from 'react';
import UITable from '../common/table/UITable';
import Column from '../common/table/Column';
import { Glyphicon } from 'react-bootstrap';
import Utils from '../../utils';

function getStatusTextColor(driverStatus) {
  switch (driverStatus) {
    case 'SUBSCRIBED': return 'color-success';
    case 'NOT_STARTED': return 'text-muted';
    default: return '';
  }
}

function HostStates(props) {
  return (
    <div>
      <h2>Singularity scheduler instances</h2>
      <UITable
        data={props.hosts || []}
        paginated={true}
        rowChunkSize={100}
        keyGetter={(host) => host.hostname}
      >
        <Column
          label="Hostname"
          id="hostname"
          key="hostname"
          cellData={(host) => host.hostname}
          sortable={true}
        />
        <Column
          label="Leader"
          id="leader"
          key="leader"
          cellData={(host) => host.master}
          cellRender={(master) => (
            <Glyphicon
              className={master ? 'color-success' : 'color-error'}
              glyph={master ? 'ok' : 'remove'}
            />
          )}
          sortable={true}
        />
        <Column
          label="Scheduler Client Status"
          id="driverStatus"
          key="driverStatus"
          cellData={(host) => host.driverStatus}
          className={(driverStatus) => getStatusTextColor(driverStatus)}
          cellRender={(driverStatus) => Utils.humanizeText(driverStatus)}
          sortable={true}
        />
        <Column
          label="Connected"
          id="mesosConnected"
          key="mesosConnected"
          cellData={(host) => host.driverStatus === 'SUBSCRIBED' && host.mesosConnected}
          cellRender={(mesosConnected) => (
            <Glyphicon
              className={mesosConnected ? 'color-success' : 'color-error'}
              glyph={mesosConnected ? 'ok' : 'remove'}
            />
          )}
          sortable={true}
        />
        <Column
          label="Uptime"
          id="uptime"
          key="uptime"
{'fraction_non_alphanumeric': 0.13737113402061857, 'fraction_numerical': 0.002577319587628866, 'mean_word_length': 2.0155400155400156, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1079715', 'n_tokens_mistral': 1116, 'n_tokens_neox': 1109, 'n_words': 198}