mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-04 15:32:35 +00:00
2.x - databases
This commit is contained in:
@ -42,8 +42,9 @@ public function infolist(Infolist $infolist): Infolist
|
||||
->inlineLabel()
|
||||
->hintIcon('heroicon-o-information-circle')
|
||||
->hintIconTooltip('Server unique identifier to use in the API'),
|
||||
TextEntry::make('created_at_by_timezone')
|
||||
TextEntry::make('created_at')
|
||||
->label('Created At')
|
||||
->formatStateUsing(fn ($record) => $record->created_at_by_timezone)
|
||||
->inlineLabel(),
|
||||
TextEntry::make('last_updated_check')
|
||||
->label('Last Updated Check')
|
||||
|
@ -55,8 +55,14 @@ public function infolist(Infolist $infolist): Infolist
|
||||
->icon('heroicon-o-arrow-path')
|
||||
->tooltip('Check Connection')
|
||||
->action(function (Server $record) {
|
||||
$previousStatus = $record->status;
|
||||
|
||||
$record = $record->checkConnection();
|
||||
|
||||
if ($previousStatus !== $record->status) {
|
||||
$this->redirect(url()->previous());
|
||||
}
|
||||
|
||||
$this->dispatch('$refresh');
|
||||
|
||||
Notification::make()
|
||||
|
@ -3,6 +3,7 @@
|
||||
namespace App\Web\Pages\Servers\Widgets;
|
||||
|
||||
use App\Models\Server;
|
||||
use App\Web\Pages\Servers\Settings;
|
||||
use App\Web\Pages\Servers\View;
|
||||
use Filament\Tables\Actions\Action;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
@ -41,8 +42,9 @@ protected function getTableColumns(): array
|
||||
->color(fn (Server $server) => Server::$statusColors[$server->status])
|
||||
->searchable()
|
||||
->sortable(),
|
||||
TextColumn::make('created_at_by_timezone')
|
||||
TextColumn::make('created_at')
|
||||
->label('Created At')
|
||||
->formatStateUsing(fn ($record) => $record->created_at_by_timezone)
|
||||
->searchable()
|
||||
->sortable(),
|
||||
];
|
||||
@ -57,7 +59,7 @@ public function getTable(): Table
|
||||
->label('Settings')
|
||||
->icon('heroicon-o-cog-6-tooth')
|
||||
->authorize(fn ($record) => auth()->user()->can('update', $record))
|
||||
->url(fn (Server $record) => '/'),
|
||||
->url(fn (Server $record) => Settings::getUrl(parameters: ['server' => $record])),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user