@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-wrench"></i>
              </span>
                    {{ trans('messages.后台操作记录') }}
                </h3>
                <nav aria-label="breadcrumb">
                    <ol class="breadcrumb">
                        <li class="breadcrumb-item"><a href="#">{{ trans('messages.系统设置') }}</a></li>
                        <li class="breadcrumb-item active" aria-current="page">{{ trans('messages.后台操作记录') }}</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">{{ trans('messages.后台操作记录') }}</h4>
                            <table class="table table-bordered">
                                <thead>
                                <tr>
                                    <th>{{ trans('messages.昵称') }}</th>
                                    <th>{{ trans('messages.账号') }}</th>
                                    <th>{{ trans('messages.创建时间') }}</th>
                                    <th>{{ trans('messages.所属角色') }}</th>
                                    <th>{{ trans('messages.查看操作记录') }}</th>
                                </tr>
                                </thead>
                                <tbody>
                                @foreach($list as $k=>$v)
                                    <tr>
                                        <td>{{ $v->nickname }}</td>
                                        <td>{{ $v->account }}</td>
                                        <td>{{ $v->create_at }}</td>
                                        <td> <button type="button" class="btn btn-sm btn-gradient-success btn-icon-text">
                                                {{$v->roles}}
                                            </button></td>
                                        <td>
                                            <button type="button" class="btn btn-sm btn-gradient-info">
                                                <a href="/admin/admin_log/list?admin_id={{$v->admin_id}}">{{ trans('messages.点击查看') }}</a>
                                            </button>
                                        </td>
                                    </tr>
                                @endforeach
                                </tbody>
                            </table>
                            <div class="box-footer clearfix">
                                {{ trans('messages.总共') }} <b>{{ $list->total() }}</b> {{ trans('messages.条,分为') }}<b>{{ $list->lastPage() }}</b> {{ trans('messages.页') }}
                                {!! $list->links() !!}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script>
        function add(){
            var page = layer.open({
                type: 2,
                title: '{{ trans('messages.添加IP白名单') }}',
                shadeClose: true,
                shade: 0.8,
                area: ['70%', '90%'],
                content: '/admin/IpWhiteList/add'
            });
        }
        function update(id){
            var page = layer.open({
                type: 2,
                title: '{{ trans('messages.修改IP白名单') }}',
                shadeClose: true,
                shade: 0.8,
                area: ['70%', '90%'],
                content: '/admin/IpWhiteList/update/'+id
            });
        }
        function del(id){
            myConfirm("{{ trans('messages.删除操作不可逆,是否继续?') }}", function(){
                myRequest("/admin/IpWhiteList/del/"+id, "post", {}, function(res){
                    layer.msg(res.msg)
                    setTimeout(function(){
                        window.location.reload();
                    },1500)
                });
            });
        }
    </script>
@endsection
