Skip to content

Commit 61464d9

Browse files
Put routes table on router page in card block (#3024)
* Remove irregular table title from router page * Update divider spacing * Divider spacing tweaks * use CardBlock for Routes table --------- Co-authored-by: Benjamin Leonard <benji@oxide.computer>
1 parent 7ca66ea commit 61464d9

File tree

7 files changed

+26
-28
lines changed

7 files changed

+26
-28
lines changed

app/components/CapacityBars.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const CapacityBars = ({
2323
allocatedLabel: string
2424
}) => {
2525
return (
26-
<div className="1000:flex-row mb-12 flex min-w-min flex-col gap-3">
26+
<div className="1000:flex-row flex min-w-min flex-col gap-3">
2727
<CapacityBar
2828
icon={<Cpu16Icon />}
2929
title="CPU"

app/pages/SiloUtilizationPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ export default function SiloUtilizationPage() {
9393
allocatedLabel="Quota"
9494
/>
9595

96-
<Divider className="my-6" />
96+
<Divider className="my-8" />
9797

98-
<div className="mt-8 mb-3 flex flex-wrap justify-between gap-3">
98+
<div className="mb-3 flex flex-wrap justify-between gap-3">
9999
<div className="flex gap-2">
100100
{intervalPicker}
101101

app/pages/project/affinity/AntiAffinityGroupPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ export default function AntiAffinityPage() {
225225
<PropertiesTable.Row label="Members">{membersCount}</PropertiesTable.Row>
226226
<PropertiesTable.IdRow id={id} />
227227
</PropertiesTable>
228-
<Divider className="mb-10" />
228+
<Divider className="my-8" />
229229
<CardBlock>
230230
<CardBlock.Header
231231
title="Members"

app/pages/project/vpcs/RouterPage.tsx

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,12 @@ import { addToast } from '~/stores/toast'
3636
import { TypeValueCell } from '~/table/cells/TypeValueCell'
3737
import { useColsWithActions, type MenuAction } from '~/table/columns/action-col'
3838
import { useQueryTable } from '~/table/QueryTable'
39+
import { CardBlock } from '~/ui/lib/CardBlock'
3940
import { CreateButton, CreateLink } from '~/ui/lib/CreateButton'
41+
import { Divider } from '~/ui/lib/Divider'
4042
import { EmptyMessage } from '~/ui/lib/EmptyMessage'
4143
import { PageHeader, PageTitle } from '~/ui/lib/PageHeader'
4244
import { PropertiesTable } from '~/ui/lib/PropertiesTable'
43-
import { TableControls, TableTitle } from '~/ui/lib/Table'
4445
import { docLinks } from '~/util/links'
4546
import { pb } from '~/util/path-builder'
4647
import type * as PP from '~/util/path-params'
@@ -199,22 +200,24 @@ export default function RouterPage() {
199200
<PropertiesTable.DateRow date={routerData.timeCreated} label="Created" />
200201
<PropertiesTable.DateRow date={routerData.timeModified} label="Last Modified" />
201202
</PropertiesTable>
202-
<TableControls className="mb-3">
203-
<TableTitle>Routes</TableTitle>
204-
{canCreateNewRoute ? (
205-
<CreateLink to={pb.vpcRouterRoutesNew({ project, vpc, router })}>
206-
New route
207-
</CreateLink>
208-
) : (
209-
<CreateButton
210-
disabled
211-
disabledReason={routeFormMessage.noNewRoutesOnSystemRouter}
212-
>
213-
New route
214-
</CreateButton>
215-
)}
216-
</TableControls>
217-
{table}
203+
<Divider className="my-8" />
204+
<CardBlock>
205+
<CardBlock.Header title="Routes" description="Rules for directing network traffic">
206+
{canCreateNewRoute ? (
207+
<CreateLink to={pb.vpcRouterRoutesNew({ project, vpc, router })}>
208+
New route
209+
</CreateLink>
210+
) : (
211+
<CreateButton
212+
disabled
213+
disabledReason={routeFormMessage.noNewRoutesOnSystemRouter}
214+
>
215+
New route
216+
</CreateButton>
217+
)}
218+
</CardBlock.Header>
219+
<CardBlock.Body>{table}</CardBlock.Body>
220+
</CardBlock>
218221
<Outlet />
219222
</>
220223
)

app/ui/lib/Table.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,4 @@ export const TableEmptyBox = ({ children, border = true }: TableEmptyBoxProps) =
131131
</div>
132132
)
133133

134-
/**
135-
* Used _outside_ of the `Table`, this element includes a soon-to-be-removed description of the resource inside the table,
136-
* along with a link to more info, and a button to take action on the resource listed in the table.
137-
*/
138-
export const TableControls = classed.div`mb-4 flex items-end justify-between space-x-8`
139134
export const TableTitle = classed.div`text-sans-lg text-raise`

app/ui/styles/components/Tabs.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
/* Tab list container styles */
1010
.ox-tabs-list {
11-
@apply mb-10 flex bg-transparent;
11+
@apply mb-8 flex bg-transparent;
1212
}
1313

1414
.ox-tabs-list:after {

app/ui/styles/components/form.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@
2323
}
2424

2525
.ox-form .ox-divider {
26-
@apply !my-10; /* important overrides space-y-* on .ox-form */
26+
@apply !my-8; /* important overrides space-y-* on .ox-form */
2727
}

0 commit comments

Comments
 (0)