mirror of
https://github.com/usebruno/bruno.git
synced 2025-06-21 20:41:41 +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);
|
||||
}
|
||||
|
||||
if (mode.includes('image')) {
|
||||
return item.requestSent.url;
|
||||
}
|
||||
|
||||
// final fallback
|
||||
if (typeof data === 'string') {
|
||||
return data;
|
||||
@ -103,6 +107,8 @@ const QueryResult = ({ item, collection, data, width, disableRunEventListener, h
|
||||
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 />;
|
||||
|
@ -60,6 +60,8 @@ export const getCodeMirrorModeBasedOnContentType = (contentType) => {
|
||||
return 'application/xml';
|
||||
} else if (contentType.includes('yaml')) {
|
||||
return 'application/yaml';
|
||||
} else if (contentType.includes('image')) {
|
||||
return 'application/image';
|
||||
} else {
|
||||
return 'application/text';
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user