lljj-x / vue-json-schema-form

基于Vue/Vue3,Json Schema 和 ElementUi/antd/iview3/naiveUi 等生成 HTML Form 表单,用于活动编辑器、h5编辑器、cms等数据配置;支持可视化生成表单Schema 。 Generate a form using Vue/Vue3, Json Schema and ElementUi/antdv/iview3/naiveUi
https://form.lljj.me/
Apache License 2.0
2.06k stars 420 forks source link

针对oneOf类型,是否可以把description显示出来 #334

Closed allendata0706 closed 6 months ago

allendata0706 commented 11 months ago

希望如图效果。

image

{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Postgres Source Spec", "type": "object", "required": ["host", "port", "database", "username"], "properties": { "host": { "title": "Host", "description": "Hostname of the database.", "type": "string", "order": 0, "group": "db" }, "port": { "title": "Port", "description": "Port of the database.", "type": "integer", "minimum": 0, "maximum": 65536, "default": 5432, "examples": ["5432"], "order": 1, "group": "db" }, "database": { "title": "Database Name", "description": "Name of the database.", "type": "string", "order": 2, "group": "db" }, "schemas": { "title": "Schemas", "description": "The list of schemas (case sensitive) to sync from. Defaults to public.", "type": "array", "items": { "type": "string" }, "minItems": 0, "uniqueItems": true, "default": ["public"], "order": 3, "group": "db" }, "username": { "title": "Username", "description": "Username to access the database.", "type": "string", "order": 4, "group": "auth" }, "password": { "title": "Password", "description": "Password associated with the username.", "type": "string", "airbyte_secret": true, "order": 5, "group": "auth", "always_show": true }, "jdbc_url_params": { "description": "Additional properties to pass to the JDBC URL string when connecting to the database formatted as 'key=value' pairs separated by the symbol '&'. (Eg. key1=value1&key2=value2&key3=value3). For more information read about <a href=\"https://jdbc.postgresql.org/documentation/head/connect.html\">JDBC URL parameters.", "title": "JDBC URL Parameters (Advanced)", "type": "string", "order": 6, "group": "advanced", "pattern_descriptor": "key1=value1&key2=value2" }, "ssl_mode": { "title": "SSL Modes", "description": "SSL connection modes. \n Read more <a href=\"https://jdbc.postgresql.org/documentation/head/ssl-client.html\"> in the docs.", "type": "object", "order": 8, "group": "security", "oneOf": [ { "title": "disable", "additionalProperties": true, "description": "Disables encryption of communication between Airbyte and source database.", "required": ["mode"], "properties": { "mode": { "type": "string", "const": "disable", "default": "disable", "ui:hidden": true, "order": 0 } } }, { "title": "allow", "additionalProperties": true, "description": "Enables encryption only when required by the source database.", "required": ["mode"], "properties": { "mode": { "type": "string", "const": "allow", "default": "allow", "ui:hidden": true, "order": 0 } } }, { "title": "prefer", "additionalProperties": true, "description": "Allows unencrypted connection only if the source database does not support encryption.", "required": ["mode"], "properties": { "mode": { "type": "string", "const": "prefer", "default": "prefer", "ui:hidden": true, "order": 0 } } }, { "title": "require", "additionalProperties": true, "description": "Always require encryption. If the source database server does not support encryption, connection will fail.", "required": ["mode"], "properties": { "mode": { "type": "string", "const": "require", "default": "require", "ui:hidden": true, "order": 0 } } }, { "title": "verify-ca", "additionalProperties": true, "description": "Always require encryption and verifies that the source database server has a valid SSL certificate.", "required": ["mode", "ca_certificate"], "properties": { "mode": { "type": "string", "const": "verify-ca", "default": "verify-ca", "ui:hidden": true, "order": 0 }, "ca_certificate": { "type": "string", "title": "CA Certificate", "description": "CA certificate", "airbyte_secret": true, "multiline": true, "order": 1 }, "client_certificate": { "type": "string", "title": "Client Certificate", "description": "Client certificate", "airbyte_secret": true, "multiline": true, "order": 2, "always_show": true }, "client_key": { "type": "string", "title": "Client Key", "description": "Client key", "airbyte_secret": true, "multiline": true, "order": 3, "always_show": true }, "client_key_password": { "type": "string", "title": "Client key password", "description": "Password for keystorage. If you do not add it - the password will be generated automatically.", "airbyte_secret": true, "order": 4 } } }, { "title": "verify-full", "additionalProperties": true, "description": "This is the most secure mode. Always require encryption and verifies the identity of the source database server.", "required": ["mode", "ca_certificate"], "properties": { "mode": { "type": "string", "const": "verify-full", "default": "verify-full", "ui:hidden": false, "order": 0 }, "ca_certificate": { "type": "string", "title": "CA Certificate", "description": "CA certificate", "airbyte_secret": true, "multiline": true, "order": 1 }, "client_certificate": { "type": "string", "title": "Client Certificate", "description": "Client certificate", "airbyte_secret": true, "multiline": true, "order": 2, "always_show": true }, "client_key": { "type": "string", "title": "Client Key", "description": "Client key", "airbyte_secret": true, "multiline": true, "order": 3, "always_show": true }, "client_key_password": { "type": "string", "title": "Client key password", "description": "Password for keystorage. If you do not add it - the password will be generated automatically.", "airbyte_secret": true, "order": 4 } } } ] }, "replication_method": { "type": "object", "title": "Update Method", "description": "Configures how data is extracted from the database.", "order": 9, "group": "advanced", "default": "CDC", "display_type": "radio", "oneOf": [ { "title": "Read Changes using Write-Ahead Log (CDC)", "description": "Recommended - Incrementally reads new inserts, updates, and deletes using the Postgres <a href=\"https://docs.airbyte.com/integrations/sources/postgres/#cdc\">write-ahead log (WAL). This needs to be configured on the source database itself. Recommended for tables of any size.", "required": ["method", "replication_slot", "publication"], "additionalProperties": true, "properties": { "method": { "type": "string", "const": "CDC", "default": "CDC", "ui:hidden": true, "order": 1 }, "plugin": { "type": "string", "title": "Plugin", "description": "A logical decoding plugin installed on the PostgreSQL server.", "enum": ["pgoutput"], "default": "pgoutput", "order": 2 }, "replication_slot": { "type": "string", "title": "Replication Slot", "description": "A plugin logical replication slot. Read about <a href=\"https://docs.airbyte.com/integrations/sources/postgres#step-3-create-replication-slot\">replication slots.", "order": 3 }, "publication": { "type": "string", "title": "Publication", "description": "A Postgres publication used for consuming changes. Read about <a href=\"https://docs.airbyte.com/integrations/sources/postgres#step-4-create-publications-and-replication-identities-for-tables\">publications and replication identities.", "order": 4 }, "initial_waiting_seconds": { "type": "integer", "title": "Initial Waiting Time in Seconds (Advanced)", "description": "The amount of time the connector will wait when it launches to determine if there is new data to sync or not. Defaults to 300 seconds. Valid range: 120 seconds to 1200 seconds. Read about <a href=\"https://docs.airbyte.com/integrations/sources/postgres#step-5-optional-set-up-initial-waiting-time\">initial waiting time.", "default": 300, "order": 5, "min": 120, "max": 1200 }, "queue_size": { "type": "integer", "title": "Size of the queue (Advanced)", "description": "The size of the internal queue. This may interfere with memory consumption and efficiency of the connector, please be careful.", "default": 10000, "order": 6, "min": 1000, "max": 10000 }, "lsn_commit_behaviour": { "type": "string", "title": "LSN commit behaviour", "description": "Determines when Airbtye should flush the LSN of processed WAL logs in the source database. After loading Data in the destination is default. If While reading Data is selected, in case of a downstream failure (while loading data into the destination), next sync would result in a full sync.", "enum": [ "While reading Data", "After loading Data in the destination" ], "default": "After loading Data in the destination", "order": 7 } } }, { "title": "Detect Changes with Xmin System Column", "description": "Recommended - Incrementally reads new inserts and updates via Postgres <a href=\"https://docs.airbyte.com/integrations/sources/postgres/#xmin\">Xmin system column. Only recommended for tables up to 500GB.", "required": ["method"], "properties": { "method": { "type": "string", "const": "Xmin", "default": "Xmin", "ui:hidden": true, "order": 0 } } }, { "title": "Scan Changes with User Defined Cursor", "description": "Incrementally detects new inserts and updates using the <a href=\"https://docs.airbyte.com/understanding-airbyte/connections/incremental-append/#user-defined-cursor\">cursor column chosen when configuring a connection (e.g. created_at, updated_at).", "required": ["method"], "properties": { "method": { "type": "string", "const": "Standard", "default": "Standard", "ui:hidden": true, "order": 8 } } } ] } }, "groups": [ { "id": "db" }, { "id": "auth" }, { "id": "security", "title": "Security" }, { "id": "advanced", "title": "Advanced" } ] }

1、 针对oneOf类型,是否可以把description显示出来。 2、如果值是const,输入框是不是可以默认不显示出来。 现在的方案需要通过设置 "default": "CDC"和 "ui:hidden": true 俩个属性解决。

allendata0706 commented 11 months ago

现在的效果是,没有description 显示

image
lljj-x commented 10 months ago
  1. 可以通过 ui:showDescription true 来显示anyOf的description 参考这个文档ui:showDescription

  2. 不会处理,考虑有些场景就是需要显示const 元素渲染的内容作为提示等