Ship production optimization M1-M12.5A: queues, metrics, HTTP observability, and vector search reliability.
Keep similar-ai from tripping the global circuit on a lone URL 502, clamp Qdrant search to 100, and add Server-Timing plus slow-request logging. Studio shared props, Academy S3 exists caching, heat chunking, and Redis/scheduler hygiene stay in this rollout.
This commit is contained in:
@@ -12,7 +12,24 @@ const kpiConfig = [
|
||||
{ key: 'followers', label: 'Followers', icon: 'fa-solid fa-user-group' },
|
||||
]
|
||||
|
||||
function KpiCard({ config, value }) {
|
||||
function snapshotHint(config, window) {
|
||||
if (!window || !['views_30d', 'appreciation_30d', 'shares_30d', 'comments_30d'].includes(config.key)) {
|
||||
return null
|
||||
}
|
||||
|
||||
const requested = Number(window.requested_days || 30)
|
||||
const available = Number(window.table_coverage_days || 0)
|
||||
const complete = Boolean(window.window_complete)
|
||||
|
||||
if (complete) {
|
||||
return `Last ${requested} days`
|
||||
}
|
||||
|
||||
const shown = Math.max(0, Math.round(available * 10) / 10)
|
||||
return `Based on ${shown} of ${requested} days`
|
||||
}
|
||||
|
||||
function KpiCard({ config, value, hint }) {
|
||||
return (
|
||||
<div className="rounded-[26px] border border-white/10 bg-white/[0.03] p-5 shadow-[0_18px_40px_rgba(2,6,23,0.18)]">
|
||||
<div className="flex items-center gap-3 text-slate-300">
|
||||
@@ -22,6 +39,7 @@ function KpiCard({ config, value }) {
|
||||
<span className="text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500">{config.label}</span>
|
||||
</div>
|
||||
<p className="mt-4 text-3xl font-semibold text-white tabular-nums">{typeof value === 'number' ? value.toLocaleString() : value}</p>
|
||||
{hint ? <p className="mt-2 text-[11px] leading-4 text-slate-500">{hint}</p> : null}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -235,7 +253,12 @@ export default function StudioDashboard() {
|
||||
<StudioLayout title="Overview" subtitle="Create, manage, and grow across artworks, cards, collections, and stories from one shared creator operating surface.">
|
||||
<div className="grid grid-cols-2 gap-4 lg:grid-cols-5">
|
||||
{kpiConfig.map((config) => (
|
||||
<KpiCard key={config.key} config={config} value={kpis?.[config.key] ?? 0} />
|
||||
<KpiCard
|
||||
key={config.key}
|
||||
config={config}
|
||||
value={kpis?.[config.key] ?? 0}
|
||||
hint={snapshotHint(config, kpis?.snapshot_window)}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user