chore(admin-ui): system settings page uses page header and list card

This commit is contained in:
萝卜
2026-03-16 03:51:05 +08:00
parent 0d4cca42b1
commit 2930e8cd22
2 changed files with 121 additions and 67 deletions

View File

@@ -4,20 +4,32 @@
@section('page_title', '系统配置') @section('page_title', '系统配置')
@section('content') @section('content')
<div class="card mb-20"> <div class="page-header mb-20" data-page="admin.settings.system">
<p class="mt-0">系统配置已经从静态骨架切到数据库读取,当前已支持基础编辑、保存和缓存刷新。</p> <div class="page-header-main">
<div class="muted">当前系统配置列表已接入缓存读取。</div> <div>
<div class="muted">当前配置分组数:{{ $groupedCount }}</div> <div class="page-header-title">系统配置</div>
<div class="page-header-subtitle">当前系统配置已从静态骨架切到数据库读取;支持基础编辑、保存与缓存刷新(用于“总台可治理/可配置”的运营闭环)。</div>
<div class="actions mt-12"> </div>
<div class="page-header-actions">
<a class="btn btn-secondary" href="/admin/settings/channels">渠道与支付配置</a> <a class="btn btn-secondary" href="/admin/settings/channels">渠道与支付配置</a>
</div> </div>
</div>
<div class="page-header-meta">
<div>当前系统配置列表已接入缓存读取</div>
<div>当前配置分组数:{{ $groupedCount }}</div>
</div>
</div> </div>
@foreach($systemSettings->groupBy('group') as $group => $items) @foreach($systemSettings->groupBy('group') as $group => $items)
<div class="card mb-20"> <div class="card list-card mb-20">
<h3 class="mt-0">配置分组:{{ $group }}</h3> <div class="list-card-header">
<table> <div>
<h3 class="list-card-title">配置分组:{{ $group }}</h3>
</div>
</div>
<div class="list-card-body">
<table class="list-card-table">
<thead> <thead>
<tr> <tr>
<th>配置键</th> <th>配置键</th>
@@ -72,12 +84,13 @@
<label><input type="checkbox" name="autoload" value="1" @checked((bool) $autoload)> yes</label> <label><input type="checkbox" name="autoload" value="1" @checked((bool) $autoload)> yes</label>
</td> </td>
<td><input name="remark" value="{{ $remark }}"></td> <td><input name="remark" value="{{ $remark }}"></td>
<td><button type="submit">保存</button></td> <td><button type="submit" class="btn btn-sm">保存</button></td>
</form> </form>
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>
</table> </table>
</div> </div>
</div>
@endforeach @endforeach
@endsection @endsection

View File

@@ -0,0 +1,41 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminSettingsSystemPageShouldUsePageHeaderAndListCardTest extends TestCase
{
use RefreshDatabase;
protected function loginAsPlatformAdmin(): void
{
$this->seed();
$this->post('/admin/login', [
'email' => 'platform.admin@demo.local',
'password' => 'Platform@123456',
])->assertRedirect('/admin');
}
public function test_admin_settings_system_page_should_use_page_header_and_list_card(): void
{
$this->loginAsPlatformAdmin();
$res = $this->get('/admin/settings/system');
$res->assertOk();
// 护栏:系统配置页应使用 PageHeader 与 ListCard保持总台管理风格统一。
$res->assertSee('page-header', false);
$res->assertSee('page-header-title', false);
$res->assertSee('page-header-subtitle', false);
$res->assertSee('page-header-actions', false);
$res->assertSee('page-header-meta', false);
$res->assertSee('list-card', false);
$res->assertSee('list-card-header', false);
$res->assertSee('list-card-body', false);
$res->assertSee('list-card-table', false);
}
}