Update imports, java script generation, tests

This commit is contained in:
erik 2022-09-28 15:16:48 +02:00
parent 46f0c72c3e
commit 25b5083895
4 changed files with 18 additions and 9 deletions

View file

@ -14,7 +14,4 @@
(website/generate-ingress config) (website/generate-ingress config)
(website/generate-certificate config) (website/generate-certificate config)
(website/generate-website-build-cron config) (website/generate-website-build-cron config)
(website/generate-website-build-deployment config) (website/generate-website-build-secret config)])))
(website/generate-website-build-secret config)
])))

View file

@ -1,7 +1,8 @@
(ns dda.c4k-website.website (ns dda.c4k-website.website
(:require (:require
[clojure.spec.alpha :as s] [clojure.spec.alpha :as s]
[clojure.math.numeric-tower :as m] #?(:clj [clojure.math.numeric-tower :as m]
:cljs [cljs.math :as m])
[clojure.string :as st] [clojure.string :as st]
#?(:cljs [shadow.resource :as rc]) #?(:cljs [shadow.resource :as rc])
#?(:clj [orchestra.core :refer [defn-spec]] #?(:clj [orchestra.core :refer [defn-spec]]

View file

@ -36,6 +36,14 @@
(cm/concat-vec (cm/concat-vec
(br/generate-input-field "volume-total-storage-size" "Your website volume-total-storage-size:" "20") (br/generate-input-field "volume-total-storage-size" "Your website volume-total-storage-size:" "20")
(br/generate-input-field "number-of-websites" "The Number of websites running on your cluster" "5"))) (br/generate-input-field "number-of-websites" "The Number of websites running on your cluster" "5")))
(generate-group
"credentials"
(br/generate-text-area
"auth" "Your auth.edn:"
"{:gitrepourl \"https://your.gitea.host/api/v1/repos/<owner>/<repo>/archive/<branchname>.zip\"
:authtoken \"yourgiteaauthtoken\"
}"
"3"))
[(br/generate-br)] [(br/generate-br)]
(br/generate-button "generate-button" "Generate c4k yaml")))] (br/generate-button "generate-button" "Generate c4k yaml")))]
(br/generate-output "c4k-website-output" "Your c4k deployment.yaml:" "25"))) (br/generate-output "c4k-website-output" "Your c4k deployment.yaml:" "25")))
@ -62,6 +70,7 @@
(br/validate! "issuer" ::website/issuer :optional true) (br/validate! "issuer" ::website/issuer :optional true)
(br/validate! "volume-total-storage-size" ::website/volume-total-storage-size :deserializer js/parseInt) (br/validate! "volume-total-storage-size" ::website/volume-total-storage-size :deserializer js/parseInt)
(br/validate! "number-of-websites" ::website/number-of-websites :deserializer js/parseInt) (br/validate! "number-of-websites" ::website/number-of-websites :deserializer js/parseInt)
(br/validate! "auth" core/auth? :deserializer edn/read-string)
(br/set-form-validated!)) (br/set-form-validated!))
(defn add-validate-listener [name] (defn add-validate-listener [name]
@ -84,4 +93,5 @@
(add-validate-listener "fqdn") (add-validate-listener "fqdn")
(add-validate-listener "volume-total-storage-size") (add-validate-listener "volume-total-storage-size")
(add-validate-listener "issuer") (add-validate-listener "issuer")
(add-validate-listener "number-of-websites")) (add-validate-listener "number-of-websites")
(add-validate-listener "auth"))

View file

@ -1 +1,2 @@
{:none "none"} {:authtoken "asdfasdfe"
:gitrepourl "https://some.de/path/to/repo.zip"}