mirror of
https://github.com/n8n-io/n8n.git
synced 2026-10-28 03:24:56 +08:00
fix(editor, core): Fix display for binary data metadata origin (#22270)
This commit is contained in:
+6
-1
@@ -236,6 +236,7 @@ export async function prepareBinaryData(
|
||||
mimeType?: string,
|
||||
): Promise<IBinaryData> {
|
||||
let fileExtension: string | undefined;
|
||||
let fullUrl: string | undefined;
|
||||
if (binaryData instanceof IncomingMessage) {
|
||||
if (!filePath) {
|
||||
try {
|
||||
@@ -243,6 +244,7 @@ export async function prepareBinaryData(
|
||||
filePath =
|
||||
binaryData.contentDisposition?.filename ??
|
||||
((responseUrl && new URL(responseUrl).pathname) ?? binaryData.req?.path)?.slice(1);
|
||||
fullUrl = responseUrl;
|
||||
} catch {}
|
||||
}
|
||||
if (!mimeType) {
|
||||
@@ -296,9 +298,12 @@ export async function prepareBinaryData(
|
||||
if (filePath) {
|
||||
const filePathParts = path.parse(filePath);
|
||||
|
||||
if (filePathParts.dir !== '') {
|
||||
if (fullUrl) {
|
||||
returnData.directory = fullUrl;
|
||||
} else if (filePathParts.dir !== '') {
|
||||
returnData.directory = filePathParts.dir;
|
||||
}
|
||||
|
||||
returnData.fileName = filePathParts.base;
|
||||
|
||||
// Remove the dot
|
||||
|
||||
@@ -2159,6 +2159,7 @@
|
||||
"runData.executionTime": "Execution Time",
|
||||
"runData.fileExtension": "File Extension",
|
||||
"runData.directory": "Directory",
|
||||
"runData.url": "URL",
|
||||
"runData.fileName": "File Name",
|
||||
"runData.invalidPinnedData": "Invalid pinned data",
|
||||
"runData.items": "Items",
|
||||
|
||||
@@ -70,7 +70,11 @@ async function downloadBinaryData(index: number, key: string | number) {
|
||||
<div v-if="data.directory">
|
||||
<div>
|
||||
<N8nText size="small" :bold="true"
|
||||
>{{ i18n.baseText('runData.directory') }}:
|
||||
>{{
|
||||
data.directory.startsWith('http://') || data.directory.startsWith('https://')
|
||||
? i18n.baseText('runData.url')
|
||||
: i18n.baseText('runData.directory')
|
||||
}}:
|
||||
</N8nText>
|
||||
</div>
|
||||
<div :class="$style.binaryValue">{{ data.directory }}</div>
|
||||
|
||||
Reference in New Issue
Block a user