Re structured lib and core

This commit is contained in:
2026-01-02 19:51:20 +01:00
parent 3f2d562299
commit caa1191736
26 changed files with 416 additions and 420 deletions
+1 -5
View File
@@ -1,11 +1,7 @@
import { NextRequest, NextResponse } from "next/server";
import testAuth from "../auth";
import { StatusCodes } from "http-status-codes";
import {
installApp,
getApplications,
removeApp,
} from "@/core/server/application";
import { installApp, getApplications, removeApp } from "@/core/application";
export async function GET(req: NextRequest): Promise<NextResponse> {
const auth = await testAuth(req);
+1 -1
View File
@@ -1,7 +1,7 @@
import { NextRequest, NextResponse } from "next/server";
import testAuth from "../auth";
import { StatusCodes } from "http-status-codes";
import { getDocker, removeContainer } from "@/core/server/docker";
import { getDocker, removeContainer } from "@/core/docker";
import { Docker } from "@/lib/types";
export async function GET(req: NextRequest): Promise<NextResponse> {
+1 -1
View File
@@ -1,7 +1,7 @@
import { NextRequest, NextResponse } from "next/server";
import testAuth from "../../auth";
import { StatusCodes } from "http-status-codes";
import { startContainer, stopContainer } from "@/core/server/docker";
import { startContainer, stopContainer } from "@/core/docker";
export async function POST(req: NextRequest): Promise<NextResponse> {
const auth = await testAuth(req);
+1 -1
View File
@@ -1,7 +1,7 @@
import { NextRequest, NextResponse } from "next/server";
import testAuth from "../../auth";
import { StatusCodes } from "http-status-codes";
import { getContainerStats } from "@/core/server/docker";
import { getContainerStats } from "@/core/docker";
export async function GET(req: NextRequest): Promise<NextResponse> {
const auth = await testAuth(req);
+1 -1
View File
@@ -1,7 +1,7 @@
import { NextRequest, NextResponse } from "next/server";
import testAuth from "../auth";
import { StatusCodes } from "http-status-codes";
import { getEnv, setEnv } from "@/core/server/application";
import { getEnv, setEnv } from "@/core/application";
export async function GET(req: NextRequest): Promise<NextResponse> {
const auth = await testAuth(req);
+1 -1
View File
@@ -1,7 +1,7 @@
import { NextRequest, NextResponse } from "next/server";
import testAuth from "../auth";
import { StatusCodes } from "http-status-codes";
import { getAllContainerLogs } from "@/core/server/docker";
import { getAllContainerLogs } from "@/core/docker";
export async function GET(req: NextRequest): Promise<NextResponse> {
const auth = await testAuth(req);
+1 -1
View File
@@ -14,7 +14,7 @@ import { Button } from "@/components/ui/button";
import { MoreVertical, Plus, Rocket } from "lucide-react";
import InstallApplicationDialog from "@/components/dialogs/InstallApplication";
import { useEffect, useState } from "react";
import { getApplications, removeApp } from "@/core/application";
import { getApplications, removeApp } from "@/lib/dockship/application";
import RemoveDialog from "@/components/dialogs/Remove";
import { Application } from "@/lib/types";
+2 -2
View File
@@ -14,8 +14,8 @@ import {
} from "lucide-react";
import { useEffect, useState } from "react";
import { Application, Deployment } from "@/lib/types";
import { getDeployments } from "@/core/server/deployment";
import { getApplications } from "@/core/application";
import { getDeployments } from "@/core/deployment";
import { getApplications } from "@/lib/dockship/application";
import { cn } from "@/lib/utils";
export default function DeploymentsPage() {
+1 -1
View File
@@ -7,7 +7,7 @@ import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Trash2, Eye, EyeOff, Copy, Save, Lock, Loader2 } from "lucide-react";
import { Env } from "@/lib/types";
import { getEnv, setEnv } from "@/core/application";
import { getEnv, setEnv } from "@/lib/dockship/application";
import { AddVariableDialog } from "@/components/dialogs/AddVariable";
import {
DropdownMenu,
+1 -1
View File
@@ -8,7 +8,7 @@ import { Badge } from "@/components/ui/badge";
import { Pause, Play, Download, Filter, RefreshCw } from "lucide-react";
import { cn } from "@/lib/utils";
import { Log } from "@/lib/types";
import { getAllContainerLogs } from "@/core/docker";
import { getAllContainerLogs } from "@/lib/dockship/docker";
export default function LogsPage() {
const [isPaused, setIsPaused] = useState(false);
+3 -3
View File
@@ -5,13 +5,13 @@ import { Progress } from "@/components/ui/progress";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { type ChartConfig } from "@/components/ui/chart";
import GradientAreaChart from "@/components/GradientAreaChart";
import { getMetrics } from "@/core/metrics";
import { getMetrics } from "@/lib/dockship/metrics";
import { useEffect, useState } from "react";
import { useIsMobile } from "@/hooks/use-mobile";
import RadialChart from "@/components/RadialChart";
import { getLiveNodes, getNodes } from "@/core/node";
import { getLiveNodes, getNodes } from "@/lib/dockship/node";
import { average } from "@/lib/format";
import { getContainerStats, getDocker } from "@/core/docker";
import { getContainerStats, getDocker } from "@/lib/dockship/docker";
import { SimpleStats } from "@/lib/types";
const cpuChartConfig = {
+3 -3
View File
@@ -8,11 +8,11 @@ import { Server, Plus, Settings } from "lucide-react";
import { Progress } from "@/components/ui/progress";
import { Docker, Node, NodeLiveData } from "@/lib/types";
import { useEffect, useState } from "react";
import { getLiveNodes } from "@/core/node";
import { getLiveNodes } from "@/lib/dockship/node";
import { formatBytes } from "@/lib/format";
import { setNodes as updateNodes } from "@/core/node";
import { setNodes as updateNodes } from "@/lib/dockship/node";
import AddNode from "@/components/dialogs/AddNode";
import { getDocker } from "@/core/docker";
import { getDocker } from "@/lib/dockship/docker";
import RemoveDialog from "@/components/dialogs/Remove";
function DiskUsage({ liveData }: NodeLiveData) {
+3 -3
View File
@@ -16,11 +16,11 @@ import {
} from "lucide-react";
import { Progress } from "@/components/ui/progress";
import Link from "next/link";
import { getLiveNodes } from "@/core/node";
import { getLiveNodes } from "@/lib/dockship/node";
import { useEffect, useState } from "react";
import { Application, Docker, Node, NodeLiveData } from "@/lib/types";
import { getDocker } from "@/core/docker";
import { getApplications } from "@/core/application";
import { getDocker } from "@/lib/dockship/docker";
import { getApplications } from "@/lib/dockship/application";
import { cn } from "@/lib/utils";
const recentDeployments = [
+1 -1
View File
@@ -2,7 +2,7 @@
import { Button } from "@/components/ui/button";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import redirectAuth from "@/core/auth/redirect";
import redirectAuth from "@/lib/dockship/redirect";
import { GithubIcon } from "lucide-react";
import Image from "next/image";