mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
refactor: remove router
This commit is contained in:
@@ -245,15 +245,13 @@ export const RequestsTable = () => {
|
||||
colSpan={columns.length}
|
||||
className="h-24 text-center"
|
||||
>
|
||||
{/* {isLoading ? (
|
||||
{statsLogs?.data.length === 0 && (
|
||||
<div className="w-full flex-col gap-2 flex items-center justify-center h-[55vh]">
|
||||
<span className="text-muted-foreground text-lg font-medium">
|
||||
Loading...
|
||||
No results.
|
||||
</span>
|
||||
</div>
|
||||
) : (
|
||||
<>No results.</>
|
||||
)} */}
|
||||
)}
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
)}
|
||||
|
||||
1
apps/dokploy/drizzle/0036_tired_ronan.sql
Normal file
1
apps/dokploy/drizzle/0036_tired_ronan.sql
Normal file
@@ -0,0 +1 @@
|
||||
ALTER TABLE "admin" ADD COLUMN "enableLogRotation" boolean DEFAULT false NOT NULL;
|
||||
3566
apps/dokploy/drizzle/meta/0036_snapshot.json
Normal file
3566
apps/dokploy/drizzle/meta/0036_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -253,6 +253,13 @@
|
||||
"when": 1725429324584,
|
||||
"tag": "0035_cool_gravity",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 36,
|
||||
"version": "6",
|
||||
"when": 1725519351871,
|
||||
"tag": "0036_tired_ronan",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -29,7 +29,6 @@ import { securityRouter } from "./routers/security";
|
||||
import { settingsRouter } from "./routers/settings";
|
||||
import { sshRouter } from "./routers/ssh-key";
|
||||
import { userRouter } from "./routers/user";
|
||||
import { licenseRouter } from "./routers/license";
|
||||
|
||||
/**
|
||||
* This is the primary router for your server.
|
||||
@@ -63,7 +62,6 @@ export const appRouter = createTRPCRouter({
|
||||
cluster: clusterRouter,
|
||||
notification: notificationRouter,
|
||||
sshKey: sshRouter,
|
||||
license: licenseRouter,
|
||||
gitProvider: gitProviderRouter,
|
||||
bitbucket: bitbucketRouter,
|
||||
gitlab: gitlabRouter,
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
import { z } from "zod";
|
||||
import { findAdmin, updateAdmin } from "../services/admin";
|
||||
import { adminProcedure, createTRPCRouter } from "../trpc";
|
||||
import { TRPCError } from "@trpc/server";
|
||||
|
||||
export const licenseRouter = createTRPCRouter({
|
||||
setLicense: adminProcedure.input(z.string()).mutation(async ({ input }) => {
|
||||
const admin = await findAdmin();
|
||||
|
||||
if (!input) {
|
||||
return await updateAdmin(admin.authId, {
|
||||
licenseKey: "",
|
||||
});
|
||||
}
|
||||
|
||||
try {
|
||||
const result = await fetch("http://127.0.0.1:4000/v1/validate-license", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({
|
||||
licenseKey: input,
|
||||
}),
|
||||
});
|
||||
|
||||
const data = await result.json();
|
||||
|
||||
if (!data.valid) {
|
||||
throw new TRPCError({
|
||||
code: "BAD_REQUEST",
|
||||
message: "License is invalid",
|
||||
});
|
||||
}
|
||||
|
||||
if (data.valid) {
|
||||
return await updateAdmin(admin.authId, {
|
||||
licenseKey: input,
|
||||
});
|
||||
}
|
||||
} catch (err) {
|
||||
return await updateAdmin(admin.authId, {
|
||||
licenseKey: "",
|
||||
});
|
||||
}
|
||||
}),
|
||||
});
|
||||
@@ -20,7 +20,6 @@ export const admins = pgTable("admin", {
|
||||
sshPrivateKey: text("sshPrivateKey"),
|
||||
enableDockerCleanup: boolean("enableDockerCleanup").notNull().default(false),
|
||||
enableLogRotation: boolean("enableLogRotation").notNull().default(false),
|
||||
licenseKey: text("licenseKey"),
|
||||
authId: text("authId")
|
||||
.notNull()
|
||||
.references(() => auth.id, { onDelete: "cascade" }),
|
||||
|
||||
Reference in New Issue
Block a user