[Ultrapossum-cvs 204] demo/haviewer 1.2,1.3,haviewer.rb

Back to archive index

Masato Taruishi taru****@sourc*****
2004年 6月 22日 (火) 01:10:43 JST


===================================================================
RCS file: demo/haviewer/haviewer.rb,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- demo/haviewer/haviewer.rb	2004/06/21 11:56:05	1.2
+++ demo/haviewer/haviewer.rb	2004/06/21 16:10:43	1.3
@@ -13,6 +13,13 @@
   Hosts = []
   OID = "private.12345"  # .2.101.1"
 
+  Green = "#00FF00"
+  DarkGreen = "#005500"
+  Yellow = "#FFFF00"
+  DarkYellow = "#555500"
+  Red = "#FF0000"
+  DarkRed = "#550000"
+
   class Host
     def initialize( host, type, viewer )
       super();
@@ -20,7 +27,7 @@
       @viewer = viewer
       @list = viewer.list
       @row =****@list*****
-      @color = "green"
+      @color = Yellow
       @status = ""
       @type = type
       update
@@ -40,19 +47,19 @@
 
     def _icon
       on  = _coloring(Uconv.euctou8("●"), @color);
-      off_g = _coloring(Uconv.euctou8("●"), "#007700" );
-      off_y = _coloring(Uconv.euctou8("●"), "#777700" );
-      off_r = _coloring(Uconv.euctou8("●"), "#770000" );
+      off_g = _coloring(Uconv.euctou8("●"), DarkGreen );
+      off_y = _coloring(Uconv.euctou8("●"), DarkYellow );
+      off_r = _coloring(Uconv.euctou8("●"), DarkRed );
       buf = ""
       case @color
-      when "green"
+      when Green
          buf = on + off_y + off_r
-      when "yellow"
+      when Yellow
          buf = off_g + on + off_r
-      when "red"
+      when Red
          buf = off_g + off_y + on
       end
-      return "<span background=\"black\">(#{buf})</span>"
+      return "<span background=\"#000000\">(#{buf})</span>"
     end
 
     def update
@@ -73,13 +80,13 @@
 
       case @status
       when "DEAD"
-        @color = "red"
+        @color = Red
       when "STOP"
-        @color = "red"
+        @color = Red
       when "-----"
-        @color = "yellow"
+        @color = Yellow
       when "ACTIVE"
-        @color = "green"
+        @color = Green
       end
 
       @list.set_value(@row, 0, _icon) if****@statu*****



Ultrapossum-cvs メーリングリストの案内
Back to archive index