Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Application and Beamline-based Filtering using TexFields #32

Merged
merged 1 commit into from
May 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
import { payload } from "./schema/payload.ts";

import Table from "@mui/material/Table";
import TextField from "@mui/material/TextField";
import TableBody from "@mui/material/TableBody";
import TableCell from "@mui/material/TableCell";
import TableContainer from "@mui/material/TableContainer";
Expand Down Expand Up @@ -50,7 +51,21 @@ function App() {
const [logfilter, setLogfilter] = useState<number>(7);
const [logPayload, handlePayload] = useReducer(reducer, payload);

// Log_Menu Props
// Payload Modifiers based off of Application Name or Beamline
const handleBeamline = (beamline: string) => {
if (beamline == "") {
beamline = "*";
}
handlePayload({ type: ACTIONS.BEAMLINE, query_condition: beamline });
};

const handleAppName = (app_name: string) => {
if (app_name == "") {
app_name = "*";
}
handlePayload({ type: ACTIONS.APP, query_condition: app_name });
};

const handleLogFilterChange = (newLogFilterValue: number) => {
setLogfilter(newLogFilterValue);
handlePayload({ type: ACTIONS.LOGFILTER, log_level: newLogFilterValue });
Expand Down Expand Up @@ -153,6 +168,20 @@ function App() {
logFilterValue={logfilter}
onLogFilterChange={handleLogFilterChange}
/>
<TextField
id="app-name"
label="Application Name"
variant="outlined"
margin="normal"
onChange={e => handleAppName(e.target.value)}
/>
<TextField
id="beamline"
label="Beamline"
variant="outlined"
margin="normal"
onChange={e => handleBeamline(e.target.value)}
/>
<BoxBasic>
<TableContainer component={Paper}>
<Table sx={{ minWidth: 650 }} aria-label="simple table">
Expand Down
Loading