summaryrefslogtreecommitdiff
path: root/lisp/webapps/snow/site.lisp
diff options
context:
space:
mode:
authorBret Koppel <bret@olo.com>2025-10-07 09:00:37 -0400
committerGitHub <noreply@github.com>2025-10-07 09:00:37 -0400
commit910d7fd656b9e957181732b36761449de5a970d1 (patch)
tree0f8ee46af3e93aa489785d64d54c5e155ef0057b /lisp/webapps/snow/site.lisp
parent9adba239b937df2830a5110adaa1dae17b7dd7d7 (diff)
parent0ad86ba37be273ee1fe4d9bdd5f7bb15c5701abf (diff)
Merge pull request #1 from ololabs/initial-commit
initial commit
Diffstat (limited to 'lisp/webapps/snow/site.lisp')
-rw-r--r--lisp/webapps/snow/site.lisp158
1 files changed, 158 insertions, 0 deletions
diff --git a/lisp/webapps/snow/site.lisp b/lisp/webapps/snow/site.lisp
new file mode 100644
index 0000000..868a188
--- /dev/null
+++ b/lisp/webapps/snow/site.lisp
@@ -0,0 +1,158 @@
+;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*-
+(declaim (optimize (speed 0) (safety 3) (debug 3)))
+
+(in-package :snow)
+
+(defmacro .base (&optional (onload-fn "goto_location('/home')"))
+ `(org-ckons-http::html5
+ `(html
+ (head
+ ((meta :name "viewport" :content "width=device-width, initial-scale=1, shrink-to-fit=no"))
+ ((meta :charset "utf-8"))
+ ((title) ,(title *webapp*))
+ ,@(mapcar (lambda (css)
+ `((link :rel "stylesheet" :href ,(getf css :href) :integrity ,(getf css :integrity) :crossorigin ,(getf css :crossorigin))))
+ '((:href "https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css" :integrity "sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" :crossorigin "anonymous")
+ (:href "/static/css/stylesheet.css" :crossorigin "anonymous")))
+ ,@(mapcar (lambda (js)
+ `((script :type "text/javascript" :src ,(getf js :src) :integrity ,(getf js :integrity) :crossorigin ,(getf js :crossorigin))))
+ '((:src "https://code.jquery.com/jquery-3.7.1.slim.min.js" :integrity "ha256-kmHvs0B+OpCW5GVHUNjv9rOmY0IvSIRcf7zGUDTDQM8=" :crossorigin "anonymous")))
+ ((script :type "text/javascript" :src "/cljs-out/dev-main.js")))
+ ((body :onload ,(format nil "snow.core.~a" ,onload-fn))
+ ((div :class "container-fluid")
+ ((div :class "row")
+ ((div :class "col") "&nbsp;")
+ ((div :class "col")
+ ((div :class "page-header")
+ ((h2 :align "center") ,(title *webapp*))))
+ ((div :class "col") "&nbsp;"))
+ ((div :id "menu" :class "well"))
+ ((div :id "location" :style "display: none"))
+ ((div :id "errormsg"))
+ ((div :id "message"))
+ ((div :id "body"))
+ ,@(mapcar (lambda (js)
+ `((script :type "text/javascript" :src ,(getf js :src) :integrity ,(getf js :integrity) :crossorigin ,(getf js :crossorigin))))
+ '((:src "https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js" :integrity "sha384-Fy6S3B9q64WdZWQUiU+q4/2Lc9npb8tCaSX9FK7E8HnRr0Jz8D6OP9dO5Vg3Q9ct" :crossorigin "anonymous"))))))))
+
+(defmacro .location ()
+ `(location-json location))
+
+(defmacro .home-get ()
+ `(home-json))
+
+(defmacro .home-post ()
+ `(home-json message errormsg))
+
+(defmacro .menu ()
+ `(menu-json))
+
+(defmacro .git-update ()
+ `(git-update-json))
+
+(defmacro .git-update-view ()
+ `(git-update-view-json))
+
+(defmacro .git-update-results ()
+ `(git-update-results-json))
+
+(defmacro .asg-recycle ()
+ `(asg-recycle-json))
+
+(defmacro .asg-recycle-view ()
+ `(asg-recycle-view-json))
+
+(defmacro .asg-recycle-results ()
+ `(asg-recycle-results-json profile region filter))
+
+(defmacro .asg-recycle-results-submit ()
+ `(asg-recycle-results-submit-json howmany))
+
+(defmacro .tfcloud-apply ()
+ `(tfcloud-apply-json))
+
+(defmacro .tfcloud-apply-view ()
+ `(tfcloud-apply-view-json))
+
+(defmacro .tfcloud-apply-results ()
+ `(tfcloud-apply-results-json filter))
+
+(defmacro .tfcloud-apply-results-submit ()
+ `(tfcloud-apply-results-submit-json))
+
+(defmacro .octopus-machines-with-roles ()
+ `(octopus-machines-with-roles-json))
+
+(defmacro .octopus-machines-with-roles-view ()
+ `(octopus-machines-with-roles-view-json))
+
+(defmacro .octopus-machines-with-roles-results ()
+ `(octopus-machines-with-roles-results-json roles))
+
+(defmacro .octopus-environments-with-roles ()
+ `(octopus-environments-with-roles-json))
+
+(defmacro .octopus-environments-with-roles-view ()
+ `(octopus-environments-with-roles-view-json))
+
+(defmacro .octopus-environments-with-roles-results ()
+ `(octopus-environments-with-roles-results-json ode_only_p roles))
+
+(defmacro .octopus-projects-with-roles ()
+ `(octopus-projects-with-roles-json))
+
+(defmacro .octopus-projects-with-roles-view ()
+ `(octopus-projects-with-roles-view-json))
+
+(defmacro .octopus-projects-with-roles-results ()
+ `(octopus-projects-with-roles-results-json roles))
+
+(defmacro .octopus-ode-deploy-release ()
+ `(octopus-ode-deploy-release-json))
+
+(defmacro .octopus-ode-deploy-release-view ()
+ `(octopus-ode-deploy-release-view-json))
+
+(defmacro .octopus-ode-deploy-release-results ()
+ `(octopus-ode-deploy-release-results-json project_name version ode_names))
+
+(defmacro .octopus-latest-deployments ()
+ `(octopus-latest-deployments-json))
+
+(defmacro .octopus-latest-deployments-view ()
+ `(octopus-latest-deployments-view-json))
+
+(defmacro .octopus-latest-deployments-results ()
+ `(octopus-latest-deployments-results-json ode_only_p))
+
+(define-endpoint :get "/" () .base)
+(define-endpoint :post "/location" ((location :parameter-type 'string)) .location)
+(define-endpoint :get "/home" () .home-get)
+(define-endpoint :post "/home" ((message :parameter-type 'string) (errormsg :parameter-type 'string)) .home-post)
+(define-endpoint :get "/menu" () .menu)
+(define-endpoint :get "/git-update" () .git-update)
+(define-endpoint :get "/git-update/view" () .git-update-view)
+(define-endpoint :post "/git-update/results" () .git-update-results)
+(define-endpoint :get "/asg-recycle" () .asg-recycle)
+(define-endpoint :get "/asg-recycle/view" () .asg-recycle-view)
+(define-endpoint :post "/asg-recycle/results" ((profile :parameter-type 'string) (region :parameter-type 'string) (filter :parameter-type 'string)) .asg-recycle-results)
+(define-endpoint :post "/asg-recycle/results/submit" ((howmany :parameter-type 'string)) .asg-recycle-results-submit)
+(define-endpoint :get "/tfcloud-apply" () .tfcloud-apply)
+(define-endpoint :get "/tfcloud-apply/view" () .tfcloud-apply-view)
+(define-endpoint :post "/tfcloud-apply/results" ((filter :parameter-type 'string)) .tfcloud-apply-results)
+(define-endpoint :post "/tfcloud-apply/results/submit" () .tfcloud-apply-results-submit)
+(define-endpoint :get "/octopus-machines-with-roles" () .octopus-machines-with-roles)
+(define-endpoint :get "/octopus-machines-with-roles/view" () .octopus-machines-with-roles-view)
+(define-endpoint :post "/octopus-machines-with-roles/results" ((roles :parameter-type 'string)) .octopus-machines-with-roles-results)
+(define-endpoint :get "/octopus-environments-with-roles" () .octopus-environments-with-roles)
+(define-endpoint :get "/octopus-environments-with-roles/view" () .octopus-environments-with-roles-view)
+(define-endpoint :post "/octopus-environments-with-roles/results" ((ode_only_p :parameter-type 'string) (roles :parameter-type 'string)) .octopus-environments-with-roles-results)
+(define-endpoint :get "/octopus-projects-with-roles" () .octopus-projects-with-roles)
+(define-endpoint :get "/octopus-projects-with-roles/view" () .octopus-projects-with-roles-view)
+(define-endpoint :post "/octopus-projects-with-roles/results" ((roles :parameter-type 'string)) .octopus-projects-with-roles-results)
+(define-endpoint :get "/octopus-ode-deploy-release" () .octopus-ode-deploy-release)
+(define-endpoint :get "/octopus-ode-deploy-release/view" () .octopus-ode-deploy-release-view)
+(define-endpoint :post "/octopus-ode-deploy-release/results" ((project_name :parameter-type 'string) (version :parameter-type 'string) (ode_names :parameter-type 'string)) .octopus-ode-deploy-release-results)
+(define-endpoint :get "/octopus-latest-deployments" () .octopus-latest-deployments)
+(define-endpoint :get "/octopus-latest-deployments/view" () .octopus-latest-deployments-view)
+(define-endpoint :post "/octopus-latest-deployments/results" ((ode_only_p :parameter-type 'string)) .octopus-latest-deployments-results)