mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
fix: correct url swagger api
This commit is contained in:
@@ -10,7 +10,7 @@ import { RedbuildApplication } from "../rebuild-application";
|
|||||||
import { StartApplication } from "../start-application";
|
import { StartApplication } from "../start-application";
|
||||||
import { StopApplication } from "../stop-application";
|
import { StopApplication } from "../stop-application";
|
||||||
import { DockerTerminalModal } from "../../settings/web-server/docker-terminal-modal";
|
import { DockerTerminalModal } from "../../settings/web-server/docker-terminal-modal";
|
||||||
import { Terminal } from "lucide-react";
|
import { CheckCircle2, Terminal } from "lucide-react";
|
||||||
import { DeployApplication } from "./deploy-application";
|
import { DeployApplication } from "./deploy-application";
|
||||||
import { ResetApplication } from "./reset-application";
|
import { ResetApplication } from "./reset-application";
|
||||||
interface Props {
|
interface Props {
|
||||||
@@ -55,8 +55,10 @@ export const ShowGeneralApplication = ({ applicationId }: Props) => {
|
|||||||
toast.error("Error to update Auto Deploy");
|
toast.error("Error to update Auto Deploy");
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
|
className="flex flex-row gap-2 items-center"
|
||||||
>
|
>
|
||||||
Autodeploy
|
Autodeploy
|
||||||
|
{data?.autoDeploy && <CheckCircle2 className="size-4" />}
|
||||||
</Toggle>
|
</Toggle>
|
||||||
<RedbuildApplication applicationId={applicationId} />
|
<RedbuildApplication applicationId={applicationId} />
|
||||||
{data?.applicationStatus === "idle" ? (
|
{data?.applicationStatus === "idle" ? (
|
||||||
|
|||||||
@@ -47,7 +47,11 @@ export const GenerateToken = () => {
|
|||||||
<div className="grid w-full gap-8">
|
<div className="grid w-full gap-8">
|
||||||
<div className="flex flex-col gap-2">
|
<div className="flex flex-col gap-2">
|
||||||
<Label>Token</Label>
|
<Label>Token</Label>
|
||||||
<ToggleVisibilityInput value={data?.token || ""} disabled />
|
<ToggleVisibilityInput
|
||||||
|
placeholder="Token"
|
||||||
|
value={data?.token || ""}
|
||||||
|
disabled
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ import { dockerRouter } from "./routers/docker";
|
|||||||
import { composeRouter } from "./routers/compose";
|
import { composeRouter } from "./routers/compose";
|
||||||
import { registryRouter } from "./routers/registry";
|
import { registryRouter } from "./routers/registry";
|
||||||
import { clusterRouter } from "./routers/cluster";
|
import { clusterRouter } from "./routers/cluster";
|
||||||
import { generateOpenApiDocument } from "@dokploy/trpc-openapi";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the primary router for your server.
|
* This is the primary router for your server.
|
||||||
@@ -59,35 +58,3 @@ export const appRouter = createTRPCRouter({
|
|||||||
|
|
||||||
// export type definition of API
|
// export type definition of API
|
||||||
export type AppRouter = typeof appRouter;
|
export type AppRouter = typeof appRouter;
|
||||||
|
|
||||||
export const openApiDocument = generateOpenApiDocument(appRouter, {
|
|
||||||
title: "tRPC OpenAPI",
|
|
||||||
version: "1.0.0",
|
|
||||||
baseUrl: "http://localhost:3000/api/trpc",
|
|
||||||
docsUrl: "http://localhost:3000/api/trpc/settings.getOpenApiDocument",
|
|
||||||
tags: [
|
|
||||||
"admin",
|
|
||||||
"docker",
|
|
||||||
"compose",
|
|
||||||
"registry",
|
|
||||||
"cluster",
|
|
||||||
"user",
|
|
||||||
"domain",
|
|
||||||
"destination",
|
|
||||||
"backup",
|
|
||||||
"deployment",
|
|
||||||
"mounts",
|
|
||||||
"certificates",
|
|
||||||
"settings",
|
|
||||||
"security",
|
|
||||||
"redirects",
|
|
||||||
"port",
|
|
||||||
"project",
|
|
||||||
"application",
|
|
||||||
"mysql",
|
|
||||||
"postgres",
|
|
||||||
"redis",
|
|
||||||
"mongo",
|
|
||||||
"mariadb",
|
|
||||||
],
|
|
||||||
});
|
|
||||||
|
|||||||
@@ -41,7 +41,8 @@ import {
|
|||||||
} from "../services/settings";
|
} from "../services/settings";
|
||||||
import { canAccessToTraefikFiles } from "../services/user";
|
import { canAccessToTraefikFiles } from "../services/user";
|
||||||
import { recreateDirectory } from "@/server/utils/filesystem/directory";
|
import { recreateDirectory } from "@/server/utils/filesystem/directory";
|
||||||
import { openApiDocument } from "../root";
|
import { generateOpenApiDocument } from "@dokploy/trpc-openapi";
|
||||||
|
import { appRouter } from "../root";
|
||||||
|
|
||||||
export const settingsRouter = createTRPCRouter({
|
export const settingsRouter = createTRPCRouter({
|
||||||
reloadServer: adminProcedure.mutation(async () => {
|
reloadServer: adminProcedure.mutation(async () => {
|
||||||
@@ -244,13 +245,49 @@ export const settingsRouter = createTRPCRouter({
|
|||||||
return readConfigInPath(input.path);
|
return readConfigInPath(input.path);
|
||||||
}),
|
}),
|
||||||
|
|
||||||
getOpenApiDocument: protectedProcedure.query((): unknown => {
|
getOpenApiDocument: protectedProcedure.query(
|
||||||
openApiDocument.info = {
|
async ({ ctx }): Promise<unknown> => {
|
||||||
title: "Dokploy API",
|
const protocol = ctx.req.headers["x-forwarded-proto"];
|
||||||
description: "Endpoints for dokploy",
|
const url = `${protocol}://${ctx.req.headers.host}/api/trpc`;
|
||||||
version: getDokployVersion(),
|
const openApiDocument = generateOpenApiDocument(appRouter, {
|
||||||
};
|
title: "tRPC OpenAPI",
|
||||||
|
version: "1.0.0",
|
||||||
|
baseUrl: url,
|
||||||
|
docsUrl: `${url}/settings.getOpenApiDocument`,
|
||||||
|
tags: [
|
||||||
|
"admin",
|
||||||
|
"docker",
|
||||||
|
"compose",
|
||||||
|
"registry",
|
||||||
|
"cluster",
|
||||||
|
"user",
|
||||||
|
"domain",
|
||||||
|
"destination",
|
||||||
|
"backup",
|
||||||
|
"deployment",
|
||||||
|
"mounts",
|
||||||
|
"certificates",
|
||||||
|
"settings",
|
||||||
|
"security",
|
||||||
|
"redirects",
|
||||||
|
"port",
|
||||||
|
"project",
|
||||||
|
"application",
|
||||||
|
"mysql",
|
||||||
|
"postgres",
|
||||||
|
"redis",
|
||||||
|
"mongo",
|
||||||
|
"mariadb",
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
return openApiDocument;
|
openApiDocument.info = {
|
||||||
}),
|
title: "Dokploy API",
|
||||||
|
description: "Endpoints for dokploy",
|
||||||
|
version: getDokployVersion(),
|
||||||
|
};
|
||||||
|
|
||||||
|
return openApiDocument;
|
||||||
|
},
|
||||||
|
),
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user