mirror of
https://github.com/coollabsio/coolify.git
synced 2026-09-25 17:01:49 -04:00
fix(server): remove duplicate Disabled badge from metrics empty state
The metrics-disabled empty state already titles itself "Metrics are disabled", so the extra status badge was redundant. Cover the Sentinel-enabled branch so that badge does not return.
This commit is contained in:
@@ -262,10 +262,6 @@
|
||||
@elseif ($server->isSentinelEnabled())
|
||||
<x-application.settings-section id="server-metrics-overview-section" title="Metrics"
|
||||
helper="Inspect recent CPU and memory usage reported by Sentinel.">
|
||||
<x-slot:actions>
|
||||
<x-status-badge status="Disabled" type="neutral" />
|
||||
</x-slot:actions>
|
||||
|
||||
<x-empty size="sm" title="Metrics are disabled"
|
||||
description="Enable metrics to begin collecting CPU and memory history for this server."
|
||||
icon-name="dashboard">
|
||||
|
||||
@@ -8,3 +8,15 @@ test('sentinel-required metrics state does not repeat an unavailable badge', fun
|
||||
->toContain('title="Sentinel is required"')
|
||||
->not->toContain('status="Unavailable"');
|
||||
});
|
||||
|
||||
test('disabled metrics state does not repeat a disabled badge', function () {
|
||||
$view = file_get_contents(resource_path('views/livewire/server/charts.blade.php'));
|
||||
$disabledState = str($view)
|
||||
->after('@elseif ($server->isSentinelEnabled())')
|
||||
->before('@else')
|
||||
->toString();
|
||||
|
||||
expect($disabledState)
|
||||
->toContain('title="Metrics are disabled"')
|
||||
->not->toContain('status="Disabled"');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user