@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,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 柱状图的「预测折回」——把末尾的推演点折回当周/当月/当年那根柱,纯函数、便于回归。
|
|
3
|
+
*
|
|
4
|
+
* 为什么折回:柱状图上单独给推演值占一列("2026预测"),会被读成"又多了一年/一个月",
|
|
5
|
+
* 而且和实际柱并排时看不出两者是同一个周期(实测 2026-11-23 用户要求把虚线框
|
|
6
|
+
* 画到"至今"那根柱上;2026-11-24 周视图也按同一逻辑收进了当周柱)。
|
|
7
|
+
* 折回后仍是同一根柱:实心到"至今",上面套一个虚线框表示按当前速度会到的位置。
|
|
8
|
+
*
|
|
9
|
+
* 为什么在客户端折、不改后端形状:
|
|
10
|
+
* · 末尾的 `forecast` 点是月/周/年共用的约定,周视图的折线靠它画推演区间;
|
|
11
|
+
* 年/月单独改形状,会让同一个字段在不同粒度下含义不一致。
|
|
12
|
+
* · 页面 bundle 与宿主进程各自更新,客户端折回对"新旧宿主"都成立。
|
|
13
|
+
*
|
|
14
|
+
* 规矩:只折**末尾**的推演点,且前面必须还有实际点;推演点自己缺数(missing)
|
|
15
|
+
* 时不折 —— 宁可保留原样,也不把"没有数"画成柱子。
|
|
16
|
+
*
|
|
17
|
+
* @module @huaweidevtools/landingzone-workbench/client/pages/CostPage/trend-fold
|
|
18
|
+
*/
|
|
19
|
+
import type { TrendPoint } from '../../../cost/types.ts';
|
|
20
|
+
export interface FoldedBarForecast {
|
|
21
|
+
/** 折回之后要展示的柱子:末尾是推演点时,数量比原始点少 1。 */
|
|
22
|
+
readonly points: readonly TrendPoint[];
|
|
23
|
+
/** 被折进去的推演值(画在同一根柱上的虚线框);没有推演点时为 null。 */
|
|
24
|
+
readonly forecast: number | null;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* 折回末尾的推演点。
|
|
28
|
+
*
|
|
29
|
+
* @param points 趋势点(原始顺序,末尾可能是 `forecast: true` 的推演点)。
|
|
30
|
+
*/
|
|
31
|
+
export declare function foldForecastBar(points: readonly TrendPoint[]): FoldedBarForecast;
|
|
32
|
+
//# sourceMappingURL=trend-fold.d.ts.map
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { EChartsCoreOption } from 'echarts/core';
|
|
2
|
+
/** 图表系列配色(服务构成与分摊环形图共用,避免两处色板漂移)。 */
|
|
3
|
+
export declare const SERIES_COLORS: string[];
|
|
4
|
+
/**
|
|
5
|
+
* 按序号取色(循环)。
|
|
6
|
+
*
|
|
7
|
+
* 单独一个函数的理由:`noUncheckedIndexedAccess` 下 `SERIES_COLORS[i % n]` 的类型是
|
|
8
|
+
* `string | undefined`,散在各处写非空断言迟早漏一个;颜色缺失只会让图难看,不该让渲染抛错。
|
|
9
|
+
*/
|
|
10
|
+
export declare function seriesColor(index: number): string;
|
|
11
|
+
/** 图表取色结果(全部是解析后的颜色串:canvas 消费不了 var())。 */
|
|
12
|
+
export interface ChartPalette {
|
|
13
|
+
readonly text: string;
|
|
14
|
+
readonly sub: string;
|
|
15
|
+
readonly grid: string;
|
|
16
|
+
readonly blue: string;
|
|
17
|
+
readonly green: string;
|
|
18
|
+
readonly well: string;
|
|
19
|
+
readonly accentFg: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* 主题里的文字/网格/强调色,跟随 DSH 的亮暗主题。
|
|
23
|
+
*
|
|
24
|
+
* hook 而非普通函数:canvas 侧颜色是解析后的颜色串,吃不到 CSS 变量,必须
|
|
25
|
+
* 在主题翻转时重读 body 令牌。内部订阅 useDarkTheme 并以它为重算信号,
|
|
26
|
+
* 返回对象引用在主题不变期间稳定 —— 调用方把它收进 useMemo 依赖即可让
|
|
27
|
+
* option 随主题重画,依赖关系是真实的数据流,不怕被 lint 清理。
|
|
28
|
+
*
|
|
29
|
+
* 全部从 `document.body` 读取:官方 --dsw-alias-* 与工作台 --wb-* 令牌层
|
|
30
|
+
* (tokens.module.css)都定义在 body 上,任何渲染时刻读到的都是当前生效
|
|
31
|
+
* 主题的值。
|
|
32
|
+
*/
|
|
33
|
+
export declare function useChartPalette(): ChartPalette;
|
|
34
|
+
/** 挂钩返回值:把 `ref` 挂到容器上,`host` 是当前容器(自检时用)。 */
|
|
35
|
+
export interface EchartsHandle {
|
|
36
|
+
readonly ref: (node: HTMLDivElement | null) => void;
|
|
37
|
+
readonly host: HTMLDivElement | null;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* 把 option 挂到容器上。
|
|
41
|
+
*
|
|
42
|
+
* @param option 图表配置;变化时以 notMerge 全量替换(避免残留旧系列)。
|
|
43
|
+
* @returns ref 回调 + 当前容器节点。
|
|
44
|
+
*/
|
|
45
|
+
export declare function useEcharts(option: EChartsCoreOption): EchartsHandle;
|
|
46
|
+
/** 深底气泡的正文行:label 弱化小字,main 加粗主文。 */
|
|
47
|
+
export interface TooltipLine {
|
|
48
|
+
readonly label?: string;
|
|
49
|
+
readonly main: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* 深底 tooltip 的 option 片段(与费用页 TrendChart 同款视觉)。
|
|
53
|
+
*
|
|
54
|
+
* @param trigger echarts 触发方式(axis/item)。
|
|
55
|
+
* @param palette 图表取色(气泡底色用 palette.text——深浅主题下都为深色)。
|
|
56
|
+
* @param format params → 正文行:返回多行时气泡从上往下排;返回 null 跳过。
|
|
57
|
+
*
|
|
58
|
+
* 用法:`tooltip: darkTooltip('axis', palette, (params) => [...])`——
|
|
59
|
+
* 抢占整个 tooltip 键,调用方不要再自己写 backgroundColor 等壳样式。
|
|
60
|
+
*/
|
|
61
|
+
export declare function darkTooltip(trigger: 'axis' | 'item', palette: ChartPalette, format: (params: unknown) => readonly (TooltipLine | null)[] | null): EChartsTooltipOption;
|
|
62
|
+
/** tooltip option 的最小形状(echarts 类型的宽松别名,够本工具与页面用)。 */
|
|
63
|
+
export type EChartsTooltipOption = {
|
|
64
|
+
readonly trigger: string;
|
|
65
|
+
readonly backgroundColor: string;
|
|
66
|
+
readonly borderWidth: number;
|
|
67
|
+
readonly padding: number;
|
|
68
|
+
readonly formatter: (params: unknown) => string;
|
|
69
|
+
};
|
|
70
|
+
//# sourceMappingURL=useEcharts.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 模块 B2 — 账号统计卡片(核心账号下方)。
|
|
3
|
+
*
|
|
4
|
+
* 三格口径(2026-11-10 按用户确认):
|
|
5
|
+
* · 账号数量 = 生效账号(active,含管理账号 1);副行拆"管理 1 · 成员 N"
|
|
6
|
+
* · 处理中 = 名册里流程未完成的账号(关闭中 + 创建中);副行标明构成
|
|
7
|
+
* · 已关闭 = 名册里 suspended 状态的账号 —— 华为云名册仍可见可数,
|
|
8
|
+
* 与管理台一致;关闭后资源与费用仍留存在云端
|
|
9
|
+
*
|
|
10
|
+
* 数字全部来自聚合层的 counts 计表(原始 ListAccounts 状态直统),
|
|
11
|
+
* 不再从核心/成员两个列表反推,也不再依赖本地在册对比。
|
|
12
|
+
*
|
|
13
|
+
* @module .../OrgStructurePage/AccountStatsCard
|
|
14
|
+
*/
|
|
15
|
+
import { type ReactNode } from 'react';
|
|
16
|
+
import type { OrgStructureCounts } from '../../../org-types.ts';
|
|
17
|
+
export declare function AccountStatsCard(props: {
|
|
18
|
+
/** 名册状态计表(聚合层权威输出)。 */
|
|
19
|
+
readonly counts: OrgStructureCounts | undefined;
|
|
20
|
+
readonly loading: boolean;
|
|
21
|
+
}): ReactNode;
|
|
22
|
+
//# sourceMappingURL=AccountStatsCard.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 模块 B — 核心账号卡片(上右,40% 宽)。
|
|
3
|
+
*
|
|
4
|
+
* "核心账号" = 管理账号 + Core 治理账号 + 审计日志账号 + 委托管理员账号。
|
|
5
|
+
* 卡片网格铺排(40% 宽下天然 1~2 列);每张卡片:角色 tag + 账号名 +
|
|
6
|
+
* 账号 ID(点击复制)+ 状态圆点/加入时间;规划中未建的账号带灰 tag。
|
|
7
|
+
* 头部统计条:账号总数 / 成员账号数 / OU 数。
|
|
8
|
+
*
|
|
9
|
+
* @module @huaweidevtools/landingzone-workbench/client/OrgStructurePage/CoreAccountsCard
|
|
10
|
+
*/
|
|
11
|
+
import { type ReactNode } from 'react';
|
|
12
|
+
import { type OrgAccountView } from './org-api.ts';
|
|
13
|
+
/** 核心账号卡片。 */
|
|
14
|
+
export declare function CoreAccountsCard(props: {
|
|
15
|
+
readonly accounts: readonly OrgAccountView[];
|
|
16
|
+
readonly loading: boolean;
|
|
17
|
+
}): ReactNode;
|
|
18
|
+
//# sourceMappingURL=CoreAccountsCard.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 模块 C1 — 添加账号对话框(创建资源账号,v2)。
|
|
3
|
+
*
|
|
4
|
+
* POST /v2/organizations/accounts:无需邮箱手机,生成的账号自动成为组织成员,
|
|
5
|
+
* 组织云服务会在新账号里建好帐号访问委托 —— 默认 OrganizationAccountAccessAgency
|
|
6
|
+
* (可改)。受理返回 202 + create_account_status:in_progress,列表刷新后新账号
|
|
7
|
+
* 以「处理中」状态出现(统计卡"处理中"+1),创建完成自动转正常。
|
|
8
|
+
*
|
|
9
|
+
* 账号命名规范(内部账号管理):
|
|
10
|
+
* · 生态租户账号前缀 es_ —— 本场景(Landing Zone 治理/资源账号)推荐且仅允许此项;
|
|
11
|
+
* · 业务租户账号前缀 bs_ —— 不适用于本入口,不提供。
|
|
12
|
+
* 前缀由表单固定 es_,用户只填后半段;整名 = es_ + 后半段,服务端再校验一次。
|
|
13
|
+
*
|
|
14
|
+
* 规矩:
|
|
15
|
+
* · 按钮不做只读前置禁用:执行报错(403/权限类)时在错误信息下追加
|
|
16
|
+
* "切换到读写后重试"的提示,失败原话始终如实显示;
|
|
17
|
+
* · 用户可见正文不出现 markdown 记号。
|
|
18
|
+
*
|
|
19
|
+
* @module .../OrgStructurePage/CreateAccountDialog
|
|
20
|
+
*/
|
|
21
|
+
import { type ReactNode } from 'react';
|
|
22
|
+
export declare function CreateAccountDialog(props: {
|
|
23
|
+
readonly open: boolean;
|
|
24
|
+
readonly onClose: () => void;
|
|
25
|
+
/** 受理成功后回调(页面刷新列表与统计)。 */
|
|
26
|
+
readonly onCreated: () => void;
|
|
27
|
+
}): ReactNode;
|
|
28
|
+
//# sourceMappingURL=CreateAccountDialog.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 「管理用户」对话框 —— 查看并管理成员账号的 IAM 用户。
|
|
3
|
+
*
|
|
4
|
+
* 数据链路:主账号凭据 assume 该成员账号的 OrganizationAccountAccessAgency
|
|
5
|
+
* 委托(Organizations 为组织内创建的账号自动建立) → 临时凭据查 V5 ListUsers
|
|
6
|
+
* (含创建时间)。
|
|
7
|
+
* 列表字段:用户名 / 描述 / 状态 / 创建时间 / 操作(删除)。
|
|
8
|
+
*
|
|
9
|
+
* 删除是破坏性操作:行内「删除」→ 二次确认弹框(展示用户名与不可恢复警示) →
|
|
10
|
+
* 确认后才调用 DELETE。账号根用户(is_root_user)展示但不给删除;失败在确认框
|
|
11
|
+
* 内就地显示人话原因(委托缺用户管理写权限时的指引与查询侧同口径)。
|
|
12
|
+
*
|
|
13
|
+
* 添加用户(2026-11-20):头栏「添加用户」→ 录入表单弹框(用户名必填/描述可选,
|
|
14
|
+
* 裸创建不带密码——凭据后续由账号管理员在 IAM 配置)→ 确认创建并刷新列表。
|
|
15
|
+
*
|
|
16
|
+
* @module .../OrgStructurePage/ManageUsersDialog
|
|
17
|
+
*/
|
|
18
|
+
import { type ReactNode } from 'react';
|
|
19
|
+
export declare function ManageUsersDialog(props: {
|
|
20
|
+
readonly open: boolean;
|
|
21
|
+
/** 目标成员账号(名称用于标题;id 用于查询)。 */
|
|
22
|
+
readonly account: {
|
|
23
|
+
readonly id: string;
|
|
24
|
+
readonly name: string;
|
|
25
|
+
};
|
|
26
|
+
readonly onClose: () => void;
|
|
27
|
+
}): ReactNode;
|
|
28
|
+
//# sourceMappingURL=ManageUsersDialog.d.ts.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 模块 C — 成员账号列表(下层,占满剩余高度)。
|
|
3
|
+
*
|
|
4
|
+
* 字段:账号名称(含 ID 副行 + 角色标签) | 所属OU(面包屑) | 时间(加入组织时间) | 操作。
|
|
5
|
+
* 列表含管理账号以外的【全部】账号;治理类账号(Core 治理/审计日志/委托管理员)
|
|
6
|
+
* 带角色标签 —— 否则按 OU 过滤会漏掉该 OU 下的治理账号(实测反馈)。
|
|
7
|
+
* 工具条:树形 OU 下拉(自绘,缩进+展开折叠,与组织树联动) + 搜索 + 计数 + 刷新。
|
|
8
|
+
* 操作列:「详情」= 行内展开明细;「移动OU」预留(置灰,待接写通道)。
|
|
9
|
+
*
|
|
10
|
+
* @module @huaweidevtools/landingzone-workbench/client/OrgStructurePage/MemberAccountsTable
|
|
11
|
+
*/
|
|
12
|
+
import { type ReactNode } from 'react';
|
|
13
|
+
import { type MemberAccountView, type OrgTreeNode } from './org-api.ts';
|
|
14
|
+
/** 成员账号表格卡片。 */
|
|
15
|
+
export declare function MemberAccountsTable(props: {
|
|
16
|
+
readonly members: readonly MemberAccountView[];
|
|
17
|
+
readonly totalCount: number;
|
|
18
|
+
/** 组织树(树形 OU 下拉的数据源)。 */
|
|
19
|
+
readonly tree: OrgTreeNode | undefined;
|
|
20
|
+
readonly selectedOuId: string | undefined;
|
|
21
|
+
readonly onSelectOu: (id: string | undefined) => void;
|
|
22
|
+
readonly searchText: string;
|
|
23
|
+
readonly onSearchText: (text: string) => void;
|
|
24
|
+
readonly loading: boolean;
|
|
25
|
+
readonly readOnly: boolean;
|
|
26
|
+
readonly onRefresh: () => void;
|
|
27
|
+
/** 打开「移动账号」对话框,入参为待移动账号;undefined = 不显示该按钮。 */
|
|
28
|
+
readonly onMoveAccount?: (member: MemberAccountView) => void;
|
|
29
|
+
/** 打开「管理用户」对话框,入参为目标账号;undefined = 不显示该按钮。 */
|
|
30
|
+
readonly onManageUsers?: (member: MemberAccountView) => void;
|
|
31
|
+
}): ReactNode;
|
|
32
|
+
//# sourceMappingURL=MemberAccountsTable.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 模块 C2 — 移动账号对话框(MoveAccount)。
|
|
3
|
+
*
|
|
4
|
+
* POST /v1/organizations/accounts/{account_id}/move:把账号从当前挂载位置
|
|
5
|
+
* (根或 OU)移到目标位置。华为云要求 source_parent_id 与当前挂载一致,
|
|
6
|
+
* 不一致 409 —— 源 id 由调用方从列表数据带进来,不重新猜。
|
|
7
|
+
*
|
|
8
|
+
* 表单 = 树形 OU 选择(与组织页 OU 下拉同款交互:缩进 + 展开/折叠 + 面板外点击
|
|
9
|
+
* 关闭),根(Root)与目标 OU 都可选;确认后调接口,成功回调让页面刷新落位。
|
|
10
|
+
*
|
|
11
|
+
* 规矩:
|
|
12
|
+
* · 按钮不做只读前置禁用:执行报错(403/权限类)时在错误信息下追加
|
|
13
|
+
* "切换读写后重试"的提示,失败原话始终如实显示;
|
|
14
|
+
* · 用户可见正文不出现 markdown 记号。
|
|
15
|
+
*
|
|
16
|
+
* @module .../OrgStructurePage/MoveAccountDialog
|
|
17
|
+
*/
|
|
18
|
+
import { type ReactNode } from 'react';
|
|
19
|
+
import { type MemberAccountView, type OrgTreeNode } from './org-api.ts';
|
|
20
|
+
export declare function MoveAccountDialog(props: {
|
|
21
|
+
readonly open: boolean;
|
|
22
|
+
readonly account: MemberAccountView | undefined;
|
|
23
|
+
readonly tree: OrgTreeNode | undefined;
|
|
24
|
+
/** 关闭。 */
|
|
25
|
+
readonly onClose: () => void;
|
|
26
|
+
/** 移动成功后回调(页面刷新列表)。 */
|
|
27
|
+
readonly onMoved: () => void;
|
|
28
|
+
}): ReactNode;
|
|
29
|
+
//# sourceMappingURL=MoveAccountDialog.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 组织架构口径抽屉 —— 与资源页 GlossaryDrawer 同一交互(右侧抽屉 + 遮罩),
|
|
3
|
+
* 样式复用 org.module.css 的同一套 drawer 样式;文案只讲组织树本页的口径。
|
|
4
|
+
* 规矩:用户可见正文不出现 markdown 记号(星号、反引号)。
|
|
5
|
+
*
|
|
6
|
+
* @module .../OrgStructurePage/OrgGlossaryDrawer
|
|
7
|
+
*/
|
|
8
|
+
import { type ReactNode } from 'react';
|
|
9
|
+
export declare function OrgGlossaryDrawer(props: {
|
|
10
|
+
readonly open: boolean;
|
|
11
|
+
readonly onClose: () => void;
|
|
12
|
+
}): ReactNode;
|
|
13
|
+
//# sourceMappingURL=OrgGlossaryDrawer.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 模块 A — 组织树卡片(上左,60% 宽,页面视觉主体)。
|
|
3
|
+
*
|
|
4
|
+
* 树体用 ECharts tree 系列渲染(2026-11-07):布局与连线交给布局引擎 ——
|
|
5
|
+
* LR 布局(root 在左向右展开)、曲线连接、支持拖拽/缩放(roam)。
|
|
6
|
+
* 中途试过 graph 显式分层(同层严格对齐),按用户要求改回 tree
|
|
7
|
+
* (tree 的"父节点=子节点中点"是标准组织树形态,层级从属感更强)。
|
|
8
|
+
*
|
|
9
|
+
* 节点视觉 = 等宽圆角芯片(2026-11-07):
|
|
10
|
+
* - 宽度 = 所有组织名中最长的估宽 + 内边距,文字居中;
|
|
11
|
+
* - 底色不透明(按钮背景同色),连线穿过芯片的部分被盖住;
|
|
12
|
+
* - 组织名在芯片内,账号数在芯片外右侧;选中 OU 蓝底白字。
|
|
13
|
+
*
|
|
14
|
+
* 交互:点 OU 节点 → 联动过滤下层成员表;点 root → 清除过滤看全部;
|
|
15
|
+
* 悬停高亮子树。账号不进树,具体账号去下层成员表看。
|
|
16
|
+
*
|
|
17
|
+
* @module @huaweidevtools/landingzone-workbench/client/OrgStructurePage/OrgTreeCard
|
|
18
|
+
*/
|
|
19
|
+
import { type ReactNode } from 'react';
|
|
20
|
+
import type { OrgTreeNode } from './org-api.ts';
|
|
21
|
+
/** 单个组织树卡片。 */
|
|
22
|
+
export declare function OrgTreeCard(props: {
|
|
23
|
+
readonly tree?: OrgTreeNode | undefined;
|
|
24
|
+
readonly ouCount: number;
|
|
25
|
+
readonly totalAccounts: number;
|
|
26
|
+
readonly memberCount: number;
|
|
27
|
+
readonly loading: boolean;
|
|
28
|
+
readonly selectedOuId: string | undefined;
|
|
29
|
+
readonly onSelect: (ouId: string | undefined) => void;
|
|
30
|
+
}): ReactNode;
|
|
31
|
+
//# sourceMappingURL=OrgTreeCard.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 组织架构页 — 三模块布局(设计见 doc/ORG-PAGE-DESIGN.md):
|
|
3
|
+
*
|
|
4
|
+
* ┌─ 上层(46% 高) ──────────────────────────────┐
|
|
5
|
+
* │ 卡片A 组织树(60%宽·视觉主体) │ 卡片B 核心账号 │
|
|
6
|
+
* ├─ 下层(flex:1) ──────────────────────────────┤
|
|
7
|
+
* │ 卡片C 成员账号列表(搜索/OU筛选/表格) │
|
|
8
|
+
* └─────────────────────────────────────────────┘
|
|
9
|
+
*
|
|
10
|
+
* 数据:GET /api/wb/org-structure(host 读凭据库 → 官方签名 → 直连 Organizations
|
|
11
|
+
* 只读接口聚合,内存缓存 5 分钟,?refresh=1 绕过)。取数用 useOrgResource
|
|
12
|
+
* (与费用页 useResource 同一模式,不轮询);SSE(/api/landing-zone/events)
|
|
13
|
+
* 在 landing_zone_* 执行后驱动刷新。能力缺失显示人话横幅,不抛红错。
|
|
14
|
+
* 联动:树上选中 OU → 成员表按其子树过滤(OU 下拉与树双向同步)。
|
|
15
|
+
*
|
|
16
|
+
* @module @huaweidevtools/landingzone-workbench/client/OrgStructurePage
|
|
17
|
+
*/
|
|
18
|
+
import { type ReactNode } from 'react';
|
|
19
|
+
/** 组织架构页主组件。 */
|
|
20
|
+
export declare function OrgStructurePage(): ReactNode;
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import type { AccountChurnView, ChurnEnvelope, MemberAccountView, OrgAccountRole, OrgAccountSource, OrgAccountStatus, OrgAccountView, OrgCapability, OrgEnvelope, OrgMeta, OrgStructurePayload, OrgTreeAccountLeaf, OrgTreeNode } from '../../../org-types.ts';
|
|
2
|
+
export type { AccountChurnView, ChurnEnvelope, MemberAccountView, OrgAccountRole, OrgAccountSource, OrgAccountStatus, OrgAccountView, OrgCapability, OrgEnvelope, OrgMeta, OrgStructurePayload, OrgTreeAccountLeaf, OrgTreeNode, };
|
|
3
|
+
/** 带 HTTP 状态的错误,message 可直接展示。 */
|
|
4
|
+
export declare class OrgApiError extends Error {
|
|
5
|
+
readonly status: number;
|
|
6
|
+
constructor(status: number, message: string);
|
|
7
|
+
}
|
|
8
|
+
/** 创建账号的受理状态(host 转发的 CreateAccountStatus)。 */
|
|
9
|
+
export interface CreateAccountStatusView {
|
|
10
|
+
readonly account_id?: string;
|
|
11
|
+
readonly account_name?: string;
|
|
12
|
+
readonly id?: string;
|
|
13
|
+
readonly state?: string;
|
|
14
|
+
readonly failure_reason?: string;
|
|
15
|
+
readonly created_at?: string;
|
|
16
|
+
}
|
|
17
|
+
/** 创建账号接口的响应。 */
|
|
18
|
+
export interface CreateAccountResp {
|
|
19
|
+
readonly ok?: boolean;
|
|
20
|
+
readonly status?: CreateAccountStatusView;
|
|
21
|
+
readonly error?: string;
|
|
22
|
+
readonly unavailable?: {
|
|
23
|
+
readonly message?: string;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export declare const orgApi: {
|
|
27
|
+
/** 组织结构聚合(`?refresh=1` 绕过 host 的 5 分钟内存缓存)。 */
|
|
28
|
+
structure: (refresh?: boolean) => Promise<OrgEnvelope>;
|
|
29
|
+
/** 账号在册对比(已删除账号数;同一套 5 分钟缓存)。 */
|
|
30
|
+
churn: (refresh?: boolean) => Promise<ChurnEnvelope>;
|
|
31
|
+
/** 添加账号(CreateResourceAccount v2;委托默认 OrganizationAccountAccessAgency)。 */
|
|
32
|
+
createAccount: (input: {
|
|
33
|
+
readonly name: string;
|
|
34
|
+
readonly description?: string;
|
|
35
|
+
readonly agency_name?: string;
|
|
36
|
+
}) => Promise<CreateAccountResp>;
|
|
37
|
+
/** 移动账号到目标 OU/根(source 与当前挂载一致,否则华为云 409)。 */
|
|
38
|
+
moveAccount: (input: {
|
|
39
|
+
readonly account_id: string;
|
|
40
|
+
readonly source_parent_id: string;
|
|
41
|
+
readonly destination_parent_id: string;
|
|
42
|
+
}) => Promise<CreateAccountResp>;
|
|
43
|
+
/**
|
|
44
|
+
* 账号的 IAM 用户列表(管理用户弹框):主账号 assume 该账号的
|
|
45
|
+
* OrganizationAccountAccessAgency 委托后查 V5 ListUsers(含创建时间)。
|
|
46
|
+
* 字段:用户名/描述/状态/创建时间。
|
|
47
|
+
*/
|
|
48
|
+
accountUsers: (accountId: string) => Promise<AccountUsersResp>;
|
|
49
|
+
/** 删除成员账号里的一个 IAM 用户(确认后调用;破坏性,不可恢复)。 */
|
|
50
|
+
deleteUser: (accountId: string, userId: string) => Promise<DeleteUserResp>;
|
|
51
|
+
/** 在成员账号里创建一个 IAM 用户(随机密码+强制改密;可选开启手机登录保护/加入admin组)。 */
|
|
52
|
+
createUser: (accountId: string, input: {
|
|
53
|
+
readonly name: string;
|
|
54
|
+
readonly description?: string;
|
|
55
|
+
/** 登录保护开启时必填:短信验证手机号(国家码 +86 自动携带)。 */
|
|
56
|
+
readonly phone?: string;
|
|
57
|
+
/** 勾选=开启手机验证登录保护(默认 true);不勾选时不采集手机号。 */
|
|
58
|
+
readonly login_protect_sms?: boolean;
|
|
59
|
+
readonly join_admin_group?: boolean;
|
|
60
|
+
}) => Promise<CreateUserResp>;
|
|
61
|
+
};
|
|
62
|
+
/** 手机绑定步骤结果。 */
|
|
63
|
+
export interface CreateUserStep {
|
|
64
|
+
readonly status: 'ok' | 'failed' | 'skipped' | 'missing';
|
|
65
|
+
readonly name?: string;
|
|
66
|
+
readonly message?: string;
|
|
67
|
+
}
|
|
68
|
+
/** 创建用户的响应。 */
|
|
69
|
+
export interface CreateUserResp {
|
|
70
|
+
readonly ok?: boolean;
|
|
71
|
+
readonly user?: {
|
|
72
|
+
readonly user_id?: string;
|
|
73
|
+
readonly user_name?: string;
|
|
74
|
+
};
|
|
75
|
+
/** 随机初始密码——仅创建成功且登录信息就绪时一次性返回;关闭回执后不再可见。 */
|
|
76
|
+
readonly initial_password?: string;
|
|
77
|
+
/** ok=登录信息已建;failed=用户已创建但密码未配(见 login_profile_message)。 */
|
|
78
|
+
readonly login_profile?: 'ok' | 'failed';
|
|
79
|
+
readonly login_profile_message?: string;
|
|
80
|
+
/** 手机绑定步骤。 */
|
|
81
|
+
readonly phone?: CreateUserStep;
|
|
82
|
+
/** 加入 admin 用户组步骤。 */
|
|
83
|
+
readonly group?: CreateUserStep;
|
|
84
|
+
readonly error?: string;
|
|
85
|
+
readonly unavailable?: {
|
|
86
|
+
readonly message?: string;
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
/** IAM 用户列表响应(数据或 unavailable 二选一)。 */
|
|
90
|
+
export interface AccountUsersResp {
|
|
91
|
+
readonly data?: readonly AccountUserRow[] | null;
|
|
92
|
+
readonly unavailable?: {
|
|
93
|
+
readonly message?: string;
|
|
94
|
+
};
|
|
95
|
+
readonly error?: string;
|
|
96
|
+
}
|
|
97
|
+
/** 用户列表一行。 */
|
|
98
|
+
export interface AccountUserRow {
|
|
99
|
+
readonly id: string;
|
|
100
|
+
readonly name: string;
|
|
101
|
+
readonly description: string;
|
|
102
|
+
readonly status: string;
|
|
103
|
+
/** 创建时间(UTC ISO);null=未知。 */
|
|
104
|
+
readonly created_at: string | null;
|
|
105
|
+
/** 账号根用户:展示但不给删除。 */
|
|
106
|
+
readonly is_root_user: boolean;
|
|
107
|
+
}
|
|
108
|
+
/** 删除用户的响应。 */
|
|
109
|
+
export interface DeleteUserResp {
|
|
110
|
+
readonly ok?: boolean;
|
|
111
|
+
readonly error?: string;
|
|
112
|
+
readonly unavailable?: {
|
|
113
|
+
readonly message?: string;
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
/** 一次取数的状态。 */
|
|
117
|
+
export interface OrgResource {
|
|
118
|
+
readonly data: OrgStructurePayload | undefined;
|
|
119
|
+
readonly meta: OrgMeta | undefined;
|
|
120
|
+
readonly capability: OrgCapability | undefined;
|
|
121
|
+
readonly error: string | undefined;
|
|
122
|
+
readonly loading: boolean;
|
|
123
|
+
/** 重新取数;`refresh` 为 true 时要求后端绕过缓存。 */
|
|
124
|
+
readonly reload: (refresh?: boolean) => void;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* 极简取数 hook。
|
|
128
|
+
*
|
|
129
|
+
* 刻意不做轮询:组织结构的变化频率是小时级(初始搭建执行后由 SSE 驱动刷新),
|
|
130
|
+
* 定时轮询只会白白打华为云接口。
|
|
131
|
+
*
|
|
132
|
+
* @param loader 取数函数。每次渲染新建,故意不进依赖 —— deps 才是真正的取数条件。
|
|
133
|
+
* @param deps 依赖变化时重取。
|
|
134
|
+
*/
|
|
135
|
+
export declare function useOrgResource(loader: (refresh: boolean) => Promise<OrgEnvelope>, deps: readonly unknown[]): OrgResource;
|
|
136
|
+
/** 在册对比(churn)的取数状态。与 useOrgResource 同一节奏,只是载荷不同。 */
|
|
137
|
+
export interface ChurnResource {
|
|
138
|
+
readonly data: AccountChurnView | undefined;
|
|
139
|
+
readonly error: string | undefined;
|
|
140
|
+
readonly loading: boolean;
|
|
141
|
+
readonly reload: (refresh?: boolean) => void;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* 在册对比取数 hook(账号统计卡的"已删除账号"数据源)。
|
|
145
|
+
*
|
|
146
|
+
* 与 useOrgResource 刻意分开而不是通用化:结构聚合是页面主数据,churn 是
|
|
147
|
+
* 附属统计 —— 分开取数互不阻塞,任一失败不拖垮另一张卡。
|
|
148
|
+
*/
|
|
149
|
+
export declare function useOrgChurn(): ChurnResource;
|
|
150
|
+
/** 订阅 landing-zone 的 SSE 事件流(landing_zone_* 执行后自动刷新)。 */ export declare function subscribeOrgRefresh(onRefresh: () => void): () => void;
|
|
151
|
+
/** ISO 时间 → 本地 `YYYY-MM-DD HH:mm:ss`;空/非法 → '—'。 */
|
|
152
|
+
export declare function formatTime(iso: string | undefined): string;
|
|
153
|
+
export interface OuOption {
|
|
154
|
+
readonly id: string;
|
|
155
|
+
/** 面包屑标签(如 `Applications / App-Dev`)。 */
|
|
156
|
+
readonly label: string;
|
|
157
|
+
}
|
|
158
|
+
/** 展平树里的所有 OU 节点(前序遍历,带面包屑标签),供计数/校验等平铺场景。 */
|
|
159
|
+
export declare function flattenOus(tree: OrgTreeNode | undefined): OuOption[];
|
|
160
|
+
/** 收集目标节点及其全部子孙节点的 id 集合(选中父 OU 时过滤含子孙)。 */
|
|
161
|
+
export declare function collectSubtreeIds(tree: OrgTreeNode | undefined, id: string): Set<string>;
|
|
162
|
+
/** 树中 OU 节点数。 */
|
|
163
|
+
export declare function countOus(tree: OrgTreeNode | undefined): number;
|
|
164
|
+
/** 树中账号总数(按 accountIds 累加)。 */
|
|
165
|
+
export declare function countAccounts(tree: OrgTreeNode | undefined): number;
|
|
166
|
+
//# sourceMappingURL=org-api.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 锚点行 —— 一域一数,总览上仅有的四个"健康度"数字。
|
|
3
|
+
*
|
|
4
|
+
* 少而精的纪律:每个域只留一个主数 + 一行口径副标;趋势、构成、明细一律回子页。
|
|
5
|
+
* 整卡可点击跳转子页(onNavigate),hover 反馈跟随外壳交互 token。
|
|
6
|
+
*
|
|
7
|
+
* @module @huaweiclouddevtools/landingzone-workbench/client/pages/OverviewPage/AnchorRow
|
|
8
|
+
*/
|
|
9
|
+
import { type ReactNode } from 'react';
|
|
10
|
+
import type { OverviewNavigateTarget } from './overview-api.ts';
|
|
11
|
+
/** 一个锚点。value/sub 都渲染为字符串 —— 数字格式化在组层完成后传入。 */
|
|
12
|
+
export interface Anchor {
|
|
13
|
+
readonly key: OverviewNavigateTarget;
|
|
14
|
+
readonly label: string;
|
|
15
|
+
readonly value: string;
|
|
16
|
+
readonly sub: string;
|
|
17
|
+
readonly subTone?: 'warn' | 'ok';
|
|
18
|
+
}
|
|
19
|
+
export declare function AnchorRow(props: {
|
|
20
|
+
readonly anchors: readonly Anchor[];
|
|
21
|
+
readonly loading: boolean;
|
|
22
|
+
readonly onNavigate: (target: OverviewNavigateTarget) => void;
|
|
23
|
+
}): ReactNode;
|
|
24
|
+
//# sourceMappingURL=AnchorRow.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 待关注清单 —— 总览的核心区:异常与风险按严重度排序,正常的不占屏。
|
|
3
|
+
*
|
|
4
|
+
* 每条 = 一个severity圆点 + 一句话(含数)+ 可选补充行 + 右侧"去 xx →"。
|
|
5
|
+
* 清单为空显示"治理现状良好";数据加载中显示骨架行。
|
|
6
|
+
*
|
|
7
|
+
* 2026-11-24 用户定稿:AI 分析能力移除(只显示最严重 3 条哨兵项);深入分析
|
|
8
|
+
* 留给费用页/配置审计页的 AI 建议——那边的数据域有档即查、无档不展示。
|
|
9
|
+
*
|
|
10
|
+
* @module @huaweidevtools/landingzone-workbench/client/pages/OverviewPage/AttentionList
|
|
11
|
+
*/
|
|
12
|
+
import { type ReactNode } from 'react';
|
|
13
|
+
import type { OverviewNavigateTarget } from './overview-api.ts';
|
|
14
|
+
/** 严重度:high=🔴 需要立刻处理;mid=🟡 治理缺口;low=⚪ 动态与提示。 */
|
|
15
|
+
export type AttentionSeverity = 'high' | 'mid' | 'low';
|
|
16
|
+
/** 一条待关注项。detail 可空;全部字段渲染为纯文本(用户可见正文不出现 markdown 记号)。 */
|
|
17
|
+
export interface AttentionItem {
|
|
18
|
+
readonly id: string;
|
|
19
|
+
readonly severity: AttentionSeverity;
|
|
20
|
+
readonly title: string;
|
|
21
|
+
readonly detail: string;
|
|
22
|
+
readonly target: OverviewNavigateTarget;
|
|
23
|
+
}
|
|
24
|
+
export declare function AttentionList(props: {
|
|
25
|
+
readonly items: readonly AttentionItem[];
|
|
26
|
+
readonly loading: boolean;
|
|
27
|
+
readonly onNavigate: (target: OverviewNavigateTarget) => void;
|
|
28
|
+
}): ReactNode;
|
|
29
|
+
//# sourceMappingURL=AttentionList.d.ts.map
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 治理总览图表集 —— 把"要管什么"从文字条目改成图形表达,文字只留图表讲不了的。
|
|
3
|
+
*
|
|
4
|
+
* 六张卡、三行两列:趋势(费用/资源) → 风险(预算/合规) → 构成(不合规规则/账号状态)。
|
|
5
|
+
* 全部复用费用页的 useEcharts(按需注册 Line/Bar/Pie,不整包引入)与 chartPalette
|
|
6
|
+
* 主题色;每张卡自带骨架与空态 —— 一张图没数据不连累其他图(StatusCards 哲学)。
|
|
7
|
+
*
|
|
8
|
+
* @module @huaweidevtools/landingzone-workbench/client/pages/OverviewPage/OverviewCharts
|
|
9
|
+
*/
|
|
10
|
+
import { type ReactNode } from 'react';
|
|
11
|
+
import type { EChartsCoreOption } from 'echarts/core';
|
|
12
|
+
import type { BudgetOverviewRow, CostTrend, TrendResp } from './overview-api.ts';
|
|
13
|
+
export declare function ChartCard(props: {
|
|
14
|
+
readonly title: string;
|
|
15
|
+
readonly sub: string;
|
|
16
|
+
/** 加载中(渲染骨架)。 */
|
|
17
|
+
readonly loading?: boolean;
|
|
18
|
+
/** 空态文案或自定义内容(按钮等);给了就不渲染图表。 */
|
|
19
|
+
readonly empty?: string | ReactNode | undefined;
|
|
20
|
+
readonly option?: EChartsCoreOption | undefined;
|
|
21
|
+
/** 通栏:占图表墙整行(grid-column: 1 / -1)。 */
|
|
22
|
+
readonly wide?: boolean | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* 右侧随行内容(2026-11-24 图左榜右布局):给了则主体区变 chartSplitBody
|
|
25
|
+
* (图 55% + 右列 45%),如资源合规卡的账号列表。仅 empty 为空时生效。
|
|
26
|
+
*/
|
|
27
|
+
readonly aside?: ReactNode | undefined;
|
|
28
|
+
}): ReactNode;
|
|
29
|
+
export declare function CostTrendCard(props: {
|
|
30
|
+
readonly loading: boolean;
|
|
31
|
+
readonly trend: CostTrend | undefined;
|
|
32
|
+
readonly unavailable: boolean;
|
|
33
|
+
}): ReactNode;
|
|
34
|
+
export declare function ResourceTrendCard(props: {
|
|
35
|
+
readonly loading: boolean;
|
|
36
|
+
readonly trend: TrendResp | undefined;
|
|
37
|
+
/** 通栏:占图表墙整行。 */
|
|
38
|
+
readonly wide?: boolean;
|
|
39
|
+
/** 空态「同步资源」按钮回调:触发一次资源同步(与资源管理页同一编排)。 */
|
|
40
|
+
readonly onSync?: () => void;
|
|
41
|
+
/** 同步进行中(按钮转圈、防重复触发)。 */
|
|
42
|
+
readonly syncing?: boolean;
|
|
43
|
+
/** 同步提示行(按钮下方一句话,如"云上无变化,未启动全量同步")。 */
|
|
44
|
+
readonly syncNote?: string | undefined;
|
|
45
|
+
}): ReactNode;
|
|
46
|
+
export declare function BudgetBarsCard(props: {
|
|
47
|
+
readonly loading: boolean;
|
|
48
|
+
readonly rows: readonly {
|
|
49
|
+
readonly label: string;
|
|
50
|
+
readonly ratio: number | null;
|
|
51
|
+
readonly status: BudgetOverviewRow['status'];
|
|
52
|
+
}[];
|
|
53
|
+
readonly cycle: string | undefined;
|
|
54
|
+
/** 本月时间进度(0~1):画"时间进度"参考线;条过线 = 花钱节奏超时。 */
|
|
55
|
+
readonly elapsedRatio?: number | undefined;
|
|
56
|
+
/** 空态「设置」按钮回调:进费用管理页设置预算额度。不给则退化为纯文案。 */
|
|
57
|
+
readonly onSetup?: () => void;
|
|
58
|
+
}): ReactNode;
|
|
59
|
+
export declare function ComplianceDonutCard(props: {
|
|
60
|
+
readonly loading: boolean;
|
|
61
|
+
/** 逐账号行(rollup.rows):按不合规数画账号分布。 */
|
|
62
|
+
readonly rows: readonly {
|
|
63
|
+
readonly name: string;
|
|
64
|
+
readonly non_compliant_resources: number;
|
|
65
|
+
}[];
|
|
66
|
+
/** 组织合计(rollup):中心数与副行口径用。 */
|
|
67
|
+
readonly rules: number | undefined;
|
|
68
|
+
readonly nonCompliantTotal: number | undefined;
|
|
69
|
+
readonly accountCount: number | undefined;
|
|
70
|
+
}): ReactNode;
|
|
71
|
+
export declare function RuleBarsCard(props: {
|
|
72
|
+
readonly loading: boolean;
|
|
73
|
+
readonly rules: readonly {
|
|
74
|
+
readonly name: string;
|
|
75
|
+
readonly non_compliant: number;
|
|
76
|
+
readonly accounts: number;
|
|
77
|
+
}[];
|
|
78
|
+
}): ReactNode;
|
|
79
|
+
//# sourceMappingURL=OverviewCharts.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 治理总览口径抽屉 —— 与组织/资源/配置页 GlossaryDrawer 同一交互(抽屉 + 遮罩),
|
|
3
|
+
* 样式复用 overview.module.css 的同一套 drawer 样式;文案只讲总览本页的口径。
|
|
4
|
+
* 规矩:用户可见正文不出现 markdown 记号(星号、反引号);
|
|
5
|
+
* 也不出现"锚点/子页"这类实现视角字眼与具体页面名 —— 条目标题与页面上的
|
|
6
|
+
* 实际标签一一对应,指引用"板块/明细"等功能性说法。
|
|
7
|
+
*
|
|
8
|
+
* @module .../OverviewPage/OverviewGlossaryDrawer
|
|
9
|
+
*/
|
|
10
|
+
import { type ReactNode } from 'react';
|
|
11
|
+
export declare function OverviewGlossaryDrawer(props: {
|
|
12
|
+
readonly open: boolean;
|
|
13
|
+
readonly onClose: () => void;
|
|
14
|
+
}): ReactNode;
|
|
15
|
+
//# sourceMappingURL=OverviewGlossaryDrawer.d.ts.map
|