redis_title: &redis_title
  - type: text
    name: title
    label: Storage Name
    required: true

# 2x2 grid
redis_params: &redis_params
  - type: text
    name: db
    label: Database Number (db)
    placeholder: 1
  - type: text
    name: path
    label: Path
  - type: password
    name: password
    label: Password
    autoComplete: "new-password"
  - type: text
    name: host
    label: Host
    placeholder: localhost
  - type: text
    name: port
    label: Port

ImportStorage:
  # Title
  - columnCount: 1
    fields: *redis_title
  # Path, Password, Host and Port
  - columnCount: 2
    fields: *redis_params
  # Regex filter
  - columnCount: 1
    fields:
      - type: text
        name: regex_filter
        label: File Filter Regex
        placeholder: '.*csv or .*(jpe?g|png|tiff) or .\w+-\d+.text'
        validators:
          - regexp

  # Import method selection
  - columnCount: 1
    fields:
      - type: select
        name: use_blob_urls
        label: Import method
        description: Choose how to import your data from storage
        placeholder: "Select an option"
        required: true
        options:
          - value: true
            label: "Files - Automatically creates a task for each storage object (e.g. JPG, MP3, TXT)"
          - value: false
            label: "Tasks - Treat each JSON or JSONL file as a task definition (one or more tasks per file)"

ExportStorage:
  - columnCount: 2
    fields: *redis_params
