@extends('kylin-adminlte::layouts.app')

@section('title', '控制台')

@section('content-header')
    <h1>控制台</h1>
@stop

@section('content')
    <div class="row">
        <div class="col-lg-3 col-6">
            <div class="small-box bg-info">
                <div class="inner">
                    <h3>{{ \Kylin\User\Models\User::count() }}</h3>
                    <p>用户总数</p>
                </div>
                <div class="icon"><i class="fas fa-users"></i></div>
            </div>
        </div>
        <div class="col-lg-3 col-6">
            <div class="small-box bg-success">
                <div class="inner">
                    <h3>{{ \Kylin\Notification\Models\Notification::whereNull('read_at')->count() }}</h3>
                    <p>未读通知</p>
                </div>
                <div class="icon"><i class="fas fa-bell"></i></div>
            </div>
        </div>
        <div class="col-lg-3 col-6">
            <div class="small-box bg-warning">
                <div class="inner">
                    <h3>{{ \Kylin\Settings\Models\Setting::count() }}</h3>
                    <p>系统配置</p>
                </div>
                <div class="icon"><i class="fas fa-cog"></i></div>
            </div>
        </div>
        <div class="col-lg-3 col-6">
            <div class="small-box bg-danger">
                <div class="inner">
                    <h3>{{ \Kylin\AuditLog\Models\AuditLog::today()->count() }}</h3>
                    <p>今日审计</p>
                </div>
                <div class="icon"><i class="fas fa-shield-alt"></i></div>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-12">
            <div class="card">
                <div class="card-header">
                    <h3 class="card-title">系统信息</h3>
                </div>
                <div class="card-body">
                    <table class="table table-striped">
                        <tr><td>框架版本</td><td>Laravel {{ app()->version() }}</td></tr>
                        <tr><td>PHP 版本</td><td>PHP {{ PHP_VERSION }}</td></tr>
                        <tr><td>Kylin 许可证</td><td>{{ config('kylin-licensing.license_key') ? '已激活' : '未激活' }}</td></tr>
                        <tr><td>环境</td><td>{{ app()->environment() }}</td></tr>
                    </table>
                </div>
            </div>
        </div>
    </div>
@stop
