Skip to content

Commit a00f444

Browse files
atrakhConvex, Inc.
authored andcommitted
dashboard: tweak min width of 2 column layout in backups page (#42165)
GitOrigin-RevId: 5f1272781a2f0c62804ea0dcba5d82d9384fa898
1 parent dbb797d commit a00f444

File tree

4 files changed

+37
-28
lines changed

4 files changed

+37
-28
lines changed

npm-packages/dashboard/src/components/deploymentSettings/BackupListItem.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -373,12 +373,12 @@ function RestoreConfirmation({
373373
team={team}
374374
/>
375375

376-
<p className="my-2">
376+
<p className="my-2 text-sm">
377377
The data (tables and files) in <code>{targetDeployment.name}</code> will
378378
be replaced by the contents of the backup.
379379
</p>
380380

381-
<p className="text-content-secondary">
381+
<p className="text-sm text-content-secondary">
382382
The rest of your deployment configuration (code, environment variables,
383383
scheduled functions, etc.) will not be changed.
384384
</p>
@@ -506,7 +506,7 @@ function BackupSummary({
506506
);
507507

508508
return (
509-
<div className="my-8 flex flex-col items-center gap-2">
509+
<div className="my-4 flex flex-col items-center gap-2">
510510
<p className="flex items-center gap-2 text-content-tertiary">
511511
<ArchiveIcon className="size-6" /> Backup
512512
</p>
@@ -560,7 +560,7 @@ function DeploymentSummary({
560560
team,
561561
}: DeploymentSummaryProps) {
562562
return (
563-
<div className="my-8 flex flex-col items-center gap-2">
563+
<div className="my-4 flex flex-col items-center gap-2">
564564
<p className="flex items-center gap-2 text-content-tertiary">
565565
<ServerIcon className="size-6" /> Deployment
566566
</p>
@@ -584,7 +584,7 @@ export function TransferSummary({
584584
team: Team;
585585
}) {
586586
return (
587-
<div className="grid justify-center gap-2 md:flex md:gap-5">
587+
<div className="mb-4 grid justify-center gap-2 rounded-lg border md:flex md:gap-5">
588588
<BackupSummary
589589
backup={backup}
590590
sourceDeploymentAppearance={
@@ -595,7 +595,7 @@ export function TransferSummary({
595595
team={team}
596596
/>
597597

598-
<div className="md:my-8">
598+
<div className="flex w-full justify-center md:my-4 md:w-fit">
599599
<ArrowDownIcon className="size-6 text-content-tertiary md:hidden" />
600600
<ArrowRightIcon className="hidden size-6 text-content-tertiary md:block" />
601601
</div>

npm-packages/dashboard/src/components/deploymentSettings/BackupRestoreStatus.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export function BackupRestoreFail({
107107

108108
return (
109109
<>
110-
<div className="flex min-h-16 flex-wrap items-center gap-2 rounded-sm border bg-background-secondary px-4 py-2">
110+
<div className="flex min-h-16 flex-wrap items-center gap-2 rounded-lg border bg-background-secondary px-4 py-2">
111111
<div className="flex grow gap-2">
112112
<CrossCircledIcon className="size-5 shrink-0 text-content-errorSecondary" />
113113
<p className="grow text-sm leading-tight text-balance text-content-secondary">
@@ -175,7 +175,7 @@ export function BackupRestoreSuccess({
175175

176176
return (
177177
<>
178-
<div className="flex min-h-16 flex-wrap items-center gap-2 rounded-sm border bg-background-secondary px-4 py-2">
178+
<div className="flex min-h-16 flex-wrap items-center gap-2 rounded-lg border bg-background-secondary px-4 py-2">
179179
<div className="flex grow items-center gap-2">
180180
<CheckCircledIcon className="shrink-0 text-content-success" />
181181
<p className="grow text-sm leading-tight text-balance text-content-secondary">
@@ -231,7 +231,7 @@ export function BackupRestoreOngoing({
231231
progressMessage: string;
232232
}) {
233233
return (
234-
<div className="flex min-h-16 flex-col flex-wrap justify-center gap-2 rounded-sm border bg-background-secondary px-4 py-2 text-sm">
234+
<div className="flex min-h-16 flex-col flex-wrap justify-center gap-2 rounded-lg border bg-background-secondary px-4 py-2 text-sm">
235235
<div className="flex flex-wrap justify-end gap-4">
236236
<div className="grow font-semibold">Restoring from a backup</div>
237237
<div className="min-w-56 text-right text-content-secondary">

npm-packages/dashboard/src/components/deploymentSettings/Backups.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export function Backups({
5454

5555
return (
5656
<div className="flex h-full flex-col gap-4">
57-
<div className="mb-4 flex flex-wrap items-center justify-between gap-4">
57+
<div className="flex flex-wrap items-center justify-between gap-4">
5858
<h3 className="min-w-fit">Backup & Restore</h3>
5959
<span className="text-sm">
6060
Use this page to automatically or manually backup and restore your
@@ -67,8 +67,8 @@ export function Backups({
6767
</Link>
6868
</span>
6969
</div>
70-
<div className="scrollbar flex grow flex-col gap-8 overflow-auto pt-1 pl-1 lg:flex-row lg:overflow-hidden">
71-
<div className="flex shrink-0 flex-col lg:w-60">
70+
<div className="scrollbar flex grow flex-col gap-4 overflow-auto pt-1 pl-1 xl:flex-row xl:overflow-hidden">
71+
<Sheet className="flex h-fit w-full shrink-0 flex-col items-start gap-6 xl:w-60 xl:items-center">
7272
{periodicBackupsEnabled ? (
7373
<AutomaticBackupSelector
7474
deployment={deployment}
@@ -92,8 +92,6 @@ export function Backups({
9292
</Tooltip>
9393
)}
9494

95-
<hr className="my-6 w-full" />
96-
9795
<BackupNowButton
9896
deployment={deployment}
9997
team={team}
@@ -105,9 +103,9 @@ export function Backups({
105103
periodicBackupsEnabled={periodicBackupsEnabled}
106104
maxCloudBackups={maxCloudBackups}
107105
/>
108-
</div>
106+
</Sheet>
109107

110-
<div className="flex flex-col gap-4 pb-8 lg:grow lg:pb-0">
108+
<div className="flex flex-col gap-4 pb-8 xl:grow xl:pb-0">
111109
{existingExport &&
112110
existingExport._creationTime < new Date("2024-11-15").getTime() &&
113111
existingExport.state === "completed" &&
@@ -194,7 +192,7 @@ function AutomaticBackupSelector({
194192
: undefined
195193
}
196194
>
197-
<div className="flex flex-col gap-2">
195+
<div className="flex w-full flex-col gap-2">
198196
<label className="mb-1 flex items-center gap-2 text-sm">
199197
<Checkbox
200198
checked={!!periodicBackup}

npm-packages/dashboard/src/components/deploymentSettings/SnapshotImport.tsx

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -245,39 +245,50 @@ export function ImportSummary({
245245
>(),
246246
);
247247
return (
248-
<div>
248+
<div className="flex flex-col gap-4">
249249
{Array.from(checkpointsByComponent.entries()).map(
250250
([componentPath, checkpoints]) => (
251251
<div key={componentPath}>
252252
{componentPath ? (
253-
<div className="flex w-full items-center space-x-1">
254-
<PuzzlePieceIcon />
253+
<h5 className="mb-1 flex w-full items-center space-x-1">
254+
<PuzzlePieceIcon className="text-content-secondary" />
255255
<span>{componentPath}</span>
256-
</div>
256+
</h5>
257257
) : null}
258-
<table className="mr-auto border-collapse border text-left">
258+
<table className="mr-auto border-collapse border text-left text-xs">
259259
<thead className="border">
260260
<tr>
261-
<th className="border px-2 font-semibold">table</th>
262-
<th className="border px-2 font-semibold">create</th>
263-
<th className="border px-2 font-semibold">delete</th>
261+
<th className="border px-2 py-0.5 font-semibold">Table</th>
262+
<th className="border px-2 py-0.5 font-semibold">Created</th>
263+
<th className="border px-2 py-0.5 font-semibold">Deleted</th>
264264
</tr>
265265
</thead>
266266
<tbody>
267267
{checkpoints.map((checkpoint) => (
268268
<tr key={checkpoint.display_table_name}>
269-
<td className="border px-2">
269+
<td className="border px-2 py-0.5 font-mono">
270270
<span>{checkpoint.display_table_name}</span>
271271
</td>
272-
<td className="border px-2">
272+
<td className="border px-2 py-0.5 tabular-nums">
273273
{Number(
274274
checkpoint.total_num_rows_to_write,
275275
).toLocaleString()}{" "}
276276
{checkpoint.display_table_name === "_storage"
277277
? `file${Number(checkpoint.total_num_rows_to_write) === 1 ? "" : "s"}`
278278
: `document${Number(checkpoint.total_num_rows_to_write) === 1 ? "" : "s"}`}
279279
</td>
280-
<td className="border px-2">{`${Number(checkpoint.existing_rows_to_delete).toLocaleString()} of ${Number(checkpoint.existing_rows_in_table).toLocaleString()} ${checkpoint.display_table_name === "_storage" ? "files" : "documents"}`}</td>
280+
<td className="border px-2 py-0.5 tabular-nums">
281+
{Number(
282+
checkpoint.existing_rows_to_delete,
283+
).toLocaleString()}{" "}
284+
of{" "}
285+
{Number(
286+
checkpoint.existing_rows_in_table,
287+
).toLocaleString()}{" "}
288+
{checkpoint.display_table_name === "_storage"
289+
? "files"
290+
: "documents"}
291+
</td>
281292
</tr>
282293
))}
283294
</tbody>

0 commit comments

Comments
 (0)