mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-08 00:02:15 +01:00
Add update lookup and telemetry, Add version and build to app config
This commit is contained in:
committed by
Gregor Vostrak
parent
f147fb9725
commit
2372ee0622
34
app/Filament/Widgets/ServerOverview.php
Normal file
34
app/Filament/Widgets/ServerOverview.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Filament\Widgets;
|
||||
|
||||
use Filament\Widgets\Widget;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
|
||||
class ServerOverview extends Widget
|
||||
{
|
||||
protected static string $view = 'filament.widgets.server-overview';
|
||||
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
protected function getViewData(): array
|
||||
{
|
||||
$currentVersion = Cache::get('latest_version', null);
|
||||
|
||||
$needsUpdate = false;
|
||||
if ($currentVersion !== null && version_compare($currentVersion, config('app.version')) > 0) {
|
||||
$needsUpdate = true;
|
||||
}
|
||||
|
||||
return [
|
||||
'version' => config('app.version'),
|
||||
'build' => config('app.build'),
|
||||
'environment' => config('app.env'),
|
||||
'currentVersion' => $currentVersion,
|
||||
'needsUpdate' => $needsUpdate,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user