Skip to content

Commit

Permalink
fix(website): fix host details panel heights
Browse files Browse the repository at this point in the history
Not ideal, but we can scroll sidebar and content areas separately now.
  • Loading branch information
vst committed Apr 25, 2024
1 parent 5fb3721 commit a00d21c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions website/src/components/report/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,19 @@ export function App({ data, onFlushRequest }: { data: HostPatrolReport; onFlushR
<Tab key="overview" title="🏖️ Overview" className="py-0">
<TabOverview data={data} />
</Tab>
1

<Tab key="tabulate-hosts" title="🗒️ Tabulate Hosts" className="py-0">
<TabTabulateHosts data={data} setHost={setHost} />
</Tab>

<Tab key="show-host-details" title="🔬 Host Details" className="py-0">
<TabShowHostDetails data={data} host={host} setHost={setHost} />
</Tab>

<Tab key="ssh-keys" title="🛂 SSH Keys" className="py-0">
<TabSshKeys data={data} />
</Tab>

<Tab key="flush" title="❌ Flush Data" className="py-0"></Tab>
</Tabs>
</div>
Expand All @@ -76,12 +79,12 @@ export function TabShowHostDetails({
setHost: (x: Maybe<HostReport>) => void;
}) {
return (
<div className="grid grid-cols-6">
<div className="border-r bg-gray-100 shadow-lg">
<div className="flex-1 flex flex-row overflow-y-hidden">
<div className="border-r bg-gray-100 shadow-lg sm:w-64">
<Sidebar data={data.hosts} onHostSelect={(x) => setHost(Just(x))} />
</div>

<div className="col-span-5">
<div className="flex-1 max-h-[80vh] overflow-y-scroll">
{host.caseOf({
Nothing: () => <div className="p-4 text-red-400">Choose a host to view details.</div>,
Just: (x) => <ShowHostDetails data={data} host={x} />,
Expand Down
2 changes: 1 addition & 1 deletion website/src/components/report/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface SidebarProps {

export function Sidebar({ data, onHostSelect }: SidebarProps) {
return (
<Listbox aria-label="Sidebar" items={data}>
<Listbox aria-label="Sidebar" items={data} classNames={{base: "max-h-[80vh] overflow-y-scroll"}}>
{/* @ts-ignore */}
{(host) => (
<ListboxItem key={host.host.name} onPress={() => onHostSelect(host)}>
Expand Down

0 comments on commit a00d21c

Please sign in to comment.