mirror of https://github.com/grafana/grafana
PublicDashboards: Refresh ds plugin supported list (#74947)
parent
158c669d1a
commit
633605af4e
@ -0,0 +1,21 @@ |
||||
import { useEffect, useState } from 'react'; |
||||
|
||||
import { DashboardModel } from 'app/features/dashboard/state'; |
||||
|
||||
import { getUnsupportedDashboardDatasources } from './SharePublicDashboardUtils'; |
||||
|
||||
export const useGetUnsupportedDataSources = (dashboard: DashboardModel) => { |
||||
const [unsupportedDataSources, setUnsupportedDataSources] = useState<string[]>([]); |
||||
|
||||
useEffect(() => { |
||||
const fetchUnsupportedDataSources = async () => { |
||||
return await getUnsupportedDashboardDatasources(dashboard.panels); |
||||
}; |
||||
|
||||
fetchUnsupportedDataSources().then((dsList) => { |
||||
setUnsupportedDataSources(dsList); |
||||
}); |
||||
}, [dashboard.panels]); |
||||
|
||||
return { unsupportedDataSources }; |
||||
}; |
Loading…
Reference in new issue