File tree Expand file tree Collapse file tree 3 files changed +12
-7
lines changed
components/dashboard/swarm/applications
packages/server/src/services Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Original file line number Diff line number Diff line change
1
+ import { Layers , Loader2 } from "lucide-react" ;
1
2
import { Button } from "@/components/ui/button" ;
2
3
import {
3
4
Dialog ,
8
9
DialogTrigger ,
9
10
} from "@/components/ui/dialog" ;
10
11
import { api } from "@/utils/api" ;
11
- import { Layers , Loader2 } from "lucide-react" ;
12
12
import { type ApplicationList , columns } from "./columns" ;
13
13
import { DataTable } from "./data-table" ;
14
14
@@ -20,10 +20,10 @@ export const ShowNodeApplications = ({ serverId }: Props) => {
20
20
const { data : NodeApps , isLoading : NodeAppsLoading } =
21
21
api . swarm . getNodeApps . useQuery ( { serverId } ) ;
22
22
23
- let applicationList = "" ;
23
+ let applicationList : string [ ] = [ ] ;
24
24
25
25
if ( NodeApps && NodeApps . length > 0 ) {
26
- applicationList = NodeApps . map ( ( app ) => app . Name ) . join ( " " ) ;
26
+ applicationList = NodeApps . map ( ( app ) => app . Name ) ;
27
27
}
28
28
29
29
const { data : NodeAppDetails , isLoading : NodeAppDetailsLoading } =
Original file line number Diff line number Diff line change 1
1
import {
2
+ findServerById ,
2
3
getApplicationInfo ,
3
4
getNodeApplications ,
4
5
getNodeInfo ,
5
6
getSwarmNodes ,
6
7
} from "@dokploy/server" ;
7
- import { findServerById } from "@dokploy/server" ;
8
8
import { TRPCError } from "@trpc/server" ;
9
9
import { z } from "zod" ;
10
10
import { createTRPCRouter , protectedProcedure } from "../trpc" ;
@@ -55,7 +55,12 @@ export const swarmRouter = createTRPCRouter({
55
55
getAppInfos : protectedProcedure
56
56
. input (
57
57
z . object ( {
58
- appName : z . string ( ) . min ( 1 ) . regex ( containerIdRegex , "Invalid app name." ) ,
58
+ appName : z
59
+ . string ( )
60
+ . min ( 1 )
61
+ . regex ( containerIdRegex , "Invalid app name." )
62
+ . array ( )
63
+ . min ( 1 ) ,
59
64
serverId : z . string ( ) . optional ( ) ,
60
65
} ) ,
61
66
)
Original file line number Diff line number Diff line change @@ -441,13 +441,13 @@ export const getNodeApplications = async (serverId?: string) => {
441
441
} ;
442
442
443
443
export const getApplicationInfo = async (
444
- appName : string ,
444
+ appNames : string [ ] ,
445
445
serverId ?: string ,
446
446
) => {
447
447
try {
448
448
let stdout = "" ;
449
449
let stderr = "" ;
450
- const command = `docker service ps ${ appName } --format '{{json .}}' --no-trunc` ;
450
+ const command = `docker service ps ${ appNames . join ( " " ) } --format '{{json .}}' --no-trunc` ;
451
451
452
452
if ( serverId ) {
453
453
const result = await execAsyncRemote ( serverId , command ) ;
You can’t perform that action at this time.
0 commit comments