|
|
@ -10,7 +10,7 @@ interface Props { |
|
|
|
|
|
|
|
|
|
|
|
const props = defineProps<Props>() |
|
|
|
const props = defineProps<Props>() |
|
|
|
|
|
|
|
|
|
|
|
const emits = defineEmits(['update:state', 'update:reload', 'awaken']) |
|
|
|
const emits = defineEmits(['update:state', 'update:reload']) |
|
|
|
|
|
|
|
|
|
|
|
const vState = useVModel(props, 'state', emits) |
|
|
|
const vState = useVModel(props, 'state', emits) |
|
|
|
|
|
|
|
|
|
|
@ -20,7 +20,9 @@ const { $api, $e } = useNuxtApp() |
|
|
|
|
|
|
|
|
|
|
|
const { t } = useI18n() |
|
|
|
const { t } = useI18n() |
|
|
|
|
|
|
|
|
|
|
|
const { loadProject } = useBases() |
|
|
|
const basesStore = useBases() |
|
|
|
|
|
|
|
const { loadProject } = basesStore |
|
|
|
|
|
|
|
const { isDataSourceLimitReached } = storeToRefs(basesStore) |
|
|
|
|
|
|
|
|
|
|
|
const baseStore = useBase() |
|
|
|
const baseStore = useBase() |
|
|
|
const { base } = storeToRefs(baseStore) |
|
|
|
const { base } = storeToRefs(baseStore) |
|
|
@ -37,10 +39,6 @@ const clientType = ref<ClientType>(ClientType.MYSQL) |
|
|
|
|
|
|
|
|
|
|
|
const isReloading = ref(false) |
|
|
|
const isReloading = ref(false) |
|
|
|
|
|
|
|
|
|
|
|
const forceAwakened = ref(false) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const dataSourcesAwakened = ref(false) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const isDeleteBaseModalOpen = ref(false) |
|
|
|
const isDeleteBaseModalOpen = ref(false) |
|
|
|
const toBeDeletedBase = ref<SourceType | undefined>() |
|
|
|
const toBeDeletedBase = ref<SourceType | undefined>() |
|
|
|
|
|
|
|
|
|
|
@ -142,12 +140,6 @@ const moveBase = async (e: any) => { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const forceAwaken = () => { |
|
|
|
|
|
|
|
forceAwakened.value = !forceAwakened.value |
|
|
|
|
|
|
|
dataSourcesAwakened.value = forceAwakened.value |
|
|
|
|
|
|
|
emits('awaken', forceAwakened.value) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
watch( |
|
|
|
watch( |
|
|
|
projectPageTab, |
|
|
|
projectPageTab, |
|
|
|
() => { |
|
|
|
() => { |
|
|
@ -169,20 +161,6 @@ watch( |
|
|
|
}, |
|
|
|
}, |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
watch( |
|
|
|
|
|
|
|
() => sources.value.length, |
|
|
|
|
|
|
|
(l) => { |
|
|
|
|
|
|
|
if (l > 1 && !forceAwakened.value) { |
|
|
|
|
|
|
|
dataSourcesAwakened.value = false |
|
|
|
|
|
|
|
emits('awaken', false) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
dataSourcesAwakened.value = true |
|
|
|
|
|
|
|
emits('awaken', true) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ immediate: true }, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
watch( |
|
|
|
watch( |
|
|
|
vState, |
|
|
|
vState, |
|
|
|
async (newState) => { |
|
|
|
async (newState) => { |
|
|
@ -211,7 +189,7 @@ watch( |
|
|
|
vState.value = DataSourcesSubTab.New |
|
|
|
vState.value = DataSourcesSubTab.New |
|
|
|
break |
|
|
|
break |
|
|
|
case DataSourcesSubTab.New: |
|
|
|
case DataSourcesSubTab.New: |
|
|
|
if (sources.value.length > 1 && !forceAwakened.value) { |
|
|
|
if (isDataSourceLimitReached.value) { |
|
|
|
vState.value = '' |
|
|
|
vState.value = '' |
|
|
|
} |
|
|
|
} |
|
|
|
break |
|
|
|
break |
|
|
@ -292,7 +270,7 @@ const isEditBaseModalOpen = computed({ |
|
|
|
<div class="flex flex-col w-full overflow-auto"> |
|
|
|
<div class="flex flex-col w-full overflow-auto"> |
|
|
|
<div class="flex flex-row w-full justify-end mt-6.5 mb-2"> |
|
|
|
<div class="flex flex-row w-full justify-end mt-6.5 mb-2"> |
|
|
|
<NcButton |
|
|
|
<NcButton |
|
|
|
v-if="dataSourcesAwakened" |
|
|
|
v-if="!isDataSourceLimitReached" |
|
|
|
size="large" |
|
|
|
size="large" |
|
|
|
class="z-10 !px-2" |
|
|
|
class="z-10 !px-2" |
|
|
|
type="primary" |
|
|
|
type="primary" |
|
|
@ -312,7 +290,7 @@ const isEditBaseModalOpen = computed({ |
|
|
|
> |
|
|
|
> |
|
|
|
<div class="ds-table-head"> |
|
|
|
<div class="ds-table-head"> |
|
|
|
<div class="ds-table-row"> |
|
|
|
<div class="ds-table-row"> |
|
|
|
<div class="ds-table-col ds-table-enabled cursor-pointer" @dblclick="forceAwaken">{{ $t('general.visibility') }}</div> |
|
|
|
<div class="ds-table-col ds-table-enabled cursor-pointer">{{ $t('general.visibility') }}</div> |
|
|
|
<div class="ds-table-col ds-table-name">{{ $t('general.name') }}</div> |
|
|
|
<div class="ds-table-col ds-table-name">{{ $t('general.name') }}</div> |
|
|
|
<div class="ds-table-col ds-table-type">{{ $t('general.type') }}</div> |
|
|
|
<div class="ds-table-col ds-table-type">{{ $t('general.type') }}</div> |
|
|
|
<div class="ds-table-col ds-table-actions -ml-13">{{ $t('labels.actions') }}</div> |
|
|
|
<div class="ds-table-col ds-table-actions -ml-13">{{ $t('labels.actions') }}</div> |
|
|
|