SSR module: live progress bar for cache warming
The Cache warming row of the VITEC SSR module now shows a Bootstrap progress bar with a running counter instead of asking for a reload. New ajax route vitec_ssr_health (SsrController::healthJson) returns the node /__health JSON; ssr-warm-progress.js polls it every 2 s while a warm run is active and every 15 s otherwise (pauses in background tabs) and also refreshes the Cache: N pages / M MB line. The health fetch moved into SsrController::fetchHealth, shared by indexAction and the ajax route; its error text is English now. Verified live in the backend: bar, counter and cache line advance during a run. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
f4f18e913a
commit
da2ca2690d
4 files changed
+136
-26
No files matched your search
@@ -24,7 +24,7 @@
|
||||
<span class="badge badge-success">running</span> {health.responseMs} ms<br>
|
||||
Release <strong>{health.release.release}</strong>
|
||||
(commit {health.release.commit})<br>
|
||||
Cache: {health.cachedPages} pages / {health.cacheMB} MB
|
||||
<span id="ssr-cache-line">Cache: {health.cachedPages} pages / {health.cacheMB} MB</span>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<span class="badge badge-danger">not reachable</span> {healthError}
|
||||
@@ -34,13 +34,17 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Cache warming</th>
|
||||
<td>
|
||||
<td id="ssr-warm-status" data-running="{f:if(condition: health.warming.running, then: '1', else: '0')}">
|
||||
<div class="progress" id="ssr-warm-progress" style="height:16px;margin-bottom:6px;{f:if(condition: health.warming.running, else: 'display:none')}">
|
||||
<div class="progress-bar progress-bar-striped progress-bar-animated bg-info" id="ssr-warm-bar" role="progressbar" style="width:0%;min-width:3em">0 %</div>
|
||||
</div>
|
||||
<div id="ssr-warm-text">
|
||||
<f:if condition="{health.warming.running}">
|
||||
<f:then>
|
||||
<span class="badge badge-info">running</span>
|
||||
{health.warming.done} of {health.warming.queued} pages rendered
|
||||
({health.warming.skipped} still fresh, {health.warming.failed} failed)
|
||||
<br><small>Reload this module to follow the progress.</small>
|
||||
<br><small class="text-muted">Live — updates every 2 seconds.</small>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<f:if condition="{health.warming.startedAt}">
|
||||
@@ -57,6 +61,7 @@
|
||||
</f:if>
|
||||
</f:else>
|
||||
</f:if>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
Reference in new issue
Block a user