Browse Source

fix: drop out of sync indicator

pull/6528/head
mertmit 1 year ago
parent
commit
e17be7dc71
  1. 31
      packages/nc-gui/components/dashboard/settings/DataSources.vue

31
packages/nc-gui/components/dashboard/settings/DataSources.vue

@ -31,8 +31,6 @@ const sources = ref<BaseType[]>([])
const activeBaseId = ref('') const activeBaseId = ref('')
const metadiffbases = ref<string[]>([])
const clientType = ref<ClientType>(ClientType.MYSQL) const clientType = ref<ClientType>(ClientType.MYSQL)
const isReloading = ref(false) const isReloading = ref(false)
@ -55,8 +53,6 @@ async function loadBases(changed?: boolean) {
if (baseList.list && baseList.list.length) { if (baseList.list && baseList.list.length) {
sources.value = baseList.list sources.value = baseList.list
} }
await loadMetaDiff()
} catch (e) { } catch (e) {
console.error(e) console.error(e)
} finally { } finally {
@ -65,21 +61,6 @@ async function loadBases(changed?: boolean) {
} }
} }
async function loadMetaDiff() {
try {
metadiffbases.value = []
const metadiff = await $api.project.metaDiffGet(project.value.id as string)
for (const model of metadiff) {
if (model.detectedChanges?.length > 0) {
metadiffbases.value.push(model.base_id)
}
}
} catch (e) {
console.error(e)
}
}
const baseAction = (baseId?: string, action?: string) => { const baseAction = (baseId?: string, action?: string) => {
if (!baseId) return if (!baseId) return
activeBaseId.value = baseId activeBaseId.value = baseId
@ -362,11 +343,7 @@ const isEditBaseModalOpen = computed({
@click="baseAction(sources[0].id, DataSourcesSubTab.Metadata)" @click="baseAction(sources[0].id, DataSourcesSubTab.Metadata)"
> >
<div class="flex items-center gap-2 text-gray-600"> <div class="flex items-center gap-2 text-gray-600">
<a-tooltip v-if="metadiffbases.includes(sources[0].id)"> <GeneralIcon icon="sync" class="group-hover:text-accent" />
<template #title>{{ $t('activity.outOfSync') }}</template>
<GeneralIcon icon="warning" class="group-hover:text-accent text-primary" />
</a-tooltip>
<GeneralIcon v-else icon="sync" class="group-hover:text-accent" />
{{ $t('tooltip.metaSync') }} {{ $t('tooltip.metaSync') }}
</div> </div>
</a-button> </a-button>
@ -472,11 +449,7 @@ const isEditBaseModalOpen = computed({
@click="baseAction(base.id, DataSourcesSubTab.Metadata)" @click="baseAction(base.id, DataSourcesSubTab.Metadata)"
> >
<div class="flex items-center gap-2 text-gray-600"> <div class="flex items-center gap-2 text-gray-600">
<a-tooltip v-if="metadiffbases.includes(base.id)"> <GeneralIcon icon="sync" class="group-hover:text-accent" />
<template #title>{{ $t('activity.outOfSync') }}</template>
<GeneralIcon icon="warning" class="group-hover:text-accent text-primary" />
</a-tooltip>
<GeneralIcon v-else icon="sync" class="group-hover:text-accent" />
{{ $t('tooltip.metaSync') }} {{ $t('tooltip.metaSync') }}
</div> </div>
</a-button> </a-button>

Loading…
Cancel
Save