From 59f360c68c4e2d2077fc96ef113da034461df8c6 Mon Sep 17 00:00:00 2001 From: Chris Bedwell Date: Tue, 10 Oct 2023 18:16:45 +0100 Subject: [PATCH 1/4] fix: update provisioning examples to match readme (#618) --- dev/provisioning/datasources/example.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dev/provisioning/datasources/example.yaml b/dev/provisioning/datasources/example.yaml index d17be313f..05509a9ab 100644 --- a/dev/provisioning/datasources/example.yaml +++ b/dev/provisioning/datasources/example.yaml @@ -5,18 +5,19 @@ # access: proxy # url: https://logs-prod-us-central1.grafana.net # basicAuth: true -# basicAuthUser: -# basicAuthPassword: +# basicAuthUser: # jsonData: # maxLines: 1000 +# secureJsonData: +# basicAuthPassword: # - name: grafanacloud--prom # type: prometheus # access: proxy # url: https://prometheus-us-central1.grafana.net/api/prom # basicAuth: true -# basicAuthUser: +# basicAuthUser: # jsonData: # timeInterval: 1s # secureJsonData: -# basicAuthPassword: +# basicAuthPassword: From 7eedad953f0bbad426ffa02906b2d7ae916801d1 Mon Sep 17 00:00:00 2001 From: Russ <8377044+rdubrock@users.noreply.github.com> Date: Tue, 10 Oct 2023 10:41:31 -0800 Subject: [PATCH 2/4] feat: add test button to multihttp checks (#619) * feat: add test button to multihttp checks * chore: remove logs * chore: improve error handling --- src/components/CheckTestButton.tsx | 22 +++++++++++++++++-- src/components/CheckTestResultsModal.tsx | 11 +++++++--- .../MultiHttp/MultiHttpSettingsForm.tsx | 2 ++ src/datasource/DataSource.ts | 4 ---- src/hooks/useAlerts.ts | 2 -- src/page/WelcomePage.tsx | 1 - 6 files changed, 30 insertions(+), 12 deletions(-) diff --git a/src/components/CheckTestButton.tsx b/src/components/CheckTestButton.tsx index 84b64d5a4..ff0476d95 100644 --- a/src/components/CheckTestButton.tsx +++ b/src/components/CheckTestButton.tsx @@ -1,5 +1,5 @@ import React, { useContext, useMemo, useState } from 'react'; -import { Button, Spinner } from '@grafana/ui'; +import { Alert, Button, Modal, Spinner } from '@grafana/ui'; import { CheckTestResultsModal } from './CheckTestResultsModal'; import { AdHocCheckResponse, Check, CheckFormValues, CheckType } from 'types'; import { useFormContext } from 'react-hook-form'; @@ -14,6 +14,8 @@ interface Props { export function CheckTestButton({ check }: Props) { const [isTestModalOpen, setTestModalOpen] = useState(false); + const [isErrorModalOpen, setErrorModalOpen] = useState(false); + const [error, setError] = useState(''); const [testResponse, setTestResponse] = useState(); const [testRequestInFlight, setTestRequestInFlight] = useState(false); const defaultValues = useMemo(() => getDefaultValuesFromCheck(check), [check]); @@ -25,7 +27,7 @@ export function CheckTestButton({ check }: Props) { + {check?.id && (