@jfvilas/plugin-kubelog
Version:
Frontend plugin for viewing Kubernetes logs in Backstage
20 lines (17 loc) • 1.94 kB
JavaScript
import React, { useState } from 'react';
import CardHeader from '@material-ui/core/CardHeader';
import Checkbox from '@material-ui/core/Checkbox';
import Divider from '@material-ui/core/Divider';
import FormControlLabel from '@material-ui/core/FormControlLabel';
import Grid from '@material-ui/core/Grid';
const KubelogOptions = (props) => {
const [options, setOptions] = useState(props.options);
const handleChange = (change) => {
var a = { ...options, ...change };
setOptions(a);
props.onChange(a);
};
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(CardHeader, { title: "Options" }), /* @__PURE__ */ React.createElement(Divider, { style: { marginTop: 8 } }), /* @__PURE__ */ React.createElement(Grid, { container: true, direction: "column", spacing: 0 }, /* @__PURE__ */ React.createElement(Grid, { item: true }, /* @__PURE__ */ React.createElement(FormControlLabel, { style: { marginLeft: 8 }, label: "Add timestamp", control: /* @__PURE__ */ React.createElement(Checkbox, { checked: options.timestamp, onChange: () => handleChange({ timestamp: !options.timestamp }), disabled: props.disabled }) })), /* @__PURE__ */ React.createElement(Grid, { item: true }, /* @__PURE__ */ React.createElement(FormControlLabel, { style: { marginLeft: 8 }, control: /* @__PURE__ */ React.createElement(Checkbox, { checked: options.previous, onChange: () => handleChange({ previous: !options.previous }) }), label: "Show previous", disabled: props.disabled })), /* @__PURE__ */ React.createElement(Grid, { item: true }, /* @__PURE__ */ React.createElement(FormControlLabel, { style: { marginLeft: 8 }, control: /* @__PURE__ */ React.createElement(Checkbox, { checked: options.follow, onChange: () => handleChange({ follow: !options.follow }) }), label: "Follow log", disabled: props.disabled }))));
};
export { KubelogOptions };
//# sourceMappingURL=KubelogOptions.esm.js.map