fix(meshcentral): use transitioning variable tcdefaultdomain in scale GUI (#4184)

* fix(meshcentral): use transitioning variable tcdefaultdomain in scale GUI

* add a debug
This commit is contained in:
Stavros Kois
2022-10-25 11:05:59 +03:00
committed by GitHub
parent 34a062e31b
commit 86b7ac4d90
3 changed files with 14 additions and 2 deletions

View File

@@ -1,8 +1,8 @@
apiVersion: v2
kubeVersion: ">=1.16.0-0"
name: meshcentral
version: 5.0.1
appVersion: "1.0.89"
version: 5.0.2
description: MeshCentral is a full computer management web site
type: application
deprecated: false

View File

@@ -224,7 +224,7 @@ questions:
additional_attrs: true
type: dict
attrs:
- variable: '""'
- variable: tcdefaultdomain
label: 'Section <"">'
schema:
additional_attrs: true

View File

@@ -86,15 +86,27 @@ data:
{{/* Prunes int and float equal to -99 */}}
{{/* Prunes empty strings (Does not prune empty strings in lists) */}}
{{/* Prunes keys that start with _ */}}
{{/* Renames tcdefaultdomain variable to "" as this is the key used by MeshCentral */}}
{{/* but SCALE GUI does not handle it well */}}
{{- define "prune.keys.scale" }}
{{- $values := . }}
{{- if (hasKey $values "domains") }}
{{- if (hasKey $values.domains "tcdefaultdomain") }}
{{- $defaultDomain := $values.domains.tcdefaultdomain }}
{{- $_ := set $values.domains "" $defaultDomain }}
{{- $_ := unset $values.domains "tcdefaultdomain" }}
{{- end }}
{{- end }}
{{- range $k, $v := $values }}
{{- if eq (kindOf $v) "string" }}
{{- if not $v }}
{{- $_ := unset $values $k }}
{{- end }}
{{- end }}
{{- if eq $k "browserPing" }}
{{- $_ := set $values "__browserPing" (printf "%v-%v" (kindOf $v) (typeOf $v)) }}
{{- end }}
{{- if or (eq (kindOf $v) "float64") (eq (kindOf $v) "int64") }}
{{- if eq (int $v) -99 }}
{{- $_ := unset $values $k }}