1
- import { IpAddress , Result , Server , ServerId , PlayerIdentityId , DockerStats , LogFile , ArsStatusResult , ArsStatus } from './interfaces' ;
1
+ import {
2
+ IpAddress ,
3
+ Result ,
4
+ Server ,
5
+ ServerId ,
6
+ PlayerIdentityId ,
7
+ DockerStats ,
8
+ LogFile ,
9
+ ArsStatusResult ,
10
+ ArsStatus ,
11
+ ResultSize
12
+ } from './interfaces' ;
2
13
import { useLogsStore } from '../stores/logs' ;
3
14
4
15
const api = import . meta. env . VITE_API_URL ;
@@ -104,6 +115,14 @@ export async function getStats(uuid: string): Promise<DockerStats> {
104
115
return result ;
105
116
}
106
117
118
+ export async function getSize ( uuid : string ) : Promise < ResultSize > {
119
+ const jsonResponse = await fetch ( `${ apiProtocol } ://${ api } /api/server/${ uuid } /size` ) ;
120
+ const result = ( await jsonResponse . json ( ) ) as ResultSize ;
121
+ const logsStore = useLogsStore ( ) ;
122
+ logsStore . add ( `Getting Size for Server with UUID: ${ uuid } ` ) ;
123
+ return result ;
124
+ }
125
+
107
126
export async function addServer ( server : Server ) : Promise < string > {
108
127
const jsonResponse = await fetch ( `${ apiProtocol } ://${ api } /api/add-server` , {
109
128
method : 'POST' ,
@@ -140,7 +159,6 @@ export async function getPublicIp(): Promise<string> {
140
159
141
160
export async function getArsStatus ( ) : Promise < ArsStatus > {
142
161
const jsonResponse = await fetch ( `${ apiProtocol } ://${ api } /api/get-ars-status` ) ;
143
-
144
162
const result = ( await jsonResponse . json ( ) ) as ArsStatusResult ;
145
163
const logsStore = useLogsStore ( ) ;
146
164
logsStore . add ( `ARS status fetched` ) ;
@@ -149,7 +167,6 @@ export async function getArsStatus(): Promise<ArsStatus> {
149
167
150
168
export async function recreateArsDockerImage ( ) : Promise < boolean > {
151
169
const jsonResponse = await fetch ( `${ apiProtocol } ://${ api } /api/recreate-ars-docker-image` ) ;
152
-
153
170
const result = ( await jsonResponse . json ( ) ) as Result ;
154
171
const logsStore = useLogsStore ( ) ;
155
172
logsStore . add ( `ARS docker image recreation started` ) ;
0 commit comments