mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-12 06:17:27 -08:00
Add input field to /graph page.
Signed-off-by: Julius Volz <julius.volz@gmail.com>
This commit is contained in:
parent
128b6461e9
commit
89ecb3a3f2
14
web/ui/mantine-ui/src/pages/graph.module.css
Normal file
14
web/ui/mantine-ui/src/pages/graph.module.css
Normal file
|
@ -0,0 +1,14 @@
|
|||
.input {
|
||||
font-family: "DejaVu Sans Mono";
|
||||
padding-top: 7px;
|
||||
transition: none;
|
||||
|
||||
&:focus-within {
|
||||
outline: rem(2px) solid var(--mantine-color-blue-filled);
|
||||
border-color: transparent;
|
||||
}
|
||||
|
||||
&:placeholder-shown {
|
||||
font-family: unset;
|
||||
}
|
||||
}
|
|
@ -1,3 +1,27 @@
|
|||
import { Group, Textarea, Button } from "@mantine/core";
|
||||
import { IconTerminal } from "@tabler/icons-react";
|
||||
import { useState } from "react";
|
||||
import classes from "./graph.module.css";
|
||||
|
||||
export default function Graph() {
|
||||
return <>Graph page</>;
|
||||
const [expr, setExpr] = useState<string>("");
|
||||
|
||||
return (
|
||||
<Group align="baseline" wrap="nowrap" gap="xs" mt="sm">
|
||||
<Textarea
|
||||
style={{ flex: "auto" }}
|
||||
classNames={classes}
|
||||
placeholder="Enter PromQL expression..."
|
||||
value={expr}
|
||||
onChange={(event) => setExpr(event.currentTarget.value)}
|
||||
leftSection={<IconTerminal />}
|
||||
rightSectionPointerEvents="all"
|
||||
autosize
|
||||
autoFocus
|
||||
/>
|
||||
<Button variant="primary" onClick={() => console.log(expr)}>
|
||||
Execute
|
||||
</Button>
|
||||
</Group>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue