Renamed deploy app to instsall
This commit is contained in:
@@ -2,7 +2,7 @@ import { NextRequest, NextResponse } from "next/server";
|
||||
import testAuth from "../auth";
|
||||
import { StatusCodes } from "http-status-codes";
|
||||
import {
|
||||
deployNewApp,
|
||||
installApp,
|
||||
getApplications,
|
||||
removeApp,
|
||||
} from "@/core/server/application";
|
||||
@@ -44,7 +44,7 @@ export async function POST(req: NextRequest): Promise<NextResponse> {
|
||||
);
|
||||
}
|
||||
|
||||
const res = await deployNewApp(name, repo, nodeId);
|
||||
const res = await installApp(name, repo, nodeId);
|
||||
|
||||
return NextResponse.json({
|
||||
message: "ok",
|
||||
|
||||
@@ -4,9 +4,9 @@ import { DashboardLayout } from "@/components/dashboard/DashboardLayout";
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Play, Square, MoreVertical, Plus } from "lucide-react";
|
||||
import { Play, Square, MoreVertical, Plus, Rocket } from "lucide-react";
|
||||
import { Progress } from "@/components/ui/progress";
|
||||
import DeployApplication from "@/components/dialogs/DeployApplication";
|
||||
import InstallApplicationDialog from "@/components/dialogs/InstallApplication";
|
||||
import { useEffect, useState } from "react";
|
||||
import { ImageApp } from "@/lib/types";
|
||||
import { getApplications, removeApp } from "@/core/application";
|
||||
@@ -34,7 +34,7 @@ export default function ApplicationsPage() {
|
||||
return (
|
||||
<DashboardLayout
|
||||
title="Applications"
|
||||
subtitle="Manage deployed applications"
|
||||
subtitle="Manage installed applications"
|
||||
>
|
||||
{/* Header */}
|
||||
<div className="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-6">
|
||||
@@ -45,12 +45,12 @@ export default function ApplicationsPage() {
|
||||
</Badge>
|
||||
</div>
|
||||
|
||||
<DeployApplication>
|
||||
<InstallApplicationDialog>
|
||||
<Button size="sm" className="gap-2 w-full sm:w-auto">
|
||||
<Plus className="w-4 h-4" />
|
||||
Deploy Application
|
||||
Install Application
|
||||
</Button>
|
||||
</DeployApplication>
|
||||
</InstallApplicationDialog>
|
||||
</div>
|
||||
|
||||
<div className="space-y-3">
|
||||
@@ -137,7 +137,7 @@ export default function ApplicationsPage() {
|
||||
</Button>
|
||||
) : (
|
||||
<Button variant="ghost" size="icon-sm">
|
||||
<Play className="w-3 h-3" />
|
||||
<Rocket className="w-3 h-3" />
|
||||
</Button>
|
||||
)}
|
||||
<RemoveDialog
|
||||
|
||||
+4
-4
@@ -16,9 +16,9 @@ import { Label } from "@/components/ui/label";
|
||||
import { getLiveNodes } from "@/core/node";
|
||||
import { Combobox } from "../ui/combobox";
|
||||
import { Node, NodeLiveData } from "@/lib/types";
|
||||
import { deployNewApp } from "@/core/application";
|
||||
import { installApp } from "@/core/application";
|
||||
|
||||
export default function DeployApplication({
|
||||
export default function InstallApplicationDialog({
|
||||
children,
|
||||
}: {
|
||||
children: ReactNode;
|
||||
@@ -36,7 +36,7 @@ export default function DeployApplication({
|
||||
}, []);
|
||||
|
||||
const deploy = async () => {
|
||||
console.log(await deployNewApp(name, repo, node));
|
||||
console.log(await installApp(name, repo, node));
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -45,7 +45,7 @@ export default function DeployApplication({
|
||||
|
||||
<DialogContent className="sm:max-w-106.25">
|
||||
<DialogHeader>
|
||||
<DialogTitle>Deploy Application</DialogTitle>
|
||||
<DialogTitle>Install Application</DialogTitle>
|
||||
</DialogHeader>
|
||||
|
||||
<div className="grid gap-4">
|
||||
@@ -5,7 +5,7 @@ import { getNodes } from "./node";
|
||||
import axios from "axios";
|
||||
import { Env, EnvVariable, ImageApp } from "@/lib/types";
|
||||
|
||||
export async function deployNewApp(name: string, repo: string, nodeId: string) {
|
||||
export async function installApp(name: string, repo: string, nodeId: string) {
|
||||
if (await verifySession()) {
|
||||
throw new Error("Unauthorized");
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ export async function getApplications(): Promise<ImageApp[]> {
|
||||
return apps;
|
||||
}
|
||||
|
||||
export async function deployNewApp(name: string, repo: string, nodeId: string) {
|
||||
export async function installApp(name: string, repo: string, nodeId: string) {
|
||||
// Create app ID
|
||||
const appId = `app_${randomUUID()}`;
|
||||
const appDir = path.join(DATA_DIR, appId);
|
||||
|
||||
Reference in New Issue
Block a user