mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-18 06:49:50 +02:00
Show response body size
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import { forwardRef } from 'react';
|
import { forwardRef } from 'react';
|
||||||
import { Icon, IconProps } from './Icon';
|
import { Icon, IconProps } from './Icon';
|
||||||
import { Button, ButtonProps } from './Button';
|
import { Button, ButtonProps } from './Button';
|
||||||
|
import classnames from 'classnames';
|
||||||
|
|
||||||
type Props = Omit<IconProps, 'size'> & ButtonProps<typeof Button>;
|
type Props = Omit<IconProps, 'size'> & ButtonProps<typeof Button>;
|
||||||
|
|
||||||
@@ -10,7 +11,14 @@ export const IconButton = forwardRef<HTMLButtonElement, Props>(function IconButt
|
|||||||
) {
|
) {
|
||||||
return (
|
return (
|
||||||
<Button ref={ref} className="group" {...props}>
|
<Button ref={ref} className="group" {...props}>
|
||||||
<Icon icon={icon} spin={spin} className="text-gray-700 group-hover:text-gray-900" />
|
<Icon
|
||||||
|
icon={icon}
|
||||||
|
spin={spin}
|
||||||
|
className={classnames(
|
||||||
|
'text-gray-700 group-hover:text-gray-900',
|
||||||
|
props.disabled && 'opacity-70',
|
||||||
|
)}
|
||||||
|
/>
|
||||||
</Button>
|
</Button>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -64,7 +64,8 @@ export function ResponsePane({ requestId, error }: Props) {
|
|||||||
{response.status}
|
{response.status}
|
||||||
{response.statusReason && ` ${response.statusReason}`}
|
{response.statusReason && ` ${response.statusReason}`}
|
||||||
•
|
•
|
||||||
{response.elapsed}ms
|
{response.elapsed}ms •
|
||||||
|
{Math.round(response.body.length / 1000)} KB
|
||||||
</HStack>
|
</HStack>
|
||||||
{contentType.includes('html') ? (
|
{contentType.includes('html') ? (
|
||||||
<iframe
|
<iframe
|
||||||
|
|||||||
Reference in New Issue
Block a user