Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add secret select input #6140

Merged
merged 9 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions ui/docs/custom-formkit-input/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
- `list`: 动态列表,定义一个数组列表。
- 参数
1. itemType: 列表项的数据类型,用于初始化数据类型,可选参数 `string`, `number`, `boolean`, `object`,默认为 `string`
1. min: 最小数量,默认为 `0`
2. max: 最大数量,默认为 `Infinity`,即无限制。
3. addLabel: 添加按钮的文本,默认为 `添加`
4. addButton: 是否显示添加按钮,默认为 `true`
5. upControl: 是否显示上移按钮,默认为 `true`
6. downControl: 是否显示下移按钮,默认为 `true`
7. insertControl: 是否显示插入按钮,默认为 `true`
8. removeControl: 是否显示删除按钮,默认为 `true`
2. min: 最小数量,默认为 `0`
3. max: 最大数量,默认为 `Infinity`,即无限制。
4. addLabel: 添加按钮的文本,默认为 `添加`
5. addButton: 是否显示添加按钮,默认为 `true`
6. upControl: 是否显示上移按钮,默认为 `true`
7. downControl: 是否显示下移按钮,默认为 `true`
8. insertControl: 是否显示插入按钮,默认为 `true`
9. removeControl: 是否显示删除按钮,默认为 `true`
- `menuCheckbox`:选择一组菜单
- `menuRadio`:选择一个菜单
- `menuItemSelect`:选择菜单项
Expand All @@ -54,6 +54,9 @@
1. action: 对目标数据进行验证的接口地址
2. label: 验证按钮文本
3. buttonAttrs: 验证按钮的额外属性
- `secret`: 用于选择或者管理密钥(Secret)
- 参数
1. requiredKey:用于确认所需密钥的字段名称

在 Vue 单组件中使用:

Expand Down Expand Up @@ -131,7 +134,6 @@ const users = ref([]);
> [!NOTE]
> `list` 组件有且只有一个子节点,并且必须为子节点传递 `index` 属性。若想提供多个字段,则建议使用 `group` 组件包裹。


最终得到的数据类似于:

```json
Expand All @@ -143,7 +145,6 @@ const users = ref([]);
}
```


### Repeater

Repeater 是一个集合类型的输入组件,可以让使用者可视化的操作集合。
Expand Down
5 changes: 5 additions & 0 deletions ui/src/constants/annotations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,8 @@ export enum contentAnnotations {
export enum patAnnotations {
ACCESS_TOKEN = "security.halo.run/access-token",
}

// Secret
export enum secretAnnotations {
DESCRIPTION = "secret.halo.run/description",
}
28 changes: 15 additions & 13 deletions ui/src/formkit/formkit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { password } from "./inputs/password";
import { postSelect } from "./inputs/post-select";
import { repeater } from "./inputs/repeater";
import { roleSelect } from "./inputs/role-select";
import { secret } from "./inputs/secret";
import { singlePageSelect } from "./inputs/singlePage-select";
import { tagCheckbox } from "./inputs/tag-checkbox";
import { tagSelect } from "./inputs/tag-select";
Expand All @@ -42,26 +43,27 @@ const config: DefaultConfigOptions = {
autoScrollToErrors,
],
inputs: {
list,
form,
password,
group,
nativeGroup,
attachment,
attachmentGroupSelect,
attachmentPolicySelect,
categoryCheckbox,
categorySelect,
code,
repeater,
form,
group,
list,
menuCheckbox,
menuRadio,
menuItemSelect,
menuRadio,
nativeGroup,
password,
postSelect,
categorySelect,
tagSelect,
repeater,
roleSelect,
secret,
singlePageSelect,
categoryCheckbox,
tagCheckbox,
roleSelect,
attachmentPolicySelect,
attachmentGroupSelect,
tagSelect,
verificationForm,
},
locales: { zh, en },
Expand Down
Loading