@@ -68,7 +68,7 @@ export const refreshStopped = (refreshStoppedContainers) => {
68
68
fetch ( 'http://localhost:3000/command/refreshStopped' )
69
69
. then ( ( data ) => data . json ( ) )
70
70
. then ( ( stoppedContainers ) => {
71
- refreshStoppedContainers ( stoppedContainers )
71
+ refreshStoppedContainers ( stoppedContainers ) ;
72
72
} )
73
73
. catch ( ( err ) => console . log ( err ) ) ;
74
74
} ;
@@ -82,7 +82,7 @@ export const refreshImages = (refreshImagesList) => {
82
82
fetch ( 'http://localhost:3000/command/refreshImages' )
83
83
. then ( ( data ) => data . json ( ) )
84
84
. then ( ( imagesList ) => {
85
- refreshImagesList ( imagesList )
85
+ refreshImagesList ( imagesList ) ;
86
86
} )
87
87
. catch ( ( err ) => console . log ( err ) ) ;
88
88
} ;
@@ -97,9 +97,9 @@ export const remove = (containerID, removeContainer) => {
97
97
fetch ( `http://localhost:3000/command/removeContainer?id=${ containerID } ` )
98
98
. then ( ( message ) => message . json ( ) )
99
99
. then ( ( message ) => {
100
- console . log ( { message} )
101
- removeContainer ( containerID )
102
- } )
100
+ console . log ( { message } ) ;
101
+ removeContainer ( containerID ) ;
102
+ } )
103
103
. catch ( ( err ) => console . log ( err ) ) ;
104
104
} ;
105
105
@@ -113,8 +113,8 @@ export const stop = (id, refreshStoppedContainers) => {
113
113
fetch ( `http://localhost:3000/command/stopContainer?id=${ id } ` )
114
114
. then ( ( message ) => message . json ( ) )
115
115
. then ( ( message ) => {
116
- console . log ( { message} )
117
- refreshStoppedContainers ( id )
116
+ console . log ( { message } ) ;
117
+ refreshStoppedContainers ( id ) ;
118
118
} )
119
119
. catch ( ( err ) => console . log ( err ) ) ;
120
120
} ;
@@ -126,12 +126,11 @@ export const stop = (id, refreshStoppedContainers) => {
126
126
* @param {* } runStoppedContainerDispatcher
127
127
*/
128
128
export const runStopped = ( id , runStoppedContainerDispatcher ) => {
129
- console . log ( 'inside runStopped' )
130
129
fetch ( `http://localhost:3000/command/runStopped?id=${ id } ` )
131
130
. then ( ( message ) => message . json ( ) )
132
131
. then ( ( message ) => {
133
- console . log ( { message} )
134
- runStoppedContainerDispatcher ( id )
132
+ console . log ( { message } ) ;
133
+ runStoppedContainerDispatcher ( id ) ;
135
134
} )
136
135
. catch ( ( err ) => console . log ( err ) ) ;
137
136
} ;
@@ -143,12 +142,14 @@ export const runStopped = (id, runStoppedContainerDispatcher) => {
143
142
* @param {* } refreshRunningContainers
144
143
*/
145
144
export const runIm = ( container , refreshRunningContainers ) => {
146
- fetch ( 'http://localhost:3000/command/runImage' , { method : 'post' , headers : {
147
- 'Content-Type' : 'application/json'
148
- } , body : JSON . stringify ( container ) } )
145
+ fetch ( 'http://localhost:3000/command/runImage' , {
146
+ method : 'post' , headers : {
147
+ 'Content-Type' : 'application/json'
148
+ } , body : JSON . stringify ( container )
149
+ } )
149
150
. then ( ( data ) => data . json ( ) )
150
151
. then ( ( newRunningList ) => {
151
- refreshRunningContainers ( newRunningList )
152
+ refreshRunningContainers ( newRunningList ) ;
152
153
} )
153
154
. catch ( ( err ) => console . log ( err ) ) ;
154
155
alert ( 'Running container.' ) ;
@@ -165,8 +166,8 @@ export const removeIm = (id, refreshImages, refreshImagesList) => {
165
166
fetch ( `http://localhost:3000/command/removeImage?id=${ id } ` )
166
167
. then ( ( ) => {
167
168
refreshImages ( refreshImagesList )
168
- . catch ( ( err ) => console . log ( err ) ) ;
169
- } )
169
+ . catch ( ( err ) => console . log ( err ) ) ;
170
+ } ) ;
170
171
} ;
171
172
172
173
/**
@@ -180,7 +181,7 @@ export const handlePruneClick = (e) => {
180
181
fetch ( `http://localhost:3000/command/dockerPrune` )
181
182
. then ( ( message ) => message . json ( ) )
182
183
. then ( ( message ) => {
183
- console . log ( { message} )
184
+ console . log ( { message } ) ;
184
185
} )
185
186
. catch ( ( err ) => console . log ( err ) ) ;
186
187
} ;
@@ -195,7 +196,7 @@ export const pullImage = (repo) => {
195
196
fetch ( `http://localhost:3000/command/pullImage?repo=${ repo } ` )
196
197
. then ( ( message ) => message . json ( ) )
197
198
. then ( ( message ) => {
198
- console . log ( { message} )
199
+ console . log ( { message } ) ;
199
200
} )
200
201
. catch ( ( err ) => console . log ( err ) ) ;
201
202
} ;
@@ -241,14 +242,16 @@ export const inspectDockerContainer = (containerId) => {
241
242
*/
242
243
243
244
export const dockerComposeUp = ( getContainerStacks , filePath , ymlFileName ) => {
244
- fetch ( 'http://localhost:3000/command/composeUp' , { method : 'post' , headers : {
245
- 'Content-Type' : 'application/json'
246
- } , body : JSON . stringify ( { filePath : filePath , ymlFileName : ymlFileName } ) } )
247
- . then ( ( data ) => data . json ( ) )
248
- . then ( ( dockerOutput ) => {
249
- getContainerStacks ( dockerOutput )
245
+ fetch ( 'http://localhost:3000/command/composeUp' , {
246
+ method : 'post' , headers : {
247
+ 'Content-Type' : 'application/json'
248
+ } , body : JSON . stringify ( { filePath : filePath , ymlFileName : ymlFileName } )
250
249
} )
251
- . catch ( ( err ) => console . log ( err ) ) ;
250
+ . then ( ( data ) => data . json ( ) )
251
+ . then ( ( dockerOutput ) => {
252
+ getContainerStacks ( dockerOutput ) ;
253
+ } )
254
+ . catch ( ( err ) => console . log ( err ) ) ;
252
255
} ;
253
256
254
257
/**
@@ -259,11 +262,11 @@ export const dockerComposeUp = (getContainerStacks, filePath, ymlFileName) => {
259
262
260
263
export const dockerComposeStacks = ( getContainerStacks ) => {
261
264
fetch ( 'http://localhost:3000/command/composeStacks' )
262
- . then ( ( data ) => data . json ( ) )
263
- . then ( ( dockerOutput ) => {
264
- getContainerStacks ( dockerOutput )
265
- } )
266
- . catch ( ( err ) => console . log ( err ) ) ;
265
+ . then ( ( data ) => data . json ( ) )
266
+ . then ( ( dockerOutput ) => {
267
+ getContainerStacks ( dockerOutput ) ;
268
+ } )
269
+ . catch ( ( err ) => console . log ( err ) ) ;
267
270
} ;
268
271
269
272
/**
@@ -274,14 +277,16 @@ export const dockerComposeStacks = (getContainerStacks) => {
274
277
*/
275
278
276
279
export const dockerComposeDown = ( getContainerStacks , filePath , ymlFileName ) => {
277
- fetch ( 'http://localhost:3000/command/composeDown' , { method : 'post' , headers : {
278
- 'Content-Type' : 'application/json'
279
- } , body : JSON . stringify ( { filePath : filePath , ymlFileName : ymlFileName } ) } )
280
- . then ( ( data ) => data . json ( ) )
281
- . then ( ( dockerOutput ) => {
282
- getContainerStacks ( dockerOutput )
280
+ fetch ( 'http://localhost:3000/command/composeDown' , {
281
+ method : 'post' , headers : {
282
+ 'Content-Type' : 'application/json'
283
+ } , body : JSON . stringify ( { filePath : filePath , ymlFileName : ymlFileName } )
283
284
} )
284
- . catch ( ( err ) => console . log ( err ) ) ;
285
+ . then ( ( data ) => data . json ( ) )
286
+ . then ( ( dockerOutput ) => {
287
+ getContainerStacks ( dockerOutput ) ;
288
+ } )
289
+ . catch ( ( err ) => console . log ( err ) ) ;
285
290
} ;
286
291
287
292
/**
@@ -296,10 +301,10 @@ export const writeToDb = () => {
296
301
const runningContainers = state . containersList . runningList ;
297
302
298
303
const stoppedContainers = state . containersList . stoppedList ;
299
-
304
+
300
305
if ( ! runningContainers . length ) return ;
301
306
const containerParameters = { } ;
302
-
307
+
303
308
// used_memory = memory_stats.usage - memory_stats.stats.cache
304
309
305
310
runningContainers . forEach ( ( container ) => {
@@ -386,9 +391,9 @@ export const getContainerGitUrl = async (container) => {
386
391
* @param {* } getVolumeList
387
392
*/
388
393
389
-
394
+
390
395
export const getAllDockerVolumes = ( getVolumeList ) => {
391
- fetch ( '/localhost:3000/command/allDockerVolumes' )
396
+ fetch ( 'http:/ /localhost:3000/command/allDockerVolumes' )
392
397
. then ( ( volumes ) => volumes . json ( ) )
393
398
. then ( ( dockerVolumes ) => {
394
399
return getVolumeList ( filterOneProperty ( dockerVolumes , 'Name' ) ) ;
@@ -427,9 +432,9 @@ export const getVolumeContainers = (volumeName, getVolumeContainersList) => {
427
432
428
433
export const getLogs = async ( optionsObj , getContainerLogsDispatcher ) => {
429
434
try {
430
- const response = await fetch ( 'http://localhost:3000/command/allLogs' ,
431
- { method : 'post' , headers : { 'Content-Type' : 'application/json' } , body : JSON . stringify ( optionsObj ) } ) ;
432
- return await response . json ( ) ;
435
+ const response = await fetch ( 'http://localhost:3000/command/allLogs' ,
436
+ { method : 'post' , headers : { 'Content-Type' : 'application/json' } , body : JSON . stringify ( optionsObj ) } ) ;
437
+ return await response . json ( ) ;
433
438
}
434
439
catch {
435
440
console . log ( err ) ;
0 commit comments