
# 基础控件
OSC console依据crd.yaml文件可以自动生成Operator的创建表单。crd.yaml文件中的properties（openAPIV3Schema.properties.spec.properties）对象会自动映射到对应的UI组件。
目前提供的基础类型控件分别有string、number、boolean、object、array类型。
- [string控件]：满足一般的文本输入。
- [number控件]：满足一般的数字输入。
- [boolean控件]：开关控件，支持设置布尔值。
- [object控件]：支持结构体格式输入，具有多层嵌套能力。
- [array类型]：支持数组结构的输入，可以动态增删。
 #### string控件
一般场景的文本输入，支持校验规则的配置。
配置示例：
```
type: string
title: Extra RabbitMQ Configuration
description: Extra configuration to be appended to...
```
图1string控件   
![](https://support.huaweicloud.com/devg-osc/zh-cn_image_0000001327667505.png "点击放大")
 #### number控件
一般场景的数字输入，支持设置数值的大小范围。
配置示例：
```
type: number
title: Number of replicas
description: Number of replicas to deploy
```
图2number控件   
![](https://support.huaweicloud.com/devg-osc/zh-cn_image_0000001276547852.png "点击放大")
 #### boolean控件
boolean类型字段输入。
配置示例：
```
type: boolean
title: Enable Init Containers
description: Use an init container to set required...
```
图3boolean控件   
![](https://support.huaweicloud.com/devg-osc/zh-cn_image_0000001276707752.png "点击放大")
 #### object控件
结构体格式输入，支持子控件的嵌套。
配置示例：
```
type: object
title: Presistence configuration
properties:
  enablePersistence:
    type: boolean
    title: Enable Persistence
    description: Enable persistence using Persistent Volume Claims
  persistentVolumeSize:
    type: string
    title: Persistent Volume Size
    description:
```
图4object控件   
![](https://support.huaweicloud.com/devg-osc/zh-cn_image_0000001276867736.png "点击放大")
 #### array类型
满足数组类型的输入，支持设置最多项最少项等。
配置示例：
```
type: array
title: env
description: The DataDog ...
items:
  properties: 
    name: 
      type: string
      title: name
      description: Name of ...
    persistentVolumeSize: 
      type: string
      title: Persistent Volume Size
      description: 
    valueFrom:
      type: object
      properties:
        ...
```
图5array类型   
![](https://support.huaweicloud.com/devg-osc/zh-cn_image_0000001919898880.png "点击放大")
