add tabs for the processes

This commit is contained in:
Jonathan Rainville 2018-08-01 14:30:47 -04:00 committed by Pascal Precht
parent fdbc567b3b
commit d6977507b6
No known key found for this signature in database
GPG Key ID: 0EE28D8D6FD85D7D
2 changed files with 8 additions and 2 deletions

View File

@ -1,6 +1,7 @@
import React, {Component} from 'react';
import {connect} from 'react-redux';
import {fetchProcesses} from '../actions';
import {Tabs, Tab} from 'tabler-react';
import PropTypes from 'prop-types';
class ProcessesContainer extends Component {
@ -26,8 +27,13 @@ class ProcessesContainer extends Component {
);
}
const processNames = Object.keys(processes.data);
return (
<p>Loaded</p>
<Tabs initialTab={processNames[0]}>
{processNames.map(processName => {
return (<Tab key={processName} title={processName}>State: {processes.data[processName].state}</Tab>);
})}
</Tabs>
);
}
}

View File

@ -20,7 +20,7 @@ class ProcessManager {
let parsedProcesses = {};
Object.keys(self.processes).forEach(processName => {
parsedProcesses[processName] = {
state: self.processes[processName]
state: self.processes[processName].state
};
});
res.send(parsedProcesses);