Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion templates/Admin/QueueProcesses/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<div class="card-body p-0">
<table class="table table-striped mb-0">
<tr>
<th style="width: 200px;"><?= __d('queue', 'Created') ?></th>
<th class="queue-col-w-200"><?= __d('queue', 'Created') ?></th>
<td>
<?= $this->Time->nice($queueProcess->created) ?>
<?php if (!$queueProcess->created->addSeconds(Config::defaultworkertimeout())->isFuture()): ?>
Expand Down
5 changes: 3 additions & 2 deletions templates/Admin/QueuedJobs/heatmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@
);
?>
<div class="heatmap-cell"
style="background-color: <?= $bgColor ?>; color: <?= $textColor ?>;"
data-bg-color="<?= h($bgColor) ?>"
data-text-color="<?= h($textColor) ?>"
data-day="<?= h($dayNamesFull[$day]) ?>"
data-hour="<?= sprintf('%02d:00-%02d:59', $hour, $hour) ?>"
data-count="<?= $count ?>"
Expand All @@ -123,7 +124,7 @@
<div class="heatmap-legend mt-3">
<small class="text-muted me-2"><?= __d('queue', 'Less') ?></small>
<?php for ($i = 0; $i <= 4; $i++) { ?>
<div class="heatmap-legend-cell" style="background-color: <?= $this->Queue->heatmapColor($i / 4) ?>;"></div>
<div class="heatmap-legend-cell" data-bg-color="<?= h($this->Queue->heatmapColor($i / 4)) ?>"></div>
<?php } ?>
<small class="text-muted ms-2"><?= __d('queue', 'More') ?></small>
</div>
Expand Down
2 changes: 1 addition & 1 deletion templates/Admin/QueuedJobs/migrate.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<table class="table table-hover">
<thead>
<tr>
<th style="width: 50px;"><?= __d('queue', 'Migrate') ?></th>
<th class="queue-col-w-50"><?= __d('queue', 'Migrate') ?></th>
<th><?= __d('queue', 'Old Name') ?></th>
<th><?= __d('queue', 'New Name') ?></th>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion templates/Admin/QueuedJobs/stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<div class="card-body">
<p class="text-muted"><?= __d('queue', 'For already processed jobs - in average seconds per timeframe.') ?></p>

<div style="position: relative; height: 400px;">
<div class="queue-chart-wrapper">
<canvas id="job-chart"></canvas>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions templates/Admin/QueuedJobs/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<div class="card-body p-0">
<table class="table table-striped mb-0">
<tr>
<th style="width: 200px;"><?= __d('queue', 'Job Type') ?></th>
<th class="queue-col-w-200"><?= __d('queue', 'Job Type') ?></th>
<td><span class="fw-medium"><?= h($queuedJob->job_task) ?></span></td>
</tr>
<tr>
Expand Down Expand Up @@ -120,7 +120,7 @@
<div class="card-body p-0">
<table class="table table-striped mb-0">
<tr>
<th style="width: 200px;"><?= __d('queue', 'Created') ?></th>
<th class="queue-col-w-200"><?= __d('queue', 'Created') ?></th>
<td><?= $this->Time->nice($queuedJob->created) ?></td>
</tr>
<tr>
Expand Down
25 changes: 24 additions & 1 deletion templates/layout/queue.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,21 @@
overflow-y: auto;
}

/* Mobile nav offcanvas — same background as sidebar */
.queue-mobile-nav-bg {
background: var(--queue-sidebar-bg);
}

/* Column-width utilities (replaces inline `<th style="width:Npx">`). */
.queue-col-w-50 { width: 50px; }
.queue-col-w-200 { width: 200px; }

/* Stats chart wrapper (replaces inline `style="position:relative;height:400px"`). */
.queue-chart-wrapper {
position: relative;
height: 400px;
}

.queue-sidebar .nav-section {
padding: 0 1rem;
margin-bottom: 1.5rem;
Expand Down Expand Up @@ -382,7 +397,7 @@
</nav>

<!-- Mobile Offcanvas Navigation -->
<div class="offcanvas offcanvas-start" tabindex="-1" id="mobileNav" aria-labelledby="mobileNavLabel" style="background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);">
<div class="offcanvas offcanvas-start queue-mobile-nav-bg" tabindex="-1" id="mobileNav" aria-labelledby="mobileNavLabel">
<div class="offcanvas-header border-bottom border-secondary">
<h5 class="offcanvas-title text-white" id="mobileNavLabel">
<i class="fas fa-layer-group me-2"></i>Queue Admin
Expand Down Expand Up @@ -455,6 +470,14 @@
});
});

// Heatmap cell colors (CSP-safe replacement for inline style="background-color:…; color:…;")
document.querySelectorAll('[data-bg-color]').forEach(function(el) {
el.style.backgroundColor = el.dataset.bgColor;
});
document.querySelectorAll('[data-text-color]').forEach(function(el) {
el.style.color = el.dataset.textColor;
});

<?php if ($autoRefresh > 0): ?>
// Auto-refresh
setTimeout(function() {
Expand Down
Loading