/
receiver-form.ts
52 lines (43 loc) · 1.33 KB
/
receiver-form.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import React from 'react';
import { GrafanaManagedReceiverConfig } from 'app/plugins/datasource/alertmanager/types';
import { CloudNotifierType, NotifierType } from 'app/types';
import { ControlledField } from '../hooks/useControlledFieldArray';
export interface ChannelValues {
__id: string; // used to correlate form values to original DTOs
type: string;
settings: Record<string, any>;
secureSettings: Record<string, any>;
secureFields: Record<string, boolean>;
}
export interface ReceiverFormValues<R extends ChannelValues> {
name: string;
items: Array<ControlledField<R>>;
}
export interface CloudChannelValues extends ChannelValues {
type: string;
sendResolved: boolean;
}
export interface GrafanaChannelValues extends ChannelValues {
type: NotifierType;
provenance?: string;
disableResolveMessage: boolean;
}
export interface CommonSettingsComponentProps {
pathPrefix: string;
className?: string;
readOnly?: boolean;
}
export type CommonSettingsComponentType = React.ComponentType<CommonSettingsComponentProps>;
export type CloudChannelConfig = {
send_resolved: boolean;
[key: string]: unknown;
};
// id to notifier
export type GrafanaChannelMap = Record<string, GrafanaManagedReceiverConfig>;
export type CloudChannelMap = Record<
string,
{
type: CloudNotifierType;
config: CloudChannelConfig;
}
>;