fix: reload when data source click refresh (#3804)
This commit is contained in:
parent
66229cc92b
commit
570e5c1354
@ -60,6 +60,13 @@ export const DatabaseConnectionManagerPane = () => {
|
|||||||
const service = useResourceActionContext();
|
const service = useResourceActionContext();
|
||||||
return {
|
return {
|
||||||
async onClick() {
|
async onClick() {
|
||||||
|
const needReloadDataSources = service?.data?.data.filter((item) => item.status !== 'loaded');
|
||||||
|
if (needReloadDataSources?.length) {
|
||||||
|
const dataSources = dm.getDataSources();
|
||||||
|
const needLoadDataSourceKeys = needReloadDataSources.map((item) => item.key);
|
||||||
|
const needLoadDataSourcesInstance = dataSources.filter((item) => needLoadDataSourceKeys.includes(item.key));
|
||||||
|
await Promise.all(needLoadDataSourcesInstance.map((item) => item.reload()));
|
||||||
|
}
|
||||||
service?.refresh?.();
|
service?.refresh?.();
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user