From 58a35dbdaffaf3bdc69bb9e22817d54ddbe50594 Mon Sep 17 00:00:00 2001 From: Jan Krebs Date: Thu, 5 Aug 2021 12:17:57 +0200 Subject: [PATCH] mob --- public/index.html | 6 +++--- src/main/cljs/dda/c4k_jira/browser.cljs | 24 ++++++++++++++++++++++-- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/public/index.html b/public/index.html index feadcff..2c5d168 100644 --- a/public/index.html +++ b/public/index.html @@ -18,17 +18,17 @@

       
- +

       
- +

       
- +

diff --git a/src/main/cljs/dda/c4k_jira/browser.cljs b/src/main/cljs/dda/c4k_jira/browser.cljs
index 9b581f0..5874ebe 100644
--- a/src/main/cljs/dda/c4k_jira/browser.cljs
+++ b/src/main/cljs/dda/c4k_jira/browser.cljs
@@ -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!))))