import React, { useEffect } from 'react'; import { useAsyncFn } from 'react-use'; import { dateTimeFormat } from '@grafana/data'; import { getBackendSrv } from '@grafana/runtime'; import { LinkButton } from '@grafana/ui'; import { Page } from 'app/core/components/Page/Page'; const subTitle = ( Support bundles allow you to easily collect and share Grafana logs, configuration, and data with the Grafana Labs team. ); type SupportBundleState = 'complete' | 'error' | 'timeout' | 'pending'; interface SupportBundle { uid: string; state: SupportBundleState; creator: string; createdAt: number; expiresAt: number; } const getBundles = () => { return getBackendSrv().get('/api/support-bundles'); }; function SupportBundles() { const [bundlesState, fetchBundles] = useAsyncFn(getBundles, []); useEffect(() => { fetchBundles(); }, [fetchBundles]); return ( Create New Support Bundle {bundlesState?.value?.map((b) => ( ))}
Date Requested by Expires
{dateTimeFormat(b.createdAt * 1000)} {b.creator} {dateTimeFormat(b.expiresAt * 1000)} Download
); } export default SupportBundles;