Skip to content

Commit

Permalink
Show suspended servers
Browse files Browse the repository at this point in the history
  • Loading branch information
RMartinOscar committed Jan 6, 2025
1 parent 2525af8 commit eb3a885
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/Models/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,9 @@ public function formatResource(string $resourceKey, bool $limit = false, ServerR
}

if ($type === ServerResourceType::Time) {
if ($this->isSuspended()) {
return 'Suspended';
}
if ($resourceAmount === 0) {
return 'Offline';
}
Expand All @@ -484,7 +487,7 @@ public function formatResource(string $resourceKey, bool $limit = false, ServerR
public function condition(): Attribute
{
return Attribute::make(
get: fn () => $this->status?->value ?? $this->retrieveStatus(),
get: fn () => $this->isSuspended() ? 'Suspended' : $this->status?->value ?? $this->retrieveStatus(),
);
}

Expand Down

0 comments on commit eb3a885

Please sign in to comment.