mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
DashboardScene: Alert states data layer (#77945)
* Add AlertStates data topic * DashboardScene: Alert states data layer * TMP package json * Remove duplicated function * Use latest scenes canry * Use latest scenes and add transformation test
This commit is contained in:
@@ -6,8 +6,9 @@ import { config, getBackendSrv } from '@grafana/runtime';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
import { Annotation } from 'app/features/alerting/unified/utils/constants';
|
||||
import { isAlertingRule } from 'app/features/alerting/unified/utils/rules';
|
||||
import { promAlertStateToAlertState } from 'app/features/dashboard-scene/scene/AlertStatesDataLayer';
|
||||
import { AccessControlAction } from 'app/types';
|
||||
import { PromAlertingRuleState, PromRulesResponse } from 'app/types/unified-alerting-dto';
|
||||
import { PromRulesResponse } from 'app/types/unified-alerting-dto';
|
||||
|
||||
import { DashboardQueryRunnerOptions, DashboardQueryRunnerWorker, DashboardQueryRunnerWorkerResult } from './types';
|
||||
import { emptyResult, handleDashboardQueryRunnerWorkerError } from './utils';
|
||||
@@ -105,12 +106,3 @@ export class UnifiedAlertStatesWorker implements DashboardQueryRunnerWorker {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function promAlertStateToAlertState(state: PromAlertingRuleState): AlertState {
|
||||
if (state === PromAlertingRuleState.Firing) {
|
||||
return AlertState.Alerting;
|
||||
} else if (state === PromAlertingRuleState.Pending) {
|
||||
return AlertState.Pending;
|
||||
}
|
||||
return AlertState.OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user