mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-12 06:17:27 -08:00
Add missing alerts page redux slice file
Signed-off-by: Julius Volz <julius.volz@gmail.com>
This commit is contained in:
parent
719b31f1b5
commit
a1f36de67c
32
web/ui/mantine-ui/src/state/alertsPageSlice.ts
Normal file
32
web/ui/mantine-ui/src/state/alertsPageSlice.ts
Normal file
|
@ -0,0 +1,32 @@
|
|||
import { PayloadAction, createSlice } from "@reduxjs/toolkit";
|
||||
|
||||
interface AlertFilters {
|
||||
state: string[];
|
||||
}
|
||||
|
||||
interface AlertsPage {
|
||||
filters: AlertFilters;
|
||||
}
|
||||
|
||||
const initialState: AlertsPage = {
|
||||
filters: {
|
||||
state: [],
|
||||
},
|
||||
};
|
||||
|
||||
export const alertsPageSlice = createSlice({
|
||||
name: "alertsPage",
|
||||
initialState,
|
||||
reducers: {
|
||||
updateAlertFilters: (
|
||||
state,
|
||||
{ payload }: PayloadAction<Partial<AlertFilters>>
|
||||
) => {
|
||||
Object.assign(state.filters, payload);
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const { updateAlertFilters } = alertsPageSlice.actions;
|
||||
|
||||
export default alertsPageSlice.reducer;
|
Loading…
Reference in a new issue