| 1 |
/* |
| 2 |
* Copyright (C) 2020 Red Hat, Inc. |
| 3 |
* SPDX-License-Identifier: LGPL-2.1-or-later |
| 4 |
*/ |
| 5 |
|
| 6 |
import React from "react"; |
| 7 |
|
| 8 |
import { Split, SplitItem } from "@patternfly/react-core/dist/esm/layouts/Split/index.js"; |
| 9 |
import { Grid, GridItem } from "@patternfly/react-core/dist/esm/layouts/Grid/index.js"; |
| 10 |
import { ZoomControls, SvgPlot, bits_per_sec_config } from "cockpit-components-plot.jsx"; |
| 11 |
|
| 12 |
import cockpit from "cockpit"; |
| 13 |
const _ = cockpit.gettext; |
| 14 |
|
| 15 |
export const NetworkPlots = ({ plot_state }) => { |
| 16 |
return ( |
| 17 |
<> |
| 18 |
<Split> |
| 19 |
<SplitItem isFilled /> |
| 20 |
<SplitItem><ZoomControls plot_state={plot_state} /></SplitItem> |
| 21 |
</Split> |
| 22 |
<Grid sm={12} md={6} lg={6} hasGutter> |
| 23 |
<GridItem> |
| 24 |
<SvgPlot className="network-graph" |
| 25 |
title={_("Transmitting")} config={bits_per_sec_config} |
| 26 |
plot_state={plot_state} plot_id='tx' /> |
| 27 |
</GridItem> |
| 28 |
<GridItem> |
| 29 |
<SvgPlot className="network-graph" |
| 30 |
title={_("Receiving")} config={bits_per_sec_config} |
| 31 |
plot_state={plot_state} plot_id='rx' /> |
| 32 |
</GridItem> |
| 33 |
</Grid> |
| 34 |
</>); |
| 35 |
}; |