description = "Example showing RepeatingGroup arrays for multiple trackers"
display_mode = "complete"
name = "Tracker Configuration with Arrays"

# Header
[[elements]]
border_bottom = true
border_top = true
name = "main_header"
title = "🎯 Tracker Configuration"
type = "section_header"

# Introduction
[[elements]]
content = "Configure multiple UDP and HTTP tracker listeners. You can add, edit, or delete trackers as needed."
name = "intro"
type = "section"

# Tracker mode selection
[[elements]]
default = "public"
name = "tracker_mode"
options = [
  { value = "public", label = "Public Tracker" },
  { value = "private", label = "Private Tracker" },
]
order = 1
prompt = "Tracker Mode"
required = true
type = "select"

# UDP Trackers array
# max_items loaded from constraints.toml via constraint interpolation
# See constraints.toml to change max_items (default: 4)
[[elements]]
default_items = 1
fragment = "fragments/tracker-udp-item.toml"
help = "Add UDP tracker listener addresses (must be unique). Standard BitTorrent port is 6969."
max_items = "${constraint.tracker.udp.max_items}"
min_items = 0
name = "udp_trackers"
order = 2
prompt = "UDP Tracker Listeners"
required = false
type = "repeatinggroup"
unique = true

# HTTP Trackers array
# max_items loaded from constraints.toml via constraint interpolation
# See constraints.toml to change max_items (default: 4)
[[elements]]
default_items = 1
fragment = "fragments/tracker-http-item.toml"
help = "Add HTTP tracker listener addresses (must be unique). Standard HTTP port is 80, HTTPS is 443."
max_items = "${constraint.tracker.http.max_items}"
min_items = 0
name = "http_trackers"
order = 3
prompt = "HTTP Tracker Listeners"
required = false
type = "repeatinggroup"
unique = true

# API Configuration section
[[elements]]
border_bottom = true
border_top = true
name = "api_header"
title = "📡 API Configuration"
type = "section_header"

# API Token
[[elements]]
help = "Secure token for API authentication"
name = "api_token"
order = 4
prompt = "Admin API Token"
required = true
type = "password"

# API Port
[[elements]]
default = "1212"
name = "api_port"
order = 5
placeholder = "1212"
prompt = "API Port"
required = true
type = "text"

# Summary
[[elements]]
border_top = true
name = "summary_header"
title = "✅ Configuration Summary"
type = "section_header"

[[elements]]
content = "Review your tracker configuration above. Click submit to save settings."
name = "summary"
order = 6
type = "section"
