Better format

This commit is contained in:
Gregory Schier
2024-01-28 16:19:46 -08:00
parent 959841fb22
commit bc0278fce9
2 changed files with 25 additions and 5 deletions

View File

@@ -1,5 +1,8 @@
import { invoke, shell } from '@tauri-apps/api';
import classNames from 'classnames'; import classNames from 'classnames';
import type { ReactNode } from 'react';
import type { HttpResponse } from '../lib/models'; import type { HttpResponse } from '../lib/models';
import { IconButton } from './core/IconButton';
import { Separator } from './core/Separator'; import { Separator } from './core/Separator';
import { HStack } from './core/Stacks'; import { HStack } from './core/Stacks';
@@ -19,9 +22,25 @@ export function ResponseHeaders({ response }: Props) {
<dl className="text-xs w-full font-mono divide-highlightSecondary"> <dl className="text-xs w-full font-mono divide-highlightSecondary">
<Row label="Version" value={response.version} /> <Row label="Version" value={response.version} />
<Row label="Remote Address" value={response.remoteAddr} /> <Row label="Remote Address" value={response.remoteAddr} />
<Row label="Status" value={response.status} /> <Row
<Row label="Reason" value={response.statusReason} /> label={
<Row label="URL" value={response.url} /> <div className="flex items-center">
URL
<IconButton
iconSize="sm"
className="inline-block w-auto ml-1 !h-auto opacity-50 hover:opacity-100"
icon="externalLink"
onClick={() => shell.open(response.url)}
title="Open in browser"
/>
</div>
}
value={
<div className="flex">
<span className="select-text cursor-text">{response.url}</span>
</div>
}
/>
</dl> </dl>
</div> </div>
); );
@@ -32,8 +51,8 @@ function Row({
value, value,
labelClassName, labelClassName,
}: { }: {
label: string; label: ReactNode;
value: string | number; value: ReactNode;
labelClassName?: string; labelClassName?: string;
}) { }) {
return ( return (

View File

@@ -21,6 +21,7 @@
} }
/* Disable user selection to make it more "app-like" */ /* Disable user selection to make it more "app-like" */
:not(a),
:not(input):not(textarea), :not(input):not(textarea),
:not(input):not(textarea)::after, :not(input):not(textarea)::after,
:not(input):not(textarea)::before { :not(input):not(textarea)::before {