Submit
Path:
~
/
/
usr
/
share
/
grafana
/
public
/
app
/
features
/
alerting
/
unified
/
components
/
File Content:
AlertingPageWrapper.tsx
import React, { PropsWithChildren } from 'react'; import { useLocation } from 'react-use'; import { Page } from 'app/core/components/Page/Page'; import { PageProps } from 'app/core/components/Page/types'; import { UAPreviewNotice } from '../../components/UAPreviewNotice'; import { AlertmanagerProvider, useAlertmanager } from '../state/AlertmanagerContext'; import { AlertManagerPicker } from './AlertManagerPicker'; import { NoAlertManagerWarning } from './NoAlertManagerWarning'; /** * This is the main alerting page wrapper, used by the alertmanager page wrapper and the alert rules list view */ interface AlertingPageWrapperProps extends PageProps { isLoading?: boolean; } export const AlertingPageWrapper = ({ children, isLoading, ...rest }: AlertingPageWrapperProps) => ( <Page {...rest}> <Page.Contents isLoading={isLoading}> <div> <UAPreviewNotice /> {children} </div> </Page.Contents> </Page> ); /** * This wrapper is for pages that use the Alertmanager API */ interface AlertmanagerPageWrapperProps extends AlertingPageWrapperProps { accessType: 'instance' | 'notification'; } export const AlertmanagerPageWrapper = ({ children, accessType, ...props }: AlertmanagerPageWrapperProps) => { const disableAlertmanager = useIsDisabledAlertmanagerSelection(); return ( <AlertmanagerProvider accessType={accessType}> <AlertingPageWrapper {...props} actions={<AlertManagerPicker disabled={disableAlertmanager} />}> <AlertManagerPagePermissionsCheck>{children}</AlertManagerPagePermissionsCheck> </AlertingPageWrapper> </AlertmanagerProvider> ); }; /** * This function tells us when we want to disable the alertmanager picker * It's not great... */ function useIsDisabledAlertmanagerSelection() { const location = useLocation(); const disabledPathSegment = ['/edit', '/new']; return disabledPathSegment.some((match) => location?.pathname?.includes(match)); } /** * This component will render an error message if the user doesn't have sufficient permissions or if the requested * alertmanager doesn't exist */ const AlertManagerPagePermissionsCheck = ({ children }: PropsWithChildren) => { const { availableAlertManagers, selectedAlertmanager } = useAlertmanager(); if (!selectedAlertmanager) { return <NoAlertManagerWarning availableAlertManagers={availableAlertManagers} />; } return <>{children}</>; };
Edit
Rename
Chmod
Delete
FILE
FOLDER
INFO
Name
Size
Permission
Action
admin
---
0755
alert-groups
---
0755
bridges
---
0755
contact-points
---
0755
export
---
0755
expressions
---
0755
extensions
---
0755
mute-timings
---
0755
notification-policies
---
0755
panel-alerts-tab
---
0755
receivers
---
0755
rule-editor
---
0755
rule-viewer
---
0755
rules
---
0755
silences
---
0755
AlertLabel.tsx
1114 bytes
0644
AlertLabelDropdown.tsx
2010 bytes
0644
AlertLabels.test.tsx
879 bytes
0644
AlertLabels.tsx
2237 bytes
0644
AlertManagerPicker.tsx
1899 bytes
0644
AlertStateDot.tsx
1540 bytes
0644
AlertingPageWrapper.tsx
2425 bytes
0644
AnnotationDetailsField.tsx
1821 bytes
0644
Authorize.tsx
2177 bytes
0644
CollapseToggle.test.tsx
1274 bytes
0644
CollapseToggle.tsx
865 bytes
0644
DetailsField.tsx
1327 bytes
0644
DynamicTable.tsx
8132 bytes
0644
DynamicTableWithGuidelines.tsx
2140 bytes
0644
EmptyArea.tsx
595 bytes
0644
EmptyAreaWithCTA.tsx
1763 bytes
0644
Expression.tsx
1939 bytes
0644
GrafanaAlertmanagerDeliveryWarning.test.tsx
3378 bytes
0644
GrafanaAlertmanagerDeliveryWarning.tsx
2546 bytes
0644
HoverCard.tsx
3847 bytes
0644
InfoIcon.tsx
264 bytes
0644
InvalidIntervalWarning.tsx
502 bytes
0644
Label.tsx
2578 bytes
0644
MetaText.tsx
1198 bytes
0644
MoreButton.tsx
568 bytes
0644
NoAlertManagerWarning.tsx
955 bytes
0644
PluginBridge.mock.ts
616 bytes
0644
PluginBridge.test.tsx
1778 bytes
0644
PluginBridge.tsx
1134 bytes
0644
Provisioning.tsx
1071 bytes
0644
RuleLocation.tsx
345 bytes
0644
Spacer.tsx
369 bytes
0644
StateColoredText.tsx
869 bytes
0644
StateTag.tsx
2018 bytes
0644
Strong.tsx
292 bytes
0644
Tokenize.tsx
3922 bytes
0644
Well.tsx
732 bytes
0644
WithReturnButton.tsx
540 bytes
0644
N4ST4R_ID | Naxtarrr