66 lines
3.4 KiB
PHP
66 lines
3.4 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' => '跟进用户反馈并及时更新处理状态。'],
|
||
|
|
][$moduleKey] ?? ['label' => '管理后台', 'index' => 'admin.dashboard', 'subtitle' => '维护站点内容与配置。'];
|
||
|
|
|
||
|
|
$actionLabel = [
|
||
|
|
'index' => '列表',
|
||
|
|
'create' => '新建',
|
||
|
|
'edit' => '编辑',
|
||
|
|
][$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>
|
||
|
|
|