WIP feedback 3

This commit is contained in:
ZacharyZhang-NY committed 2026-10-05 12:19:28 -04:00
1 parent 036de19d86
commit 9ce5953640
17 files changed
+1148 -3

No files matched your search

+37
View File
@@ -0,0 +1,37 @@
# 098 StatusIndicator 状态标记
## 用途
以图形加文字标出状态:成功、警告、错误、离线、处理中。每种状态有独立形状(对勾圆、三角、叉圆、断开的 Wi-Fi、旋转菱形),并总是显示文字,不只靠颜色。
## 最小示例
```go
mujica.StatusIndicator(c, mujica.StatusSuccess, mujica.StatusIndicatorOptions{Label: "API online"})
mujica.StatusIndicator(c, mujica.StatusOffline, mujica.StatusIndicatorOptions{})
```
签名:`func StatusIndicator(c *ui.Context, status Status, opts StatusIndicatorOptions) *ui.Element`
## 参数
| 字段 | 类型 | 默认值 | 含义 |
| --- | --- | --- | --- |
| `status` | `Status` | `StatusSuccess` | `StatusSuccess`、`StatusWarning`、`StatusError`、`StatusOffline`、`StatusBusy`;未知值 panic。 |
| `Label` | `string` | 内置词(Healthy、Degraded、Failing、Offline、Working) | 替换显示的文字。 |
## 状态
处理中使用 Spinner,减少动画时静止。整体为 `RoleStatus`,名称为文字。
## 事件
无。
## 键盘操作
不可聚焦。
## 限制
- 无 Badge 式的纯圆点模式;PRD 要求不能只靠颜色。