fix: the display of data source status (#5069)

* fix: the display of data source status

* fix: bug
This commit is contained in:
Katherine 2024-08-16 16:36:11 +08:00 committed by GitHub
parent 09159f0296
commit 7cf2c6add5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View File

@ -23,7 +23,10 @@ export const BreadcumbTitle = () => {
const dm = useDataSourceManager();
const { displayName } = dm.getDataSource(name) || {};
const { dataSource } = useContext(DataSourceContext);
const dataSourceValue = useMemo(() => dataSource || dm.getDataSource(name), [dataSource, name]);
const dataSourceValue = useMemo(
() => (dataSource && dataSource?.name === name ? dataSource : dm.getDataSource(name)),
[dataSource, name],
);
const items = useMemo(() => {
const status = dataSourceValue?.status;
const option = statusEnum.find((v) => v.value === status);

View File

@ -148,7 +148,7 @@ export const ConfigurationTable = () => {
method: 'post',
});
field.data.loading = false;
setDataSource(data?.data);
setDataSource({ ...data?.data, name });
if (data?.data?.status === 'reloading') {
message.warning(t('Data source synchronization in progress'));
} else if (data?.data?.status === 'loaded') {