docs: enhance plugin configuration documentation with preset options for string and select types

This commit is contained in:
Junyan Qin
2026-03-29 00:32:14 +08:00
parent 9c1243fc38
commit 202d200814
3 changed files with 60 additions and 9 deletions
+20 -3
View File
@@ -84,7 +84,7 @@ All types of configuration items support conditional rendering using the `show_i
### type: string
String type.
String type. Optionally supports `options` for preset values — when provided, a dropdown button appears next to the input allowing users to quickly fill in a preset value. Users can still type freely.
```yaml
- name: api_key
@@ -92,6 +92,23 @@ String type.
...
```
With preset options:
```yaml
- name: api_url
type: string
options: # Optional preset values, displayed as a dropdown button next to the input.
- name: "https://api.openai.com/v1" # The value to fill in when selected.
label: # Display name, supports multilingual.
en_US: OpenAI Official
zh_Hans: OpenAI 官方
- name: "https://api.deepseek.com/v1"
label:
en_US: DeepSeek
zh_Hans: DeepSeek
...
```
### type: array[string]
String array.
@@ -134,13 +151,13 @@ Boolean type.
### type: select
Dropdown menu. Requires configuring `options`, which represents the dropdown menu options.
Dropdown menu. Requires configuring `options`, which represents the dropdown menu options. Each option displays its `label` as the primary text, with the `name` (value) shown in smaller text below.
```yaml
- name: mode
type: select
options: # Dropdown options, supports multilingual.
- name: mode1 # Value
- name: mode1 # Value, displayed as secondary text in the dropdown.
label: # Display name, supports multilingual.
en_US: Mode 1
zh_Hans: 模式 1
+20 -3
View File
@@ -84,7 +84,7 @@ spec:
### type: string
文字列型。
文字列型。オプションで`options`を設定してプリセット値をサポートできます。設定すると、入力フィールドの横にドロップダウンボタンが表示され、ユーザーがプリセット値をすばやく入力できます。自由入力も可能です。
```yaml
- name: api_key
@@ -92,6 +92,23 @@ spec:
...
```
プリセットオプション付き:
```yaml
- name: api_url
type: string
options: # オプションのプリセット値、入力フィールドの横にドロップダウンボタンとして表示。
- name: "https://api.openai.com/v1" # 選択時に入力される値。
label: # 表示名、多言語サポート。
en_US: OpenAI Official
zh_Hans: OpenAI 官方
- name: "https://api.deepseek.com/v1"
label:
en_US: DeepSeek
zh_Hans: DeepSeek
...
```
### type: array[string]
文字列配列。
@@ -134,13 +151,13 @@ spec:
### type: select
ドロップダウンメニュー。`options`の設定が必要で、ドロップダウンメニューのオプションを表します。
ドロップダウンメニュー。`options`の設定が必要で、ドロップダウンメニューのオプションを表します。各オプションは`label`をメインテキストとして表示し、`name`(値)を小さなテキストで下に表示します。
```yaml
- name: mode
type: select
options: # ドロップダウンオプション、多言語サポート。
- name: mode1 # 値
- name: mode1 # 値、ドロップダウンで小さなテキストとして表示。
label: # 表示名、多言語サポート。
en_US: Mode 1
zh_Hans: 模式 1
+20 -3
View File
@@ -84,7 +84,7 @@ spec:
### type: string
字符串。
字符串。可选配置 `options` 预选项——配置后会在输入框旁显示一个下拉按钮,用户可快速选择预设值填入输入框,也可以自由输入。
```yaml
- name: api_key
@@ -92,6 +92,23 @@ spec:
...
```
带预选项:
```yaml
- name: api_url
type: string
options: # 可选的预设值,以下拉按钮形式显示在输入框旁。
- name: "https://api.openai.com/v1" # 选中时填入的值。
label: # 显示名称,支持多语言。
en_US: OpenAI Official
zh_Hans: OpenAI 官方
- name: "https://api.deepseek.com/v1"
label:
en_US: DeepSeek
zh_Hans: DeepSeek
...
```
### type: array[string]
字符串数组。
@@ -134,13 +151,13 @@ spec:
### type: select
下拉框。需要配置 `options` 选项,表示下拉框的选项。
下拉框。需要配置 `options` 选项,表示下拉框的选项。每个选项会显示 `label` 作为主要文本,`name`(值)以小字显示在下方。
```yaml
- name: mode
type: select
options: # 下拉框选项,支持多语言。
- name: mode1 # 值
- name: mode1 # 值,在下拉框中以小字显示。
label: # 显示名称,支持多语言。
en_US: Mode 1
zh_Hans: 模式 1