mirror of
https://github.com/usebruno/bruno.git
synced 2025-06-21 12:33:34 +02:00
Merge pull request #519 from Nikhil569/main
feat: shows image if url return a image
This commit is contained in:
commit
5682c47d00
@ -45,6 +45,10 @@ const QueryResult = ({ item, collection, data, width, disableRunEventListener, h
|
|||||||
return safeStringifyJSON(data);
|
return safeStringifyJSON(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mode.includes('image')) {
|
||||||
|
return item.requestSent.url;
|
||||||
|
}
|
||||||
|
|
||||||
// final fallback
|
// final fallback
|
||||||
if (typeof data === 'string') {
|
if (typeof data === 'string') {
|
||||||
return data;
|
return data;
|
||||||
@ -103,6 +107,8 @@ const QueryResult = ({ item, collection, data, width, disableRunEventListener, h
|
|||||||
className="h-full bg-white"
|
className="h-full bg-white"
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
} else if (mode.includes('image')) {
|
||||||
|
return <img src={item.requestSent.url} alt="image" />;
|
||||||
}
|
}
|
||||||
|
|
||||||
return <CodeEditor collection={collection} theme={storedTheme} onRun={onRun} value={value} mode={mode} readOnly />;
|
return <CodeEditor collection={collection} theme={storedTheme} onRun={onRun} value={value} mode={mode} readOnly />;
|
||||||
|
@ -60,6 +60,8 @@ export const getCodeMirrorModeBasedOnContentType = (contentType) => {
|
|||||||
return 'application/xml';
|
return 'application/xml';
|
||||||
} else if (contentType.includes('yaml')) {
|
} else if (contentType.includes('yaml')) {
|
||||||
return 'application/yaml';
|
return 'application/yaml';
|
||||||
|
} else if (contentType.includes('image')) {
|
||||||
|
return 'application/image';
|
||||||
} else {
|
} else {
|
||||||
return 'application/text';
|
return 'application/text';
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user