|
|
@ -203,191 +203,193 @@ onMounted(() => { |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div ref="dataExporterRef" class="data-exporter"> |
|
|
|
<ExtensionsExtensionWrapper> |
|
|
|
<div class="pb-3 flex items-center justify-between gap-2.5 flex-wrap"> |
|
|
|
<div ref="dataExporterRef" class="data-exporter"> |
|
|
|
<div |
|
|
|
<div class="pb-3 flex items-center justify-between gap-2.5 flex-wrap"> |
|
|
|
class="flex-1 flex items-center" |
|
|
|
<div |
|
|
|
:class="{ |
|
|
|
class="flex-1 flex items-center" |
|
|
|
'max-w-[min(350px,calc(100%-124px))]': isExporting && !fullscreen && width > 325, |
|
|
|
|
|
|
|
'max-w-[min(350px,calc(100%_-_84px))]': !isExporting && !fullscreen && width > 325, |
|
|
|
|
|
|
|
'max-w-full': width <= 325, |
|
|
|
|
|
|
|
'max-w-[900px]': fullscreen, |
|
|
|
|
|
|
|
}" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<NcSelect |
|
|
|
|
|
|
|
v-model:value="exportPayload.tableId" |
|
|
|
|
|
|
|
placeholder="-select table-" |
|
|
|
|
|
|
|
:disabled="isExporting" |
|
|
|
|
|
|
|
class="nc-data-exporter-table-select" |
|
|
|
|
|
|
|
:class="{ |
|
|
|
:class="{ |
|
|
|
'flex-1 max-w-[240px]': fullscreen, |
|
|
|
'max-w-[min(350px,calc(100%-124px))]': isExporting && !fullscreen && width > 325, |
|
|
|
'min-w-1/2 max-w-[175px]': !fullscreen, |
|
|
|
'max-w-[min(350px,calc(100%_-_84px))]': !isExporting && !fullscreen && width > 325, |
|
|
|
|
|
|
|
'max-w-full': width <= 325, |
|
|
|
|
|
|
|
'max-w-[900px]': fullscreen, |
|
|
|
}" |
|
|
|
}" |
|
|
|
:filter-option="filterOption" |
|
|
|
|
|
|
|
dropdown-class-name="w-[250px]" |
|
|
|
|
|
|
|
show-search |
|
|
|
|
|
|
|
@change="onTableSelect" |
|
|
|
|
|
|
|
> |
|
|
|
> |
|
|
|
<a-select-option v-for="table of tableList" :key="table.label" :value="table.value"> |
|
|
|
<NcSelect |
|
|
|
<div class="w-full flex items-center gap-2"> |
|
|
|
v-model:value="exportPayload.tableId" |
|
|
|
<div class="min-w-5 flex items-center justify-center"> |
|
|
|
placeholder="-select table-" |
|
|
|
<GeneralTableIcon :meta="{ meta: table.meta }" class="text-gray-500" /> |
|
|
|
:disabled="isExporting" |
|
|
|
</div> |
|
|
|
class="nc-data-exporter-table-select" |
|
|
|
<NcTooltip class="flex-1 truncate" show-on-truncate-only> |
|
|
|
:class="{ |
|
|
|
<template #title>{{ table.label }}</template> |
|
|
|
'flex-1 max-w-[240px]': fullscreen, |
|
|
|
<span>{{ table.label }}</span> |
|
|
|
'min-w-1/2 max-w-[175px]': !fullscreen, |
|
|
|
</NcTooltip> |
|
|
|
}" |
|
|
|
<component |
|
|
|
:filter-option="filterOption" |
|
|
|
:is="iconMap.check" |
|
|
|
dropdown-class-name="w-[250px]" |
|
|
|
v-if="exportPayload.tableId === table.value" |
|
|
|
show-search |
|
|
|
id="nc-selected-item-icon" |
|
|
|
@change="onTableSelect" |
|
|
|
class="flex-none text-primary w-4 h-4" |
|
|
|
> |
|
|
|
/> |
|
|
|
<a-select-option v-for="table of tableList" :key="table.label" :value="table.value"> |
|
|
|
</div> |
|
|
|
<div class="w-full flex items-center gap-2"> |
|
|
|
</a-select-option> |
|
|
|
<div class="min-w-5 flex items-center justify-center"> |
|
|
|
</NcSelect> |
|
|
|
<GeneralTableIcon :meta="{ meta: table.meta }" class="text-gray-500" /> |
|
|
|
|
|
|
|
</div> |
|
|
|
<NcSelect |
|
|
|
<NcTooltip class="flex-1 truncate" show-on-truncate-only> |
|
|
|
v-model:value="exportPayload.viewId" |
|
|
|
<template #title>{{ table.label }}</template> |
|
|
|
placeholder="-select view-" |
|
|
|
<span>{{ table.label }}</span> |
|
|
|
:disabled="isExporting" |
|
|
|
</NcTooltip> |
|
|
|
class="nc-data-exporter-view-select" |
|
|
|
<component |
|
|
|
:class="{ |
|
|
|
:is="iconMap.check" |
|
|
|
'flex-1 max-w-[240px]': fullscreen, |
|
|
|
v-if="exportPayload.tableId === table.value" |
|
|
|
'min-w-1/2 max-w-[175px]': !fullscreen, |
|
|
|
id="nc-selected-item-icon" |
|
|
|
}" |
|
|
|
class="flex-none text-primary w-4 h-4" |
|
|
|
dropdown-class-name="w-[250px]" |
|
|
|
/> |
|
|
|
:filter-option="filterOption" |
|
|
|
|
|
|
|
show-search |
|
|
|
|
|
|
|
@change="onViewSelect" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<a-select-option v-for="view of viewList" :key="view.label" :value="view.value"> |
|
|
|
|
|
|
|
<div class="w-full flex items-center gap-2"> |
|
|
|
|
|
|
|
<div class="min-w-5 flex items-center justify-center"> |
|
|
|
|
|
|
|
<GeneralViewIcon :meta="{ meta: view.meta, type: view.type }" class="flex-none text-gray-500" /> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<NcTooltip class="flex-1 truncate" show-on-truncate-only> |
|
|
|
</a-select-option> |
|
|
|
<template #title>{{ view.label }}</template> |
|
|
|
</NcSelect> |
|
|
|
<span>{{ view.label }}</span> |
|
|
|
|
|
|
|
</NcTooltip> |
|
|
|
<NcSelect |
|
|
|
<component |
|
|
|
v-model:value="exportPayload.viewId" |
|
|
|
:is="iconMap.check" |
|
|
|
placeholder="-select view-" |
|
|
|
v-if="exportPayload.viewId === view.value" |
|
|
|
:disabled="isExporting" |
|
|
|
id="nc-selected-item-icon" |
|
|
|
class="nc-data-exporter-view-select" |
|
|
|
class="flex-none text-primary w-4 h-4" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</div> </a-select-option |
|
|
|
|
|
|
|
></NcSelect> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="flex-none flex justify-end"> |
|
|
|
|
|
|
|
<NcTooltip class="flex" placement="topRight" :disabled="!isExporting"> |
|
|
|
|
|
|
|
<template #title> The CSV file is being prepared in the background. You'll be notified once it's ready. </template> |
|
|
|
|
|
|
|
<NcButton :disabled="!exportPayload?.viewId" :loading="isExporting" size="xs" @click="exportDataAsync">{{ |
|
|
|
|
|
|
|
isExporting ? 'Generating' : 'Export' |
|
|
|
|
|
|
|
}}</NcButton> |
|
|
|
|
|
|
|
</NcTooltip> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="data-exporter-body flex-1 flex flex-col"> |
|
|
|
|
|
|
|
<div class="data-exporter-header">Recent Exports</div> |
|
|
|
|
|
|
|
<div v-if="exportedFiles.length" class="flex-1 flex flex-col nc-scrollbar-thin max-h-[calc(100%_-_25px)]"> |
|
|
|
|
|
|
|
<template v-for="exp of exportedFiles"> |
|
|
|
|
|
|
|
<div |
|
|
|
|
|
|
|
v-if="exp.status === JobStatus.COMPLETED ? exp.result : true" |
|
|
|
|
|
|
|
:key="exp.id" |
|
|
|
|
|
|
|
class="px-3 py-2 flex gap-2 justify-between border-b-1 hover:bg-gray-50" |
|
|
|
|
|
|
|
:class="{ |
|
|
|
:class="{ |
|
|
|
'px-4 py-3': fullscreen, |
|
|
|
'flex-1 max-w-[240px]': fullscreen, |
|
|
|
'px-3 py-2': !fullscreen, |
|
|
|
'min-w-1/2 max-w-[175px]': !fullscreen, |
|
|
|
}" |
|
|
|
}" |
|
|
|
|
|
|
|
dropdown-class-name="w-[250px]" |
|
|
|
|
|
|
|
:filter-option="filterOption" |
|
|
|
|
|
|
|
show-search |
|
|
|
|
|
|
|
@change="onViewSelect" |
|
|
|
> |
|
|
|
> |
|
|
|
|
|
|
|
<a-select-option v-for="view of viewList" :key="view.label" :value="view.value"> |
|
|
|
|
|
|
|
<div class="w-full flex items-center gap-2"> |
|
|
|
|
|
|
|
<div class="min-w-5 flex items-center justify-center"> |
|
|
|
|
|
|
|
<GeneralViewIcon :meta="{ meta: view.meta, type: view.type }" class="flex-none text-gray-500" /> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<NcTooltip class="flex-1 truncate" show-on-truncate-only> |
|
|
|
|
|
|
|
<template #title>{{ view.label }}</template> |
|
|
|
|
|
|
|
<span>{{ view.label }}</span> |
|
|
|
|
|
|
|
</NcTooltip> |
|
|
|
|
|
|
|
<component |
|
|
|
|
|
|
|
:is="iconMap.check" |
|
|
|
|
|
|
|
v-if="exportPayload.viewId === view.value" |
|
|
|
|
|
|
|
id="nc-selected-item-icon" |
|
|
|
|
|
|
|
class="flex-none text-primary w-4 h-4" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</div> </a-select-option |
|
|
|
|
|
|
|
></NcSelect> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="flex-none flex justify-end"> |
|
|
|
|
|
|
|
<NcTooltip class="flex" placement="topRight" :disabled="!isExporting"> |
|
|
|
|
|
|
|
<template #title> The CSV file is being prepared in the background. You'll be notified once it's ready. </template> |
|
|
|
|
|
|
|
<NcButton :disabled="!exportPayload?.viewId" :loading="isExporting" size="xs" @click="exportDataAsync">{{ |
|
|
|
|
|
|
|
isExporting ? 'Generating' : 'Export' |
|
|
|
|
|
|
|
}}</NcButton> |
|
|
|
|
|
|
|
</NcTooltip> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="data-exporter-body flex-1 flex flex-col"> |
|
|
|
|
|
|
|
<div class="data-exporter-header">Recent Exports</div> |
|
|
|
|
|
|
|
<div v-if="exportedFiles.length" class="flex-1 flex flex-col nc-scrollbar-thin max-h-[calc(100%_-_25px)]"> |
|
|
|
|
|
|
|
<template v-for="exp of exportedFiles"> |
|
|
|
<div |
|
|
|
<div |
|
|
|
class="flex-1 flex items-center gap-3" |
|
|
|
v-if="exp.status === JobStatus.COMPLETED ? exp.result : true" |
|
|
|
|
|
|
|
:key="exp.id" |
|
|
|
|
|
|
|
class="px-3 py-2 flex gap-2 justify-between border-b-1 hover:bg-gray-50" |
|
|
|
:class="{ |
|
|
|
:class="{ |
|
|
|
'max-w-[calc(100%_-_74px)]': exp.status === JobStatus.COMPLETED, |
|
|
|
'px-4 py-3': fullscreen, |
|
|
|
'max-w-[calc(100%_-_38px)]': exp.status !== JobStatus.COMPLETED, |
|
|
|
'px-3 py-2': !fullscreen, |
|
|
|
}" |
|
|
|
}" |
|
|
|
> |
|
|
|
> |
|
|
|
<NcTooltip v-if="[JobStatus.COMPLETED, JobStatus.FAILED].includes(exp.status)" class="flex"> |
|
|
|
<div |
|
|
|
<template #title> |
|
|
|
class="flex-1 flex items-center gap-3" |
|
|
|
{{ jobStatusTooltip[exp.status] }} |
|
|
|
:class="{ |
|
|
|
</template> |
|
|
|
'max-w-[calc(100%_-_74px)]': exp.status === JobStatus.COMPLETED, |
|
|
|
<GeneralIcon |
|
|
|
'max-w-[calc(100%_-_38px)]': exp.status !== JobStatus.COMPLETED, |
|
|
|
:icon="exp.status === JobStatus.COMPLETED ? 'circleCheckSolid' : 'alertTriangleSolid'" |
|
|
|
}" |
|
|
|
class="flex-none h-4 w-4" |
|
|
|
> |
|
|
|
:class="{ |
|
|
|
<NcTooltip v-if="[JobStatus.COMPLETED, JobStatus.FAILED].includes(exp.status)" class="flex"> |
|
|
|
'!text-green-700': exp.status === JobStatus.COMPLETED, |
|
|
|
<template #title> |
|
|
|
'!text-red-700': exp.status === JobStatus.FAILED, |
|
|
|
{{ jobStatusTooltip[exp.status] }} |
|
|
|
}" |
|
|
|
</template> |
|
|
|
/> |
|
|
|
<GeneralIcon |
|
|
|
</NcTooltip> |
|
|
|
:icon="exp.status === JobStatus.COMPLETED ? 'circleCheckSolid' : 'alertTriangleSolid'" |
|
|
|
<div v-else class="h-5 flex items-center"> |
|
|
|
class="flex-none h-4 w-4" |
|
|
|
<GeneralLoader size="regular" class="flex-none" /> |
|
|
|
:class="{ |
|
|
|
</div> |
|
|
|
'!text-green-700': exp.status === JobStatus.COMPLETED, |
|
|
|
|
|
|
|
'!text-red-700': exp.status === JobStatus.FAILED, |
|
|
|
|
|
|
|
}" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</NcTooltip> |
|
|
|
|
|
|
|
<div v-else class="h-5 flex items-center"> |
|
|
|
|
|
|
|
<GeneralLoader size="regular" class="flex-none" /> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div class="flex-1 max-w-[calc(100%_-_28px)] flex flex-col gap-1"> |
|
|
|
<div class="flex-1 max-w-[calc(100%_-_28px)] flex flex-col gap-1"> |
|
|
|
<div class="inline-flex gap-1 text-sm text-gray-800 -ml-[1px]"> |
|
|
|
<div class="inline-flex gap-1 text-sm text-gray-800 -ml-[1px]"> |
|
|
|
<span class="inline-flex items-center h-5"> |
|
|
|
<span class="inline-flex items-center h-5"> |
|
|
|
<GeneralIcon icon="file" class="flex-none text-gray-600/80 h-3.5 w-3.5" /> |
|
|
|
<GeneralIcon icon="file" class="flex-none text-gray-600/80 h-3.5 w-3.5" /> |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
<NcTooltip class="truncate max-w-[calc(100%_-_20px)]" show-on-truncate-only> |
|
|
|
<NcTooltip class="truncate max-w-[calc(100%_-_20px)]" show-on-truncate-only> |
|
|
|
<template #title> |
|
|
|
<template #title> |
|
|
|
|
|
|
|
{{ exp.result.title || titleHelper() }} |
|
|
|
|
|
|
|
</template> |
|
|
|
{{ exp.result.title || titleHelper() }} |
|
|
|
{{ exp.result.title || titleHelper() }} |
|
|
|
</template> |
|
|
|
</NcTooltip> |
|
|
|
{{ exp.result.title || titleHelper() }} |
|
|
|
</div> |
|
|
|
</NcTooltip> |
|
|
|
<div v-if="exp.result.timestamp" class="text-[10px] leading-4 text-gray-600"> |
|
|
|
</div> |
|
|
|
<NcTooltip class="truncate" show-on-truncate-only> |
|
|
|
<div v-if="exp.result.timestamp" class="text-[10px] leading-4 text-gray-600"> |
|
|
|
<template #title> |
|
|
|
<NcTooltip class="truncate" show-on-truncate-only> |
|
|
|
{{ dayjs(exp.result.timestamp).format('MM/DD/YYYY [at] hh:mm A') }} |
|
|
|
<template #title> |
|
|
|
</template> |
|
|
|
{{ dayjs(exp.result.timestamp).format('MM/DD/YYYY [at] hh:mm A') }} |
|
|
|
{{ dayjs(exp.result.timestamp).format('MM/DD/YYYY [at] hh:mm A') }} |
|
|
|
</template> |
|
|
|
</NcTooltip> |
|
|
|
{{ dayjs(exp.result.timestamp).format('MM/DD/YYYY [at] hh:mm A') }} |
|
|
|
</div> |
|
|
|
</NcTooltip> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div |
|
|
|
<div |
|
|
|
v-if="exp.status === JobStatus.COMPLETED" |
|
|
|
v-if="exp.status === JobStatus.COMPLETED" |
|
|
|
class="flex items-center" |
|
|
|
class="flex items-center" |
|
|
|
@click="handleDownload(urlHelper(exp.result.url))" |
|
|
|
@click="handleDownload(urlHelper(exp.result.url))" |
|
|
|
> |
|
|
|
> |
|
|
|
<NcTooltip class="flex items-center"> |
|
|
|
<NcTooltip class="flex items-center"> |
|
|
|
<template #title> |
|
|
|
<template #title> |
|
|
|
{{ $t('general.download') }} |
|
|
|
{{ $t('general.download') }} |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<NcButton type="secondary" size="xs" class="!px-[5px]"> |
|
|
|
<NcButton type="secondary" size="xs" class="!px-[5px]"> |
|
|
|
<div class="flex items-center gap-2"> |
|
|
|
<div class="flex items-center gap-2"> |
|
|
|
<GeneralIcon icon="download" /> |
|
|
|
<GeneralIcon icon="download" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</NcButton> |
|
|
|
</NcButton> |
|
|
|
</NcTooltip> |
|
|
|
</NcTooltip> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div class="flex items-center"> |
|
|
|
<div class="flex items-center"> |
|
|
|
<NcTooltip class="flex"> |
|
|
|
<NcTooltip class="flex"> |
|
|
|
<template #title> |
|
|
|
<template #title> |
|
|
|
{{ $t('general.remove') }} |
|
|
|
{{ $t('general.remove') }} |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<NcButton type="text" size="xs" class="!px-[5px]" @click="onRemoveExportedFile(exp.id)"> |
|
|
|
<NcButton type="text" size="xs" class="!px-[5px]" @click="onRemoveExportedFile(exp.id)"> |
|
|
|
<GeneralIcon icon="close" /> |
|
|
|
<GeneralIcon icon="close" /> |
|
|
|
</NcButton> |
|
|
|
</NcButton> |
|
|
|
</NcTooltip> |
|
|
|
</NcTooltip> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div v-else class="px-3 py-2 flex-1 flex items-center justify-center text-gray-600">No exports</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div v-else class="px-3 py-2 flex-1 flex items-center justify-center text-gray-600">No exports</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</ExtensionsExtensionWrapper> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|
<style lang="scss" scoped> |
|
|
|
.data-exporter { |
|
|
|
.data-exporter { |
|
|
|
@apply flex flex-col overflow-hidden h-full; |
|
|
|
@apply flex flex-col overflow-hidden h-full; |
|
|
|
.data-exporter-header { |
|
|
|
.data-exporter-header { |
|
|
|
@apply px-3 py-1 bg-gray-100 text-[11px] leading-4 text-gray-600 border-b-1; |
|
|
|
@apply px-3 py-1 bg-gray-100 text-[11px] leading-4 text-gray-600 border-b-1; |
|
|
|
} |
|
|
|
} |
|
|
|