20260728_2 修复rpki-explorer体验问题7项(#134):证书资源可展开、CMS对象新增EE Parsed Tab、Overview增加repo数KPI/修复Object types标签/Top repositories按objects排序(后端sort参数)/reject reasons按前缀聚类可下钻、Run选择器30s轮询
This commit is contained in:
@@ -21,6 +21,7 @@ import {
|
||||
RUN_2,
|
||||
SERVICE_INFO,
|
||||
STATS_OBJECT_TYPES,
|
||||
STATS_OVERVIEW,
|
||||
STATS_REASONS,
|
||||
STATS_VALIDATION,
|
||||
VALIDATION_SUMMARY,
|
||||
@@ -234,8 +235,13 @@ export async function installMockApi(
|
||||
}
|
||||
|
||||
if (section === "repos" && !a) {
|
||||
const { page: items, next } = paginate(REPOS, url);
|
||||
return fulfillJson(route, items, next);
|
||||
let items = REPOS;
|
||||
if (url.searchParams.get("sort") === "objects") {
|
||||
const dir = url.searchParams.get("order") === "asc" ? 1 : -1;
|
||||
items = [...REPOS].sort((x, y) => dir * (x.objects - y.objects));
|
||||
}
|
||||
const { page: itemsPage, next } = paginate(items, url);
|
||||
return fulfillJson(route, itemsPage, next);
|
||||
}
|
||||
if (section === "repos" && a) {
|
||||
const repo = REPOS.find((r) => r.repoId === a);
|
||||
@@ -384,6 +390,7 @@ export async function installMockApi(
|
||||
if (a === "validation") return fulfillJson(route, STATS_VALIDATION);
|
||||
if (a === "object-types") return fulfillJson(route, STATS_OBJECT_TYPES);
|
||||
if (a === "reasons") return fulfillJson(route, STATS_REASONS);
|
||||
if (a === "overview") return fulfillJson(route, STATS_OVERVIEW);
|
||||
if (a === "downloads") return fulfillJson(route, { requests: 42, bytes: 1234567 });
|
||||
return fulfillJson(route, {});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user