@@ -221,6 +221,8 @@ const createFolder = (folder, id, positionInMainOrder, liveOrderArray, container
221221 // Default variables
222222 let upToDate = true ;
223223 let started = 0 ;
224+ let paused = 0 ;
225+ let stopped = 0 ;
224226 let autostart = 0 ;
225227 let autostartStarted = 0 ;
226228 let managed = 0 ;
@@ -928,7 +930,15 @@ const createFolder = (folder, id, positionInMainOrder, liveOrderArray, container
928930 }
929931
930932 upToDate = upToDate && ! newFolder [ container_name_in_folder ] . update ;
931- started += newFolder [ container_name_in_folder ] . state ? 1 : 0 ;
933+ if ( newFolder [ container_name_in_folder ] . state ) {
934+ if ( newFolder [ container_name_in_folder ] . pause ) {
935+ paused += 1 ;
936+ } else {
937+ started += 1 ;
938+ }
939+ } else {
940+ stopped += 1 ;
941+ }
932942 const isDockerMan = ct . info . State . manager === 'dockerman' ;
933943 autostart += ( isDockerMan && ! ( ct . info . State . Autostart === false ) ) ? 1 : 0 ;
934944 autostartStarted += ( isDockerMan && ! ( ct . info . State . Autostart === false ) && newFolder [ container_name_in_folder ] . state ) ? 1 : 0 ;
@@ -1011,28 +1021,35 @@ const createFolder = (folder, id, positionInMainOrder, liveOrderArray, container
10111021 $ ( `tr.folder-id-${ id } > td.updatecolumn` ) . append ( $ ( `<a class="exec" onclick="updateFolder('${ id } ');"><span style="white-space:nowrap;"><i class="fa fa-cloud-download fa-fw"></i> ${ $ . i18n ( 'apply-update' ) } </span></a>` ) ) ;
10121022 if ( FOLDER_VIEW_DEBUG_MODE ) console . log ( `[FV3_DEBUG] createFolder (id: ${ id } ): Set 'update ready' status in update column.` ) ;
10131023 }
1014- if ( started ) {
1024+ const total = Object . entries ( folder . containers ) . length ;
1025+ let folderStatusKind = 'stopped' ;
1026+ if ( started > 0 ) {
1027+ folderStatusKind = 'running' ;
10151028 $ ( `tr.folder-id-${ id } i#load-folder-${ id } ` ) . attr ( 'class' , 'fa fa-play started green-text folder-load-status' ) ;
1016- $ ( `tr.folder-id-${ id } span.folder-state` ) . text ( `${ started } /${ Object . entries ( folder . containers ) . length } ${ $ . i18n ( 'started' ) } ` ) ;
1017- if ( FOLDER_VIEW_DEBUG_MODE ) console . log ( `[FV3_DEBUG] createFolder (id: ${ id } ): Set 'started' status. Count: ${ started } /${ Object . entries ( folder . containers ) . length } .` ) ;
1029+ $ ( `tr.folder-id-${ id } span.folder-state` ) . text ( `${ started } /${ total } ${ $ . i18n ( 'started' ) } ` ) ;
1030+ } else if ( paused > 0 ) {
1031+ folderStatusKind = 'paused' ;
1032+ $ ( `tr.folder-id-${ id } i#load-folder-${ id } ` ) . attr ( 'class' , 'fa fa-pause paused orange-text folder-load-status' ) ;
1033+ $ ( `tr.folder-id-${ id } span.folder-state` ) . text ( `${ paused } /${ total } ${ $ . i18n ( 'paused' ) } ` ) ;
1034+ } else {
1035+ folderStatusKind = 'stopped' ;
1036+ $ ( `tr.folder-id-${ id } i#load-folder-${ id } ` ) . attr ( 'class' , 'fa fa-square stopped red-text folder-load-status' ) ;
1037+ $ ( `tr.folder-id-${ id } span.folder-state` ) . text ( `${ stopped } /${ total } ${ $ . i18n ( 'stopped' ) } ` ) ;
10181038 }
10191039 const badgePrefs = folderTypePrefs ?. badges || { } ;
10201040 const showRunningBadge = badgePrefs . running !== false ;
10211041 const showStoppedBadge = badgePrefs . stopped === true ;
10221042 const showUpdateBadge = badgePrefs . updates !== false ;
1023- const folderIsRunning = started > 0 ;
10241043
10251044 if ( ! showUpdateBadge && ! folder . settings . update_column ) {
10261045 $ ( `tr.folder-id-${ id } > td.updatecolumn` ) . next ( ) . attr ( 'colspan' , 6 ) . end ( ) . remove ( ) ;
10271046 }
10281047
1029- if ( folderIsRunning && ! showRunningBadge ) {
1048+ if ( folderStatusKind === 'running' && ! showRunningBadge ) {
10301049 $ ( `tr.folder-id-${ id } i#load-folder-${ id } ` ) . hide ( ) ;
10311050 }
1032- if ( ! folderIsRunning && ! showStoppedBadge ) {
1033- const total = Object . entries ( folder . containers ) . length ;
1051+ if ( folderStatusKind === 'stopped' && ! showStoppedBadge ) {
10341052 $ ( `tr.folder-id-${ id } i#load-folder-${ id } ` ) . hide ( ) ;
1035- $ ( `tr.folder-id-${ id } span.folder-state` ) . text ( `${ started } /${ total } ${ $ . i18n ( 'started' ) } ` ) ;
10361053 }
10371054
10381055 if ( ! managerTypes . has ( 'dockerman' ) ) {
@@ -1057,7 +1074,7 @@ const createFolder = (folder, id, positionInMainOrder, liveOrderArray, container
10571074 else if ( managed > 0 && managed === Object . values ( folder . containers ) . length ) { $ ( `tr.folder-id-${ id } ` ) . addClass ( 'managed-full' ) ; }
10581075 if ( FOLDER_VIEW_DEBUG_MODE ) console . log ( `[FV3_DEBUG] createFolder (id: ${ id } ): Applied managed status class. Managed: ${ managed } , Total: ${ Object . values ( folder . containers ) . length } .` ) ;
10591076
1060- folder . status = { upToDate, started, autostart, autostartStarted, managed, managerTypes : Array . from ( managerTypes ) , expanded : false } ;
1077+ folder . status = { upToDate, started, paused , stopped , autostart, autostartStarted, managed, managerTypes : Array . from ( managerTypes ) , expanded : false } ;
10611078 if ( FOLDER_VIEW_DEBUG_MODE ) console . log ( `[FV3_DEBUG] createFolder (id: ${ id } ): Set final folder.status object:` , JSON . parse ( JSON . stringify ( folder . status ) ) ) ;
10621079 if ( FOLDER_VIEW_DEBUG_MODE ) console . log ( `[FV3_DEBUG] createFolder (id: ${ id } ): Dispatching docker-post-folder-creation event.` ) ;
10631080 folderEvents . dispatchEvent ( new CustomEvent ( 'docker-post-folder-creation' , { detail : {
0 commit comments