forked from usebruno/bruno
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add warning for large response
- Loading branch information
1 parent
15e11c0
commit e24c0fd
Showing
2 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
packages/bruno-app/src/components/ResponsePane/QueryResult/QueryResultSizeWarning/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React from 'react'; | ||
|
||
const QueryResultSizeWarning = ({ size, width, dismissWarning }) => { | ||
const sizeFormatted = (size / 1000 / 1000).toFixed(2); | ||
|
||
return ( | ||
<div className={'mt-4 flex-col content-center'} style={{ maxWidth: width }}> | ||
<div className="text-red-500">Response is larger than 5 MB ({sizeFormatted} MB)</div> | ||
<div className="my-4">Showing too large responses will make Bruno unresponsive or could crash the app</div> | ||
|
||
<button className="submit btn btn-md btn-secondary" onClick={dismissWarning}> | ||
Show anyway | ||
</button> | ||
</div> | ||
); | ||
}; | ||
|
||
export default QueryResultSizeWarning; |
13 changes: 12 additions & 1 deletion
13
packages/bruno-app/src/components/ResponsePane/QueryResult/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters