@extends('layouts.app')
@section('title')日志@endsection

@section('content')
    <span id="nav2">
        @component('maintenance.menu')@endcomponent
        @component('maintenance.log.menu')@endcomponent
    </span>
    <div class="container-fluid">
        <div class="card">
            <div class="card-body">
                @if(Session::has('successTip'))
                    <div class="alert alert-success h1">{{Session::get('successTip')}}</div>
                @endif
                <table class="table table-striped table-sm" id="list">
                    <tr>
                        <th>ID</th>
                        <th>用户</th>
                        <th>操作</th>
                        <th>类型</th>
                        <th>ip</th>
                        <th>时间</th>
                    </tr>
                    @foreach($logs as $log)
                        <tr class="hover" onclick="location.href='{{url('maintenance/log/'.$log['id'])}}'" style="cursor: pointer">
                            <td class="text-muted">{{$log['id']}}</td>
                            <td>{{$log['user_name']}}</td>
                            <td>{{$log['operation']}}</td>
                            <td>{{$log['type']}}</td>
                            <td>{{$log['ip']}}</td>
                            <td>{{$log['created_at']}}</td>
                        </tr>
                    @endforeach
                </table>
                {{$logs->links()}}
            </div>
        </div>
    </div>
    <style>
        .hover:hover{
            color: #1f6fb2;
        }
    </style>
@endsection
