feat: update layout to use list to maintain ordering

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

@ -251,11 +251,16 @@ resource "kubernetes_config_map" "homepage_config" {
data = { data = {
"services.yaml" = yamlencode(var.services_config) "services.yaml" = yamlencode(var.services_config)
"widgets.yaml" = yamlencode(var.widgets_config) "widgets.yaml" = yamlencode(var.widgets_config)
"settings.yaml" = yamlencode( "settings.yaml" = <<-EOT
merge(var.settings, { base = var.settings.base == null ? "https://${var.host}" : var.host }) ${yamlencode(
) merge({ for k, v in var.settings : k => v if k != "layout" }, {
"bookmarks.yaml" = yamlencode(var.bookmarks) base = var.settings.base == null ? "https://${var.host}" : var.settings.base
"docker.yaml" = yamlencode(var.docker_config) }))}
"kubernetes.yaml" = yamlencode(var.kubernetes_config) 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) background = optional(string)
backgroundOpacity = optional(string) backgroundOpacity = optional(string)
theme = optional(string) theme = optional(string)
layout = optional(map( layout = list(
object({ object({
name = string
icon = optional(string) icon = optional(string)
style = optional(string) style = optional(string)
columns = optional(number) columns = optional(number)
}) })
)) )
}) })
} }

Loading…
Cancel
Save