<commit_before>var blessed = require('blessed')
    , contrib = require('blessed-contrib')
    , screen = blessed.screen();


var grid = new contrib.grid({rows: 6, cols: 2, screen: screen});

var queueTable = grid.set(0,0,2,1, contrib.table, {
    keys: true,
    fg: 'white',
    selectedFg: 'white',
    selectedBg: 'blue',
    interactive: true,
    label: 'Build Queue',
    width: '30%',
    height: '30%',
    border: {type: "line", fg: "cyan"},
    columnSpacing: 5, //in chars
    columnWidth: [25, 18] /*in chars*/ });

var activeTable = grid.set(2,0,1,1, contrib.table, {
    keys: true,
    fg: 'white',
    selectedFg: 'white',
    selectedBg: 'blue',
    interactive: true,
    label: 'Active Builds',
    width: '30%',
    height: '30%',
    border: {type: "line", fg: "cyan"},
    columnSpacing: 5, //in chars
    columnWidth: [25, 18] /*in chars*/ });

var finishedTable = grid.set(3,0,3,1, contrib.table, {
    keys: true,
    fg: 'white',
    selectedFg: 'white',
    selectedBg: 'blue',
    interactive: true,
    label: 'Finished Builds',
    width: '30%',
    height: '30%',
    border: {type: "line", fg: "cyan"},
    columnSpacing: 5, //in chars
    columnWidth: [25, 18] /*in chars*/ });


//allow control the table with the keyboard
//queueTable.focus();

setInterval(updateQueueList, 1000);
setInterval(updateActiveList, 1000);
setInterval(updateFinishedList, 1000);


screen.key(['escape', 'q', 'C-c'], function (ch, key) {
    return process.exit(0);
});

screen.render();

function updateQueueList() {
    var request = require('request');
    request('http://localhost:64322/build/queue', function (error, response, body) {
        if (!error && response.statusCode == 200) {
            updateQueueData(JSON.parse(body));
        }
    })
}

function updateQueueData(queue) {
    queueTable.setData({
        headers: ['repo', 'id'],
        data: queue.map(function(item){return [item.repo, item.id]})}
    );
    screen.render();
}


function updateActiveList() {
    var request = require('request');
    request('http://localhost:64322/build/active', function (error, response, body) {
        if (!error && response.statusCode == 200) {
            updateActiveData(JSON.parse(body));
        }
    })
}

function updateActiveData(queue) {
    activeTable.setData({
            headers: ['repo', 'id'],
            data: queue.map(function(item){return [item.repo, item.id]})}
    );
    screen.render();
}

function updateFinishedList() {
    var request = require('request');
    request('http://localhost:64322/build/finished', function (error, response, body) {
        if (!error && response.statusCode == 200) {
            updateFinishedData(JSON.parse(body));
        }
    })
}<commit_msg>updated console to point to herokuapp<commit_after>var blessed = require('blessed')
    , contrib = require('blessed-contrib')
    , screen = blessed.screen();


var grid = new contrib.grid({rows: 6, cols: 2, screen: screen});

var queueTable = grid.set(0,0,2,1, contrib.table, {
    keys: true,
    fg: 'white',
    selectedFg: 'white',
    selectedBg: 'blue',
    interactive: true,
    label: 'Build Queue',
    width: '30%',
    height: '30%',
    border: {type: "line", fg: "cyan"},
    columnSpacing: 5, //in chars
    columnWidth: [25, 18] /*in chars*/ });

var activeTable = grid.set(2,0,1,1, contrib.table, {
    keys: true,
    fg: 'white',
    selectedFg: 'white',
    selectedBg: 'blue',
    interactive: true,
    label: 'Active Builds',
    width: '30%',
    height: '30%',
    border: {type: "line", fg: "cyan"},
    columnSpacing: 5, //in chars
    columnWidth: [25, 18] /*in chars*/ });

var finishedTable = grid.set(3,0,3,1, contrib.table, {
    keys: true,
    fg: 'white',
    selectedFg: 'white',
    selectedBg: 'blue',
    interactive: true,
    label: 'Finished Builds',
    width: '30%',
    height: '30%',
    border: {type: "line", fg: "cyan"},
    columnSpacing: 5, //in chars
    columnWidth: [25, 18] /*in chars*/ });


//allow control the table with the keyboard
//queueTable.focus();

setInterval(updateQueueList, 3000);
setInterval(updateActiveList, 3000);
setInterval(updateFinishedList, 3000);


screen.key(['escape', 'q', 'C-c'], function (ch, key) {
    return process.exit(0);
});

screen.render();

function updateQueueList() {
    var request = require('request');
    request('http://leanci.herokuapp.com/build/queue', function (error, response, body) {
        if (!error && response.statusCode == 200) {
            updateQueueData(JSON.parse(body));
        }
    })
}

function updateQueueData(queue) {
    queueTable.setData({
        headers: ['repo', 'id'],
        data: queue.map(function(item){return [item.repo, item.id]})}
    );
    screen.render();
}


function updateActiveList() {
    var request = require('request');
    request('http://leanci.herokuapp.com/build/active', function (error, response, body) {
        if (!error && response.statusCode == 200) {
            updateActiveData(JSON.parse(body));
        }
    })
}

function updateActiveData(queue) {
    activeTable.setData({
            headers: ['repo', 'id'],
            data: queue.map(function(item){return [item.repo, item.id]})}
    );
    screen.render();
}

function updateFinishedList() {
    var request = require('request');
    request('http://leanci.herokuapp.com/build/finished', function (error, response, body) {
        if (!error && response.statusCode == 200) {
            updateFinishedData(JSON.parse(body));
        }
    })
}
{'fraction_non_alphanumeric': 0.1752315235155257, 'fraction_numerical': 0.02560377701107681, 'mean_word_length': 3.116591928251121, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6237485', 'n_tokens_mistral': 1920, 'n_tokens_neox': 1795, 'n_words': 427}