mirror of
https://gitee.com/nocobase/nocobase.git
synced 2024-12-02 12:18:15 +08:00
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();
|
||||
return {
|
||||
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?.();
|
||||
},
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user