'use strict';

let blessed = require('blessed');
let _ = require('lodash');
let config = require('../../config/config');


module.exports = function () {
    let hostDetailsPanel = blessed.list({
        top: 5,
        bottom: 5,
        left: '30%',
        tags: true,
        border: {type: 'line'},
        keys: true,
        scrollable: true,
        style: config.styles.main
    });

    hostDetailsPanel.updateItems = function (host) {
        let items = [];
        _.forEach(host, function (val, key) {
            if (_.isArray(val)) val = val.join(', ');
            let content = '{bold}' + key + '{/bold} : ' + val + '\n';
            items.push(content);
        });
        this.setItems(items);
    };

    return hostDetailsPanel;
};

'use strict';

let blessed = require('blessed');
let _ = require('lodash');
let config = require('../../config/config');


module.exports = function () {
    let hostDetailsPanel = blessed.list({
        top: 5,
        bottom: 5,
        left: '30%',
        tags: true,
        border: {type: 'line'},
        keys: true,
        scrollable: true,
        style: config.styles.main
    });

    hostDetailsPanel.updateItems = function (host) {
        let items = [];
        _.forEach(host, function (val, key) {
            if (_.isArray(val)) val = val.join(', ');
            key = key[0].toUpperCase() + key.slice(1);
            let content = '{bold}' + key + '{/bold} : ' + val + '\n';
            items.push(content);
        });
        this.setItems(items);
    };

    return hostDetailsPanel;
};

Fix keys case into details panel
Fix keys case into details panel
