In this episode, we're working on displaying a list of our endpoints on the dashboard, just underneath the main form. We start by creating a new section with a bit of spacing, then add a styled table to hold our endpoints. This includes headers like location, frequency, last check, status, uptime percentage, and action buttons. Right now, we're just setting up the framework and not actually pulling in any real data yet.
Next, we build a dedicated component for each endpoint. This lets us easily manage things like editing and deleting later on, since everything for an individual endpoint will be encapsulated in its own component. We scaffold this component out and get it ready to receive data from our endpoints list.
Moving to the backend, we set up an EndpointResource
so we can transform our endpoint data cleanly when passing it to the front end. After linking this up to the dashboard, we iterate over each endpoint, pass the data into our endpoint component, and key everything nicely so Vue (or whichever frontend we're using) can keep track.
Finally, we start outputting some real data in the table – just the endpoint location and its frequency label for now. We hook up the frequency enum so it's readable, and we're set! You should now see each endpoint listed with its location and frequency. We point out there's more to do, like last check and uptime, but those will come later when we have that data.