mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-14 01:24:04 -08:00
Add back removing panels via menu
Signed-off-by: Julius Volz <julius.volz@gmail.com>
This commit is contained in:
parent
1e523b204d
commit
124f36e670
|
@ -58,6 +58,7 @@ import {
|
||||||
IconTerminal,
|
IconTerminal,
|
||||||
IconTrash,
|
IconTrash,
|
||||||
} from "@tabler/icons-react";
|
} from "@tabler/icons-react";
|
||||||
|
import { removePanel } from "../../state/queryPageSlice";
|
||||||
|
|
||||||
const promqlExtension = new PromQLExtension();
|
const promqlExtension = new PromQLExtension();
|
||||||
|
|
||||||
|
@ -106,11 +107,13 @@ export class HistoryCompleteStrategy implements CompleteStrategy {
|
||||||
interface ExpressionInputProps {
|
interface ExpressionInputProps {
|
||||||
initialExpr: string;
|
initialExpr: string;
|
||||||
executeQuery: (expr: string) => void;
|
executeQuery: (expr: string) => void;
|
||||||
|
removePanel: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ExpressionInput: FC<ExpressionInputProps> = ({
|
const ExpressionInput: FC<ExpressionInputProps> = ({
|
||||||
initialExpr,
|
initialExpr,
|
||||||
executeQuery,
|
executeQuery,
|
||||||
|
removePanel,
|
||||||
}) => {
|
}) => {
|
||||||
const theme = useComputedColorScheme();
|
const theme = useComputedColorScheme();
|
||||||
const [expr, setExpr] = useState(initialExpr);
|
const [expr, setExpr] = useState(initialExpr);
|
||||||
|
@ -183,6 +186,7 @@ const ExpressionInput: FC<ExpressionInputProps> = ({
|
||||||
leftSection={
|
leftSection={
|
||||||
<IconTrash style={{ width: rem(14), height: rem(14) }} />
|
<IconTrash style={{ width: rem(14), height: rem(14) }} />
|
||||||
}
|
}
|
||||||
|
onClick={removePanel}
|
||||||
>
|
>
|
||||||
Remove query
|
Remove query
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
|
|
|
@ -52,6 +52,9 @@ const QueryPanel: FC<PanelProps> = ({ idx }) => {
|
||||||
setRetriggerIdx((idx) => idx + 1);
|
setRetriggerIdx((idx) => idx + 1);
|
||||||
dispatch(setExpr({ idx, expr }));
|
dispatch(setExpr({ idx, expr }));
|
||||||
}}
|
}}
|
||||||
|
removePanel={() => {
|
||||||
|
dispatch(removePanel(idx));
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
<Tabs defaultValue="table" keepMounted={false}>
|
<Tabs defaultValue="table" keepMounted={false}>
|
||||||
<Tabs.List>
|
<Tabs.List>
|
||||||
|
|
Loading…
Reference in a new issue