mirror of https://github.com/prometheus/prometheus
Add missing alerts page redux slice file
Signed-off-by: Julius Volz <julius.volz@gmail.com>pull/14448/head
parent
719b31f1b5
commit
a1f36de67c
|
@ -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 New Issue