@extends('base.base')
@section('base')
    <!-- 内容区域 -->
    <div class="main-panel">
        <div class="content-wrapper">
            <div class="page-header">
                <h3 class="page-title">
                     <span class="page-title-icon bg-gradient-primary text-white mr-2">
                        <i class="mdi mdi-earth"></i>
                    </span>
                    {{ __('auto.虚拟分区配置') }}
                </h3>
                <nav aria-label="breadcrumb">
                    <ol class="breadcrumb">
                        <li class="breadcrumb-item"><a href="#">{{ __('auto.渠道管理') }}</a></li>
                        <li class="breadcrumb-item active" aria-current="page">{{ __('auto.虚拟分区配置') }}</li>
                    </ol>
                </nav>
            </div>
            <div class="row">
                <div class="col-lg-12 grid-margin stretch-card">
                    <div class="card">
                        <div class="card-body">
                            <h4 class="card-title">{{ __('auto.分区列表') }}</h4>
                            <table class="table table-bordered">
                                <thead>
                                <tr>
                                    <th>ID</th>
                                    <th>RegionID</th>
                                    <th>DomainUrl</th>
                                    <th>Logo</th>
                                    <th>Icon</th>
                                    <th>GroupID</th>
                                    <th>BindChannels</th>
                                    <th>ThemeKey</th>
                                    <th>{{ __('auto.操作') }}</th>
                                </tr>
                                </thead>
                                <tbody>
                                @foreach($list as $v)
                                    <tr>
                                        <td>{{$v->id}}</td>
                                        <td>{{$v->RegionID}}</td>
                                        <td>{{$v->DomainUrl}}</td>
                                        <td>
                                            @if($v->LogoUrl)
                                                <div style="background-color: #000; display: inline-block; padding: 5px;">
                                                    <img src="{{$v->DomainUrl}}{{$v->LogoUrl}}" style="max-width: 150px; height: auto; border-radius: 0;" alt="Logo">
                                                </div>
                                            @endif
                                        </td>
                                        <td>
                                            @if($v->IconUrl)
                                                <img src="{{$v->DomainUrl}}{{$v->IconUrl}}" style="width: 192px; height: 192px; border-radius: 0;" alt="Icon">
                                            @endif
                                        </td>
                                        <td>{{$v->GroupID}}</td>
                                        <td style="word-break: break-all; max-width: 300px;">
                                            @if($v->BindChannels)
                                                {{ is_array($v->BindChannels) ? implode(',', $v->BindChannels) : $v->BindChannels }}
                                            @endif
                                        </td>
                                        <td>{{$v->ThemeKey}}</td>
                                        <td>
                                            <a href="{{ url('admin/web_region_config/edit/'.$v->id) }}" class="btn btn-sm btn-gradient-info">{{ __('auto.编辑') }}</a>
                                        </td>
                                    </tr>
                                @endforeach
                                </tbody>
                            </table>
                            <div class="box-footer clearfix" id="pages">
                                {{ __('auto.总共') }} <b>{{ $list->total() }}</b> {{ __('auto.条,分为') }}<b>{{ $list->lastPage() }}</b>{{ __('auto.页') }}
                                {!! $list->links() !!}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection
