@@ -82,17 +82,31 @@ class BackendController extends \Neos\Flow\Mvc\Controller\ActionController
8282 */
8383 protected $ redisContentStores ;
8484
85+ /**
86+ * @Flow\InjectConfiguration("configEpoch")
87+ * @var array
88+ */
89+ protected $ configEpochSettings ;
90+
8591 protected $ defaultViewObjectName = FusionView::class;
8692
8793 public function indexAction (?string $ contentStore = null )
8894 {
8995 $ contentStore = $ contentStore ? RedisInstanceIdentifier::fromString ($ contentStore ) : RedisInstanceIdentifier::primary ();
90- $ storeSize = $ this ->redisClientManager ->getRedis ($ contentStore )->info ('memory ' )['used_memory_human ' ];
96+ $ redis = $ this ->redisClientManager ->getRedis ($ contentStore );
97+ $ storeSize = $ redis ->info ('memory ' )['used_memory_human ' ];
98+ $ currentConfigEpoch = $ this ->configEpochSettings ['current ' ] ?? null ;
99+ $ previousConfigEpoch = $ this ->configEpochSettings ['previous ' ] ?? null ;
100+ $ configEpochRedis = $ redis ->get ('contentStore:configEpoch ' );
101+ $ showToggleConfigEpochButton = $ previousConfigEpoch !== null && !$ contentStore ->isPrimary ();
91102
92103 $ this ->view ->assign ('contentStore ' , $ contentStore ->getIdentifier ());
93104 $ this ->view ->assign ('overviewData ' , $ this ->backendUiDataService ->loadBackendOverviewData ($ contentStore ));
94105 $ this ->view ->assign ('redisContentStores ' , array_keys ($ this ->redisContentStores ));
95106 $ this ->view ->assign ('storeSize ' , $ storeSize );
107+ $ this ->view ->assign ('toggleFromConfigEpoch ' , $ configEpochRedis );
108+ $ this ->view ->assign ('toggleToConfigEpoch ' , $ configEpochRedis === $ currentConfigEpoch ? $ previousConfigEpoch : $ currentConfigEpoch );
109+ $ this ->view ->assign ('showToggleConfigEpochButton ' , $ showToggleConfigEpochButton );
96110 }
97111
98112 public function detailsAction (string $ contentReleaseIdentifier , ?string $ contentStore = null , ?string $ detailTaskName = '' , ?string $ prunnerJobId = '' )
@@ -183,4 +197,12 @@ public function cancelRunningReleaseAction(string $redisInstanceIdentifier)
183197
184198 $ this ->redirect ('index ' , null , null , ['contentStore ' => $ redisInstanceIdentifier ->getIdentifier ()]);
185199 }
200+
201+ public function toggleConfigEpochAction (string $ redisInstanceIdentifier )
202+ {
203+ $ redisInstanceIdentifier = RedisInstanceIdentifier::fromString ($ redisInstanceIdentifier );
204+ $ this ->contentReleaseManager ->toggleConfigEpoch ($ redisInstanceIdentifier );
205+
206+ $ this ->redirect ('index ' , null , null , ['contentStore ' => $ redisInstanceIdentifier ->getIdentifier ()]);
207+ }
186208}
0 commit comments