Skip to content

Commit

Permalink
Added Application and Beamline-based Filtering using TexFields
Browse files Browse the repository at this point in the history
  • Loading branch information
TBThomas56 committed May 26, 2024
1 parent dff2708 commit 8de4a1f
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions 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 @@ -51,6 +52,20 @@ function App() {
const [logPayload, handlePayload] = useReducer(reducer, payload);

// Log_Menu Props
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

0 comments on commit 8de4a1f

Please sign in to comment.