Skip to content

Commit

Permalink
- Move the cache detail links to the individual database pages.
Browse files Browse the repository at this point in the history
- Fix the auto refresh functionality on the Reference Count page.
  • Loading branch information
dataflake committed Oct 26, 2023
1 parent c05476c commit 45bed8b
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 22 deletions.
6 changes: 5 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ https://github.com/zopefoundation/Zope/blob/4.x/CHANGES.rst
5.8.7 (unreleased)
------------------

- Separate ZODB connection information into new ZODB Connections view
- Separate ZODB connection information into new ZODB Connections view.

- Move the cache detail links to the individual database pages.

- Fix the auto refresh functionality on the Reference Count page

- Update the Ace editor in the ZMI.

Expand Down
3 changes: 3 additions & 0 deletions src/App/ApplicationManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,9 @@ def _getDB(self):
def cache_length(self):
return self._getDB().cacheSize()

def cache_active_and_inactive_count(self):
return sum([x['size'] for x in self._getDB().cacheDetailSize()])

def cache_length_bytes(self):
return self._getDB().getCacheSizeBytes()

Expand Down
13 changes: 12 additions & 1 deletion src/App/dtml/dbMain.dtml
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,22 @@
<tr>
<th>Total</th>
<th>&dtml-cache_length;</th>
<th>&nbsp;</th>
<th>&dtml-cache_active_and_inactive_count;</th>
</tr>
</tbody>
</table>

<p class="form-help">
<a href="cache_detail" class="mr-3" target="blank">
<i class="fas fa-microchip" title="Cache detail"></i>
Cache detail
</a>
<a href="cache_extreme_detail" target="blank">
<i class="fas fa-microchip" title="Cache extreme detail"></i>
Cache extreme detail
</a>
</p>

<div class="zmi-controls mb-5">
<form action="&dtml-URL1;/manage_minimize" method="post">
<input class="btn btn-primary" id="minimize" type="submit"
Expand Down
33 changes: 13 additions & 20 deletions src/App/dtml/debug.dtml
Original file line number Diff line number Diff line change
Expand Up @@ -49,33 +49,26 @@
</dtml-if>
</dtml-let>

<p class="form-help">
<a href="../Database/cache_detail" class="mr-3" target="blank">
<i class="fas fa-microchip" title="Cache detail"></i>
Cache detail
</a>
<a href="../Database/cache_extreme_detail" target="blank">
<i class="fas fa-microchip" title="Cache extreme detail"></i>
Cache extreme detail
</a>
</p>

<div class="zmi-controls row border-top border-bottom p-3 bg-light">
<form action="&dtml-URL;" method="GET" class="form-group form-inline p-0 m-0">
<button class="btn btn-primary mr-3"
onclick="window.location.href='&dtml-URL;?update_snapshot=1';"
>Update Snapshot</button>
<dtml-if debug_auto_reload>
<button class="btn btn-primary mr-3"
onclick="window.location.href='&dtml-URL;';"
>Stop auto refresh</button>
<button class="btn btn-primary mr-3"
onclick="window.location.href='&dtml-URL;';"
>Stop auto refresh</button>
</form>
<dtml-else>
<button class="btn btn-primary mr-3"
onclick="window.location.href='&dtml-URL;';"
>Refresh</button>
<label for="debug_auto_reload" class="mx-3">Auto refresh interval (seconds):</label>
<input class="form-control mr-3" type="text" id="debug_auto_reload" name="debug_auto_reload" size="3" value="10" />
<input class="btn btn-primary" type="submit" value="Start auto refresh" />
<button class="btn btn-primary mr-3"
onclick="window.location.href='&dtml-URL;';"
>Refresh</button>
</form>
<form action="&dtml-URL;" method="GET" class="form-group form-inline p-0 m-0">
<label for="debug_auto_reload" class="mx-3">Auto refresh interval (seconds):</label>
<input class="form-control mr-3" type="text" id="debug_auto_reload" name="debug_auto_reload" size="3" value="10" />
<input class="btn btn-primary" type="submit" value="Start auto refresh" />
</form>
</dtml-if>
</form>
</div>
Expand Down

0 comments on commit 45bed8b

Please sign in to comment.