add data-sort-value, post size has an input in column

This commit is contained in:
Barış Soner Uşaklı
2026-02-12 18:23:36 -05:00
parent 4b9b3648c1
commit e61989a320
2 changed files with 13 additions and 15 deletions

View File

@@ -47,8 +47,8 @@ define('admin/advanced/cache', ['alerts'], function (alerts) {
.toggleClass('fa-sort-down', !ascending);
rows.sort(function (a, b) {
const A = $(a).children().eq(columnIndex).text().trim();
const B = $(b).children().eq(columnIndex).text().trim();
const A = $(a).children().eq(columnIndex).attr('data-sort-value').trim();
const B = $(b).children().eq(columnIndex).attr('data-sort-value').trim();
// Remove thousands separators
const cleanA = A.replace(/,/g, '');
const cleanB = B.replace(/,/g, '');

View File

@@ -29,7 +29,7 @@
<tbody class="text-xs">
{{{ each caches }}}
<tr class="align-middle">
<td>
<td data-sort-value="{./name}">
<div class="d-flex gap-1 align-items-center">
<div class="form-check form-switch text-sm" data-name="{@key}" style="min-height: initial;">
<input class="form-check-input" type="checkbox" {{{if caches.enabled}}}checked{{{end}}}>
@@ -37,25 +37,23 @@
{./name}
</div>
</td>
<td class="text-end">{./percentFull}%</td>
<td class="text-end">{{{if ./length}}}{./length}{{{else}}}{./itemCount}{{{end}}} </td>
<td class="text-end">
<td class="text-end" data-sort-value="{./percentFull}">{./percentFull}%</td>
<td class="text-end" data-sort-value="{{{if ./length}}}{./length}{{{else}}}{./itemCount}{{{end}}}">{{{if ./length}}}{./length}{{{else}}}{./itemCount}{{{end}}} </td>
<td class="text-end" data-sort-value="{{{if ./max}}}{./max}{{{else}}}{./maxSize}{{{end}}}">
{{{ if (./name == "post") }}}
<div class="d-flex justify-content-end align-items-center gap-1">
<a href="#" data-bs-toggle="tooltip" data-bs-title="Changing the post cache size requires a restart."><i class="fa-regular fa-circle-question"></i></a>
<input id="postCacheSize" style="width:100px;" type="text" class="text-end form-control form-control-sm" value="" data-field="postCacheSize">
<a href="#" data-bs-toggle="tooltip" data-bs-title="Changing the post cache size requires a restart."><i class="fa-regular fa-circle-question"></i></a>
<input id="postCacheSize" style="width:100px;" type="text" class="text-end form-control form-control-sm" value="" data-field="postCacheSize">
</div>
{{{ else }}}
{{{if ./max}}}{./max}{{{else}}}{./maxSize}{{{end}}}
{{{ end }}}
</td>
<td class="text-end">{./hits}</td>
<td class="text-end">{./misses}</td>
<td class="text-end">{./hitRatio}</td>
<td class="text-end">{./hitsPerSecond}</td>
<td class="text-end">{./ttl}</td>
<td class="text-end" data-sort-value="{./hits}">{./hits}</td>
<td class="text-end" data-sort-value="{./misses}">{./misses}</td>
<td class="text-end" data-sort-value="{./hitRatio}">{./hitRatio}</td>
<td class="text-end" data-sort-value="{./hitsPerSecond}">{./hitsPerSecond}</td>
<td class="text-end" data-sort-value="{./ttl}">{./ttl}</td>
<td class="">
<div class="d-flex justify-content-end gap-1">
<a href="{config.relative_path}/api/admin/advanced/cache/dump?name={./name}" class="btn btn-light btn-sm"><i class="fa fa-download"></i></a>