Managed instances: problems on an instance can open tickets on its client (Admin > Managed Instances > Problem Tickets, off by default) after lasting 10 minutes, the same problem again goes on its ticket, a cleared one resolves it unless someone has written on it, the Health card links each problem to its ticket, database 4.1.8

This commit is contained in:
johnnyq
2026-11-25 01:24:39 -05:00
parent 42df246266
commit 96edfde0e9
11 changed files with 548 additions and 20 deletions

View File

@@ -32,6 +32,8 @@ $name = escapeHtml($row['managed_instance_name']);
$page_title = $row['managed_instance_name'];
$removed = !empty($row['managed_instance_archived_at']);
$health = managedInstanceHealth($row);
// The tickets its problems are on (managerIssueTickets())
$issue_tickets = managedInstanceIssueTickets($instance_id);
$state = $health['state'];
$report = $health['report'];
$app = (array) ($report['app'] ?? []);
@@ -295,10 +297,14 @@ if ($error_count > 0) {
<div class="card-body text-success-emphasis"><i class="fas fa-fw fa-check-circle me-2"></i>All good - cron is running, it's up to date, backups are recent and nothing has gone wrong today.</div>
<?php } else { ?>
<ul class="list-group list-group-flush" data-managed-issues>
<?php foreach ($health['issues'] as [$tone, $text]) { ?>
<?php foreach ($health['issues'] as [$tone, $text, $key]) { ?>
<li class="list-group-item d-flex gap-2 align-items-start">
<i class="fas fa-fw fa-<?= $tone === 'info' ? 'info-circle' : 'exclamation-circle' ?> text-<?= $tone ?>-emphasis mt-1"></i>
<span><?= escapeHtml($text) ?></span>
<span class="flex-grow-1"><?= escapeHtml($text) ?></span>
<?php if (isset($issue_tickets[$key])) { ?>
<a class="badge rounded-pill bg-secondary-subtle text-secondary-emphasis border border-secondary-subtle fw-normal text-decoration-none mt-1" data-managed-issue-ticket
href="/agent/<?= ticketUrl($issue_tickets[$key]['ticket_id'], $issue_tickets[$key]['client_id']) ?>" title="The ticket this opened"><i class="fas fa-fw fa-ticket-alt me-1"></i><?= escapeHtml($issue_tickets[$key]['reference']) ?></a>
<?php } ?>
</li>
<?php } ?>
</ul>