feat: update layout to use list to maintain ordering

main
RaviAnand Mohabir 2 years ago
parent 4ba6e884f0
commit 81acd6600c

@ -251,9 +251,14 @@ resource "kubernetes_config_map" "homepage_config" {
data = {
"services.yaml" = yamlencode(var.services_config)
"widgets.yaml" = yamlencode(var.widgets_config)
"settings.yaml" = yamlencode(
merge(var.settings, { base = var.settings.base == null ? "https://${var.host}" : var.host })
)
"settings.yaml" = <<-EOT
${yamlencode(
merge({ for k, v in var.settings : k => v if k != "layout" }, {
base = var.settings.base == null ? "https://${var.host}" : var.settings.base
}))}
layout:
${join("\n", [for layout in var.settings.layout : " \"${layout.name}\": ${jsonencode(layout)}"])}
EOT
"bookmarks.yaml" = yamlencode(var.bookmarks)
"docker.yaml" = yamlencode(var.docker_config)
"kubernetes.yaml" = yamlencode(var.kubernetes_config)

@ -83,13 +83,14 @@ variable "settings" {
background = optional(string)
backgroundOpacity = optional(string)
theme = optional(string)
layout = optional(map(
layout = list(
object({
name = string
icon = optional(string)
style = optional(string)
columns = optional(number)
})
))
)
})
}

Loading…
Cancel
Save