@webx-ui/module-catalog 0.8.9 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CategoriesPage-B6GBTzvN.js +279 -0
- package/dist/CategoriesPage-B6GBTzvN.js.map +1 -0
- package/dist/CategoryEditorPage-y6EFmOof.js +232 -0
- package/dist/CategoryEditorPage-y6EFmOof.js.map +1 -0
- package/dist/DeletedPage-TGTyQbzn.js +214 -0
- package/dist/DeletedPage-TGTyQbzn.js.map +1 -0
- package/dist/ExchangeImportPage-C6cSg7Cr.js +603 -0
- package/dist/ExchangeImportPage-C6cSg7Cr.js.map +1 -0
- package/dist/ExchangePage-9RrRcSiS.js +544 -0
- package/dist/ExchangePage-9RrRcSiS.js.map +1 -0
- package/dist/ExchangeProfilePage-BUnh9_D7.js +321 -0
- package/dist/ExchangeProfilePage-BUnh9_D7.js.map +1 -0
- package/dist/ExchangeProfilesPage-T6G3HHD8.js +180 -0
- package/dist/ExchangeProfilesPage-T6G3HHD8.js.map +1 -0
- package/dist/ProductEditorPage-Bfp6ZV3d.js +262 -0
- package/dist/ProductEditorPage-Bfp6ZV3d.js.map +1 -0
- package/dist/ProductsPage-BBmw9W4m.js +963 -0
- package/dist/ProductsPage-BBmw9W4m.js.map +1 -0
- package/dist/index-BTEbHnJ5.js +2571 -0
- package/dist/index-BTEbHnJ5.js.map +1 -0
- package/dist/index.d.ts +67 -9
- package/dist/index.js +46 -6056
- package/dist/index.js.map +1 -1
- package/dist/paths-DvfRnXtl.js +15 -0
- package/dist/paths-DvfRnXtl.js.map +1 -0
- package/dist/style.css +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExchangeImportPage-C6cSg7Cr.js","sources":["../src/ExchangeImportPage.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, onMounted, ref } from 'vue'\nimport { useRoute, useRouter } from 'vue-router'\nimport {\n useAdmin,\n useChunkedUpload,\n useErrorText,\n useTranslate,\n WxScreen,\n WxScreenHead,\n} from '@webx-ui/module-admin'\nimport {\n toast,\n WxAlert,\n WxButton,\n WxCard,\n WxFormItem,\n WxInput,\n WxProgress,\n WxSegmented,\n WxSelect,\n WxStep,\n WxSteps,\n WxText,\n type SelectOption,\n} from '@webx-ui/core'\nimport type { ScreenModel } from '@webx-ui/schema'\nimport {\n createExchangeApi,\n EXCHANGE_PURPOSE,\n IMPORT_DEFAULTS,\n type ExchangeColumnInfo,\n type ExchangeInspection,\n type ExchangeProfile,\n type ExchangeSource,\n} from './exchange'\nimport { useCatalogMessages } from './i18n'\n\n/**\n * The import wizard (§8.1 of the exchange spec, screen `catalog.exchange-import`): a file — an\n * upload in pieces or an address the server downloads — then its columns matched to the\n * catalogue's with five rows of the file under each, then how the rows are written. The last\n * step checks the whole file without writing, or runs it; either way the run is followed in\n * «Exchange».\n *\n * The settings are a described screen: a project can take a setting away or fix it with a\n * patch, the way it does any form of the panel. A profile fills all three steps at once — its\n * columns are laid over the header of the file, and what the file has that the profile does not\n * know keeps the server's guess.\n */\nconst props = withDefaults(defineProps<{ base?: string }>(), { base: '/catalog' })\n\nconst context = useAdmin()\nconst api = createExchangeApi(context)\nconst upload = useChunkedUpload({ admin: context })\nconst route = useRoute()\nconst router = useRouter()\nuseCatalogMessages()\n\nconst t = useTranslate('webx-catalog')\nconst message = useErrorText()\n\nconst step = ref(0)\nconst way = ref<'upload' | 'url'>('upload')\nconst url = ref('')\nconst source = ref<ExchangeSource | null>(null)\nconst fileName = ref('')\nconst inspection = ref<ExchangeInspection | null>(null)\nconst reading = ref(false)\nconst encoding = ref<string | null>(null)\nconst delimiter = ref<string | null>(null)\n\nconst columns = ref<ExchangeColumnInfo[]>([])\nconst profiles = ref<ExchangeProfile[]>([])\nconst profileId = ref<number | null>(null)\nconst mapping = ref<Record<string, string | null>>({})\nconst options = ref<ScreenModel>({ ...IMPORT_DEFAULTS })\nconst profileName = ref('')\nconst saving = ref(false)\nconst starting = ref<'run' | 'check' | null>(null)\nconst picker = ref<HTMLInputElement | null>(null)\n\nconst profile = computed(() => profiles.value.find((one) => one.id === profileId.value) ?? null)\n\nonMounted(async () => {\n try {\n const [found, saved] = await Promise.all([api.columns(), api.profiles('import')])\n\n columns.value = found\n profiles.value = saved\n } catch (error) {\n toast.danger(message(error))\n }\n\n const wanted = Number(route.query.profile)\n\n if (Number.isInteger(wanted) && profiles.value.some((one) => one.id === wanted)) {\n chooseProfile(wanted)\n }\n})\n\nfunction chooseProfile(id: number | null): void {\n profileId.value = id\n\n const chosen = profiles.value.find((one) => one.id === id)\n\n options.value = { ...IMPORT_DEFAULTS, ...(chosen?.options ?? {}) }\n encoding.value = typeof chosen?.options.encoding === 'string' ? chosen.options.encoding : null\n delimiter.value = typeof chosen?.options.delimiter === 'string' ? chosen.options.delimiter : null\n\n if (inspection.value) mapping.value = mapped(inspection.value)\n}\n\n/* ------------------------------------------------------------------ file ----- */\n\nconst ways = computed(() => [\n { value: 'upload', label: t('panel.exchange-source-upload'), icon: 'upload' as const },\n { value: 'url', label: t('panel.exchange-source-url'), icon: 'link' as const },\n])\n\nconst uploading = computed(\n () => upload.state.value === 'uploading' || upload.state.value === 'paused',\n)\n\nasync function onFile(event: Event): Promise<void> {\n const input = event.target as HTMLInputElement\n const file = input.files?.[0]\n\n input.value = ''\n\n if (!file) return\n\n fileName.value = file.name\n inspection.value = null\n\n try {\n const id = await upload.start(file, EXCHANGE_PURPOSE)\n\n if (id === null) return\n\n source.value = { upload_id: id }\n await inspect()\n } catch (error) {\n toast.danger(message(error))\n }\n}\n\nasync function readUrl(): Promise<void> {\n const address = url.value.trim()\n\n if (address === '') return\n\n fileName.value = address\n source.value = { url: address }\n await inspect()\n}\n\n/** The header of the file as a profile names it, the server's guess for the rest. */\nfunction mapped(found: ExchangeInspection): Record<string, string | null> {\n const saved = profile.value?.mapping\n\n if (!saved || Array.isArray(saved)) return { ...found.mapping }\n\n return Object.fromEntries(\n found.header\n .filter((cell) => cell.trim() !== '')\n .map((cell) => [cell, saved[cell] ?? found.mapping[cell] ?? null]),\n )\n}\n\nasync function inspect(): Promise<void> {\n if (source.value === null) return\n\n reading.value = true\n\n try {\n const found = await api.inspect(source.value, {\n encoding: encoding.value ?? undefined,\n delimiter: delimiter.value ?? undefined,\n })\n\n inspection.value = found\n mapping.value = mapped(found)\n if (step.value === 0) step.value = 1\n } catch (error) {\n toast.danger(message(error))\n } finally {\n reading.value = false\n }\n}\n\n/* ------------------------------------------------------------------ columns ----- */\n\nconst encodings = computed<SelectOption[]>(() =>\n ['UTF-8', 'Windows-1252', 'Windows-1251', 'ISO-8859-1'].map((code) => ({\n value: code,\n label: code,\n })),\n)\n\nconst delimiters = computed<SelectOption[]>(() => [\n { value: ',', label: ',' },\n { value: ';', label: ';' },\n { value: '\\t', label: t('panel.exchange-delimiter-tab') },\n])\n\n/** Every column the caller may map, each translation a choice of its own: `name@de`. */\nconst targets = computed<SelectOption[]>(() =>\n columns.value.flatMap((column) => [\n { value: column.key, label: `${column.label} · ${column.key}` },\n ...column.locales.map((code) => ({\n value: `${column.key}@${code}`,\n label: `${column.label} (${code.toUpperCase()}) · ${column.key}@${code}`,\n })),\n ]),\n)\n\nconst headers = computed(() =>\n (inspection.value?.header ?? [])\n .map((cell, index) => ({ cell: cell.trim(), index }))\n .filter((one) => one.cell !== ''),\n)\n\n/** A column of the catalogue goes into one header only: the ones taken elsewhere are off. */\nfunction targetsFor(cell: string): SelectOption[] {\n const taken = new Set(\n Object.entries(mapping.value)\n .filter(([header, code]) => header !== cell && code)\n .map(([, code]) => code),\n )\n\n return targets.value.map((one) => ({ ...one, disabled: taken.has(String(one.value)) }))\n}\n\nfunction samples(index: number): string[] {\n return (inspection.value?.sample ?? []).map((row) => row[index] ?? '').filter((one) => one !== '')\n}\n\nconst mappedCount = computed(() => Object.values(mapping.value).filter(Boolean).length)\n\nconst keyMissing = computed(\n () => !Object.values(mapping.value).includes(String(options.value.key ?? 'sku')),\n)\n\nfunction setTarget(cell: string, value: unknown): void {\n mapping.value = {\n ...mapping.value,\n [cell]: value === null || value === '' ? null : String(value),\n }\n}\n\n/* ------------------------------------------------------------------ settings ----- */\n\nfunction plan(): {\n profile_id?: number\n mapping: Record<string, string | null>\n options: ScreenModel\n} {\n return {\n ...(profileId.value !== null ? { profile_id: profileId.value } : {}),\n mapping: mapping.value,\n options: {\n ...options.value,\n ...(inspection.value?.format === 'csv'\n ? { encoding: encoding.value ?? undefined, delimiter: delimiter.value ?? undefined }\n : {}),\n format: inspection.value?.format,\n },\n }\n}\n\nasync function start(dryRun: boolean): Promise<void> {\n if (source.value === null) return\n\n starting.value = dryRun ? 'check' : 'run'\n\n try {\n const run = await api.startImport(source.value, plan(), dryRun)\n\n toast.success(dryRun ? t('panel.exchange-checked') : t('panel.exchange-started'))\n void router.push({ path: `${props.base}/exchange`, query: { run: String(run.id) } })\n } catch (error) {\n toast.danger(message(error))\n } finally {\n starting.value = null\n }\n}\n\nasync function saveProfile(): Promise<void> {\n const name = profileName.value.trim()\n\n if (name === '' || inspection.value === null) return\n\n saving.value = true\n\n try {\n const rest = plan()\n const created = await api.createProfile({\n name,\n direction: 'import',\n format: inspection.value.format,\n options: rest.options,\n mapping: Object.fromEntries(\n Object.entries(rest.mapping).filter((entry): entry is [string, string] => !!entry[1]),\n ),\n })\n\n profiles.value = [...profiles.value, created]\n profileId.value = created.id\n profileName.value = ''\n toast.success(t('panel.exchange-profile-saved'))\n } catch (error) {\n toast.danger(message(error))\n } finally {\n saving.value = false\n }\n}\n\nconst profileOptions = computed<SelectOption[]>(() =>\n profiles.value.map((one) => ({ value: one.id, label: one.name })),\n)\n\n/** A profile that never ran is checked first: the button that writes is not the loud one. */\nconst checkFirst = computed(() => profile.value !== null && profile.value.last_run_id === null)\n\nfunction go(index: number): void {\n if (index < step.value) step.value = index\n}\n</script>\n\n<template>\n <div class=\"wx-catalog-import\">\n <wx-screen-head\n :back=\"`${props.base}/exchange`\"\n :back-label=\"t('panel.exchange-title')\"\n :title=\"t('panel.exchange-import-title')\"\n :subtitle=\"t('panel.exchange-import-help')\"\n />\n\n <wx-card>\n <wx-steps\n :current=\"step\"\n clickable\n :min-step-width=\"140\"\n :aria-label=\"t('panel.exchange-import-title')\"\n @change=\"go\"\n >\n <wx-step\n :title=\"t('panel.exchange-step-file')\"\n :description=\"t('panel.exchange-step-file-help')\"\n />\n <wx-step\n :title=\"t('panel.exchange-step-mapping')\"\n :description=\"t('panel.exchange-step-mapping-help')\"\n />\n <wx-step\n :title=\"t('panel.exchange-step-settings')\"\n :description=\"t('panel.exchange-step-settings-help')\"\n />\n </wx-steps>\n </wx-card>\n\n <!-- 1. The file. -->\n <wx-card v-if=\"step === 0\">\n <div class=\"wx-catalog-import__file\">\n <wx-form-item v-if=\"profiles.length > 0\" :label=\"t('panel.exchange-use-profile')\">\n <wx-select\n :model-value=\"profileId\"\n :options=\"profileOptions\"\n clearable\n :placeholder=\"t('panel.exchange-use-profile-none')\"\n :aria-label=\"t('panel.exchange-use-profile')\"\n @update:model-value=\"\n (value: unknown) => chooseProfile((value as number | null) ?? null)\n \"\n />\n </wx-form-item>\n\n <wx-segmented v-model=\"way\" :options=\"ways\" :aria-label=\"t('panel.exchange-step-file')\" />\n\n <div v-if=\"way === 'upload'\" class=\"wx-catalog-import__upload\">\n <input ref=\"picker\" type=\"file\" accept=\".csv,.txt,.xlsx\" hidden @change=\"onFile\" />\n <div v-if=\"uploading\" class=\"wx-catalog-import__progress\" role=\"status\">\n <wx-text size=\"sm\" weight=\"medium\" truncate>{{ fileName }}</wx-text>\n <wx-progress\n :value=\"Math.round(upload.progress.value * 100)\"\n :aria-label=\"t('panel.exchange-uploading')\"\n />\n <div class=\"wx-catalog-import__row\">\n <wx-button\n v-if=\"upload.state.value === 'uploading'\"\n size=\"sm\"\n variant=\"outline\"\n @click=\"upload.pause()\"\n >\n {{ t('panel.exchange-pause') }}\n </wx-button>\n <wx-button v-else size=\"sm\" variant=\"outline\" @click=\"upload.resume()\">\n {{ t('panel.exchange-resume') }}\n </wx-button>\n <wx-button size=\"sm\" variant=\"text\" @click=\"upload.cancel()\">\n {{ t('panel.exchange-cancel') }}\n </wx-button>\n </div>\n </div>\n <template v-else>\n <wx-button icon=\"upload\" :loading=\"reading\" @click=\"picker?.click()\">\n {{ t('panel.exchange-choose-file') }}\n </wx-button>\n <wx-text size=\"sm\" tone=\"muted\">{{ t('panel.exchange-file-help') }}</wx-text>\n </template>\n </div>\n\n <form v-else class=\"wx-catalog-import__url\" @submit.prevent=\"readUrl\">\n <wx-form-item :label=\"t('panel.exchange-url')\" :help=\"t('panel.exchange-url-help')\">\n <wx-input v-model=\"url\" type=\"url\" placeholder=\"https://\" />\n </wx-form-item>\n <wx-button\n native-type=\"submit\"\n :loading=\"reading\"\n :disabled=\"url.trim() === ''\"\n class=\"wx-catalog-import__read\"\n >\n {{ t('panel.exchange-read') }}\n </wx-button>\n </form>\n\n <wx-text v-if=\"inspection\" size=\"sm\" tone=\"muted\">\n {{ fileName }} · {{ inspection.format.toUpperCase() }}\n </wx-text>\n </div>\n\n <div class=\"wx-catalog-import__nav\">\n <span />\n <wx-button type=\"primary\" :disabled=\"inspection === null\" @click=\"step = 1\">\n {{ t('panel.exchange-next') }}\n </wx-button>\n </div>\n </wx-card>\n\n <!-- 2. Its columns. -->\n <wx-card v-else-if=\"step === 1 && inspection\">\n <div v-if=\"inspection.format === 'csv'\" class=\"wx-catalog-import__read-as\">\n <wx-text size=\"sm\" tone=\"muted\">{{ t('panel.exchange-read-as') }}</wx-text>\n <wx-select\n v-model=\"encoding\"\n :options=\"encodings\"\n clearable\n size=\"sm\"\n :placeholder=\"`${t('panel.exchange-encoding')}: ${inspection.options.encoding ?? t('panel.exchange-detect')}`\"\n :aria-label=\"t('panel.exchange-encoding')\"\n class=\"wx-catalog-import__read-select\"\n />\n <wx-select\n v-model=\"delimiter\"\n :options=\"delimiters\"\n clearable\n size=\"sm\"\n :placeholder=\"`${t('panel.exchange-delimiter')}: ${inspection.options.delimiter === '\\t' ? t('panel.exchange-delimiter-tab') : (inspection.options.delimiter ?? t('panel.exchange-detect'))}`\"\n :aria-label=\"t('panel.exchange-delimiter')\"\n class=\"wx-catalog-import__read-select\"\n />\n <wx-button size=\"sm\" variant=\"outline\" icon=\"refresh\" :loading=\"reading\" @click=\"inspect\">\n {{ t('panel.exchange-reread') }}\n </wx-button>\n </div>\n\n <wx-alert v-if=\"headers.length === 0\" type=\"warning\" :title=\"t('panel.exchange-map-empty')\" />\n\n <div\n v-else\n class=\"wx-catalog-import__map\"\n role=\"table\"\n :aria-label=\"t('panel.exchange-step-mapping')\"\n >\n <div class=\"wx-catalog-import__map-head\" role=\"row\">\n <span role=\"columnheader\">{{ t('panel.exchange-map-file') }}</span>\n <span role=\"columnheader\">{{ t('panel.exchange-map-catalog') }}</span>\n </div>\n <div v-for=\"one in headers\" :key=\"one.cell\" class=\"wx-catalog-import__map-row\" role=\"row\">\n <div class=\"wx-catalog-import__header\" role=\"cell\">\n <span class=\"wx-catalog-import__cell\">\n {{ one.cell }}\n <span\n v-if=\"mapping[one.cell] && mapping[one.cell] === options.key\"\n class=\"wx-catalog-import__key\"\n >\n {{ t('panel.exchange-map-key') }}\n </span>\n </span>\n <ul v-if=\"samples(one.index).length > 0\" class=\"wx-catalog-import__samples\">\n <li v-for=\"(value, at) in samples(one.index)\" :key=\"at\">{{ value }}</li>\n </ul>\n </div>\n <div class=\"wx-catalog-import__target\" role=\"cell\">\n <wx-select\n :model-value=\"mapping[one.cell] ?? null\"\n :options=\"targetsFor(one.cell)\"\n clearable\n filterable\n :placeholder=\"t('panel.exchange-map-skip')\"\n :aria-label=\"one.cell\"\n @update:model-value=\"(value: unknown) => setTarget(one.cell, value)\"\n />\n </div>\n </div>\n </div>\n\n <wx-alert\n v-if=\"headers.length > 0 && keyMissing\"\n type=\"warning\"\n :title=\"t('panel.exchange-map-key-missing', { key: String(options.key ?? 'sku') })\"\n />\n\n <div class=\"wx-catalog-import__nav\">\n <wx-button variant=\"outline\" @click=\"step = 0\">{{ t('panel.exchange-back') }}</wx-button>\n <wx-text size=\"sm\" tone=\"muted\">\n {{ t('panel.exchange-map-mapped', { count: mappedCount }) }}\n </wx-text>\n <wx-button type=\"primary\" :disabled=\"mappedCount === 0\" @click=\"step = 2\">\n {{ t('panel.exchange-next') }}\n </wx-button>\n </div>\n </wx-card>\n\n <!-- 3. How it is written. -->\n <template v-else-if=\"step === 2 && inspection\">\n <wx-alert v-if=\"checkFirst\" type=\"info\" :title=\"t('panel.exchange-check-first')\" />\n <wx-alert\n v-if=\"keyMissing\"\n type=\"warning\"\n :title=\"t('panel.exchange-map-key-missing', { key: String(options.key ?? 'sku') })\"\n />\n\n <wx-screen v-model=\"options\" name=\"catalog.exchange-import\" />\n\n <wx-card>\n <form class=\"wx-catalog-import__profile\" @submit.prevent=\"saveProfile\">\n <wx-form-item :label=\"t('panel.exchange-save-profile')\">\n <wx-input\n v-model=\"profileName\"\n :maxlength=\"120\"\n :placeholder=\"t('panel.exchange-profile-name')\"\n />\n </wx-form-item>\n <wx-button\n native-type=\"submit\"\n variant=\"outline\"\n :loading=\"saving\"\n :disabled=\"profileName.trim() === ''\"\n class=\"wx-catalog-import__read\"\n >\n {{ t('panel.exchange-save') }}\n </wx-button>\n </form>\n\n <div class=\"wx-catalog-import__nav\">\n <wx-button variant=\"outline\" @click=\"step = 1\">{{ t('panel.exchange-back') }}</wx-button>\n <div class=\"wx-catalog-import__row\">\n <wx-button\n :type=\"checkFirst ? 'primary' : 'default'\"\n :variant=\"checkFirst ? undefined : 'outline'\"\n :loading=\"starting === 'check'\"\n :disabled=\"starting !== null || keyMissing\"\n @click=\"start(true)\"\n >\n {{ t('panel.exchange-run-check') }}\n </wx-button>\n <wx-button\n :type=\"checkFirst ? 'default' : 'primary'\"\n :variant=\"checkFirst ? 'outline' : undefined\"\n :loading=\"starting === 'run'\"\n :disabled=\"starting !== null || keyMissing\"\n @click=\"start(false)\"\n >\n {{ t('panel.exchange-run') }}\n </wx-button>\n </div>\n </div>\n </wx-card>\n </template>\n </div>\n</template>\n\n<style scoped>\n.wx-catalog-import {\n display: flex;\n flex-direction: column;\n gap: var(--wx-gap, var(--wx-space-16));\n min-width: 0;\n container-type: inline-size;\n}\n\n.wx-catalog-import__file {\n display: grid;\n gap: var(--wx-space-16);\n justify-items: start;\n max-width: 560px;\n}\n\n.wx-catalog-import__file > :deep(.wx-form-item),\n.wx-catalog-import__url {\n justify-self: stretch;\n}\n\n.wx-catalog-import__upload {\n display: grid;\n gap: var(--wx-space-8);\n justify-items: start;\n justify-self: stretch;\n}\n\n.wx-catalog-import__progress {\n display: grid;\n gap: var(--wx-space-8);\n justify-self: stretch;\n min-width: 0;\n}\n\n.wx-catalog-import__row {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--wx-space-8);\n}\n\n.wx-catalog-import__url,\n.wx-catalog-import__profile {\n display: flex;\n flex-wrap: wrap;\n align-items: flex-end;\n gap: var(--wx-space-8) var(--wx-space-12);\n}\n\n.wx-catalog-import__url > :deep(.wx-form-item),\n.wx-catalog-import__profile > :deep(.wx-form-item) {\n flex: 1 1 240px;\n min-width: 0;\n margin-bottom: 0;\n}\n\n/* The field's help sits under the input; the button lines up with the input, not with it. */\n.wx-catalog-import__read {\n margin-bottom: var(--wx-space-24);\n}\n\n.wx-catalog-import__profile .wx-catalog-import__read {\n margin-bottom: 0;\n}\n\n.wx-catalog-import__read-as {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--wx-space-8);\n margin-bottom: var(--wx-space-16);\n}\n\n.wx-catalog-import__read-as > :deep(.wx-select) {\n width: 200px;\n}\n\n.wx-catalog-import__map {\n display: grid;\n min-width: 0;\n}\n\n.wx-catalog-import__map-head,\n.wx-catalog-import__map-row {\n display: grid;\n grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);\n gap: var(--wx-space-8) var(--wx-space-16);\n padding: var(--wx-space-10) 0;\n border-bottom: 1px solid var(--wx-border-muted);\n}\n\n.wx-catalog-import__map-head {\n padding-top: 0;\n font-size: var(--wx-font-size-sm);\n font-weight: var(--wx-font-weight-medium);\n color: var(--wx-text-muted);\n}\n\n.wx-catalog-import__header {\n display: grid;\n gap: var(--wx-space-4);\n min-width: 0;\n}\n\n.wx-catalog-import__cell {\n font-family: var(--wx-font-family-mono);\n font-weight: var(--wx-font-weight-medium);\n overflow-wrap: anywhere;\n}\n\n.wx-catalog-import__samples {\n display: grid;\n margin: 0;\n padding: 0;\n list-style: none;\n font-size: var(--wx-font-size-xs);\n color: var(--wx-text-muted);\n}\n\n.wx-catalog-import__samples li {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.wx-catalog-import__target {\n display: flex;\n align-items: flex-start;\n gap: var(--wx-space-8);\n min-width: 0;\n}\n\n.wx-catalog-import__target > :deep(.wx-select) {\n flex: 1 1 auto;\n min-width: 0;\n}\n\n.wx-catalog-import__key {\n display: inline-block;\n margin-inline-start: var(--wx-space-6);\n font-family: var(--wx-font-family-sans);\n vertical-align: middle;\n padding: var(--wx-space-2) var(--wx-space-8);\n border-radius: var(--wx-radius-full);\n background: var(--wx-color-primary-soft);\n color: var(--wx-color-primary);\n font-size: var(--wx-font-size-xs);\n font-weight: var(--wx-font-weight-medium);\n}\n\n.wx-catalog-import__nav {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: space-between;\n gap: var(--wx-space-8);\n margin-top: var(--wx-space-16);\n}\n\n/* A phone: the header of the file over its choice, not beside it. */\n@container (max-width: 520px) {\n .wx-catalog-import__map-head {\n display: none;\n }\n\n .wx-catalog-import__map-row {\n grid-template-columns: minmax(0, 1fr);\n }\n}\n</style>\n"],"names":["props","__props","context","useAdmin","api","createExchangeApi","upload","useChunkedUpload","route","useRoute","router","useRouter","useCatalogMessages","t","useTranslate","message","useErrorText","step","ref","way","url","source","fileName","inspection","reading","encoding","delimiter","columns","profiles","profileId","mapping","options","IMPORT_DEFAULTS","profileName","saving","starting","picker","profile","computed","one","onMounted","found","saved","error","toast","wanted","chooseProfile","id","chosen","mapped","ways","uploading","onFile","event","input","file","EXCHANGE_PURPOSE","inspect","readUrl","address","cell","encodings","code","delimiters","targets","column","headers","index","targetsFor","taken","header","samples","row","mappedCount","keyMissing","setTarget","value","plan","start","dryRun","run","saveProfile","name","rest","created","entry","profileOptions","checkFirst","go","_openBlock","_createElementBlock","_hoisted_1","_createVNode","_unref","WxScreenHead","WxCard","WxSteps","WxStep","_createBlock","_createElementVNode","_hoisted_2","WxFormItem","WxSelect","_cache","WxSegmented","$event","_hoisted_3","_hoisted_4","WxText","WxProgress","_hoisted_5","WxButton","_Fragment","WxInput","_createTextVNode","_toDisplayString","_hoisted_6","_hoisted_7","WxAlert","_hoisted_9","_hoisted_10","_hoisted_11","_renderList","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","at","_hoisted_16","_hoisted_17","WxScreen","_hoisted_18","_hoisted_19"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDA,UAAMA,IAAQC,IAERC,IAAUC,GAAA,GACVC,IAAMC,GAAkBH,CAAO,GAC/BI,IAASC,GAAiB,EAAE,OAAOL,GAAS,GAC5CM,KAAQC,GAAA,GACRC,KAASC,GAAA;AACf,IAAAC,GAAA;AAEA,UAAMC,IAAIC,GAAa,cAAc,GAC/BC,IAAUC,GAAA,GAEVC,IAAOC,EAAI,CAAC,GACZC,IAAMD,EAAsB,QAAQ,GACpCE,IAAMF,EAAI,EAAE,GACZG,IAASH,EAA2B,IAAI,GACxCI,IAAWJ,EAAI,EAAE,GACjBK,IAAaL,EAA+B,IAAI,GAChDM,IAAUN,EAAI,EAAK,GACnBO,IAAWP,EAAmB,IAAI,GAClCQ,IAAYR,EAAmB,IAAI,GAEnCS,IAAUT,EAA0B,EAAE,GACtCU,IAAWV,EAAuB,EAAE,GACpCW,IAAYX,EAAmB,IAAI,GACnCY,IAAUZ,EAAmC,EAAE,GAC/Ca,IAAUb,EAAiB,EAA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AAAA,kBAC/B,kCAAOI,GAAK,EAAA;AAAA,gBAAA;6BAEb,MAAmC;AAAA,wBAAhCe,EAAAhF,CAAA,EAAC,0BAAA,CAAA,GAAA,CAAA;AAAA,kBAAA;;;gBAEN+E,EAQYC,EAAAkB,CAAA,GAAA;AAAA,kBAPT,MAAMxB,EAAA,QAAU,YAAA;AAAA,kBAChB,SAASA,EAAA,QAAU,YAAe;AAAA,kBAClC,SAASpD,EAAA,UAAQ;AAAA,kBACjB,UAAUA,EAAA,UAAQ,QAAauC,EAAA;AAAA,kBAC/B,kCAAOI,GAAK,EAAA;AAAA,gBAAA;6BAEb,MAA6B;AAAA,wBAA1Be,EAAAhF,CAAA,EAAC,oBAAA,CAAA,GAAA,CAAA;AAAA,kBAAA;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,544 @@
|
|
|
1
|
+
import { defineComponent as V, ref as j, onMounted as Q, openBlock as l, createBlock as k, unref as e, isRef as re, createSlots as ce, withCtx as c, createElementBlock as h, Fragment as T, renderList as X, createTextVNode as b, toDisplayString as u, createCommentVNode as x, createVNode as $, watch as ie, computed as C, createElementVNode as y, normalizeClass as de } from "vue";
|
|
2
|
+
import { RouterLink as ge, useRoute as pe, useRouter as xe } from "vue-router";
|
|
3
|
+
import { useAdmin as q, createHistoryApi as fe, useTranslate as F, useErrorText as J, WxDate as Y, WxListScreen as he } from "@webx-ui/module-admin";
|
|
4
|
+
import { useModal as me, WxDialog as ve, WxSkeleton as _e, WxEmpty as ye, WxLink as ke, WxText as I, WxButton as S, toast as A, createModal as Z, WxAlert as L, WxTable as ee, WxBadge as O, WxProgress as be, WxIcon as we } from "@webx-ui/core";
|
|
5
|
+
import { a as U, _ as G, j as ae, k as P, E as $e, l as je } from "./index-BTEbHnJ5.js";
|
|
6
|
+
const Ee = {
|
|
7
|
+
key: 2,
|
|
8
|
+
class: "wx-catalog-journal"
|
|
9
|
+
}, We = /* @__PURE__ */ V({
|
|
10
|
+
__name: "ExchangeJournalDialog",
|
|
11
|
+
props: {
|
|
12
|
+
runId: {},
|
|
13
|
+
base: {}
|
|
14
|
+
},
|
|
15
|
+
setup(a) {
|
|
16
|
+
const i = a, { open: v, dismiss: m } = me(), s = q(), E = fe(s, "catalog.product", 0);
|
|
17
|
+
U();
|
|
18
|
+
const o = F("webx-catalog"), z = J(), w = j(null), d = j(1), W = j(1), f = j(!1);
|
|
19
|
+
async function N(_) {
|
|
20
|
+
f.value = !0;
|
|
21
|
+
try {
|
|
22
|
+
const g = await E.run(i.runId, _);
|
|
23
|
+
w.value = _ === 1 ? g.rows.data : [...w.value ?? [], ...g.rows.data], d.value = g.rows.current_page, W.value = g.rows.last_page;
|
|
24
|
+
} catch (g) {
|
|
25
|
+
A.danger(z(g)), w.value ??= [];
|
|
26
|
+
} finally {
|
|
27
|
+
f.value = !1;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
Q(() => {
|
|
31
|
+
N(1);
|
|
32
|
+
});
|
|
33
|
+
function R(_) {
|
|
34
|
+
return _.changes.map((g) => g.label).join(", ");
|
|
35
|
+
}
|
|
36
|
+
return (_, g) => (l(), k(e(ve), {
|
|
37
|
+
open: e(v),
|
|
38
|
+
"onUpdate:open": g[2] || (g[2] = (r) => re(v) ? v.value = r : null),
|
|
39
|
+
title: e(o)("panel.exchange-journal-title"),
|
|
40
|
+
width: 560
|
|
41
|
+
}, ce({
|
|
42
|
+
default: c(() => [
|
|
43
|
+
w.value === null ? (l(), k(e(_e), {
|
|
44
|
+
key: 0,
|
|
45
|
+
rows: 5
|
|
46
|
+
})) : w.value.length === 0 ? (l(), k(e(ye), {
|
|
47
|
+
key: 1,
|
|
48
|
+
description: e(o)("panel.exchange-journal-empty")
|
|
49
|
+
}, null, 8, ["description"])) : (l(), h("ul", Ee, [
|
|
50
|
+
(l(!0), h(T, null, X(w.value, (r) => (l(), h("li", {
|
|
51
|
+
key: r.id,
|
|
52
|
+
class: "wx-catalog-journal__row"
|
|
53
|
+
}, [
|
|
54
|
+
r.subject.id !== null ? (l(), k(e(ke), {
|
|
55
|
+
key: 0,
|
|
56
|
+
as: e(ge),
|
|
57
|
+
to: `${a.base}/products/${r.subject.id}`,
|
|
58
|
+
class: "wx-catalog-journal__subject",
|
|
59
|
+
onClick: g[0] || (g[0] = (B) => e(m)())
|
|
60
|
+
}, {
|
|
61
|
+
default: c(() => [
|
|
62
|
+
b(" #" + u(r.subject.id), 1)
|
|
63
|
+
]),
|
|
64
|
+
_: 2
|
|
65
|
+
}, 1032, ["as", "to"])) : x("", !0),
|
|
66
|
+
$(e(I), {
|
|
67
|
+
size: "sm",
|
|
68
|
+
tone: "muted",
|
|
69
|
+
class: "wx-catalog-journal__fields"
|
|
70
|
+
}, {
|
|
71
|
+
default: c(() => [
|
|
72
|
+
b(u(R(r)), 1)
|
|
73
|
+
]),
|
|
74
|
+
_: 2
|
|
75
|
+
}, 1024)
|
|
76
|
+
]))), 128))
|
|
77
|
+
]))
|
|
78
|
+
]),
|
|
79
|
+
_: 2
|
|
80
|
+
}, [
|
|
81
|
+
w.value !== null && d.value < W.value ? {
|
|
82
|
+
name: "footer",
|
|
83
|
+
fn: c(() => [
|
|
84
|
+
$(e(S), {
|
|
85
|
+
variant: "outline",
|
|
86
|
+
loading: f.value,
|
|
87
|
+
onClick: g[1] || (g[1] = (r) => N(d.value + 1))
|
|
88
|
+
}, {
|
|
89
|
+
default: c(() => [
|
|
90
|
+
b(u(e(o)("panel.exchange-journal-more")), 1)
|
|
91
|
+
]),
|
|
92
|
+
_: 1
|
|
93
|
+
}, 8, ["loading"])
|
|
94
|
+
]),
|
|
95
|
+
key: "0"
|
|
96
|
+
} : void 0
|
|
97
|
+
]), 1032, ["open", "title"]));
|
|
98
|
+
}
|
|
99
|
+
}), ze = /* @__PURE__ */ G(We, [["__scopeId", "data-v-7f2cb668"]]);
|
|
100
|
+
function te(a, i) {
|
|
101
|
+
if (a.direction === "export")
|
|
102
|
+
return a.rows_done > 0 || a.status === "done" ? [
|
|
103
|
+
{
|
|
104
|
+
key: "exported",
|
|
105
|
+
text: i("panel.exchange-exported", { count: a.rows_done }),
|
|
106
|
+
tone: "default"
|
|
107
|
+
}
|
|
108
|
+
] : [];
|
|
109
|
+
const v = [], m = (s, E, o) => {
|
|
110
|
+
E > 0 && v.push({ key: s, text: i(`panel.exchange-${s}`, { count: E }), tone: o });
|
|
111
|
+
};
|
|
112
|
+
return m("created", a.created, "success"), m("updated", a.updated, "default"), m("skipped", a.skipped, "muted"), m("absent", a.absent, "default"), a.failed > 0 && v.push({
|
|
113
|
+
key: "failed",
|
|
114
|
+
text: i("panel.exchange-errors-count", { count: a.failed }),
|
|
115
|
+
tone: "danger"
|
|
116
|
+
}), v;
|
|
117
|
+
}
|
|
118
|
+
const Ne = {
|
|
119
|
+
queued: "default",
|
|
120
|
+
running: "info",
|
|
121
|
+
done: "success",
|
|
122
|
+
stopped: "warning",
|
|
123
|
+
failed: "danger"
|
|
124
|
+
};
|
|
125
|
+
function K(a, i) {
|
|
126
|
+
const v = a.status === "done" && a.failed > 0 ? "warning" : Ne[a.status];
|
|
127
|
+
return { label: i(`panel.exchange-status-${a.status}`), type: v };
|
|
128
|
+
}
|
|
129
|
+
const Ce = { class: "wx-catalog-run" }, Ie = { class: "wx-catalog-run__facts" }, Re = {
|
|
130
|
+
key: 0,
|
|
131
|
+
class: "wx-catalog-run__fact"
|
|
132
|
+
}, Be = { class: "wx-catalog-run__source" }, De = {
|
|
133
|
+
key: 1,
|
|
134
|
+
class: "wx-catalog-run__fact"
|
|
135
|
+
}, Se = {
|
|
136
|
+
key: 2,
|
|
137
|
+
class: "wx-catalog-run__fact"
|
|
138
|
+
}, Te = {
|
|
139
|
+
key: 3,
|
|
140
|
+
class: "wx-catalog-run__fact"
|
|
141
|
+
}, Ae = {
|
|
142
|
+
key: 3,
|
|
143
|
+
class: "wx-catalog-run__totals"
|
|
144
|
+
}, Me = { class: "wx-catalog-run__actions" }, Le = {
|
|
145
|
+
key: 0,
|
|
146
|
+
class: "wx-catalog-run__code"
|
|
147
|
+
}, Pe = ["title"], Ve = /* @__PURE__ */ V({
|
|
148
|
+
__name: "ExchangeRunDetail",
|
|
149
|
+
props: {
|
|
150
|
+
run: {},
|
|
151
|
+
base: {},
|
|
152
|
+
profileName: {}
|
|
153
|
+
},
|
|
154
|
+
setup(a) {
|
|
155
|
+
const i = a, v = q(), m = ae(v);
|
|
156
|
+
U();
|
|
157
|
+
const s = F("webx-catalog"), E = J(), o = Z(ze), z = j([]), w = j(!1), d = j(!1);
|
|
158
|
+
async function W() {
|
|
159
|
+
if (i.run.failed === 0) {
|
|
160
|
+
z.value = [], w.value = !1;
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
d.value = !0;
|
|
164
|
+
try {
|
|
165
|
+
const _ = await m.errors(i.run.id);
|
|
166
|
+
z.value = _.data, w.value = _.last_page > 1;
|
|
167
|
+
} catch (_) {
|
|
168
|
+
A.danger(E(_));
|
|
169
|
+
} finally {
|
|
170
|
+
d.value = !1;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
ie(
|
|
174
|
+
() => [i.run.id, i.run.failed],
|
|
175
|
+
() => {
|
|
176
|
+
W();
|
|
177
|
+
},
|
|
178
|
+
{ immediate: !0 }
|
|
179
|
+
);
|
|
180
|
+
const f = C(() => te(i.run, s)), N = C(() => [
|
|
181
|
+
{ key: "row", label: s("panel.exchange-error-row"), width: 72, align: "right" },
|
|
182
|
+
{ key: "column", label: s("panel.exchange-error-column"), width: 150 },
|
|
183
|
+
{ key: "value", label: s("panel.exchange-error-value"), width: 180, hideBelow: 560 },
|
|
184
|
+
{ key: "message", label: s("panel.exchange-error-message"), minWidth: 200 }
|
|
185
|
+
]), R = C(
|
|
186
|
+
() => i.run.direction === "export" && i.run.status === "done" && i.run.file_url === null
|
|
187
|
+
);
|
|
188
|
+
return (_, g) => (l(), h("div", Ce, [
|
|
189
|
+
y("dl", Ie, [
|
|
190
|
+
a.run.source ? (l(), h("div", Re, [
|
|
191
|
+
y("dt", null, u(e(s)("panel.exchange-source")), 1),
|
|
192
|
+
y("dd", Be, u(a.run.source), 1)
|
|
193
|
+
])) : x("", !0),
|
|
194
|
+
a.profileName ? (l(), h("div", De, [
|
|
195
|
+
y("dt", null, u(e(s)("panel.exchange-profile")), 1),
|
|
196
|
+
y("dd", null, u(a.profileName), 1)
|
|
197
|
+
])) : x("", !0),
|
|
198
|
+
a.run.admin_name ? (l(), h("div", Se, [
|
|
199
|
+
y("dt", null, u(e(s)("panel.exchange-who")), 1),
|
|
200
|
+
y("dd", null, u(a.run.admin_name), 1)
|
|
201
|
+
])) : x("", !0),
|
|
202
|
+
a.run.started_at ? (l(), h("div", Te, [
|
|
203
|
+
y("dt", null, u(e(s)("panel.exchange-column-started")), 1),
|
|
204
|
+
y("dd", null, [
|
|
205
|
+
$(e(Y), {
|
|
206
|
+
value: a.run.started_at
|
|
207
|
+
}, null, 8, ["value"])
|
|
208
|
+
])
|
|
209
|
+
])) : x("", !0)
|
|
210
|
+
]),
|
|
211
|
+
a.run.dry_run && !e(P)(a.run) ? (l(), k(e(L), {
|
|
212
|
+
key: 0,
|
|
213
|
+
type: "info",
|
|
214
|
+
title: e(s)("panel.exchange-check-help")
|
|
215
|
+
}, null, 8, ["title"])) : x("", !0),
|
|
216
|
+
a.run.status === "stopped" ? (l(), k(e(L), {
|
|
217
|
+
key: 1,
|
|
218
|
+
type: "warning",
|
|
219
|
+
title: e(s)("panel.exchange-stopped-help")
|
|
220
|
+
}, null, 8, ["title"])) : x("", !0),
|
|
221
|
+
a.run.status === "failed" ? (l(), k(e(L), {
|
|
222
|
+
key: 2,
|
|
223
|
+
type: "danger",
|
|
224
|
+
title: e(s)("panel.exchange-failed-help")
|
|
225
|
+
}, null, 8, ["title"])) : x("", !0),
|
|
226
|
+
f.value.length > 0 ? (l(), h("ul", Ae, [
|
|
227
|
+
(l(!0), h(T, null, X(f.value, (r) => (l(), h("li", {
|
|
228
|
+
key: r.key,
|
|
229
|
+
class: de(`is-${r.tone}`)
|
|
230
|
+
}, u(r.text), 3))), 128))
|
|
231
|
+
])) : x("", !0),
|
|
232
|
+
y("div", Me, [
|
|
233
|
+
a.run.direction === "export" && a.run.file_url ? (l(), k(e(S), {
|
|
234
|
+
key: 0,
|
|
235
|
+
size: "sm",
|
|
236
|
+
type: "primary",
|
|
237
|
+
icon: "download",
|
|
238
|
+
href: e(m).file(a.run.id)
|
|
239
|
+
}, {
|
|
240
|
+
default: c(() => [
|
|
241
|
+
b(u(e(s)("panel.exchange-file")), 1)
|
|
242
|
+
]),
|
|
243
|
+
_: 1
|
|
244
|
+
}, 8, ["href"])) : R.value ? (l(), k(e(I), {
|
|
245
|
+
key: 1,
|
|
246
|
+
size: "sm",
|
|
247
|
+
tone: "muted"
|
|
248
|
+
}, {
|
|
249
|
+
default: c(() => [
|
|
250
|
+
b(u(e(s)("panel.exchange-file-gone")), 1)
|
|
251
|
+
]),
|
|
252
|
+
_: 1
|
|
253
|
+
})) : x("", !0),
|
|
254
|
+
a.run.history_id !== null && !a.run.dry_run ? (l(), k(e(S), {
|
|
255
|
+
key: 2,
|
|
256
|
+
size: "sm",
|
|
257
|
+
variant: "outline",
|
|
258
|
+
icon: "clock",
|
|
259
|
+
onClick: g[0] || (g[0] = (r) => e(o)({ runId: a.run.history_id, base: a.base }))
|
|
260
|
+
}, {
|
|
261
|
+
default: c(() => [
|
|
262
|
+
b(u(e(s)("panel.exchange-journal")), 1)
|
|
263
|
+
]),
|
|
264
|
+
_: 1
|
|
265
|
+
})) : x("", !0),
|
|
266
|
+
a.run.failed > 0 ? (l(), k(e(S), {
|
|
267
|
+
key: 3,
|
|
268
|
+
size: "sm",
|
|
269
|
+
variant: "outline",
|
|
270
|
+
icon: "download",
|
|
271
|
+
href: e(m).errorsFile(a.run.id)
|
|
272
|
+
}, {
|
|
273
|
+
default: c(() => [
|
|
274
|
+
b(u(e(s)("panel.exchange-errors-csv")), 1)
|
|
275
|
+
]),
|
|
276
|
+
_: 1
|
|
277
|
+
}, 8, ["href"])) : x("", !0)
|
|
278
|
+
]),
|
|
279
|
+
a.run.failed > 0 ? (l(), h(T, { key: 4 }, [
|
|
280
|
+
$(e(ee), {
|
|
281
|
+
data: z.value,
|
|
282
|
+
columns: N.value,
|
|
283
|
+
loading: d.value,
|
|
284
|
+
clickable: !1,
|
|
285
|
+
hover: !1,
|
|
286
|
+
pagination: !1,
|
|
287
|
+
"cards-below": 420,
|
|
288
|
+
"max-height": 360,
|
|
289
|
+
layout: "fixed",
|
|
290
|
+
size: "sm",
|
|
291
|
+
bordered: "",
|
|
292
|
+
"aria-label": e(s)("panel.exchange-errors")
|
|
293
|
+
}, {
|
|
294
|
+
"cell-column": c(({ row: r }) => [
|
|
295
|
+
r.column ? (l(), h("code", Le, u(r.column), 1)) : (l(), k(e(I), {
|
|
296
|
+
key: 1,
|
|
297
|
+
size: "sm",
|
|
298
|
+
tone: "muted"
|
|
299
|
+
}, {
|
|
300
|
+
default: c(() => [
|
|
301
|
+
b(u(e(s)("panel.exchange-error-whole-row")), 1)
|
|
302
|
+
]),
|
|
303
|
+
_: 1
|
|
304
|
+
}))
|
|
305
|
+
]),
|
|
306
|
+
"cell-value": c(({ row: r }) => [
|
|
307
|
+
y("span", {
|
|
308
|
+
class: "wx-catalog-run__value",
|
|
309
|
+
title: r.value ?? void 0
|
|
310
|
+
}, u(r.value), 9, Pe)
|
|
311
|
+
]),
|
|
312
|
+
_: 1
|
|
313
|
+
}, 8, ["data", "columns", "loading", "aria-label"]),
|
|
314
|
+
w.value ? (l(), k(e(I), {
|
|
315
|
+
key: 0,
|
|
316
|
+
size: "sm",
|
|
317
|
+
tone: "muted"
|
|
318
|
+
}, {
|
|
319
|
+
default: c(() => [
|
|
320
|
+
b(u(e(s)("panel.exchange-errors-more")), 1)
|
|
321
|
+
]),
|
|
322
|
+
_: 1
|
|
323
|
+
})) : x("", !0)
|
|
324
|
+
], 64)) : x("", !0)
|
|
325
|
+
]));
|
|
326
|
+
}
|
|
327
|
+
}), qe = /* @__PURE__ */ G(Ve, [["__scopeId", "data-v-38262d5f"]]), Fe = { class: "wx-catalog-exchange" }, Je = { class: "wx-catalog-exchange__run" }, Ue = { class: "wx-catalog-exchange__title" }, Ge = {
|
|
328
|
+
key: 0,
|
|
329
|
+
class: "wx-catalog-exchange__sub"
|
|
330
|
+
}, He = { class: "wx-catalog-exchange__status" }, Oe = /* @__PURE__ */ V({
|
|
331
|
+
__name: "ExchangePage",
|
|
332
|
+
props: {
|
|
333
|
+
base: { default: "/catalog" }
|
|
334
|
+
},
|
|
335
|
+
setup(a) {
|
|
336
|
+
const i = a, v = q(), m = ae(v), s = pe(), E = xe();
|
|
337
|
+
U();
|
|
338
|
+
const o = F("webx-catalog"), z = J(), w = Z(
|
|
339
|
+
$e
|
|
340
|
+
), d = j(null), W = j(!0), f = j([]), N = j([]), R = C(() => v.can("catalog.manage")), _ = je(m, (n) => {
|
|
341
|
+
d.value !== null && (d.value = {
|
|
342
|
+
...d.value,
|
|
343
|
+
data: d.value.data.map((p) => p.id === n.id ? n : p)
|
|
344
|
+
});
|
|
345
|
+
}), g = C(() => [
|
|
346
|
+
{ key: "run", label: o("panel.exchange-column-run"), minWidth: 200 },
|
|
347
|
+
{ key: "status", label: o("panel.exchange-column-status"), width: 130 },
|
|
348
|
+
{ key: "result", label: o("panel.exchange-column-result"), width: 240, hideBelow: 780 },
|
|
349
|
+
{ key: "started", label: o("panel.exchange-column-started"), width: 120, hideBelow: 560 }
|
|
350
|
+
]);
|
|
351
|
+
function r(n) {
|
|
352
|
+
return n === null ? null : N.value.find((p) => p.id === n)?.name ?? null;
|
|
353
|
+
}
|
|
354
|
+
let B = 0;
|
|
355
|
+
async function M(n) {
|
|
356
|
+
const p = ++B;
|
|
357
|
+
W.value = !0;
|
|
358
|
+
try {
|
|
359
|
+
const t = await m.runs({ page: n?.page ?? d.value?.current_page ?? 1 });
|
|
360
|
+
if (p !== B) return;
|
|
361
|
+
d.value = t;
|
|
362
|
+
for (const D of t.data) P(D) && _.watch(D.id);
|
|
363
|
+
} catch (t) {
|
|
364
|
+
A.danger(z(t));
|
|
365
|
+
} finally {
|
|
366
|
+
p === B && (W.value = !1);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
Q(async () => {
|
|
370
|
+
m.profiles().then((p) => N.value = p).catch(() => {
|
|
371
|
+
}), await M();
|
|
372
|
+
const n = Number(s.query.run);
|
|
373
|
+
Number.isInteger(n) && n > 0 && H(n);
|
|
374
|
+
});
|
|
375
|
+
async function H(n) {
|
|
376
|
+
if (f.value.includes(n) || (f.value = [...f.value, n]), d.value !== null && !d.value.data.some((p) => p.id === n))
|
|
377
|
+
try {
|
|
378
|
+
const p = await m.run(n);
|
|
379
|
+
d.value = { ...d.value, data: [p, ...d.value.data] };
|
|
380
|
+
} catch {
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
_.watch(n);
|
|
384
|
+
}
|
|
385
|
+
function ne(n) {
|
|
386
|
+
f.value = f.value.includes(n.id) ? f.value.filter((p) => p !== n.id) : [...f.value, n.id];
|
|
387
|
+
}
|
|
388
|
+
async function le() {
|
|
389
|
+
const n = await w({ selection: null });
|
|
390
|
+
n && (A.success(o("panel.exchange-export-started")), await M({ page: 1 }), H(n.id));
|
|
391
|
+
}
|
|
392
|
+
const oe = C(() => [
|
|
393
|
+
...R.value ? [
|
|
394
|
+
{
|
|
395
|
+
key: "import",
|
|
396
|
+
label: o("panel.exchange-import"),
|
|
397
|
+
icon: "upload",
|
|
398
|
+
primary: !0,
|
|
399
|
+
run: () => {
|
|
400
|
+
E.push(`${i.base}/exchange/import`);
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
] : [],
|
|
404
|
+
{
|
|
405
|
+
key: "export",
|
|
406
|
+
label: o("panel.exchange-export"),
|
|
407
|
+
icon: "download",
|
|
408
|
+
run: () => {
|
|
409
|
+
le();
|
|
410
|
+
}
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
key: "profiles",
|
|
414
|
+
label: o("panel.exchange-profiles"),
|
|
415
|
+
icon: "sliders",
|
|
416
|
+
menu: !0,
|
|
417
|
+
run: () => {
|
|
418
|
+
E.push(`${i.base}/exchange/profiles`);
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
]);
|
|
422
|
+
function se(n) {
|
|
423
|
+
return `${o(`panel.exchange-${n.direction}`)} #${n.id}`;
|
|
424
|
+
}
|
|
425
|
+
function ue(n) {
|
|
426
|
+
return n.rows_total > 0 ? Math.round(n.rows_done / n.rows_total * 100) : 0;
|
|
427
|
+
}
|
|
428
|
+
return (n, p) => (l(), h("div", Fe, [
|
|
429
|
+
$(e(he), {
|
|
430
|
+
title: e(o)("panel.exchange-title"),
|
|
431
|
+
subtitle: e(o)("panel.exchange-help"),
|
|
432
|
+
back: `${i.base}/products`,
|
|
433
|
+
"back-label": e(o)("module.products"),
|
|
434
|
+
actions: oe.value
|
|
435
|
+
}, {
|
|
436
|
+
default: c(() => [
|
|
437
|
+
$(e(ee), {
|
|
438
|
+
expanded: f.value,
|
|
439
|
+
"onUpdate:expanded": p[0] || (p[0] = (t) => f.value = t),
|
|
440
|
+
data: d.value,
|
|
441
|
+
columns: g.value,
|
|
442
|
+
"row-key": "id",
|
|
443
|
+
expandable: "",
|
|
444
|
+
"cards-below": 0,
|
|
445
|
+
flush: "",
|
|
446
|
+
layout: "fixed",
|
|
447
|
+
loading: W.value,
|
|
448
|
+
"empty-text": e(o)("panel.exchange-empty"),
|
|
449
|
+
"aria-label": e(o)("panel.exchange-title"),
|
|
450
|
+
onStateChange: M,
|
|
451
|
+
onRowClick: ne
|
|
452
|
+
}, {
|
|
453
|
+
"cell-run": c(({ row: t }) => [
|
|
454
|
+
y("div", Je, [
|
|
455
|
+
y("span", Ue, [
|
|
456
|
+
$(e(we), {
|
|
457
|
+
name: t.direction === "import" ? "upload" : "download",
|
|
458
|
+
size: "sm",
|
|
459
|
+
class: "wx-catalog-exchange__direction"
|
|
460
|
+
}, null, 8, ["name"]),
|
|
461
|
+
b(" " + u(se(t)) + " ", 1),
|
|
462
|
+
t.dry_run ? (l(), k(e(O), {
|
|
463
|
+
key: 0,
|
|
464
|
+
size: "sm",
|
|
465
|
+
round: ""
|
|
466
|
+
}, {
|
|
467
|
+
default: c(() => [
|
|
468
|
+
b(u(e(o)("panel.exchange-check")), 1)
|
|
469
|
+
]),
|
|
470
|
+
_: 1
|
|
471
|
+
})) : x("", !0)
|
|
472
|
+
]),
|
|
473
|
+
r(t.profile_id) || t.source ? (l(), h("span", Ge, u(r(t.profile_id) ?? t.source), 1)) : x("", !0)
|
|
474
|
+
])
|
|
475
|
+
]),
|
|
476
|
+
"cell-status": c(({ row: t }) => [
|
|
477
|
+
y("div", He, [
|
|
478
|
+
$(e(O), {
|
|
479
|
+
type: e(K)(t, e(o)).type,
|
|
480
|
+
dot: ""
|
|
481
|
+
}, {
|
|
482
|
+
default: c(() => [
|
|
483
|
+
b(u(e(K)(t, e(o)).label), 1)
|
|
484
|
+
]),
|
|
485
|
+
_: 2
|
|
486
|
+
}, 1032, ["type"]),
|
|
487
|
+
e(P)(t) && t.rows_total > 0 ? (l(), h(T, { key: 0 }, [
|
|
488
|
+
$(e(be), {
|
|
489
|
+
value: ue(t),
|
|
490
|
+
size: "sm",
|
|
491
|
+
"aria-label": e(o)("panel.exchange-progress", {
|
|
492
|
+
done: t.rows_done,
|
|
493
|
+
total: t.rows_total
|
|
494
|
+
})
|
|
495
|
+
}, null, 8, ["value", "aria-label"]),
|
|
496
|
+
$(e(I), {
|
|
497
|
+
size: "xs",
|
|
498
|
+
tone: "muted"
|
|
499
|
+
}, {
|
|
500
|
+
default: c(() => [
|
|
501
|
+
b(u(e(o)("panel.exchange-progress", { done: t.rows_done, total: t.rows_total })), 1)
|
|
502
|
+
]),
|
|
503
|
+
_: 2
|
|
504
|
+
}, 1024)
|
|
505
|
+
], 64)) : x("", !0)
|
|
506
|
+
])
|
|
507
|
+
]),
|
|
508
|
+
"cell-result": c(({ row: t }) => [
|
|
509
|
+
$(e(I), {
|
|
510
|
+
size: "sm",
|
|
511
|
+
tone: t.failed > 0 ? void 0 : "muted",
|
|
512
|
+
truncate: ""
|
|
513
|
+
}, {
|
|
514
|
+
default: c(() => [
|
|
515
|
+
b(u(e(te)(t, e(o)).map((D) => D.text).join(" · ")), 1)
|
|
516
|
+
]),
|
|
517
|
+
_: 2
|
|
518
|
+
}, 1032, ["tone"])
|
|
519
|
+
]),
|
|
520
|
+
"cell-started": c(({ row: t }) => [
|
|
521
|
+
$(e(Y), {
|
|
522
|
+
value: t.started_at ?? t.created_at,
|
|
523
|
+
compact: ""
|
|
524
|
+
}, null, 8, ["value"])
|
|
525
|
+
]),
|
|
526
|
+
expanded: c(({ row: t }) => [
|
|
527
|
+
$(qe, {
|
|
528
|
+
run: t,
|
|
529
|
+
base: i.base,
|
|
530
|
+
"profile-name": r(t.profile_id)
|
|
531
|
+
}, null, 8, ["run", "base", "profile-name"])
|
|
532
|
+
]),
|
|
533
|
+
_: 1
|
|
534
|
+
}, 8, ["expanded", "data", "columns", "loading", "empty-text", "aria-label"])
|
|
535
|
+
]),
|
|
536
|
+
_: 1
|
|
537
|
+
}, 8, ["title", "subtitle", "back", "back-label", "actions"])
|
|
538
|
+
]));
|
|
539
|
+
}
|
|
540
|
+
}), ea = /* @__PURE__ */ G(Oe, [["__scopeId", "data-v-09e45b4c"]]);
|
|
541
|
+
export {
|
|
542
|
+
ea as default
|
|
543
|
+
};
|
|
544
|
+
//# sourceMappingURL=ExchangePage-9RrRcSiS.js.map
|