lthn.io/app/Mod/Names/Views/index.blade.php
Claude 9675c0fe81
feat(names): rich name detail pages + type badges in directory
- Name detail: owner with @LetheanRegistry/@LetheanTestnet labels
- Type badges: Reserved (amber), Gateway/Service/User (green)
- Capabilities shown as individual badges (vpn, dns, proxy, etc)
- HNS sidechain reference shown when present
- Directory: type column with badges, details column with capabilities
- API lookup link on detail pages

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 03:56:37 +01:00

54 lines
2.6 KiB
PHP

@extends('lethean::layout')
@section('title', 'Names')
@section('content')
<div class="section">
<h2>.lthn Name Directory</h2>
<p style="color: var(--muted); margin-bottom: 1.5rem;">{{ $total }} names registered on the Lethean blockchain.</p>
<form method="get" action="/names" style="margin-bottom: 1.5rem; display: flex; gap: 0.5rem;">
<input type="text" name="search" value="{{ $search }}" placeholder="Search names..."
style="flex: 1; padding: 0.5rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 0.5rem; color: var(--text); font-size: 0.9rem;">
<button type="submit" class="api-link" style="margin-top: 0;">Search</button>
</form>
<table style="width: 100%; border-collapse: collapse;">
<tr style="border-bottom: 1px solid var(--border); text-align: left;">
<th style="padding: 0.75rem; color: var(--muted); font-size: 0.8rem; text-transform: uppercase;">Name</th>
<th style="padding: 0.75rem; color: var(--muted); font-size: 0.8rem; text-transform: uppercase;">Type</th>
<th style="padding: 0.75rem; color: var(--muted); font-size: 0.8rem; text-transform: uppercase;">Details</th>
</tr>
@foreach($aliases as $alias)
@php
$comment = $alias['comment'] ?? '';
$type = 'user';
if (str_contains($comment, 'type=reserved')) $type = 'reserved';
elseif (str_contains($comment, 'type=gateway')) $type = 'gateway';
elseif (str_contains($comment, 'type=service')) $type = 'service';
@endphp
<tr style="border-bottom: 1px solid var(--border);">
<td style="padding: 0.75rem;">
<a href="/names/{{ $alias['alias'] ?? '' }}" style="font-weight: 600;">{{ $alias['alias'] ?? '' }}.lthn</a>
</td>
<td style="padding: 0.75rem;">
<span class="badge {{ $type === 'reserved' ? 'badge-amber' : 'badge-green' }}" style="font-size: 0.7rem;">{{ ucfirst($type) }}</span>
</td>
<td style="padding: 0.75rem; color: var(--muted); font-size: 0.85rem;">
@if($type === 'gateway')
@php preg_match('/cap=([^;]+)/', $comment, $m); @endphp
{{ $m[1] ?? '' }}
@elseif($type === 'service')
@php preg_match('/cap=([^;]+)/', $comment, $m); @endphp
{{ $m[1] ?? '' }}
@elseif($type === 'reserved')
HNS protected
@else
&mdash;
@endif
</td>
</tr>
@endforeach
</table>
</div>
@endsection