Files
weave-scope/client/app/scripts/components/node-details/node-details-info.js
Paul Bellamy 7632e0b3c5 Adding support for plugins, with basic example of iowait, and ebpf
Squash of:
* Include plugins in the report
* show plugin list in the UI
* moving metric and metadata templates into the probe reports
* update js for prime -> priority
* added retry to plugin handshake
* added iowait plugin
* review feedback
* plugin documentation
2016-04-12 17:22:14 +01:00

45 lines
1.3 KiB
JavaScript

import React from 'react';
import ShowMore from '../show-more';
export default class NodeDetailsInfo extends React.Component {
constructor(props, context) {
super(props, context);
this.state = {
expanded: false
};
this.handleClickMore = this.handleClickMore.bind(this);
}
handleClickMore() {
const expanded = !this.state.expanded;
this.setState({expanded});
}
render() {
let rows = (this.props.rows || []);
const prime = rows.filter(row => row.priority < 10);
let notShown = 0;
if (!this.state.expanded && prime.length < rows.length) {
notShown = rows.length - prime.length;
rows = prime;
}
return (
<div className="node-details-info">
{rows.map(field => (<div className="node-details-info-field" key={field.id}>
<div className="node-details-info-field-label truncate" title={field.label}>
{field.label}
</div>
<div className="node-details-info-field-value truncate" title={field.value}>
{field.value}
</div>
</div>
))}
<ShowMore handleClick={this.handleClickMore} collection={this.props.rows}
expanded={this.state.expanded} notShown={notShown} />
</div>
);
}
}