UNPKG

@jfvilas/plugin-kwirth-log

Version:

Frontend plugin for viewing real-time Kubernetes logs in Backstage

21 lines (18 loc) 2.31 kB
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'; import { Typography } from '@material-ui/core'; const Options = (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: "From start", control: /* @__PURE__ */ React.createElement(Checkbox, { checked: options.fromStart, onChange: () => handleChange({ fromStart: !options.fromStart }), disabled: props.disabled }) })), /* @__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.follow, onChange: () => handleChange({ follow: !options.follow }) }), label: "Follow log", disabled: props.disabled })), /* @__PURE__ */ React.createElement(Grid, { item: true }, /* @__PURE__ */ React.createElement(Typography, { style: { fontSize: 9, marginLeft: 20, marginTop: 4, marginBottom: 6 } }, "Powered by ", /* @__PURE__ */ React.createElement("a", { href: "https://jfvilas.github.io/kwirth/", target: "_blank", style: { color: "blue" } }, "Kwirth"))))); }; export { Options }; //# sourceMappingURL=Options.esm.js.map