Implemented more of DeleteDialog
This commit is contained in:
@@ -1,10 +1,10 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { DashboardLayout } from "@/components/dashboard/DashboardLayout";
|
import { DashboardLayout } from "@/components/dashboard/DashboardLayout";
|
||||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
import { Card, CardContent } from "@/components/ui/card";
|
||||||
import { Badge } from "@/components/ui/badge";
|
import { Badge } from "@/components/ui/badge";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { MoreVertical, Play, Square, Trash2, Container } from "lucide-react";
|
import { MoreVertical, Play, Square, Container } from "lucide-react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { getDocker, removeContainer } from "@/core/docker";
|
import { getDocker, removeContainer } from "@/core/docker";
|
||||||
import { getNodes } from "@/core/node";
|
import { getNodes } from "@/core/node";
|
||||||
@@ -239,17 +239,23 @@ export default function ContainersPage() {
|
|||||||
|
|
||||||
<div className="flex justify-end gap-1 pt-2">
|
<div className="flex justify-end gap-1 pt-2">
|
||||||
{container.status === "running" ? (
|
{container.status === "running" ? (
|
||||||
<Button variant="ghost" size="icon-sm">
|
<Button
|
||||||
|
variant="ghost"
|
||||||
|
size="icon-sm"
|
||||||
|
onClick={() => stopContainer(container.id)}
|
||||||
|
>
|
||||||
<Square className="w-3 h-3" />
|
<Square className="w-3 h-3" />
|
||||||
</Button>
|
</Button>
|
||||||
) : (
|
) : (
|
||||||
<Button variant="ghost" size="icon-sm">
|
<Button
|
||||||
|
variant="ghost"
|
||||||
|
size="icon-sm"
|
||||||
|
onClick={() => startContainer(container.id)}
|
||||||
|
>
|
||||||
<Play className="w-3 h-3" />
|
<Play className="w-3 h-3" />
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
<Button variant="ghost" size="icon-sm">
|
<RemoveDialog remove={() => removeContainer(container.id)} />
|
||||||
<Trash2 className="w-3 h-3" />
|
|
||||||
</Button>
|
|
||||||
<Button variant="ghost" size="icon-sm">
|
<Button variant="ghost" size="icon-sm">
|
||||||
<MoreVertical className="w-3 h-3" />
|
<MoreVertical className="w-3 h-3" />
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -6,16 +6,7 @@ import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
|||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { Badge } from "@/components/ui/badge";
|
import { Badge } from "@/components/ui/badge";
|
||||||
import { Input } from "@/components/ui/input";
|
import { Input } from "@/components/ui/input";
|
||||||
import {
|
import { Trash2, Eye, EyeOff, Copy, Save, Lock, Loader2 } from "lucide-react";
|
||||||
Plus,
|
|
||||||
Trash2,
|
|
||||||
Eye,
|
|
||||||
EyeOff,
|
|
||||||
Copy,
|
|
||||||
Save,
|
|
||||||
Lock,
|
|
||||||
Loader2,
|
|
||||||
} from "lucide-react";
|
|
||||||
import { Env } from "@/lib/types";
|
import { Env } from "@/lib/types";
|
||||||
import { getEnv, setEnv } from "@/core/application";
|
import { getEnv, setEnv } from "@/core/application";
|
||||||
import { AddVariableDialog } from "@/components/dialogs/AddVariable";
|
import { AddVariableDialog } from "@/components/dialogs/AddVariable";
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { DashboardLayout } from "@/components/dashboard/DashboardLayout";
|
|||||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||||
import { Badge } from "@/components/ui/badge";
|
import { Badge } from "@/components/ui/badge";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { Server, Plus, Settings, Trash2 } from "lucide-react";
|
import { Server, Plus, Settings } from "lucide-react";
|
||||||
import { Progress } from "@/components/ui/progress";
|
import { Progress } from "@/components/ui/progress";
|
||||||
import { Docker, Node, NodeLiveData } from "@/lib/types";
|
import { Docker, Node, NodeLiveData } from "@/lib/types";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
@@ -13,6 +13,7 @@ import { formatBytes } from "@/lib/format";
|
|||||||
import { setNodes as updateNodes } from "@/core/node";
|
import { setNodes as updateNodes } from "@/core/node";
|
||||||
import AddNode from "@/components/dialogs/AddNode";
|
import AddNode from "@/components/dialogs/AddNode";
|
||||||
import { getDocker } from "@/core/docker";
|
import { getDocker } from "@/core/docker";
|
||||||
|
import RemoveDialog from "@/components/dialogs/Remove";
|
||||||
|
|
||||||
function DiskUsage({ liveData }: NodeLiveData) {
|
function DiskUsage({ liveData }: NodeLiveData) {
|
||||||
if (!liveData) return null;
|
if (!liveData) return null;
|
||||||
@@ -97,17 +98,13 @@ export default function NodesPage() {
|
|||||||
<Button variant="ghost" size="icon-sm">
|
<Button variant="ghost" size="icon-sm">
|
||||||
<Settings className="w-4 h-4" />
|
<Settings className="w-4 h-4" />
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<RemoveDialog
|
||||||
variant="ghost"
|
remove={async () => {
|
||||||
size="icon-sm"
|
|
||||||
onClick={async () => {
|
|
||||||
const newNodes = nodes.filter((_, index) => index !== i);
|
const newNodes = nodes.filter((_, index) => index !== i);
|
||||||
setNodes(newNodes);
|
setNodes(newNodes);
|
||||||
await updateNodes(newNodes);
|
await updateNodes(newNodes);
|
||||||
}}
|
}}
|
||||||
>
|
/>
|
||||||
<Trash2 className="w-4 h-4" />
|
|
||||||
</Button>
|
|
||||||
</div>
|
</div>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent>
|
<CardContent>
|
||||||
|
|||||||
Reference in New Issue
Block a user