@huawei-iac-tools/landingzone-workbench 0.0.0-stage → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +85 -2
- package/cordis.patch.yml +21 -0
- package/knowledge/account-qualification.md +128 -0
- package/knowledge/blueprints/_base/blueprint.json +481 -0
- package/knowledge/blueprints/_base/defaults.json +127 -0
- package/knowledge/blueprints/foundation-lz/blueprint.json +43 -0
- package/knowledge/blueprints/foundation-lz/defaults.json +47 -0
- package/knowledge/blueprints/full-lz/blueprint.json +11 -0
- package/knowledge/blueprints/full-lz/defaults.json +8 -0
- package/knowledge/config.json +43 -0
- package/knowledge/error-rules.json +14 -0
- package/knowledge/ic-policies.json +21 -0
- package/knowledge/modules/account-structure.md +101 -0
- package/knowledge/modules/compliance/config-rms.md +212 -0
- package/knowledge/modules/compliance/cts.md +179 -0
- package/knowledge/modules/compliance/obs-lts.md +155 -0
- package/knowledge/modules/ic-policies.json +21 -0
- package/knowledge/modules/identity-center.md +603 -0
- package/knowledge/modules/module-layers.md +169 -0
- package/knowledge/modules/network/er.md +222 -0
- package/knowledge/modules/network/nat-eip.md +123 -0
- package/knowledge/modules/network/ram-share.md +92 -0
- package/knowledge/modules/network/vpc-subnet.md +142 -0
- package/knowledge/modules/organization-security/scp.md +122 -0
- package/knowledge/modules/organizations.md +212 -0
- package/knowledge/modules/recommended-config.md +157 -0
- package/knowledge/modules/recommended-rules.json +175 -0
- package/knowledge/modules/scp-policies.json +111 -0
- package/knowledge/modules/security/aad.md +94 -0
- package/knowledge/modules/security/cfw.md +105 -0
- package/knowledge/modules/security/waf.md +110 -0
- package/knowledge/param-mappings.json +133 -0
- package/knowledge/prompts.md +83 -0
- package/knowledge/resource-types.json +1162 -0
- package/knowledge/scp-policies.json +111 -0
- package/knowledge/state-machine.md +33 -0
- package/lib/client.js +21 -0
- package/lib/index.js +28592 -0
- package/lib/types/account-role.d.ts +19 -0
- package/lib/types/account-scope.d.ts +10 -0
- package/lib/types/agency.d.ts +38 -0
- package/lib/types/client/DropdownSelect.d.ts +49 -0
- package/lib/types/client/LoginGate.d.ts +20 -0
- package/lib/types/client/PanelIcon.d.ts +11 -0
- package/lib/types/client/WorkbenchShell.d.ts +21 -0
- package/lib/types/client/account-role.d.ts +15 -0
- package/lib/types/client/credential-status.d.ts +15 -0
- package/lib/types/client/huawei-mark.d.ts +37 -0
- package/lib/types/client/index.d.ts +26 -0
- package/lib/types/client/layout-ref.d.ts +23 -0
- package/lib/types/client/pages/ConfigPage/AdviceCard.d.ts +26 -0
- package/lib/types/client/pages/ConfigPage/AuditBar.d.ts +21 -0
- package/lib/types/client/pages/ConfigPage/ChangeSummaryCard.d.ts +22 -0
- package/lib/types/client/pages/ConfigPage/ChangesCard.d.ts +27 -0
- package/lib/types/client/pages/ConfigPage/ComplianceDetail.d.ts +25 -0
- package/lib/types/client/pages/ConfigPage/ComplianceSummaryCard.d.ts +31 -0
- package/lib/types/client/pages/ConfigPage/FindingsCard.d.ts +21 -0
- package/lib/types/client/pages/ConfigPage/GlossaryDrawer.d.ts +17 -0
- package/lib/types/client/pages/ConfigPage/OrgComplianceDetail.d.ts +15 -0
- package/lib/types/client/pages/ConfigPage/Pager.d.ts +32 -0
- package/lib/types/client/pages/ConfigPage/ResourceDrawer.d.ts +26 -0
- package/lib/types/client/pages/ConfigPage/ResourcesTable.d.ts +35 -0
- package/lib/types/client/pages/ConfigPage/RollupPanel.d.ts +17 -0
- package/lib/types/client/pages/ConfigPage/RuleDetailDrawer.d.ts +23 -0
- package/lib/types/client/pages/ConfigPage/StatusCards.d.ts +26 -0
- package/lib/types/client/pages/ConfigPage/UncoveredDialog.d.ts +22 -0
- package/lib/types/client/pages/ConfigPage/config-api.d.ts +101 -0
- package/lib/types/client/pages/ConfigPage/config-store.d.ts +57 -0
- package/lib/types/client/pages/ConfigPage/index.d.ts +21 -0
- package/lib/types/client/pages/ConfigPage/paging.d.ts +46 -0
- package/lib/types/client/pages/ConfigPage/scope-options.d.ts +51 -0
- package/lib/types/client/pages/CostPage/AccountAllocation.d.ts +24 -0
- package/lib/types/client/pages/CostPage/AccountBars.d.ts +20 -0
- package/lib/types/client/pages/CostPage/AccountColumns.d.ts +24 -0
- package/lib/types/client/pages/CostPage/AccountDonut.d.ts +18 -0
- package/lib/types/client/pages/CostPage/AccountSwitcher.d.ts +25 -0
- package/lib/types/client/pages/CostPage/AdviceCard.d.ts +43 -0
- package/lib/types/client/pages/CostPage/AdviceFindings.d.ts +43 -0
- package/lib/types/client/pages/CostPage/BillingPanels.d.ts +23 -0
- package/lib/types/client/pages/CostPage/BudgetCard.d.ts +36 -0
- package/lib/types/client/pages/CostPage/GlossaryDrawer.d.ts +16 -0
- package/lib/types/client/pages/CostPage/KpiRow.d.ts +23 -0
- package/lib/types/client/pages/CostPage/MarkdownBlock.d.ts +16 -0
- package/lib/types/client/pages/CostPage/ReportView.d.ts +17 -0
- package/lib/types/client/pages/CostPage/ResourceColumns.d.ts +19 -0
- package/lib/types/client/pages/CostPage/ResourceDonut.d.ts +18 -0
- package/lib/types/client/pages/CostPage/ResourcesCard.d.ts +40 -0
- package/lib/types/client/pages/CostPage/RuleDetailDrawer.d.ts +23 -0
- package/lib/types/client/pages/CostPage/SavingView.d.ts +38 -0
- package/lib/types/client/pages/CostPage/ServiceDonut.d.ts +17 -0
- package/lib/types/client/pages/CostPage/TrendChart.d.ts +24 -0
- package/lib/types/client/pages/CostPage/budget-input.d.ts +30 -0
- package/lib/types/client/pages/CostPage/cost-api.d.ts +266 -0
- package/lib/types/client/pages/CostPage/cost-store.d.ts +25 -0
- package/lib/types/client/pages/CostPage/format.d.ts +37 -0
- package/lib/types/client/pages/CostPage/index.d.ts +34 -0
- package/lib/types/client/pages/CostPage/trend-fold.d.ts +32 -0
- package/lib/types/client/pages/CostPage/useEcharts.d.ts +70 -0
- package/lib/types/client/pages/OrgStructurePage/AccountStatsCard.d.ts +22 -0
- package/lib/types/client/pages/OrgStructurePage/CoreAccountsCard.d.ts +18 -0
- package/lib/types/client/pages/OrgStructurePage/CreateAccountDialog.d.ts +28 -0
- package/lib/types/client/pages/OrgStructurePage/ManageUsersDialog.d.ts +28 -0
- package/lib/types/client/pages/OrgStructurePage/MemberAccountsTable.d.ts +32 -0
- package/lib/types/client/pages/OrgStructurePage/MoveAccountDialog.d.ts +29 -0
- package/lib/types/client/pages/OrgStructurePage/OrgGlossaryDrawer.d.ts +13 -0
- package/lib/types/client/pages/OrgStructurePage/OrgTreeCard.d.ts +31 -0
- package/lib/types/client/pages/OrgStructurePage/index.d.ts +21 -0
- package/lib/types/client/pages/OrgStructurePage/org-api.d.ts +166 -0
- package/lib/types/client/pages/OverviewPage/AnchorRow.d.ts +24 -0
- package/lib/types/client/pages/OverviewPage/AttentionList.d.ts +29 -0
- package/lib/types/client/pages/OverviewPage/OverviewCharts.d.ts +79 -0
- package/lib/types/client/pages/OverviewPage/OverviewGlossaryDrawer.d.ts +15 -0
- package/lib/types/client/pages/OverviewPage/index.d.ts +22 -0
- package/lib/types/client/pages/OverviewPage/overview-api.d.ts +115 -0
- package/lib/types/client/pages/ResourcePage/AccountResourceList.d.ts +21 -0
- package/lib/types/client/pages/ResourcePage/components/GlossaryDrawer.d.ts +20 -0
- package/lib/types/client/pages/ResourcePage/components/MetricCards.d.ts +19 -0
- package/lib/types/client/pages/ResourcePage/components/MultiSelect.d.ts +27 -0
- package/lib/types/client/pages/ResourcePage/components/PanelPager.d.ts +26 -0
- package/lib/types/client/pages/ResourcePage/components/RankBars.d.ts +25 -0
- package/lib/types/client/pages/ResourcePage/components/ScopeSelect.d.ts +27 -0
- package/lib/types/client/pages/ResourcePage/components/SourceConfigModal.d.ts +21 -0
- package/lib/types/client/pages/ResourcePage/components/SyncControls.d.ts +18 -0
- package/lib/types/client/pages/ResourcePage/components/TrendChart.d.ts +14 -0
- package/lib/types/client/pages/ResourcePage/components/useColumnWidths.d.ts +12 -0
- package/lib/types/client/pages/ResourcePage/format.d.ts +9 -0
- package/lib/types/client/pages/ResourcePage/index.d.ts +20 -0
- package/lib/types/client/pages/ResourcePage/summary-api.d.ts +205 -0
- package/lib/types/client/pages/SetupPage/AskPanel.d.ts +21 -0
- package/lib/types/client/pages/SetupPage/ChatEmbed.d.ts +40 -0
- package/lib/types/client/pages/SetupPage/ChatTab.d.ts +17 -0
- package/lib/types/client/pages/SetupPage/FormTab.d.ts +12 -0
- package/lib/types/client/pages/SetupPage/FormTabV2.d.ts +14 -0
- package/lib/types/client/pages/SetupPage/ProgressTreeView.d.ts +15 -0
- package/lib/types/client/pages/SetupPage/StageFlow.d.ts +16 -0
- package/lib/types/client/pages/SetupPage/index.d.ts +10 -0
- package/lib/types/client/pages/SetupPage/progress-types.d.ts +36 -0
- package/lib/types/client/pages/SetupPage/session-binding.d.ts +38 -0
- package/lib/types/client/pages/SetupPage/session-store.d.ts +57 -0
- package/lib/types/client/pages/SetupPage/sessions-ref.d.ts +5 -0
- package/lib/types/client/pages/SetupPage/setup-replan.d.ts +13 -0
- package/lib/types/client/pages/SetupPage/wb-api.d.ts +192 -0
- package/lib/types/client/pages/list-preview.d.ts +36 -0
- package/lib/types/client/permission-mode.d.ts +53 -0
- package/lib/types/client/store.d.ts +22 -0
- package/lib/types/collect.d.ts +78 -0
- package/lib/types/config/account-scope.d.ts +61 -0
- package/lib/types/config/advice-findings.d.ts +31 -0
- package/lib/types/config/advice-prompt.d.ts +60 -0
- package/lib/types/config/advice.d.ts +116 -0
- package/lib/types/config/cts.d.ts +30 -0
- package/lib/types/config/evidence/rules.d.ts +31 -0
- package/lib/types/config/evidence/types.d.ts +103 -0
- package/lib/types/config/failure-note.d.ts +46 -0
- package/lib/types/config/fingerprint-cache.d.ts +45 -0
- package/lib/types/config/identity.d.ts +67 -0
- package/lib/types/config/query.d.ts +49 -0
- package/lib/types/config/rms.d.ts +412 -0
- package/lib/types/config/routes.d.ts +32 -0
- package/lib/types/config/types.d.ts +785 -0
- package/lib/types/config/views.d.ts +158 -0
- package/lib/types/cost/accounts.d.ts +29 -0
- package/lib/types/cost/advice-findings.d.ts +77 -0
- package/lib/types/cost/advice-model.d.ts +19 -0
- package/lib/types/cost/advice-prompt.d.ts +73 -0
- package/lib/types/cost/advice-subagent-types.d.ts +6 -0
- package/lib/types/cost/advice-subagent.d.ts +116 -0
- package/lib/types/cost/advice-types.d.ts +63 -0
- package/lib/types/cost/advice.d.ts +125 -0
- package/lib/types/cost/aggregate.d.ts +157 -0
- package/lib/types/cost/assume.d.ts +43 -0
- package/lib/types/cost/bss.d.ts +166 -0
- package/lib/types/cost/budget-overview.d.ts +38 -0
- package/lib/types/cost/budget.d.ts +56 -0
- package/lib/types/cost/cache.d.ts +58 -0
- package/lib/types/cost/caliber.d.ts +40 -0
- package/lib/types/cost/console-links.d.ts +27 -0
- package/lib/types/cost/credentials.d.ts +38 -0
- package/lib/types/cost/data-window.d.ts +38 -0
- package/lib/types/cost/evidence/catalog.d.ts +35 -0
- package/lib/types/cost/evidence/index.d.ts +70 -0
- package/lib/types/cost/evidence/inventory.d.ts +44 -0
- package/lib/types/cost/evidence/pricing.d.ts +72 -0
- package/lib/types/cost/evidence/projects.d.ts +18 -0
- package/lib/types/cost/evidence/rules.d.ts +66 -0
- package/lib/types/cost/evidence/state.d.ts +38 -0
- package/lib/types/cost/evidence/thresholds.d.ts +68 -0
- package/lib/types/cost/evidence/types.d.ts +288 -0
- package/lib/types/cost/evidence/utilization.d.ts +37 -0
- package/lib/types/cost/history.d.ts +36 -0
- package/lib/types/cost/ledger.d.ts +97 -0
- package/lib/types/cost/normalize.d.ts +37 -0
- package/lib/types/cost/period-projection.d.ts +57 -0
- package/lib/types/cost/plan-check.d.ts +102 -0
- package/lib/types/cost/plan-db.d.ts +73 -0
- package/lib/types/cost/plan-types.d.ts +183 -0
- package/lib/types/cost/plan.d.ts +63 -0
- package/lib/types/cost/quote.d.ts +45 -0
- package/lib/types/cost/report.d.ts +136 -0
- package/lib/types/cost/resources.d.ts +108 -0
- package/lib/types/cost/routes.d.ts +38 -0
- package/lib/types/cost/scope.d.ts +42 -0
- package/lib/types/cost/types.d.ts +335 -0
- package/lib/types/cost/unit-prices-derive.d.ts +19 -0
- package/lib/types/cost/unit-prices.d.ts +23 -0
- package/lib/types/db.d.ts +228 -0
- package/lib/types/host-log.d.ts +7 -0
- package/lib/types/http.d.ts +42 -0
- package/lib/types/index.d.ts +30 -0
- package/lib/types/inventory.d.ts +286 -0
- package/lib/types/obs.d.ts +16 -0
- package/lib/types/org/aggregate.d.ts +36 -0
- package/lib/types/org/churn.d.ts +10 -0
- package/lib/types/org/orgs.d.ts +258 -0
- package/lib/types/org/routes.d.ts +28 -0
- package/lib/types/org-types.d.ts +156 -0
- package/lib/types/per-service.d.ts +39 -0
- package/lib/types/setup/blueprint-loader.d.ts +81 -0
- package/lib/types/setup/caller.d.ts +105 -0
- package/lib/types/setup/engine.d.ts +41 -0
- package/lib/types/setup/form-store.d.ts +13 -0
- package/lib/types/setup/nodes/n1-check.d.ts +14 -0
- package/lib/types/setup/nodes/n10-governance.d.ts +6 -0
- package/lib/types/setup/nodes/n11-infra.d.ts +6 -0
- package/lib/types/setup/nodes/n12-reconcile.d.ts +6 -0
- package/lib/types/setup/nodes/n2-region.d.ts +6 -0
- package/lib/types/setup/nodes/n3-blueprint.d.ts +6 -0
- package/lib/types/setup/nodes/n4-modules.d.ts +6 -0
- package/lib/types/setup/nodes/n5-details.d.ts +6 -0
- package/lib/types/setup/nodes/n6-plan.d.ts +6 -0
- package/lib/types/setup/nodes/n7-verify.d.ts +6 -0
- package/lib/types/setup/nodes/n8-approve.d.ts +6 -0
- package/lib/types/setup/nodes/n9-buildmode.d.ts +6 -0
- package/lib/types/setup/plan-state.d.ts +10 -0
- package/lib/types/setup/prompt-loader.d.ts +16 -0
- package/lib/types/setup/routes.d.ts +22 -0
- package/lib/types/setup/session-notify.d.ts +30 -0
- package/lib/types/setup/tools.d.ts +19 -0
- package/lib/types/setup/types.d.ts +157 -0
- package/lib/types/sse-bus.d.ts +23 -0
- package/lib/types/tools/config-facts.d.ts +16 -0
- package/lib/types/tools/cost-facts.d.ts +10 -0
- package/lib/types/tools/register.d.ts +18 -0
- package/lib/types/wb-conventions.d.ts +140 -0
- package/package.json +77 -4
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 治理总览 —— 锚点 + 图表墙 + 精简待关注。
|
|
3
|
+
*
|
|
4
|
+
* 定位是分诊台不是报表间:图表讲趋势与构成,文字只留图表讲不了的"要动手"项。
|
|
5
|
+
* 所有数字来自四个子页的同一条路由、同一套口径(见 doc/OVERVIEW-PAGE-DESIGN.md §五):
|
|
6
|
+
* · 费用只用成本口径(ORIGINAL_COST×PAYMENT_AMOUNT),与费用页一致;
|
|
7
|
+
* · 合规率只用 rollup 合计口径(与合规摘要卡一致),分母 0 →"无判定";
|
|
8
|
+
* · 账号数含管理账号、排除停用(组织域聚合已过滤 suspended)。
|
|
9
|
+
*
|
|
10
|
+
* 图表墙(三行两列):费用趋势 / 资源趋势 → 预算执行 / 组织合规 → 不合规规则 Top5 / 账号状态。
|
|
11
|
+
* 待关注只留四类无法图表化的"要动手"项:同步失败、Config 未开通、覆盖缺口、IaC 未纳管。
|
|
12
|
+
*
|
|
13
|
+
* @module @huaweidevtools/landingzone-workbench/client/pages/OverviewPage
|
|
14
|
+
*/
|
|
15
|
+
import { type ReactNode } from 'react';
|
|
16
|
+
import { type OverviewNavigateTarget } from './overview-api.ts';
|
|
17
|
+
export interface OverviewPageProps {
|
|
18
|
+
/** 锚点/待关注条目的跳转回调,由 WorkbenchShell 接菜单状态。 */
|
|
19
|
+
readonly onNavigate?: (target: OverviewNavigateTarget) => void;
|
|
20
|
+
}
|
|
21
|
+
export declare function OverviewPage(props: OverviewPageProps): ReactNode;
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type { OrgEnvelope, OrgStructurePayload } from '../../../org-types.ts';
|
|
2
|
+
import type { Envelope } from '../../../cost/types.ts';
|
|
3
|
+
import type { CostOverview, CostTrend } from '../../../cost/types.ts';
|
|
4
|
+
import type { ConfigComplianceRollup, ConfigSnapshot } from '../../../config/types.ts';
|
|
5
|
+
import type { AccountsResp, SummaryResp, TrendResp } from '../ResourcePage/summary-api.ts';
|
|
6
|
+
export type { OrgStructurePayload, SummaryResp, AccountsResp, CostOverview, CostTrend, ConfigSnapshot, ConfigComplianceRollup, TrendResp };
|
|
7
|
+
/** 总览可跳转的子页(WorkbenchShell 菜单 id 的子集)。 */
|
|
8
|
+
export type OverviewNavigateTarget = 'org' | 'resource' | 'cost' | 'config';
|
|
9
|
+
/** 配置审计快照的响应信封(字段同 ConfigEnvelope,避免引入该域全部类型)。 */
|
|
10
|
+
export interface ConfigSnapshotEnvelope {
|
|
11
|
+
readonly data: ConfigSnapshot | null;
|
|
12
|
+
/** 取数元信息(数据截至/来源;总览「数据截至」行用)。 */
|
|
13
|
+
readonly meta?: {
|
|
14
|
+
readonly data_as_of?: string | null;
|
|
15
|
+
readonly source?: 'live' | 'cache';
|
|
16
|
+
readonly is_stale?: boolean;
|
|
17
|
+
};
|
|
18
|
+
readonly unavailable?: unknown;
|
|
19
|
+
}
|
|
20
|
+
/** 组织级合规汇总的响应形状(routes.ts:`{ rollup }`,能力缺失附 `unavailable`)。 */
|
|
21
|
+
interface RollupResp {
|
|
22
|
+
readonly rollup: ConfigComplianceRollup;
|
|
23
|
+
readonly unavailable?: unknown;
|
|
24
|
+
}
|
|
25
|
+
/** 批量预算状态(cost/budget-overview.ts):只含设了预算的账号。 */
|
|
26
|
+
export interface BudgetOverviewRow {
|
|
27
|
+
/** '*' = 主账号(全组织)。 */
|
|
28
|
+
readonly account_id: string;
|
|
29
|
+
readonly amount: number;
|
|
30
|
+
readonly alert_ratio: number;
|
|
31
|
+
readonly used: number;
|
|
32
|
+
readonly ratio: number | null;
|
|
33
|
+
readonly forecast: number | null;
|
|
34
|
+
readonly forecast_ratio: number | null;
|
|
35
|
+
readonly status: 'ok' | 'warn' | 'over';
|
|
36
|
+
}
|
|
37
|
+
export interface BudgetOverviewResp {
|
|
38
|
+
readonly cycle: string;
|
|
39
|
+
readonly rows: readonly BudgetOverviewRow[];
|
|
40
|
+
readonly data_as_of: string | null;
|
|
41
|
+
/** 本月时间进度(0~1)——"时间进度"参考线用。 */
|
|
42
|
+
readonly elapsed_ratio?: number;
|
|
43
|
+
readonly unavailable?: unknown;
|
|
44
|
+
}
|
|
45
|
+
/** 带 HTTP 状态的错误,message 可直接展示。 */
|
|
46
|
+
export declare class OverviewApiError extends Error {
|
|
47
|
+
readonly status: number;
|
|
48
|
+
constructor(status: number, message: string);
|
|
49
|
+
}
|
|
50
|
+
export declare const overviewApi: {
|
|
51
|
+
/** 组织结构聚合(`?refresh=1` 绕过 host 5 分钟内存缓存)。 */
|
|
52
|
+
org: (refresh?: boolean) => Promise<OrgEnvelope>;
|
|
53
|
+
/** 资源汇总(组织聚合口径,读本地 SQLite 快照)。 */
|
|
54
|
+
resourceSummary: () => Promise<SummaryResp>;
|
|
55
|
+
/** 逐账号资源行(含 config_enabled,用于"未开通配置审计"计数)。 */
|
|
56
|
+
resourceAccounts: () => Promise<AccountsResp>;
|
|
57
|
+
/** 本月费用概览(成本口径,host 默认取最新账期)。 */
|
|
58
|
+
costOverview: (refresh?: boolean) => Promise<Envelope<CostOverview>>;
|
|
59
|
+
/** 配置审计快照(组织视角,带 coverage.missing 与 audit.findings)。 */
|
|
60
|
+
configSnapshot: (refresh?: boolean) => Promise<ConfigSnapshotEnvelope>;
|
|
61
|
+
/**
|
|
62
|
+
* 组织级合规汇总。host 侧 6 小时缓存:有缓存即时返回,没缓存会现场逐账号
|
|
63
|
+
* assume 评估(慢)——总览只在用户点「刷新」时才带 `?refresh=1`。
|
|
64
|
+
*/
|
|
65
|
+
configRollup: (refresh?: boolean) => Promise<RollupResp>;
|
|
66
|
+
/** 批量预算状态(本月哪些账号预算不够;host 走各账号盘缓存)。 */
|
|
67
|
+
budgetOverview: (refresh?: boolean) => Promise<BudgetOverviewResp>;
|
|
68
|
+
/** 近 30 日费用趋势(成本口径,日粒度)。 */
|
|
69
|
+
costTrend: (refresh?: boolean) => Promise<Envelope<CostTrend>>;
|
|
70
|
+
/** 近 30 日资源规模趋势(按天快照,组织聚合)。 */
|
|
71
|
+
resourceTrend: () => Promise<TrendResp>;
|
|
72
|
+
};
|
|
73
|
+
/** 一个数据槽:要么有数,要么有人话错误,二者必有其一(加载期都为空)。 */
|
|
74
|
+
export interface OverviewSlot<T> {
|
|
75
|
+
readonly data: T | undefined;
|
|
76
|
+
readonly error: string | undefined;
|
|
77
|
+
/** 2026-11-21 分槽加载:本槽是否在途(卡片级骨架屏用)。 */
|
|
78
|
+
readonly loading: boolean;
|
|
79
|
+
}
|
|
80
|
+
/** 九个槽各归各域,互不影响。信封类响应整包入槽,由展示层解包 `data`。 */
|
|
81
|
+
export interface OverviewData {
|
|
82
|
+
readonly org: OverviewSlot<OrgEnvelope>;
|
|
83
|
+
readonly resource: OverviewSlot<SummaryResp>;
|
|
84
|
+
readonly resourceAccounts: OverviewSlot<AccountsResp>;
|
|
85
|
+
readonly resourceTrend: OverviewSlot<TrendResp>;
|
|
86
|
+
readonly cost: OverviewSlot<Envelope<CostOverview>>;
|
|
87
|
+
readonly costTrend: OverviewSlot<Envelope<CostTrend>>;
|
|
88
|
+
readonly budgetOverview: OverviewSlot<BudgetOverviewResp>;
|
|
89
|
+
readonly config: OverviewSlot<ConfigSnapshotEnvelope>;
|
|
90
|
+
readonly rollup: OverviewSlot<RollupResp>;
|
|
91
|
+
}
|
|
92
|
+
export interface OverviewResource {
|
|
93
|
+
readonly data: OverviewData;
|
|
94
|
+
/** 是否有任一槽在途(刷新按钮禁用用;卡片级骨架看各自槽 loading)。 */
|
|
95
|
+
readonly loading: boolean;
|
|
96
|
+
/** 重新取数;`refresh` 为 true 时要求后端绕过缓存(合规汇总除外,见 configRollup)。 */
|
|
97
|
+
readonly reload: (refresh?: boolean) => void;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* 总览取数 hook(2026-11-21 分槽化):挂载即启动一次取数,九槽各自完成
|
|
101
|
+
* 各自就绪——快卡(资源 0.15s)不等慢卡(config 冷 2.2s)。
|
|
102
|
+
* 刻意不轮询(与组织页同一立场):刷新由 SSE 或按钮驱动。
|
|
103
|
+
*
|
|
104
|
+
* @param accountHint 当前账号 chip 提示——变化(换凭据/换账号登录)时九槽
|
|
105
|
+
* 全部 reset 后重取:槽 store 是模块级单例,上一个账号
|
|
106
|
+
* 的总览数据绝不沿用到新身份下(与 account-role 同款纪律)。
|
|
107
|
+
*/
|
|
108
|
+
export declare function useOverview(accountHint?: string): OverviewResource;
|
|
109
|
+
/** 订阅 landing-zone SSE 事件流(资源同步 / landing_zone_* 执行后自动刷新)。 */
|
|
110
|
+
export declare function subscribeOverviewRefresh(onRefresh: () => void): () => void;
|
|
111
|
+
/** 整数千分位(锚点数字用)。 */
|
|
112
|
+
export declare function groupNumber(n: number | null | undefined): string;
|
|
113
|
+
/** ISO 时间 → 本地 `MM-DD HH:mm`;空/非法 → '—'。 */
|
|
114
|
+
export declare function shortTime(iso: string | null | undefined): string;
|
|
115
|
+
//# sourceMappingURL=overview-api.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 子账号资源明细列表(2026-11-11 产品调整:由下钻子页改为直接铺在子账号页上,
|
|
3
|
+
* 顶替原 6 张服务明细卡)。数据只读 SQLite(不做实时云查询)。
|
|
4
|
+
*
|
|
5
|
+
* 筛选:服务(多选)/ 类型(多选)/ 区域(多选)/ 纳管状态(多选) / 企业项目
|
|
6
|
+
* (按项目 id 多选,含「未归集」)/ 关键字(取值来自 facets)
|
|
7
|
+
* 表:资源ID│名称│服务│类型│区域│企业项目│创建时间│纳管;服务端分页
|
|
8
|
+
* (每页 20/50/100,缺省 50,选择记忆在 localStorage)
|
|
9
|
+
* 列宽默认"内容全显",可拖拽调整(列头右缘 grip;双击复位;localStorage 记忆)
|
|
10
|
+
*
|
|
11
|
+
* 「纳管」列来自同步时按 tfstate 对齐回填的 managed 标记;ep_id 列显示
|
|
12
|
+
* 「未归集」/项目 ID(企业项目名称映射 M3 再补)。
|
|
13
|
+
*
|
|
14
|
+
* @module .../ResourcePage/AccountResourceList
|
|
15
|
+
*/
|
|
16
|
+
import { type ReactNode } from 'react';
|
|
17
|
+
/** 子账号资源明细(筛选 + 服务端分页)。 */
|
|
18
|
+
export declare function AccountResourceList(props: {
|
|
19
|
+
readonly accountId: string;
|
|
20
|
+
}): ReactNode;
|
|
21
|
+
//# sourceMappingURL=AccountResourceList.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 指标口径抽屉(页面左侧)——与费用页 GlossaryDrawer 同一交互:
|
|
3
|
+
* 右上角「口径」按钮打开(资源页无问号,口径说明唯一入口在此)。
|
|
4
|
+
* 文案合并自旧口径弹层的白话版本并修订过时表述;
|
|
5
|
+
* 规矩:用户可见正文不出现 markdown 记号(星号、反引号)。
|
|
6
|
+
* 目标线的具体数值由页面下发(配置项持久化),文案随之插值。
|
|
7
|
+
*
|
|
8
|
+
* @module .../ResourcePage/components/GlossaryDrawer
|
|
9
|
+
*/
|
|
10
|
+
import { type ReactNode } from 'react';
|
|
11
|
+
export declare function GlossaryDrawer(props: {
|
|
12
|
+
readonly open: boolean;
|
|
13
|
+
readonly onClose: () => void;
|
|
14
|
+
/** 目标线(配置项持久化值):coverage=IaC 纳管率、ep=项目归集率,口径文案插值用。 */
|
|
15
|
+
readonly targets: {
|
|
16
|
+
readonly coverage: number;
|
|
17
|
+
readonly ep: number;
|
|
18
|
+
};
|
|
19
|
+
}): ReactNode;
|
|
20
|
+
//# sourceMappingURL=GlossaryDrawer.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 三核心指标卡(资源总数 / IaC 纳管率 / 项目归集率)——周报截图观感:
|
|
3
|
+
* 色点 + 大数值 + delta 徽章(纳管率进度条已删:形似滚动条,评审 2026-11-11)。
|
|
4
|
+
* 口径定义在右上角「口径」抽屉,卡片不铺说明文字;成员模式的分母覆盖
|
|
5
|
+
* 以红色小字标注在资源总数卡(无权访问服务数)。
|
|
6
|
+
* 2026-11-25 用户反馈:「资源总数」被读成"云上全部资源"产生歧义——卡片
|
|
7
|
+
* 标签加问号悬浮,说明统计范围=「关注服务」内直接产生费用的资源。
|
|
8
|
+
*
|
|
9
|
+
* @module .../ResourcePage/components/MetricCards
|
|
10
|
+
*/
|
|
11
|
+
import { type ReactNode } from 'react';
|
|
12
|
+
import type { SummaryResp } from '../summary-api.ts';
|
|
13
|
+
export declare function MetricCards(props: {
|
|
14
|
+
readonly summary: SummaryResp;
|
|
15
|
+
readonly scoped: boolean;
|
|
16
|
+
/** 子账号登录:无权访问的服务数(分母为已采集服务的常驻标注;undefined=不标注)。 */
|
|
17
|
+
readonly failedServices?: number;
|
|
18
|
+
}): ReactNode;
|
|
19
|
+
//# sourceMappingURL=MetricCards.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 多选下拉(明细筛选条用):按钮 + 复选面板,点击外部 / Esc 关闭。
|
|
3
|
+
* 选项即点即生效——父级筛选带防抖,不需要确认按钮。
|
|
4
|
+
* 样式全走 --wb-* / 官方令牌,深色跟随令牌层自动翻转,无需深色覆盖规则。
|
|
5
|
+
*
|
|
6
|
+
* 勾选语义(2026-11-25 用户反馈改造):**0 勾选 = 全选**——面板默认全部勾上,
|
|
7
|
+
* 用户手动取消不关注的服务;「全选」键一键回满(规范形态仍是空数组,与全部
|
|
8
|
+
* 显式勾上等价,查询层不发参数)。取消到一项不剩 = 回到全选(不是空结果,
|
|
9
|
+
* 空结果由筛选组合交叉产生,如 服务×区域 无交集)。
|
|
10
|
+
*
|
|
11
|
+
* @module .../ResourcePage/components/MultiSelect
|
|
12
|
+
*/
|
|
13
|
+
import { type ReactNode } from 'react';
|
|
14
|
+
export interface MultiSelectOption {
|
|
15
|
+
readonly value: string;
|
|
16
|
+
readonly label: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function MultiSelect(props: {
|
|
19
|
+
/** 按钮前缀(如「服务」),已选项数展示用。 */
|
|
20
|
+
readonly label: string;
|
|
21
|
+
/** 未过滤时的按钮文案(如「全部服务」)——现在也是"全选态"的文案。 */
|
|
22
|
+
readonly placeholder: string;
|
|
23
|
+
readonly options: readonly MultiSelectOption[];
|
|
24
|
+
readonly selected: readonly string[];
|
|
25
|
+
readonly onChange: (next: readonly string[]) => void;
|
|
26
|
+
}): ReactNode;
|
|
27
|
+
//# sourceMappingURL=MultiSelect.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 面板分页(客户端):页码按钮 + 上一页/下一页 + 每页条数选择。
|
|
3
|
+
* PaginatedPanel = 面板骨架 + 行分页,供排名/维度面板复用;
|
|
4
|
+
* 趋势图为连续序列,不分页。
|
|
5
|
+
*
|
|
6
|
+
* @module .../ResourcePage/components/PanelPager
|
|
7
|
+
*/
|
|
8
|
+
import { type ReactNode } from 'react';
|
|
9
|
+
/** 每页条数候选项(面板分页)。 */
|
|
10
|
+
export declare const SIZE_OPTIONS: readonly [10, 20, 50];
|
|
11
|
+
export declare function PanelPager(props: {
|
|
12
|
+
readonly page: number;
|
|
13
|
+
readonly pageCount: number;
|
|
14
|
+
readonly total: number;
|
|
15
|
+
readonly pageSize: number;
|
|
16
|
+
readonly onPage: (p: number) => void;
|
|
17
|
+
readonly onPageSize: (s: number) => void;
|
|
18
|
+
}): ReactNode;
|
|
19
|
+
/** 面板骨架 + 行分页(10/20/50 每页;页码按钮;页码始终展示)。 */
|
|
20
|
+
export declare function PaginatedPanel(props: {
|
|
21
|
+
readonly title: string;
|
|
22
|
+
readonly rows: readonly ReactNode[];
|
|
23
|
+
/** 列表下的附加行(如速率面板的 0/50/100 轴刻度),渲染在分页条之前。 */
|
|
24
|
+
readonly footer?: ReactNode;
|
|
25
|
+
}): ReactNode;
|
|
26
|
+
//# sourceMappingURL=PanelPager.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 按子账号排名——三个指标面板并排(资源总数 / IaC纳管率 / 项目归集率),
|
|
3
|
+
* 不再用下拉切换;纯 CSS 横条 + 渐变 + 目标参考线,观感按可截图发周报标准。
|
|
4
|
+
* 目标线数值来自配置项(服务端持久化,页面下发),不再写死。
|
|
5
|
+
* 点击横条或账号名 → 切换查看范围到该账号(出该账号的汇总视角;2026-11-06 调整,不再直接进明细子页)。面板不放说明性文字,定义走悬浮。
|
|
6
|
+
*
|
|
7
|
+
* @module .../ResourcePage/components/RankBars
|
|
8
|
+
*/
|
|
9
|
+
import { type ReactNode } from 'react';
|
|
10
|
+
import type { AccountRow } from '../summary-api.ts';
|
|
11
|
+
/**
|
|
12
|
+
* 速率类数值胶囊按阈值语义着色(对齐原型纳管诊断:28.8%/34% 红、88.9% 橙、
|
|
13
|
+
* 92%+ 蓝):<60% 红(远低于目标)、<90% 橙(接近)、≥90% 蓝(达标);null 灰。
|
|
14
|
+
*/
|
|
15
|
+
export declare function rateChipClass(value: number | null): string | undefined;
|
|
16
|
+
export declare function RankBars(props: {
|
|
17
|
+
readonly accounts: readonly AccountRow[];
|
|
18
|
+
readonly onPick: (accountId: string) => void;
|
|
19
|
+
/** 目标参考线(配置项持久化值):coverage=IaC 纳管率、ep=项目归集率。 */
|
|
20
|
+
readonly targets: {
|
|
21
|
+
readonly coverage: number;
|
|
22
|
+
readonly ep: number;
|
|
23
|
+
};
|
|
24
|
+
}): ReactNode;
|
|
25
|
+
//# sourceMappingURL=RankBars.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 查看范围下拉(资源管理页)。
|
|
3
|
+
*
|
|
4
|
+
* 名单口径:组织全量未删除账号(未停用);未开通配置审计的置灰 + 「未开通」
|
|
5
|
+
* 徽标,悬停提示去开通 Config(2026-11-07)。渲染本体是客户端根级共享件
|
|
6
|
+
* DropdownSelect(费用页账号切换同款,样式/层级行为一致),这里只做
|
|
7
|
+
* 账号行 → 选项的映射。仅组织视角渲染——子账号登录(视角锁定)时整个
|
|
8
|
+
* 不渲染,见 ResourcePage/index.tsx(产品调整 2026-11-19)。
|
|
9
|
+
*
|
|
10
|
+
* @module @huaweidevtools/landingzone-workbench/client/pages/ResourcePage/components/ScopeSelect
|
|
11
|
+
*/
|
|
12
|
+
import { type ReactNode } from 'react';
|
|
13
|
+
import type { AccountRow } from '../summary-api.ts';
|
|
14
|
+
/** 未开通徽标的悬停提示文案。 */
|
|
15
|
+
export declare const CONFIG_TIP = "\u8BF7\u5F00\u901A\u914D\u7F6E\u5BA1\u8BA1Config\u670D\u52A1";
|
|
16
|
+
interface ScopeSelectProps {
|
|
17
|
+
/** 全量账号行(含未开通;已按「可选在前、未开通按名称在后」排序)。 */
|
|
18
|
+
readonly accounts: readonly AccountRow[];
|
|
19
|
+
/** 当前查看范围:'*' = 组织聚合;账号 id = 该账号口径。 */
|
|
20
|
+
readonly scope: string;
|
|
21
|
+
readonly onChange: (v: string) => void;
|
|
22
|
+
/** 组织接口不可用时的降级说明(菜单底部提示,undefined = 不提示)。 */
|
|
23
|
+
readonly organizationUnavailable?: string;
|
|
24
|
+
}
|
|
25
|
+
export declare function ScopeSelect({ accounts, scope, onChange, organizationUnavailable }: ScopeSelectProps): ReactNode;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=ScopeSelect.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 配置项弹层——本页数字怎么算、怎么标,都在这里配。
|
|
3
|
+
*
|
|
4
|
+
* 四个区块:tfstate 数据源(纳管比对的数据从哪来)、关注服务(统计范围)、
|
|
5
|
+
* 指标目标(排名图目标参考线)、采集权限(子账号登录的只读状态展示)。
|
|
6
|
+
*
|
|
7
|
+
* 前 three 类为**暂存编辑**:所有改动先落本地草稿,点右上「保存」统一提交,
|
|
8
|
+
* 「取消」/点遮罩丢弃草稿(2026-11-25 用户反馈改造:原"区块各自即时生效 +
|
|
9
|
+
* 指标目标独享一个保存键"被同事误读成"那个保存=保存全部配置"——现在把
|
|
10
|
+
* 保存挪到头部,语义真实成立;原关闭键移除)。部分成功的重试:已提交的
|
|
11
|
+
* 变更在草稿里就地标记完成,失败后修正可再点「保存」只补剩余。
|
|
12
|
+
*
|
|
13
|
+
* @module .../ResourcePage/components/SourceConfigModal
|
|
14
|
+
*/
|
|
15
|
+
import { type ReactNode } from 'react';
|
|
16
|
+
export declare function SourceConfigModal(props: {
|
|
17
|
+
readonly onClose: () => void;
|
|
18
|
+
/** 目标线保存成功回调:页面侧同步排名图参考线与口径文案(数字即时生效,无需刷新)。 */
|
|
19
|
+
readonly onTargetsSaved?: (coverage: number, ep: number) => void;
|
|
20
|
+
}): ReactNode;
|
|
21
|
+
//# sourceMappingURL=SourceConfigModal.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 口径/配置项/刷新按钮 + 同步进度文案(方案A+ 单按钮,2026-11-10)。
|
|
3
|
+
* 「刷新」= 与费用/配置页同语义:探测云上变化——无变化瞬回,有变化后台跑
|
|
4
|
+
* 全量同步(进度文案在此展示,完成自动更新数字);不再有独立的"同步资源清单"按钮。
|
|
5
|
+
* 「口径」= 打开本页数字的计算逻辑说明;「配置项」= 数据源/统计范围/指标目标配置。
|
|
6
|
+
*
|
|
7
|
+
* @module .../ResourcePage/components/SyncControls
|
|
8
|
+
*/
|
|
9
|
+
import { type ReactNode } from 'react';
|
|
10
|
+
export declare function SyncControls(props: {
|
|
11
|
+
readonly running: boolean;
|
|
12
|
+
readonly detail: string;
|
|
13
|
+
readonly error: string;
|
|
14
|
+
readonly onCaliber: () => void;
|
|
15
|
+
readonly onSources: () => void;
|
|
16
|
+
readonly onRefresh: () => void;
|
|
17
|
+
}): ReactNode;
|
|
18
|
+
//# sourceMappingURL=SyncControls.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 资源增长趋势(echarts 版)——从手写 SVG 迁移,对齐费用页图表观感
|
|
3
|
+
* (tooltip/网格线/主题色同源;echarts 已在 bundle,不增重)。
|
|
4
|
+
* 两系列:资源总数(accent 蓝 + 浅面积)、已纳管(绿,对齐费用页第二系列)。
|
|
5
|
+
* hook 复用 CostPage/useEcharts(通用:echarts + 主题色读取,无费用业务耦合)。
|
|
6
|
+
*
|
|
7
|
+
* @module .../ResourcePage/components/TrendChart
|
|
8
|
+
*/
|
|
9
|
+
import { type ReactNode } from 'react';
|
|
10
|
+
import type { TrendPoint } from '../summary-api.ts';
|
|
11
|
+
export declare function TrendChart({ points }: {
|
|
12
|
+
readonly points: readonly TrendPoint[];
|
|
13
|
+
}): ReactNode;
|
|
14
|
+
//# sourceMappingURL=TrendChart.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** grip 的四件套事件(props 直接展开到 grip 元素上)。 */
|
|
2
|
+
export interface ColumnGripProps {
|
|
3
|
+
readonly onPointerDown: (e: React.PointerEvent) => void;
|
|
4
|
+
readonly onPointerMove: (e: React.PointerEvent) => void;
|
|
5
|
+
readonly onPointerUp: (e: React.PointerEvent) => void;
|
|
6
|
+
readonly onDoubleClick: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function useColumnWidths(storageKey: string, defaults: readonly number[]): {
|
|
9
|
+
readonly widths: readonly number[];
|
|
10
|
+
readonly gripProps: (index: number) => ColumnGripProps;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=useColumnWidths.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** 整数千分位(12,847)。 */
|
|
2
|
+
export declare function fmtInt(n: number): string;
|
|
3
|
+
/** ISO 时间 → YYYY-MM-DD;空串 '—',不可解析原样返回。 */
|
|
4
|
+
export declare function fmtDate(iso: string): string;
|
|
5
|
+
/** ISO 时间 → 本地 YYYY-MM-DD HH:mm:ss;空值 '—',不可解析原样返回。 */
|
|
6
|
+
export declare function fmtTime(iso: string | null | undefined): string;
|
|
7
|
+
/** 服务展示名:中文名(含缩写,如"弹性云服务器 ECS");未收录显示原始码。 */
|
|
8
|
+
export declare function serviceLabel(provider: string): string;
|
|
9
|
+
//# sourceMappingURL=format.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 资源管理页(M1 汇总 + M2 明细整合)——数据读 SQLite,页面不直连云。
|
|
3
|
+
*
|
|
4
|
+
* - 组织聚合:指标卡 + 按账号排名 + 趋势;点击排名柱 → 切到该账号口径
|
|
5
|
+
* - 子账号口径:指标卡 + 资源明细列表(多条件筛选,服务端分页)
|
|
6
|
+
* (产品调整 2026-11-11:删 6 张服务明细卡与底部维度面板/趋势图,
|
|
7
|
+
* 明细列表由下钻子页改为直接内嵌;服务/类型/企业项目筛选支持多选)
|
|
8
|
+
* - 子账号登录(doc/SUBACCOUNT-LOGIN-RESOURCE-PAGE.md):服务端运行时探测
|
|
9
|
+
* 下发 scope_default,非组织视角则锁定本账号口径(隐藏组织聚合入口;
|
|
10
|
+
* 登录身份由宿主账号 chip 展示,页面不重复)
|
|
11
|
+
*
|
|
12
|
+
* 页面不直连云:读 /api/wb/resource-summary|accounts|trend|resource-list(SQLite),
|
|
13
|
+
* 「刷新」触发 host 采集编排(resource-sync,SSE 广播阶段)。
|
|
14
|
+
*
|
|
15
|
+
* @module @huaweidevtools/landingzone-workbench/client/pages/ResourcePage
|
|
16
|
+
*/
|
|
17
|
+
import { type ReactNode } from 'react';
|
|
18
|
+
/** 资源管理页主组件(汇总首页)。 */
|
|
19
|
+
export declare function ResourcePage(): ReactNode;
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 资源管理页(M1 改版)API 封装——页面只读 SQLite,不直连云。
|
|
3
|
+
*
|
|
4
|
+
* 类型与 host 半(db.ts / index.ts 路由)一一对应;错误经 fetchJson 统一抛出。
|
|
5
|
+
*
|
|
6
|
+
* @module @huaweidevtools/landingzone-workbench/client/pages/ResourcePage/summary-api
|
|
7
|
+
*/
|
|
8
|
+
/** sync_runs 的一行(最新 run 状态)。 */
|
|
9
|
+
export interface SyncRun {
|
|
10
|
+
readonly run_id: number;
|
|
11
|
+
readonly status: 'running' | 'ok' | 'error';
|
|
12
|
+
readonly trigger: string;
|
|
13
|
+
readonly started_at: string;
|
|
14
|
+
readonly finished_at: string | null;
|
|
15
|
+
readonly error: string | null;
|
|
16
|
+
readonly stats: Record<string, unknown>;
|
|
17
|
+
}
|
|
18
|
+
/** GET /api/wb/resource-summary 响应:汇总三指标 + 最近同步信息。 */
|
|
19
|
+
export interface SummaryResp {
|
|
20
|
+
readonly has_data: boolean;
|
|
21
|
+
readonly latest_run: SyncRun | null;
|
|
22
|
+
/** 数据截至:最近一次成功同步的完成时间;null=从未同步。 */
|
|
23
|
+
readonly data_as_of?: string | null;
|
|
24
|
+
/** 查看范围:'*' = 组织聚合;否则为账号 domain_id。 */
|
|
25
|
+
readonly account_id: string;
|
|
26
|
+
/** 范围为具体账号时的账号名。 */
|
|
27
|
+
readonly account_name: string;
|
|
28
|
+
readonly total: number;
|
|
29
|
+
readonly managed: number;
|
|
30
|
+
readonly unmanaged: number;
|
|
31
|
+
readonly coverage: number | null;
|
|
32
|
+
readonly account_count: number;
|
|
33
|
+
/** 归集率分母=参与归属口径的资源数(非豁免服务;ep 缺失按 '0' 未归集计)。 */
|
|
34
|
+
readonly ep_total: number;
|
|
35
|
+
readonly ep_attributed: number;
|
|
36
|
+
readonly ep_rate: number | null;
|
|
37
|
+
readonly delta_total: number | null;
|
|
38
|
+
readonly snap_date: string | null;
|
|
39
|
+
}
|
|
40
|
+
/** GET /api/wb/resource-accounts 的一行。 */
|
|
41
|
+
export interface AccountRow {
|
|
42
|
+
readonly account_id: string;
|
|
43
|
+
readonly account_name: string;
|
|
44
|
+
readonly total: number;
|
|
45
|
+
readonly managed: number;
|
|
46
|
+
readonly coverage: number | null;
|
|
47
|
+
readonly ep_rate: number | null;
|
|
48
|
+
/** 出现在最近一次成功同步 = 已开通配置审计(可选);false = 灰显「未开通」。 */
|
|
49
|
+
readonly config_enabled: boolean;
|
|
50
|
+
}
|
|
51
|
+
export interface AccountsResp {
|
|
52
|
+
readonly metric: string;
|
|
53
|
+
readonly order: string;
|
|
54
|
+
readonly accounts: readonly AccountRow[];
|
|
55
|
+
/** 数据截至:最近一次成功同步的完成时间;null=从未同步。 */
|
|
56
|
+
readonly data_as_of?: string | null;
|
|
57
|
+
/** 组织接口不可用时的降级说明(此时名单仅含本地覆盖账号)。 */
|
|
58
|
+
readonly organization_unavailable?: string;
|
|
59
|
+
/** 页面默认视角:'*' = 组织聚合;账号 id = 锁定该账号(子账号登录)。 */
|
|
60
|
+
readonly scope_default?: string;
|
|
61
|
+
}
|
|
62
|
+
/** GET /api/wb/resource-trend 的一个快照点。 */
|
|
63
|
+
export interface TrendPoint {
|
|
64
|
+
readonly snap_date: string;
|
|
65
|
+
readonly total: number;
|
|
66
|
+
readonly managed: number;
|
|
67
|
+
readonly ep_rate: number | null;
|
|
68
|
+
}
|
|
69
|
+
export interface TrendResp {
|
|
70
|
+
readonly days: number;
|
|
71
|
+
readonly account_id: string;
|
|
72
|
+
readonly points: readonly TrendPoint[];
|
|
73
|
+
/** 数据截至:最近一次成功同步的完成时间(2026-11-21 治理总览「数据截至」用);null=从未同步。 */
|
|
74
|
+
readonly data_as_of?: string | null;
|
|
75
|
+
}
|
|
76
|
+
/** GET /api/wb/resource-sync 响应。 */
|
|
77
|
+
export interface SyncStatusResp {
|
|
78
|
+
readonly running: boolean;
|
|
79
|
+
readonly run: SyncRun | null;
|
|
80
|
+
}
|
|
81
|
+
/** run.stats 里的逐服务采集统计(channel=per-service 的成功同步轮才带;
|
|
82
|
+
* 数据源弹层用它展示"哪些服务缺查看权限"。
|
|
83
|
+
* perm_codes 为旧轮次缺省(功能上线前的 stats 无此字段)。 */
|
|
84
|
+
export interface PerServiceStats {
|
|
85
|
+
readonly collected: readonly {
|
|
86
|
+
readonly type: string;
|
|
87
|
+
readonly count: number;
|
|
88
|
+
}[];
|
|
89
|
+
readonly failed: readonly {
|
|
90
|
+
readonly type: string;
|
|
91
|
+
readonly regions: number;
|
|
92
|
+
readonly error: string;
|
|
93
|
+
}[];
|
|
94
|
+
/** 本轮 403 提炼的权限码(去重排序);旧轮次数据缺省。 */
|
|
95
|
+
readonly perm_codes?: readonly string[];
|
|
96
|
+
}
|
|
97
|
+
/** 从最近一次同步 run 里解析逐服务采集统计;非逐服务轮(主账号聚合/无数据)返回 undefined。 */
|
|
98
|
+
export declare function parsePerServiceStats(run: SyncRun | null): PerServiceStats | undefined;
|
|
99
|
+
/** 汇总三指标('*' = 组织聚合;传账号 id 按该账号口径)。 */
|
|
100
|
+
export declare function fetchSummary(scope?: string): Promise<SummaryResp>;
|
|
101
|
+
/** 按账号合计(排名柱状图)。 */
|
|
102
|
+
export declare function fetchAccounts(): Promise<AccountsResp>;
|
|
103
|
+
/** 近 30 天趋势(指定账号或 '*' 汇总)。 */
|
|
104
|
+
export declare function fetchTrend(scope?: string): Promise<TrendResp>;
|
|
105
|
+
/** 最新同步状态(轮询用)。 */
|
|
106
|
+
export declare function fetchSyncStatus(): Promise<SyncStatusResp>;
|
|
107
|
+
/** 触发同步(探测优先:unchanged=云上无变化未启动全量;started=全量已在后台跑;进度走 SSE/轮询)。 */
|
|
108
|
+
export declare function triggerSync(): Promise<{
|
|
109
|
+
started: boolean;
|
|
110
|
+
unchanged?: boolean;
|
|
111
|
+
}>;
|
|
112
|
+
/** resources 表一行(M2 明细列)。 */
|
|
113
|
+
export interface ResourceListRow {
|
|
114
|
+
readonly account_id: string;
|
|
115
|
+
readonly resource_id: string;
|
|
116
|
+
readonly provider: string;
|
|
117
|
+
readonly type: string;
|
|
118
|
+
readonly region_id: string;
|
|
119
|
+
readonly name: string;
|
|
120
|
+
readonly ep_id: string;
|
|
121
|
+
/** 企业项目名(ep_projects join;缺失 = 空串,显示时回退 id)。 */
|
|
122
|
+
readonly ep_name: string;
|
|
123
|
+
readonly created: string;
|
|
124
|
+
readonly managed: boolean;
|
|
125
|
+
}
|
|
126
|
+
/** GET /api/wb/resource-list 响应(服务端分页 + 筛选取值)。 */
|
|
127
|
+
export interface ResourceListResp {
|
|
128
|
+
readonly total: number;
|
|
129
|
+
readonly page: number;
|
|
130
|
+
readonly page_size: number;
|
|
131
|
+
readonly rows: readonly ResourceListRow[];
|
|
132
|
+
readonly facets: {
|
|
133
|
+
readonly providers: readonly string[];
|
|
134
|
+
readonly types: readonly string[];
|
|
135
|
+
readonly regions: readonly string[];
|
|
136
|
+
readonly eps: readonly string[];
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
/** 明细列表查询参数(空值字段不发送;多选值同名参数重复携带)。 */
|
|
140
|
+
export interface ResourceListQuery {
|
|
141
|
+
readonly account_id: string;
|
|
142
|
+
/** true = 只看关注服务(与汇总口径一致);默认全量。 */
|
|
143
|
+
readonly focused?: boolean;
|
|
144
|
+
/** 多选:服务 provider。 */
|
|
145
|
+
readonly providers?: readonly string[];
|
|
146
|
+
/** 多选:资源类型。 */
|
|
147
|
+
readonly types?: readonly string[];
|
|
148
|
+
/** 多选:区域。 */
|
|
149
|
+
readonly regions?: readonly string[];
|
|
150
|
+
/** '1' 已纳管 / '0' 未纳管 / '' 全部。 */
|
|
151
|
+
readonly managed?: string;
|
|
152
|
+
/** 多选企业项目:'none' = 未归集,其余为项目 id。 */
|
|
153
|
+
readonly eps?: readonly string[];
|
|
154
|
+
readonly q?: string;
|
|
155
|
+
readonly page: number;
|
|
156
|
+
/** 每页条数(服务端 1~200,缺省 50)。 */
|
|
157
|
+
readonly page_size?: number;
|
|
158
|
+
}
|
|
159
|
+
/** 子账号资源明细(服务端分页,页大小缺省 50)。 */
|
|
160
|
+
export declare function fetchResourceList(p: ResourceListQuery): Promise<ResourceListResp>;
|
|
161
|
+
export interface MetricConfig {
|
|
162
|
+
readonly focused: readonly string[];
|
|
163
|
+
readonly known: readonly string[];
|
|
164
|
+
/** 排名图目标参考线(1~100;服务端缺省回 80/60)。 */
|
|
165
|
+
readonly coverage_target: number;
|
|
166
|
+
readonly ep_target: number;
|
|
167
|
+
}
|
|
168
|
+
export declare function fetchMetricConfig(): Promise<MetricConfig>;
|
|
169
|
+
export declare function setFocusedProviders(providers: readonly string[]): Promise<{
|
|
170
|
+
ok: boolean;
|
|
171
|
+
focused: readonly string[];
|
|
172
|
+
}>;
|
|
173
|
+
/** 保存指标目标线(排名图参考线);coverage/ep 须为 1~100 整数。 */
|
|
174
|
+
export declare function setMetricTargets(coverage: number, ep: number): Promise<{
|
|
175
|
+
ok: boolean;
|
|
176
|
+
coverage_target: number;
|
|
177
|
+
ep_target: number;
|
|
178
|
+
}>;
|
|
179
|
+
/**
|
|
180
|
+
* 订阅本插件自己的 /api/wb/events 总线,过滤 resource-sync 事件。
|
|
181
|
+
* (SetupPage 的 subscribeSse 订阅的是 landing-zone 的流,事件不同;
|
|
182
|
+
* 这里按同一模式单独建一条 EventSource,挂载期唯一。)
|
|
183
|
+
*/
|
|
184
|
+
export declare function subscribeSyncEvents(onEvent: (phase: string, detail?: string) => void): () => void;
|
|
185
|
+
export interface TfSource {
|
|
186
|
+
readonly id: number;
|
|
187
|
+
readonly kind: 'local' | 'obs';
|
|
188
|
+
readonly path: string;
|
|
189
|
+
readonly account_id: string;
|
|
190
|
+
readonly label: string;
|
|
191
|
+
readonly enabled: boolean;
|
|
192
|
+
}
|
|
193
|
+
export declare function fetchTfSources(): Promise<{
|
|
194
|
+
sources: readonly TfSource[];
|
|
195
|
+
}>;
|
|
196
|
+
export declare function addTfSource(kind: 'local' | 'obs', path: string, accountId: string, label: string): Promise<{
|
|
197
|
+
ok: boolean;
|
|
198
|
+
}>;
|
|
199
|
+
export declare function deleteTfSource(id: number): Promise<{
|
|
200
|
+
ok: boolean;
|
|
201
|
+
}>;
|
|
202
|
+
export declare function toggleTfSource(id: number, enabled: boolean): Promise<{
|
|
203
|
+
ok: boolean;
|
|
204
|
+
}>;
|
|
205
|
+
//# sourceMappingURL=summary-api.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ask 面板 — 检测 DSH pending question,渲染单选/多选选择面板。
|
|
3
|
+
*
|
|
4
|
+
* DSH 的 ask_user_question 工具触发后,host 创建 PendingQuestion,
|
|
5
|
+
* uiSession.sessionStatus 里会出现 pendingInteraction。
|
|
6
|
+
* 本组件检测到后渲染选择面板,用户选择后调 pending.answer() 提交。
|
|
7
|
+
*
|
|
8
|
+
* question 结构(从 PendingQuestion.questions):
|
|
9
|
+
* { id, question, header?, options?: [{label}], multiSelect?, recommended? }
|
|
10
|
+
*
|
|
11
|
+
* answer 格式(提交给 pending.answer):
|
|
12
|
+
* { answers: [{ id, selected: [label], custom?: string }] }
|
|
13
|
+
*
|
|
14
|
+
* @module @huaweidevtools/landingzone-workbench/client/AskPanel
|
|
15
|
+
*/
|
|
16
|
+
import { type ReactNode } from 'react';
|
|
17
|
+
/** Ask 面板:检测 pending question,渲染选择 UI。 */
|
|
18
|
+
export declare function AskPanel(props: {
|
|
19
|
+
sessionId: string;
|
|
20
|
+
}): ReactNode;
|
|
21
|
+
//# sourceMappingURL=AskPanel.d.ts.map
|