117 lines
4.8 KiB
PHP
117 lines
4.8 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\TerminalResource\Pages;
|
|
|
|
use App\Filament\Resources\TerminalResource;
|
|
use Filament\Actions;
|
|
use Filament\Resources\Pages\ViewRecord;
|
|
use Filament\Infolists;
|
|
use Filament\Infolists\Infolist;
|
|
|
|
class ViewTerminal extends ViewRecord
|
|
{
|
|
protected static string $resource = TerminalResource::class;
|
|
|
|
protected function getHeaderActions(): array
|
|
{
|
|
return [
|
|
Actions\EditAction::make()
|
|
->label('编辑'),
|
|
Actions\DeleteAction::make()
|
|
->label('删除'),
|
|
];
|
|
}
|
|
|
|
public function infolist(Infolist $infolist): Infolist
|
|
{
|
|
return $infolist
|
|
->schema([
|
|
Infolists\Components\Section::make('基本信息')
|
|
->schema([
|
|
Infolists\Components\TextEntry::make('name')
|
|
->label('终端名称'),
|
|
Infolists\Components\TextEntry::make('code')
|
|
->label('终端编码')
|
|
->copyable(),
|
|
Infolists\Components\TextEntry::make('ip_address')
|
|
->label('IP地址')
|
|
->copyable()
|
|
->placeholder('未设置'),
|
|
Infolists\Components\TextEntry::make('station.name')
|
|
->label('所属线站')
|
|
->placeholder('未绑定'),
|
|
])
|
|
->columns(2),
|
|
|
|
Infolists\Components\Section::make('组态配置')
|
|
->schema([
|
|
Infolists\Components\RepeatableEntry::make('diagram_urls')
|
|
->label('组态界面地址')
|
|
->schema([
|
|
Infolists\Components\TextEntry::make('title')
|
|
->label('标题'),
|
|
Infolists\Components\TextEntry::make('url')
|
|
->label('地址')
|
|
->copyable()
|
|
->url(fn ($state) => $state)
|
|
->openUrlInNewTab(),
|
|
])
|
|
->columns(2)
|
|
->placeholder('未设置'),
|
|
]),
|
|
|
|
Infolists\Components\Section::make('AI提示词配置')
|
|
->schema([
|
|
Infolists\Components\TextEntry::make('prompt_template')
|
|
->label('提示词模板')
|
|
->markdown()
|
|
->placeholder('未配置提示词'),
|
|
])
|
|
->collapsible(),
|
|
|
|
Infolists\Components\Section::make('语音唤醒')
|
|
->schema([
|
|
Infolists\Components\IconEntry::make('voice_wakeup_enabled')
|
|
->label('语音唤醒')
|
|
->boolean()
|
|
->trueIcon('heroicon-o-check-circle')
|
|
->falseIcon('heroicon-o-x-circle')
|
|
->trueColor('success')
|
|
->falseColor('danger'),
|
|
Infolists\Components\TextEntry::make('voice_wakeup_word')
|
|
->label('唤醒词')
|
|
->placeholder('未设置'),
|
|
])
|
|
->columns(2),
|
|
|
|
Infolists\Components\Section::make('状态信息')
|
|
->schema([
|
|
Infolists\Components\IconEntry::make('is_online')
|
|
->label('在线状态')
|
|
->boolean()
|
|
->trueIcon('heroicon-o-check-circle')
|
|
->falseIcon('heroicon-o-x-circle')
|
|
->trueColor('success')
|
|
->falseColor('danger'),
|
|
Infolists\Components\TextEntry::make('last_online_at')
|
|
->label('最后在线时间')
|
|
->dateTime('Y-m-d H:i:s')
|
|
->placeholder('从未在线'),
|
|
])
|
|
->columns(2),
|
|
|
|
Infolists\Components\Section::make('时间信息')
|
|
->schema([
|
|
Infolists\Components\TextEntry::make('created_at')
|
|
->label('创建时间')
|
|
->dateTime('Y-m-d H:i:s'),
|
|
Infolists\Components\TextEntry::make('updated_at')
|
|
->label('更新时间')
|
|
->dateTime('Y-m-d H:i:s'),
|
|
])
|
|
->columns(2)
|
|
->collapsed(),
|
|
]);
|
|
}
|
|
}
|