mob
This commit is contained in:
parent
2155075ba0
commit
58a35dbdaf
2 changed files with 25 additions and 5 deletions
|
@ -18,17 +18,17 @@
|
|||
<div class="invalid-feedback">
|
||||
<pre id="fqdn-validation"></pre>
|
||||
</div>
|
||||
<label for="jira-data-volume-path" class="form-label">Your jira-data-volume-path:</label>
|
||||
<label for="jira-data-volume-path" class="form-label">(Optional) Your jira-data-volume-path:</label>
|
||||
<input class="form-control" type="text" name="jira-data-volume-path" id="jira-data-volume-path" value="/var/jira">
|
||||
<div class="invalid-feedback">
|
||||
<pre id="jira-data-volume-path-validation"></pre>
|
||||
</div>
|
||||
<label for="postgres-data-volume-path" class="form-label">Your postgres-data-volume-path:</label>
|
||||
<label for="postgres-data-volume-path" class="form-label">(Optional) Your postgres-data-volume-path:</label>
|
||||
<input class="form-control" type="text" name="postgres-data-volume-path" id="postgres-data-volume-path" value="/var/postgres">
|
||||
<div class="invalid-feedback">
|
||||
<pre id="postgres-data-volume-path"></pre>
|
||||
</div>
|
||||
<label for="restic-repository" class="form-label">Your restic-repository:</label>
|
||||
<label for="restic-repository" class="form-label">(Optional) Your restic-repository:</label>
|
||||
<input class="form-control" type="text" name="restic-repository" id="restic-repository" value="restic-repository">
|
||||
<div class="invalid-feedback">
|
||||
<pre id="restic-repository"></pre>
|
||||
|
|
|
@ -6,14 +6,25 @@
|
|||
[dda.c4k-common.browser :as br]))
|
||||
|
||||
(defn config-from-document []
|
||||
(let [issuer (br/get-content-from-element "issuer" :optional true :deserializer keyword)]
|
||||
(let [jira-data-volume-path (br/get-content-from-element "jira-data-volume-path" :optional true :deserializer keyword)
|
||||
postgres-data-volume-path (br/get-content-from-element "postgres-data-volume-path" :optional true :deserializer keyword)
|
||||
restic-repository (br/get-content-from-element "restic-repository" :optional true :deserializer keyword)
|
||||
issuer (br/get-content-from-element "issuer" :optional true :deserializer keyword)]
|
||||
(merge
|
||||
{:fqdn (br/get-content-from-element "fqdn")}
|
||||
(when (some? postgres-data-volume-path)
|
||||
{:postgres-data-volume-path postgres-data-volume-path})
|
||||
(when (some? restic-repository)
|
||||
{:restic-repository restic-repository})
|
||||
(when (some? issuer)
|
||||
{:issuer issuer}))))
|
||||
{:issuer issuer})
|
||||
)))
|
||||
|
||||
(defn validate-all! []
|
||||
(br/validate! "fqdn" ::jira/fqdn)
|
||||
(br/validate! "jira-data-volume-path" ::jira/jira-data-volume-path :optional true :deserializer keyword)
|
||||
(br/validate! "postgres-data-volume-path" ::jira/jira-data-volume-path :optional true :deserializer keyword)
|
||||
(br/validate! "restic-repository" ::jira/restic-repository :optional true :deserializer keyword)
|
||||
(br/validate! "issuer" ::jira/issuer :optional true :deserializer keyword)
|
||||
(br/validate! "auth" core/auth? :deserializer edn/read-string)
|
||||
(br/set-validated!))
|
||||
|
@ -30,6 +41,15 @@
|
|||
(-> (br/get-element-by-id "fqdn")
|
||||
(.addEventListener "blur"
|
||||
#(do (validate-all!))))
|
||||
(-> (br/get-element-by-id "jira-data-volume-path")
|
||||
(.addEventListener "blur"
|
||||
#(do (validate-all!))))
|
||||
(-> (br/get-element-by-id "postgres-data-volume-path")
|
||||
(.addEventListener "blur"
|
||||
#(do (validate-all!))))
|
||||
(-> (br/get-element-by-id "restic-repository")
|
||||
(.addEventListener "blur"
|
||||
#(do (validate-all!))))
|
||||
(-> (br/get-element-by-id "issuer")
|
||||
(.addEventListener "blur"
|
||||
#(do (validate-all!))))
|
||||
|
|
Reference in a new issue