@@ -203,35 +203,35 @@ <h5 class="modal-title" id="modalNotificationTitle"></h5>
203203 var dockerAgent = [ ] ;
204204
205205 $ . ajax ( {
206- url : "/api/containers"
206+ url : "/api/containers"
207+ } ) . done ( function ( result ) {
208+ dockerAgent [ "containers" ] = result ;
209+ $ ( "#containers_num" ) . text ( result . length ) ;
210+ $ . ajax ( {
211+ url : "/api/volumes" ,
207212 } ) . done ( function ( result ) {
208- dockerAgent [ "containers" ] = result ;
209- $ ( "#containers_num" ) . text ( result . length ) ;
210- $ . ajax ( {
211- url : "/api/volumes" ,
212- } ) . done ( function ( result ) {
213- dockerAgent [ "volumes" ] = result ;
214- $ ( "#volumes_num" ) . text ( result . Volumes . length ) ;
215- } ) ;
216- $ . ajax ( {
217- url : "/api/images" ,
218- } ) . done ( function ( result ) {
219- dockerAgent [ "images" ] = result ;
220- $ ( "#images_num" ) . text ( result . length ) ;
221- } ) ;
222- $ . ajax ( {
223- url : "/api/networks" ,
224- } ) . done ( function ( result ) {
225- dockerAgent [ "networks" ] = result ;
226- $ ( "#networks_num" ) . text ( result . length ) ;
227- } ) ;
228- $ . ajax ( {
229- url : "/api/registries" ,
230- } ) . done ( function ( result ) {
231- dockerAgent [ "registries" ] = result ;
232- $ ( "#registries_num" ) . text ( result . length ) ;
233- } ) ;
234- } )
213+ dockerAgent [ "volumes" ] = result ;
214+ $ ( "#volumes_num" ) . text ( result . Volumes . length ) ;
215+ } ) ;
216+ $ . ajax ( {
217+ url : "/api/images" ,
218+ } ) . done ( function ( result ) {
219+ dockerAgent [ "images" ] = result ;
220+ $ ( "#images_num" ) . text ( result . length ) ;
221+ } ) ;
222+ $ . ajax ( {
223+ url : "/api/networks" ,
224+ } ) . done ( function ( result ) {
225+ dockerAgent [ "networks" ] = result ;
226+ $ ( "#networks_num" ) . text ( result . length ) ;
227+ } ) ;
228+ $ . ajax ( {
229+ url : "/api/registries" ,
230+ } ) . done ( function ( result ) {
231+ dockerAgent [ "registries" ] = result ;
232+ $ ( "#registries_num" ) . text ( result . length ) ;
233+ } ) ;
234+ } )
235235 . fail ( function ( result ) {
236236 if ( result . status == 403 ) $ ( '#system-usage-chart' ) . html (
237237 '<span class="badge bg-danger"><h3>Error</h3></span>' ) ;
@@ -353,11 +353,11 @@ <h5 class="modal-title" id="modalNotificationTitle"></h5>
353353 '" disabled/></div></div><div class="col-4"><div class="input-group flex-nowrap"><span class="input-group-text bg-white text-primary">container</span><input class="form-control" value="' +
354354 po . split ( '/' ) [ 0 ] +
355355 '" disabled/></div></div><div class="col-2"><input class="form-control" disabled value="' + po
356- . split ( '/' ) [ 1 ] + '"></div></div>'
356+ . split ( '/' ) [ 1 ] + '"></div></div>'
357357 }
358358 } else {
359359 if ( 'PortBindings' in c . HostConfig && c . HostConfig . PortBindings !== null && Object . keys ( c . HostConfig
360- . PortBindings ) . length > 0 ) {
360+ . PortBindings ) . length > 0 ) {
361361 for ( const po of Object . keys ( c . HostConfig . PortBindings ) ) {
362362 containers +=
363363 '<div class="row m-2 ports"><div class="col-4"><div class="input-group flex-nowrap"><span class="input-group-text bg-white text-primary">host</span><input class="form-control ports-host" placeholder="name" value="' +
@@ -670,7 +670,7 @@ <h5 class="modal-title" id="modalNotificationTitle"></h5>
670670 let used_by = "" ;
671671 for ( gc in dockerAgent [ "containers" ] ) {
672672 if ( c . Name in dockerAgent [ "containers" ] [ gc ] . NetworkSettings . Networks ) used_by += dockerAgent [
673- "containers" ] [ gc ] . Name
673+ "containers" ] [ gc ] . Name
674674 . replace ( '/' , '' ) + " "
675675 }
676676 networks +=
@@ -1016,7 +1016,7 @@ <h5 class="modal-title" id="modalNotificationTitle"></h5>
10161016 dataType : "json"
10171017 } ) . done ( result => {
10181018 let url = new URL ( window . location . origin ) ;
1019- url . protocol = url . protocol == "https" ? "wss" : "ws" ;
1019+ url . protocol = url . protocol . startsWith ( "https" ) ? "wss" : "ws" ;
10201020
10211021 let client = new DockerExecWebsocketClient ( {
10221022 url : url . toString ( ) . slice ( 0 , - 1 ) + result . path ,
@@ -1212,7 +1212,7 @@ <h5 class="modal-title" id="modalNotificationTitle"></h5>
12121212 if ( dockerAgent [ "images" ] ) {
12131213 for ( const d of dockerAgent [ "images" ] ) {
12141214 if ( d . registry === false ) {
1215- if ( d . RepoTags . length > 0 ) s += '<br><span class="badge rounded-pill bg-danger">error</span> ' + d . RepoTags [ 0 ] ;
1215+ if ( d . RepoTags . length > 0 ) s += '<br><span class="badge rounded-pill bg-danger">error</span> ' + d . RepoTags [ 0 ] ;
12161216 else s += '<br><span class="badge rounded-pill bg-danger">error</span> ' + d . RepoDigests [ 0 ] ;
12171217 count ++ ;
12181218 }
0 commit comments