filament - dicom server
This commit is contained in:
parent
0bed01ff68
commit
d343d105fc
132
app/Filament/Resources/DicomServerResource.php
Normal file
132
app/Filament/Resources/DicomServerResource.php
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources;
|
||||||
|
|
||||||
|
use App\Filament\Resources\DicomServerResource\Pages;
|
||||||
|
use App\Models\DicomServer;
|
||||||
|
use Filament\Forms\Components\TextInput;
|
||||||
|
use Filament\Forms\Components\Toggle;
|
||||||
|
use Filament\Forms\Form;
|
||||||
|
use Filament\Resources\Resource;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Filament\Tables\Columns\IconColumn;
|
||||||
|
use Filament\Tables\Columns\TextColumn;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
|
||||||
|
class DicomServerResource extends Resource
|
||||||
|
{
|
||||||
|
protected static ?string $model = DicomServer::class;
|
||||||
|
|
||||||
|
protected static ?string $navigationIcon = 'heroicon-o-server-stack';
|
||||||
|
|
||||||
|
public static function form(Form $form): Form
|
||||||
|
{
|
||||||
|
return $form
|
||||||
|
->schema([
|
||||||
|
Toggle::make('is_active')
|
||||||
|
->required(),
|
||||||
|
TextInput::make('server_name')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
TextInput::make('geo_code')
|
||||||
|
->required()
|
||||||
|
->maxLength(2),
|
||||||
|
TextInput::make('host')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
TextInput::make('http_port')
|
||||||
|
->required()
|
||||||
|
->numeric(),
|
||||||
|
TextInput::make('dicom_port')
|
||||||
|
->required()
|
||||||
|
->numeric(),
|
||||||
|
TextInput::make('rest_api_endpoint')
|
||||||
|
->required()
|
||||||
|
->maxLength(255),
|
||||||
|
TextInput::make('ae_title')
|
||||||
|
->maxLength(255),
|
||||||
|
TextInput::make('username')
|
||||||
|
->maxLength(255),
|
||||||
|
TextInput::make('password')
|
||||||
|
->password()
|
||||||
|
->maxLength(255),
|
||||||
|
TextInput::make('wado_path')
|
||||||
|
->maxLength(255),
|
||||||
|
TextInput::make('stone_viewer_path')
|
||||||
|
->maxLength(255),
|
||||||
|
TextInput::make('ohif_viewer_path')
|
||||||
|
->maxLength(255),
|
||||||
|
TextInput::make('meddream_viewer_path')
|
||||||
|
->maxLength(255),
|
||||||
|
TextInput::make('organization_id')
|
||||||
|
->numeric(),
|
||||||
|
TextInput::make('department_id')
|
||||||
|
->numeric(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
IconColumn::make('is_active')
|
||||||
|
->label('')
|
||||||
|
->boolean(),
|
||||||
|
TextColumn::make('server_name')
|
||||||
|
->label('Name')
|
||||||
|
->searchable(),
|
||||||
|
TextColumn::make('geo_code')
|
||||||
|
->label('GEO')
|
||||||
|
->searchable(),
|
||||||
|
TextColumn::make('host')
|
||||||
|
->searchable(),
|
||||||
|
TextColumn::make('http_port')
|
||||||
|
->label('WADO'),
|
||||||
|
TextColumn::make('dicom_port')
|
||||||
|
->label('DICOM'),
|
||||||
|
TextColumn::make('rest_api_endpoint')
|
||||||
|
->label('REST')
|
||||||
|
->searchable(),
|
||||||
|
TextColumn::make('ae_title')
|
||||||
|
->label('AET')
|
||||||
|
->searchable(),
|
||||||
|
TextColumn::make('created_at')
|
||||||
|
->dateTime()
|
||||||
|
->sortable()
|
||||||
|
->toggleable(isToggledHiddenByDefault: true),
|
||||||
|
TextColumn::make('updated_at')
|
||||||
|
->dateTime()
|
||||||
|
->sortable()
|
||||||
|
->toggleable(isToggledHiddenByDefault: true),
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->actions([
|
||||||
|
Tables\Actions\ViewAction::make(),
|
||||||
|
Tables\Actions\EditAction::make(),
|
||||||
|
])
|
||||||
|
->bulkActions([
|
||||||
|
Tables\Actions\BulkActionGroup::make([
|
||||||
|
Tables\Actions\DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getRelations(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getPages(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'index' => Pages\ListDicomServers::route('/'),
|
||||||
|
'create' => Pages\CreateDicomServer::route('/create'),
|
||||||
|
'view' => Pages\ViewDicomServer::route('/{record}'),
|
||||||
|
'edit' => Pages\EditDicomServer::route('/{record}/edit'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\DicomServerResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\DicomServerResource;
|
||||||
|
use Filament\Resources\Pages\CreateRecord;
|
||||||
|
|
||||||
|
class CreateDicomServer extends CreateRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = DicomServerResource::class;
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\DicomServerResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\DicomServerResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\EditRecord;
|
||||||
|
|
||||||
|
class EditDicomServer extends EditRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = DicomServerResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\ViewAction::make(),
|
||||||
|
Actions\DeleteAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\DicomServerResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\DicomServerResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\ListRecords;
|
||||||
|
|
||||||
|
class ListDicomServers extends ListRecords
|
||||||
|
{
|
||||||
|
protected static string $resource = DicomServerResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\CreateAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\DicomServerResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\DicomServerResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\ViewRecord;
|
||||||
|
|
||||||
|
class ViewDicomServer extends ViewRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = DicomServerResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\EditAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user