75 lines
3.2 KiB
PHP
75 lines
3.2 KiB
PHP
@extends('layouts.admin')
|
|
|
|
@section('title', '采集规则')
|
|
|
|
@section('head')
|
|
@include('admin.partials.modern-index-head')
|
|
@endsection
|
|
|
|
@section('page_actions')
|
|
<a class="btn btn-success" href="{{ route('admin.crawlers.create') }}"><i class="bi bi-plus-circle me-1"></i>新建规则</a>
|
|
@endsection
|
|
|
|
@section('content')
|
|
<div class="card modern-index-toolbar mb-3">
|
|
<div class="card-body d-flex flex-column flex-lg-row gap-3 align-items-lg-center justify-content-between">
|
|
<form method="get" action="{{ route('admin.crawlers.index') }}" class="d-flex flex-column flex-md-row gap-2 w-100">
|
|
<input class="form-control" type="text" name="q" value="{{ $filters['q'] ?? '' }}" placeholder="搜索规则名称">
|
|
<button class="btn btn-primary" type="submit"><i class="bi bi-search me-1"></i>搜索</button>
|
|
</form>
|
|
</div>
|
|
<div class="card-footer bg-transparent border-0 pt-0">
|
|
<div class="toolbar-meta">共 {{ number_format($items->total()) }} 条规则</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card modern-index-card">
|
|
<div class="table-responsive">
|
|
<table class="table table-vcenter card-table modern-index-table">
|
|
<thead>
|
|
<tr>
|
|
<th>规则</th>
|
|
<th>目标模块</th>
|
|
<th>Cron</th>
|
|
<th>状态</th>
|
|
<th>最近运行</th>
|
|
<th class="text-end">操作</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@forelse($items as $item)
|
|
<tr>
|
|
<td>
|
|
<div class="modern-index-title">{{ $item->name }}</div>
|
|
<div class="modern-index-summary">运行次数:{{ $item->runs_count }} / 下次:{{ $item->next_run_at?->format('Y-m-d H:i') ?? '-' }}</div>
|
|
</td>
|
|
<td>{{ $item->target_module?->label() ?? '-' }}</td>
|
|
<td><code>{{ $item->cron_expression }}</code></td>
|
|
<td>
|
|
@if($item->enabled)
|
|
<span class="badge bg-green-lt text-green-fg">启用</span>
|
|
@else
|
|
<span class="badge bg-gray-200 text-dark">停用</span>
|
|
@endif
|
|
</td>
|
|
<td>{{ $item->last_run_at?->format('Y-m-d H:i') ?? '-' }}</td>
|
|
<td class="text-end d-flex justify-content-end gap-2">
|
|
<form method="post" action="{{ route('admin.crawlers.run', $item) }}">
|
|
@csrf
|
|
<button class="btn btn-sm btn-outline-success" type="submit">立即执行</button>
|
|
</form>
|
|
<a class="btn btn-sm btn-outline-primary" href="{{ route('admin.crawlers.edit', $item) }}">编辑</a>
|
|
</td>
|
|
</tr>
|
|
@empty
|
|
<tr>
|
|
<td colspan="6" class="text-center text-muted py-5">暂无采集规则</td>
|
|
</tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="card-footer">{{ $items->links() }}</div>
|
|
</div>
|
|
@endsection
|