@extends('layout.app') @section('_style') @endsection @section('content') @php // Nhãn nguồn dữ liệu theo từng sự kiện: [event => [key => label]] để hiển thị tên dễ đọc thay cho key kỹ thuật $sourceLabels = []; foreach ($events as $eventKey => $eventName) { foreach (\App\Services\Zns\ZnsVariableRegistry::options($eventKey) as $items) { foreach ($items as $key => $label) { $sourceLabels[$eventKey][$key] = $label; } } } $activeCount = $templates->where('status', \App\Constants\StatusCode::ON)->count(); @endphp
@if(session('success'))
{{ session('success') }}
@endif {{-- Tổng quan nhanh số mẫu tin --}}
{{ $templates->count() }}Tổng mẫu tin
{{ $activeCount }}Đang bật
{{ $templates->count() - $activeCount }}Đang tắt
{{-- Lọc phía trình duyệt (danh sách không phân trang) --}}
@forelse($templates as $key => $template) @php $isOn = $template->status == \App\Constants\StatusCode::ON; @endphp @empty @endforelse @if($templates->count()) {{-- Hiện khi bộ lọc không khớp dòng nào --}} @endif
# Mẫu tin Sự kiện Template ID Tham số (param → nguồn dữ liệu) Trạng thái Thao tác
{{ $key + 1 }} {{ $template->name }} @if($template->note) {{ $template->note }} @endif {{ $template->event_label }} {{ $template->template_id }}
@forelse($template->params as $param)
{{ $param->param }} @if($param->source) {{ $sourceLabels[$template->event][$param->source] ?? $param->source }} @else để trống @endif @if($param->max_length) · tối đa {{ $param->max_length }} ký tự @endif @if($param->is_required) * @endif
@empty Chưa định nghĩa tham số @endforelse
Chưa có mẫu tin ZNS nào
Không có mẫu tin phù hợp bộ lọc
@endsection @section('_script') @endsection