feat: new server checking job

feat: show if the server  has problems on ui
This commit is contained in:
Andras Bacsai
2024-08-05 15:48:15 +02:00
parent bc48b42ff1
commit e4b92bb660
19 changed files with 539 additions and 383 deletions

View File

@@ -2,6 +2,7 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\SoftDeletes;
@@ -39,6 +40,8 @@ class Service extends BaseModel
protected $guarded = [];
protected $appends = ['server_status'];
public function isConfigurationChanged(bool $save = false)
{
$domains = $this->applications()->get()->pluck('fqdn')->sort()->toArray();
@@ -77,6 +80,15 @@ class Service extends BaseModel
}
}
protected function serverStatus(): Attribute
{
return Attribute::make(
get: function () {
return $this->server->isFunctional();
}
);
}
public function isRunning()
{
return (bool) str($this->status())->contains('running');