refactor: add tag to web server update

This commit is contained in:
Mauricio Siu
2024-12-21 13:13:38 -06:00
parent 978324e2bf
commit ae159c5678
2 changed files with 6 additions and 1 deletions

View File

@@ -29,6 +29,7 @@ export const UpdateServer = () => {
const { mutateAsync: getUpdateData, isLoading } = const { mutateAsync: getUpdateData, isLoading } =
api.settings.getUpdateData.useMutation(); api.settings.getUpdateData.useMutation();
const { data: dokployVersion } = api.settings.getDokployVersion.useQuery(); const { data: dokployVersion } = api.settings.getDokployVersion.useQuery();
const { data: releaseTag } = api.settings.getReleaseTag.useQuery();
const [isOpen, setIsOpen] = useState(false); const [isOpen, setIsOpen] = useState(false);
const [latestVersion, setLatestVersion] = useState(""); const [latestVersion, setLatestVersion] = useState("");
@@ -74,7 +75,7 @@ export const UpdateServer = () => {
<div className="flex items-center gap-1.5 rounded-full px-3 py-1 mr-2 bg-muted"> <div className="flex items-center gap-1.5 rounded-full px-3 py-1 mr-2 bg-muted">
<Server className="h-4 w-4 text-muted-foreground" /> <Server className="h-4 w-4 text-muted-foreground" />
<span className="text-sm text-muted-foreground"> <span className="text-sm text-muted-foreground">
{dokployVersion} {dokployVersion} | {releaseTag}
</span> </span>
</div> </div>
)} )}

View File

@@ -26,6 +26,7 @@ import {
findAdminById, findAdminById,
findServerById, findServerById,
getDokployImage, getDokployImage,
getDokployImageTag,
getUpdateData, getUpdateData,
initializeTraefik, initializeTraefik,
logRotationManager, logRotationManager,
@@ -373,6 +374,9 @@ export const settingsRouter = createTRPCRouter({
getDokployVersion: adminProcedure.query(() => { getDokployVersion: adminProcedure.query(() => {
return packageInfo.version; return packageInfo.version;
}), }),
getReleaseTag: adminProcedure.query(() => {
return getDokployImageTag();
}),
readDirectories: protectedProcedure readDirectories: protectedProcedure
.input(apiServerSchema) .input(apiServerSchema)
.query(async ({ ctx, input }) => { .query(async ({ ctx, input }) => {