mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-07-02 11:12:20 +08:00
fix: the display of data source status (#5069)
* fix: the display of data source status * fix: bug
This commit is contained in:
parent
09159f0296
commit
7cf2c6add5
@ -23,7 +23,10 @@ export const BreadcumbTitle = () => {
|
|||||||
const dm = useDataSourceManager();
|
const dm = useDataSourceManager();
|
||||||
const { displayName } = dm.getDataSource(name) || {};
|
const { displayName } = dm.getDataSource(name) || {};
|
||||||
const { dataSource } = useContext(DataSourceContext);
|
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 items = useMemo(() => {
|
||||||
const status = dataSourceValue?.status;
|
const status = dataSourceValue?.status;
|
||||||
const option = statusEnum.find((v) => v.value === status);
|
const option = statusEnum.find((v) => v.value === status);
|
||||||
|
@ -148,7 +148,7 @@ export const ConfigurationTable = () => {
|
|||||||
method: 'post',
|
method: 'post',
|
||||||
});
|
});
|
||||||
field.data.loading = false;
|
field.data.loading = false;
|
||||||
setDataSource(data?.data);
|
setDataSource({ ...data?.data, name });
|
||||||
if (data?.data?.status === 'reloading') {
|
if (data?.data?.status === 'reloading') {
|
||||||
message.warning(t('Data source synchronization in progress'));
|
message.warning(t('Data source synchronization in progress'));
|
||||||
} else if (data?.data?.status === 'loaded') {
|
} else if (data?.data?.status === 'loaded') {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user