move clog-db-admin to run from /dbadmin and added the ability to set to a different port than 8080

This commit is contained in:
David Botton 2022-05-25 22:21:36 -04:00
parent 58a20ed770
commit 6256d746bc
2 changed files with 11 additions and 8 deletions

View file

@ -1520,11 +1520,11 @@ of controls and double click to select control."
;; return empty string to prevent nav off page
""))))
(defun clog-builder (&key static-root)
(defun clog-builder (&key (port 8080) static-root)
"Start clog-builder."
(if static-root
(initialize nil :static-root static-root)
(initialize nil))
(initialize nil :port port :static-root static-root)
(initialize nil :port port))
(set-on-new-window 'on-new-builder :path "/builder")
(set-on-new-window 'on-attach-builder-page :path "/builder-page")
(open-browser :url "http://127.0.0.1:8080/builder"))
(open-browser :url (format nil "http://127.0.0.1:~A/builder" port)))

View file

@ -167,7 +167,7 @@
(set-on-window-can-size about (lambda (obj)
(declare (ignore obj))()))))
(defun on-new-window (body)
(defun on-new-db-admin (body)
(let ((app (make-instance 'app-data)))
(setf (connection-data-item body "app-data") app)
(setf (body app) body)
@ -195,7 +195,10 @@
(when (db-connection app)
(sqlite:disconnect (db-connection app)))))
(defun clog-db-admin ()
(defun clog-db-admin (&key (port 8080) static-root)
"Start clog-db-admin."
(initialize #'on-new-window)
(open-browser))
(if static-root
(initialize nil :port port :static-root static-root)
(initialize nil :port port))
(set-on-new-window 'on-new-db-admin :path "/dbadmin")
(open-browser :url (format nil "http://127.0.0.1:~A/dbadmin" port)))