@jfvilas/plugin-kwirth-log
Version:
Frontend plugin for viewing real-time Kubernetes logs in Backstage
21 lines (18 loc) • 3.02 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';
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: "Show timestamp", control: /* @__PURE__ */ React.createElement(Checkbox, { checked: options.showTimestamp, onChange: () => handleChange({ showTimestamp: !options.showTimestamp }), disabled: props.disabled }) })), /* @__PURE__ */ React.createElement(Grid, { item: true }, /* @__PURE__ */ React.createElement(FormControlLabel, { style: { marginLeft: 8 }, label: "Show names", control: /* @__PURE__ */ React.createElement(Checkbox, { checked: options.showNames, onChange: () => handleChange({ showNames: !options.showNames }), disabled: props.disabled }) })), /* @__PURE__ */ React.createElement(Grid, { item: true }, /* @__PURE__ */ React.createElement(FormControlLabel, { style: { marginLeft: 8 }, label: "Follow log", control: /* @__PURE__ */ React.createElement(Checkbox, { checked: options.followLog, onChange: () => handleChange({ followLog: !options.followLog }) }), disabled: props.disabled })), /* @__PURE__ */ React.createElement(Grid, { item: true }, /* @__PURE__ */ React.createElement(FormControlLabel, { style: { marginLeft: 8 }, label: "Wrap lines", control: /* @__PURE__ */ React.createElement(Checkbox, { checked: options.wrapLines, onChange: () => handleChange({ wrapLines: !options.wrapLines }) }), 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: "#1D63ED" } }, "Kwirth")))));
};
export { Options };
//# sourceMappingURL=Options.esm.js.map