[noctool-cvs] CVS source

jprewett jprewett at common-lisp.net
Wed Dec 3 16:42:28 UTC 2008


Update of /project/noctool/cvsroot/source
In directory cl-net:/tmp/cvs-serv31184

Modified Files:
	config.lisp web.lisp 
Log Message:

made it so objects loaded via config file have proper parents

minor web ui fixups
	- more info about monitors!



--- /project/noctool/cvsroot/source/config.lisp	2008/12/02 14:52:28	1.10
+++ /project/noctool/cvsroot/source/config.lisp	2008/12/03 16:42:28	1.11
@@ -143,16 +143,16 @@
 		       (interval 60))
     :machine
   (list max-rtt max-fail interval ping-count)
-  `(noctool::make-monitor 'ping-monitor ,*config-object* , at args))
+  `(noctool::make-monitor 'ping-monitor ,*config-object* :parent ,*config-object* , at args))
 
 (defnested load-monitor (&optional (low-water 1.0) (high-water 5.0))
     :machine
-  `(noctool::make-monitor 'load-monitor ,*config-object* :low-water ,low-water :high-water ,high-water))
+  `(noctool::make-monitor 'load-monitor ,*config-object* :low-water ,low-water :high-water ,high-water :parent ,*config-object*))
 
 (defmacro defmon (mon-class)
   (export (list mon-class))
   `(defnested ,mon-class (&rest options) :machine
-     `(noctool::make-monitor ',',mon-class ,*config-object* , at options)))
+     `(noctool::make-monitor ',',mon-class ,*config-object* :parent ,*config-object* , at options)))
 
 (defmacro cluster ((fmt low high &optional (name nil) (c-fmt t)) form)
   (let ((format-string (if c-fmt
--- /project/noctool/cvsroot/source/web.lisp	2008/12/03 12:28:01	1.3
+++ /project/noctool/cvsroot/source/web.lisp	2008/12/03 16:42:28	1.4
@@ -68,6 +68,7 @@
 ;; XXX do I need all of these damn hashes??? 
 (defvar *monitor-hash* (make-hash-table))
 (defvar *last-updated-hash* (make-hash-table))
+(defvar *alert-level-hash* (make-hash-table))
 (defvar *next-run-hash* (make-hash-table))
 (defvar *last-rtt-hash* (make-hash-table))
 (defvar *last-failed-hash* (make-hash-table))
@@ -140,6 +141,16 @@
     (setf (css-class-of widget)
           (alert-class (noctool::alert-level instance)))))
 
+(defensure ensure-alert-level
+    (mk-span (format NIL "~A" (noctool::alert-level instance))
+             :css-class (alert-class (noctool::alert-level instance)))
+    *alert-level-hash*
+  (defmethod (setf noctool::alert-level) :after (new (instance (eql instance)))
+    (setf (html-of widget)
+          (format NIL "~A" (noctool::alert-level instance)))
+    (setf (css-class-of widget)
+          (alert-class (noctool::alert-level instance)))))
+
 (defensure ensure-next-run
     (let ((next-time (noctool-scheduler::time (noctool-scheduler::find-object instance noctool-scheduler::*default-scheduler*))))
       (mk-span (if next-time 
@@ -268,8 +279,13 @@
 (defmethod display-monitor-info (mon)
   (mk-container
    (list
-    (mk-div (noctool::name (noctool::equipment mon)))
-    (mk-span (symbol-name (class-name (class-of mon))))
+    (mk-container 
+     (list 
+      (mk-span (noctool::name (noctool::equipment mon)))
+      (mk-span " Alert Level: ")
+      (ensure-alert-level (noctool::equipment mon))))
+    (mk-span " Alert Level: ")
+    (ensure-alert-level mon)
     (mk-span (who (:br)))
     (mk-span " Last Updated ")
     (ensure-last-updated-widget mon)
@@ -281,8 +297,14 @@
   (mk-container
    (nconc
     (list
-     (mk-div (noctool::name (noctool::equipment mon)))
+     (mk-container 
+      (list 
+       (mk-span (noctool::name (noctool::equipment mon)))
+       (mk-span " Alert Level: ")
+       (ensure-alert-level (noctool::equipment mon))))
      (mk-span (symbol-name (class-name (class-of mon))))
+     (mk-span " Alert Level: ")
+     (ensure-alert-level mon)
      (mk-span (who (:br)))
      (mk-span " Last Updated ")
      (ensure-last-updated-widget mon)
@@ -299,8 +321,14 @@
 (defmethod display-monitor-info ((mon noctool::ping-monitor))
   (mk-container
    (list
-    (mk-div (noctool::name (noctool::equipment mon)))
+    (mk-container 
+     (list 
+      (mk-span (noctool::name (noctool::equipment mon)))
+      (mk-span " Alert Level: ")
+      (ensure-alert-level (noctool::equipment mon))))
     (mk-span (symbol-name (class-name (class-of mon))))
+    (mk-span " Alert Level: ")
+    (ensure-alert-level mon)
     (mk-span (who (:br)))
     (mk-span " Last Updated ")
     (ensure-last-updated-widget mon)
@@ -320,8 +348,14 @@
 (defmethod display-monitor-info ((mon noctool::load-monitor))
   (mk-container
    (list
-    (mk-div (noctool::name (noctool::equipment mon)))
+    (mk-container 
+     (list 
+      (mk-span (noctool::name (noctool::equipment mon)))
+      (mk-span " Alert Level: ")
+      (ensure-alert-level (noctool::equipment mon))))
     (mk-span (symbol-name (class-name (class-of mon))))
+    (mk-span " Alert Level: ")
+    (ensure-alert-level mon)
     (mk-span (who (:br)))
     (mk-span " Last Updated ")
     (ensure-last-updated-widget mon)
@@ -365,6 +399,7 @@
     (loop for eqp in systems
        do
          (add-to systems-pane eqp))
+    (add-to systems-pane (mk-div ""))
     (add-to *root* systems-pane)
     (add-to *root* info-pane)))
 





More information about the noctool-cvs mailing list