ui(dashboard): fold northstar text table into details
This commit is contained in:
@@ -492,34 +492,38 @@
|
|||||||
$goSyncFailed = (int) ($ops['govern_sync_failed'] ?? 0);
|
$goSyncFailed = (int) ($ops['govern_sync_failed'] ?? 0);
|
||||||
@endphp
|
@endphp
|
||||||
|
|
||||||
<table class="mt-10">
|
<details class="mt-10" data-role="platform-ops-northstar-details" data-storage-key="admin.dashboard.platform_ops_northstar_details">
|
||||||
<tr>
|
<summary class="muted"><strong>北极星指标(文字口径)</strong> <span class="muted muted-xs">(少用,默认收起)</span></summary>
|
||||||
<th>近30天已收款</th>
|
|
||||||
<td>
|
<table class="mt-10">
|
||||||
<a class="link" href="{!! (string) ($opsLinks['revenue_30d_paid_orders'] ?? $billingEntryLinks['platform_orders']) !!}">
|
<tr>
|
||||||
¥{{ number_format($paidRevenue30d, 2) }}
|
<th>近30天已收款</th>
|
||||||
</a>
|
<td>
|
||||||
</td>
|
<a class="link" href="{!! (string) ($opsLinks['revenue_30d_paid_orders'] ?? $billingEntryLinks['platform_orders']) !!}">
|
||||||
</tr>
|
¥{{ number_format($paidRevenue30d, 2) }}
|
||||||
<tr>
|
</a>
|
||||||
<th>活跃付费站点</th>
|
</td>
|
||||||
<td>
|
</tr>
|
||||||
<a class="link" href="{!! (string) ($opsLinks['active_paid_merchants_subscriptions'] ?? $billingEntryLinks['site_subscriptions']) !!}">
|
<tr>
|
||||||
{{ $activePaidMerchants }}
|
<th>活跃付费站点</th>
|
||||||
</a>
|
<td>
|
||||||
<span class="muted muted-xs">(以“已生效且未到期订阅”估算)</span>
|
<a class="link" href="{!! (string) ($opsLinks['active_paid_merchants_subscriptions'] ?? $billingEntryLinks['site_subscriptions']) !!}">
|
||||||
</td>
|
{{ $activePaidMerchants }}
|
||||||
</tr>
|
</a>
|
||||||
<tr>
|
<span class="muted muted-xs">(以“已生效且未到期订阅”估算)</span>
|
||||||
<th>续费成功率(30天)</th>
|
</td>
|
||||||
<td>
|
</tr>
|
||||||
<a class="link" href="{!! (string) ($opsLinks['renewal_orders_30d'] ?? $billingEntryLinks['platform_orders']) !!}">
|
<tr>
|
||||||
{{ $renewalRate30d }}%
|
<th>续费成功率(30天)</th>
|
||||||
</a>
|
<td>
|
||||||
<span class="muted muted-xs">({{ $renewalSuccess30d }} / {{ $renewalCreated30d }})</span>
|
<a class="link" href="{!! (string) ($opsLinks['renewal_orders_30d'] ?? $billingEntryLinks['platform_orders']) !!}">
|
||||||
</td>
|
{{ $renewalRate30d }}%
|
||||||
</tr>
|
</a>
|
||||||
</table>
|
<span class="muted muted-xs">({{ $renewalSuccess30d }} / {{ $renewalCreated30d }})</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</details>
|
||||||
|
|
||||||
@php
|
@php
|
||||||
// 北极星指标图形化:给运营“规模感/健康感”,但不引入额外分类维度。
|
// 北极星指标图形化:给运营“规模感/健康感”,但不引入额外分类维度。
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\Feature;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
class AdminDashboardPlatformOpsOverviewNorthStarTextDetailsShouldBeCollapsibleTest 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_platform_ops_overview_northstar_text_details_should_be_collapsible(): void
|
||||||
|
{
|
||||||
|
$this->loginAsPlatformAdmin();
|
||||||
|
|
||||||
|
$res = $this->get('/admin');
|
||||||
|
$res->assertOk();
|
||||||
|
|
||||||
|
$html = (string) $res->getContent();
|
||||||
|
|
||||||
|
// Guardrail:北极星指标“文字口径”应默认下沉到可折叠 details,避免与 mini bars 重复抢版面。
|
||||||
|
$this->assertStringContainsString('data-role="platform-ops-northstar-details"', $html);
|
||||||
|
$this->assertStringContainsString('data-storage-key="admin.dashboard.platform_ops_northstar_details"', $html);
|
||||||
|
$this->assertStringContainsString('北极星指标(文字口径)', $html);
|
||||||
|
|
||||||
|
// 文字口径仍需保留关键行(避免后续误删导致运营无法核对)。
|
||||||
|
$this->assertStringContainsString('近30天已收款', $html);
|
||||||
|
$this->assertStringContainsString('活跃付费站点', $html);
|
||||||
|
$this->assertStringContainsString('续费成功率(30天)', $html);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user