feat: list mode 50/page, card mode left-image rows, AI cover generation command
Build and Deploy / verify (push) Successful in 10s
Build and Deploy / deploy (push) Successful in 18s

- blog_paginate: 纯列表模式每页 50 条(list_per_page 可调),其余模式仍走 per_page
- 图文(card)模式:卡片网格改为左图右文横排,小屏回退竖排;摘要放宽到 100 字
- 新增 covers:generate:复用 AI 设置的 LLM 配置调 /image_generation(默认 image-01),
  为无封面文章批量生成封面存入 media cover 集合;支持 --all/--limit/--post/--style/--dry-run
- AI 设置页新增图片模型、封面风格两项配置
- 修正 HomeViewModeTest:列表模式为纯标题(不再显示摘要),并断言每页 50 条与图文布局
This commit is contained in:
2026-10-13 23:58:15 +00:00
parent 16dac8b568
commit 57b6221d90
7 changed files with 202 additions and 44 deletions
@@ -42,6 +42,8 @@ class AiSettings extends Page
'llm_base_url' => Setting::get('llm_base_url', env('LLM_BASE_URL')),
'llm_api_key' => Setting::get('llm_api_key', env('LLM_API_KEY')),
'llm_model' => Setting::get('llm_model', env('LLM_MODEL', 'gpt-4o-mini')),
'llm_image_model' => Setting::get('llm_image_model', 'image-01'),
'cover_prompt_style' => Setting::get('cover_prompt_style', '扁平插画风格,色调柔和,构图简洁'),
'ai_moderation_enabled' => (int) Setting::get('ai_moderation_enabled', 1) === 1,
'ai_moderation_system_prompt' => Setting::get('ai_moderation_system_prompt', '你是博客评论审核员。判断评论是否包含:广告/垃圾、人身攻击、违法内容、无关灌水。只回复 JSON:{"verdict":"approved|rejected|spam","reason":"简短理由"}'),
]);
@@ -57,6 +59,9 @@ class AiSettings extends Page
TextInput::make('llm_base_url')->label('Base URL')->placeholder('https://api.openai.com/v1')->required(),
TextInput::make('llm_api_key')->label('API Key')->password()->required(),
TextInput::make('llm_model')->label('模型')->default('gpt-4o-mini')->required(),
TextInput::make('llm_image_model')->label('图片模型')->default('image-01')
->helperText('供 php artisan covers:generate 批量生成封面使用(接口:{Base URL}/image_generation)'),
TextInput::make('cover_prompt_style')->label('封面风格')->default('扁平插画风格,色调柔和,构图简洁'),
]),
\Filament\Schemas\Components\Section::make('评论审核')
->schema([