feat(certificates): display server information in certificate details

- Added a new section to the certificate details view to show associated server information, including the server name and IP address, enhancing the visibility of server-related data for each certificate.
- Updated the API to include server data when fetching certificates.
This commit is contained in:
Mauricio Siu
2026-04-03 23:09:19 -06:00
parent 91d4fe2420
commit 199589d42e
2 changed files with 10 additions and 0 deletions

View File

@@ -4,6 +4,7 @@ import {
ChevronRight,
Link,
Loader2,
Server,
ShieldCheck,
Trash2,
} from "lucide-react";
@@ -121,6 +122,12 @@ export const ShowCertificates = () => {
CN: {commonName}
</span>
)}
<span className="text-xs text-muted-foreground flex items-center gap-1">
<Server className="size-3" />
{certificate.server
? `${certificate.server.name} (${certificate.server.ipAddress})`
: "Dokploy (Local)"}
</span>
{chainInfo.isChain && (
<div className="flex flex-col gap-1.5 mt-1">
<button

View File

@@ -74,6 +74,9 @@ export const certificateRouter = createTRPCRouter({
all: withPermission("certificate", "read").query(async ({ ctx }) => {
return await db.query.certificates.findMany({
where: eq(certificates.organizationId, ctx.session.activeOrganizationId),
with: {
server: true,
},
});
}),
update: withPermission("certificate", "update")