Files
ai-web/resources/views/admin/partials/admin-page-header.blade.php
cjd 260460df03
Some checks failed
Tests / PHP 8.2 (push) Has been cancelled
Tests / PHP 8.3 (push) Has been cancelled
Tests / PHP 8.4 (push) Has been cancelled
爬虫开发
2026-02-18 12:56:36 +08:00

70 lines
3.8 KiB
PHP

@php
$routeName = (string) (request()->route()?->getName() ?? '');
$parts = explode('.', $routeName);
$moduleKey = $parts[1] ?? 'dashboard';
$actionKey = $parts[2] ?? 'index';
$moduleMeta = [
'dashboard' => ['label' => '控制台', 'index' => 'admin.dashboard', 'subtitle' => '查看系统概览与关键运营数据。'],
'tools' => ['label' => 'AI 工具', 'index' => 'admin.tools.index', 'subtitle' => '维护工具信息、状态与展示内容。'],
'models' => ['label' => 'AI 模型', 'index' => 'admin.models.index', 'subtitle' => '管理模型参数、评分与发布状态。'],
'articles' => ['label' => 'AI 资讯', 'index' => 'admin.articles.index', 'subtitle' => '维护资讯内容、来源与发布质量。'],
'guides' => ['label' => 'AI 教程', 'index' => 'admin.guides.index', 'subtitle' => '维护教程内容与学习难度层级。'],
'categories' => ['label' => '分类管理', 'index' => 'admin.categories.index', 'subtitle' => '统一管理分类体系与启用状态。'],
'sources' => ['label' => '来源管理', 'index' => 'admin.sources.index', 'subtitle' => '维护可用来源及可信度配置。'],
'settings' => ['label' => '首页配置', 'index' => 'admin.settings.index', 'subtitle' => '配置首页模块、条目和展示顺序。'],
'feedback' => ['label' => '反馈管理', 'index' => 'admin.feedback.index', 'subtitle' => '跟进用户反馈并更新处理状态。'],
'crawlers' => ['label' => '采集规则', 'index' => 'admin.crawlers.index', 'subtitle' => '维护采集目标、字段映射与调度策略。'],
'crawl-runs' => ['label' => '采集运行', 'index' => 'admin.crawl-runs.index', 'subtitle' => '查看每次采集执行结果、失败原因和重试。'],
'crawl-alerts' => ['label' => '采集告警', 'index' => 'admin.crawl-alerts.index', 'subtitle' => '集中处理采集异常并追踪恢复情况。'],
][$moduleKey] ?? ['label' => '管理后台', 'index' => 'admin.dashboard', 'subtitle' => '维护站点内容与配置。'];
$actionLabel = [
'index' => '列表',
'create' => '新建',
'edit' => '编辑',
'show' => '详情',
][$actionKey] ?? '详情';
$defaultTitle = $moduleMeta['label'];
$pageTitle = trim((string) $__env->yieldContent('title'));
$pageTitle = $pageTitle !== '' ? $pageTitle : $defaultTitle;
$pageSubtitle = trim((string) $__env->yieldContent('page_subtitle'));
if ($pageSubtitle === '') {
$pageSubtitle = $actionKey === 'index'
? $moduleMeta['subtitle']
: '当前为'.$actionLabel.'页面,请按提示完善信息后保存。';
}
@endphp
<div class="admin-page-head">
<nav class="admin-breadcrumb" aria-label="breadcrumb">
<ol class="breadcrumb mb-2">
<li class="breadcrumb-item"><a href="{{ route('admin.dashboard') }}">控制台</a></li>
@if($moduleKey !== 'dashboard')
@if($actionKey === 'index')
<li class="breadcrumb-item active" aria-current="page">{{ $moduleMeta['label'] }}</li>
@else
<li class="breadcrumb-item"><a href="{{ route($moduleMeta['index']) }}">{{ $moduleMeta['label'] }}</a></li>
<li class="breadcrumb-item active" aria-current="page">{{ $actionLabel }}</li>
@endif
@endif
</ol>
</nav>
<div class="d-flex align-items-start justify-content-between gap-3 flex-wrap">
<div>
<h2 class="page-title mb-1">{{ $pageTitle }}</h2>
<div class="admin-page-subtitle">{{ $pageSubtitle }}</div>
</div>
@if(trim((string) $__env->yieldContent('page_actions')) !== '')
<div class="admin-page-actions">
@yield('page_actions')
</div>
@endif
</div>
</div>