In this episode, we're building a progress list UI to show the state of each task as we create a server. Now that our tasks are being stored and updated in the database, we can fetch their statuses dynamically and iterate over them in the frontend.
We use Livewire with polling to keep things updated in real time. Starting off, we set up a new page that will act as the server's details view, where we'll redirect users after creating a new server. We update our routes, use route model binding, and make sure the redirect works from our create server component. This way, everything moves smoothly from server creation straight into watching the setup steps.
On the UI side, we scaffold out simple Blade components: a progress-list
that wraps server task items, and a server-progress-item
for each task. We loop through the tasks, passing each one in so we can represent its state in the interface. For styling, we pull in some Tailwind UI styles to quickly get a nice look, and we also set up the basics for showing different task states: pending, in progress, complete, and failed. We wrap the related markup in if-statements so that the component updates based on each task's current status.
Finally, we wire up the UI to display each task's title and description, and get ready to make this progress tracker fully dynamic in the next episode. It's a great setup for a real-time feedback experience as your server goes through the different provisioning stages.