mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-25 13:44:05 -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,
|
||||
IconTrash,
|
||||
} from "@tabler/icons-react";
|
||||
import { removePanel } from "../../state/queryPageSlice";
|
||||
|
||||
const promqlExtension = new PromQLExtension();
|
||||
|
||||
|
@ -106,11 +107,13 @@ export class HistoryCompleteStrategy implements CompleteStrategy {
|
|||
interface ExpressionInputProps {
|
||||
initialExpr: string;
|
||||
executeQuery: (expr: string) => void;
|
||||
removePanel: () => void;
|
||||
}
|
||||
|
||||
const ExpressionInput: FC<ExpressionInputProps> = ({
|
||||
initialExpr,
|
||||
executeQuery,
|
||||
removePanel,
|
||||
}) => {
|
||||
const theme = useComputedColorScheme();
|
||||
const [expr, setExpr] = useState(initialExpr);
|
||||
|
@ -183,6 +186,7 @@ const ExpressionInput: FC<ExpressionInputProps> = ({
|
|||
leftSection={
|
||||
<IconTrash style={{ width: rem(14), height: rem(14) }} />
|
||||
}
|
||||
onClick={removePanel}
|
||||
>
|
||||
Remove query
|
||||
</Menu.Item>
|
||||
|
|
|
@ -52,6 +52,9 @@ const QueryPanel: FC<PanelProps> = ({ idx }) => {
|
|||
setRetriggerIdx((idx) => idx + 1);
|
||||
dispatch(setExpr({ idx, expr }));
|
||||
}}
|
||||
removePanel={() => {
|
||||
dispatch(removePanel(idx));
|
||||
}}
|
||||
/>
|
||||
<Tabs defaultValue="table" keepMounted={false}>
|
||||
<Tabs.List>
|
||||
|
|
Loading…
Reference in a new issue