shadcn.io is not affiliated with official shadcn/ui
Backup Schedule Settings Block for React
A backup schedule panel that leads with what the schedule amounts to (the next run, how much history the copies cover, how much space they take), with frequency, time, retention and destination controls beside a list of the next five runs.
Installation
Overview
Show what a backup schedule really does before anyone saves it, with this backup schedule panel for React with Base UI. Inside a hairline frame with a plus mark on each corner, a strip of three figures leads: when the next run is ("Next run in 17 h"), how far back the copies reach ("14 days", with the date of the oldest) and how much space they take. Under it a form sets how often with a Segment Group (hourly, daily or weekly), the time and the weekday with Native Select menus, how many copies to keep with a Number Input, and where they go with three radio cards: the product's own vault or a bucket at Amazon S3 or Google Cloud Storage, each with a lettermark tile. Beside the form a list names the next five runs, worked out in UTC from a typed starting moment, so changing the frequency, the hour or the weekday redraws it at once. Keeping more copies than the vault holds is refused with a plain reason. The last band counts unsaved changes in a status line beside a Shine Button to save them and an outline Button to discard them. On a phone the list of runs sits under the form and the save bar stays pinned to the bottom of the screen. It's built from Segment Group, Native Select, Number Input, Button, Shine Button and Guides, with a CSS entrance only. For a backup, sync or storage product, or any setting that turns a schedule into history.
FAQ
How do I fill it with my own schedule and storage?
Edit the constants at the top. SAVED is the schedule the account has stored when the page opens (frequency, hour, minute, weekday, how many copies to keep and where they go), PLACES lists the destinations with their two-letter tiles, COPY_GB is the size of one copy and VAULT_GB is the space the product's own storage includes. ANCHOR is the moment every next run and every "in 17 h" is counted from; in your app replace it with the current time on the server.
How are the next five runs worked out?
In plain functions on the typed starting moment, in UTC with no daylight saving: an hourly run is the next chosen minute past the hour, a daily one the next time of day, and a weekly one the next chosen weekday at that time, then each further run adds one step. The strip's figures come from the same schedule: the history is the number of copies times the step between runs, and the oldest date is the last run before the next one, minus the copies kept. Nothing reads the clock, so the page shows the same runs on the server and in every time zone.
Why is Save refused for some retention counts?
Because the copies would not fit. On the vault each copy is 3.1 GB and 100 GB is included, so 33 copies or more do not fit; the line under the form says so while you type, the count field is marked invalid when you press Save, and focus moves to it. Choosing a bucket in your own account lifts the limit, since that storage is yours. The figure under "Stored" switches from "of 100 GB" to "in your bucket" accordingly.
What happens when I press Save, and what stays local?
Nothing leaves the page and no backup ever runs. The block keeps two copies of the schedule, the saved one and the one being edited, and counts how many settings differ, so the status line can say "2 changes not saved yet." Save makes the edited copy the saved one and says it was saved in this demo; Discard puts the saved copy back. To make it real, send the edited schedule to your scheduler in the save handler and update the saved copy from the response. Save and Discard are marked aria-disabled rather than disabled while nothing changed, so they keep their place and focus.
How do the radio cards work?
They are native radio inputs inside labels, so the whole card is the target, arrow keys move between them and the group is named "Where copies go". The chosen card gets a heavier edge and a tint rather than a color, so it reads without one. Wire each card to the credentials form of its destination in your app; this block only picks where.
Related
- Pro
Export Schedule Settings
Backups and exportsA scheduled export panel where you choose and order the columns with Move up and Move down, see the first three rows and the exact header line in that order with a Copy button, and pick a format, a frequency and an S3 or SFTP destination that shows only its own two fields.
- Pro
Backup and Restore Settings
Backups and exportsA backups page with a list of six snapshots and the three-step restore that opens from it, shown open on load: choose what to bring back, read the impact and type the snapshot date to confirm, then watch a progress bar fill and end on a plain statement that nothing was restored in the demo.
- Pro
Audit Log Retention Settings
Backups and exportsAn audit log retention panel with a row for each class of event, a preset for how long to keep it, an archive-after menu, a legal hold that freezes the row and a two-part bar to one scale, with the gigabytes searchable and archived added up from typed daily volumes.
- Pro
Data Export Settings
Backups and exportsA data export panel built around a tree of what an account holds, where ticking a part adds what it depends on and says so, with a format control, the size, time and file count it adds up to, and a request list that queues one archive at a time.
- Pro
Usage Meters Billing
Plan and usageUsage meters for an app's settings: one row per quota with its count, a bar that turns to a warning tone at 80% and an over-limit tone past 100%, and a plain line on what happens next.
- Pro
Account Deletion Settings
Backups and exportsA whole-page account deletion that first asks what happens to each kind of data (delete, anonymise or transfer, with invoices locked for tax law), sums the choices in one sentence, then schedules deletion 14 days out behind a typed-email alert dialog.