hq-log-monitor-server 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,6 +13,7 @@ Feature: View and manipulate a single event
13
13
  <type name="critical" level="critical"/>
14
14
  </service>
15
15
  </icinga>
16
+ <assets bootstrap=""/>
16
17
  </log-monitor-server-config>
17
18
  """
18
19
 
@@ -9,6 +9,7 @@ Feature: Log monitor server overview
9
9
  <server port="${port}"/>
10
10
  <db host="${db-host}" port="${db-port}" name="${db-name}"/>
11
11
  <icinga command-file="/dev/null"/>
12
+ <assets bootstrap=""/>
12
13
  </log-monitor-server-config>
13
14
  """
14
15
 
@@ -14,6 +14,7 @@ Feature: Log monitor server submit event via HTTP
14
14
  <type name="critical" level="critical"/>
15
15
  </service>
16
16
  </icinga>
17
+ <assets bootstrap=""/>
17
18
  </log-monitor-server-config>
18
19
  """
19
20
 
@@ -54,9 +54,51 @@ class Script
54
54
  esc_ht(title),
55
55
  ]
56
56
 
57
+ html << "<link href=\"%s\" rel=\"stylesheet\">" % [
58
+ "%s/css/bootstrap-combined.min.css" % [
59
+ @assets_elem["bootstrap"],
60
+ ],
61
+ ]
62
+
63
+ html << "<script src=\"%s\"></script>" % [
64
+ "%s/js/bootstrap.min.js" % [
65
+ @assets_elem["bootstrap"],
66
+ ],
67
+ ]
68
+
57
69
  html << "</head>\n"
58
70
  html << "<body>\n"
59
71
 
72
+ html << "<div class=\"navbar navbar-static-top\">\n"
73
+ html << "<div class=\"navbar-inner\">\n"
74
+ html << "<div class=\"container\">\n"
75
+ html << "<ul class=\"nav\">\n"
76
+ html << "<li><a href=\"/\">Overview</a></li>\n"
77
+ html << "<li><a href=\"%s\">Service</a></li>\n" % [
78
+ esc_ht("/service/%s" % [
79
+ event["source"]["service"],
80
+ ]),
81
+ ]
82
+ html << "<li><a href=\"%s\">Host</a></li>\n" % [
83
+ esc_ht("/service/%s/host/%s" % [
84
+ event["source"]["service"],
85
+ event["source"]["host"],
86
+ ])
87
+ ]
88
+ html << "<li class=\"active\"><a href=\"%s\">Event</a></li>\n" % [
89
+ esc_ht("/event/%s" % [
90
+ context[:event_id],
91
+ ])
92
+ ]
93
+ html << "</ul>\n"
94
+ html << "</div>\n"
95
+ html << "</div>\n"
96
+ html << "</div>\n"
97
+
98
+ html << "<div class=\"container\">\n"
99
+ html << "<div class=\"row\">\n"
100
+ html << "<div class=\"span12\">\n"
101
+
60
102
  html << "<h1>%s</h1>\n" % [
61
103
  esc_ht(title),
62
104
  ]
@@ -67,7 +109,7 @@ class Script
67
109
 
68
110
  else
69
111
 
70
- html << "<table id=\"event\">\n"
112
+ html << "<table id=\"event\" class=\"table table-striped\">\n"
71
113
  html << "<tbody>\n"
72
114
 
73
115
  html << "<tr id=\"id\">\n"
@@ -189,6 +231,10 @@ class Script
189
231
 
190
232
  html << "</form>\n"
191
233
 
234
+ html << "</div>\n"
235
+ html << "</div>\n"
236
+ html << "</div>\n"
237
+
192
238
  html << "</body>\n"
193
239
  html << "</html>\n"
194
240
 
@@ -24,9 +24,35 @@ class Script
24
24
  esc_ht(title),
25
25
  ]
26
26
 
27
+ html << "<link href=\"%s\" rel=\"stylesheet\">" % [
28
+ "%s/css/bootstrap-combined.min.css" % [
29
+ @assets_elem["bootstrap"],
30
+ ],
31
+ ]
32
+
33
+ html << "<script src=\"%s\"></script>" % [
34
+ "%s/js/bootstrap.min.js" % [
35
+ @assets_elem["bootstrap"],
36
+ ],
37
+ ]
38
+
27
39
  html << "</head>\n"
28
40
  html << "<body>\n"
29
41
 
42
+ html << "<div class=\"navbar navbar-static-top\">\n"
43
+ html << "<div class=\"navbar-inner\">\n"
44
+ html << "<div class=\"container\">\n"
45
+ html << "<ul class=\"nav\">\n"
46
+ html << "<li class=\"active\"><a href=\"/\">Overview</a></li>\n"
47
+ html << "</ul>\n"
48
+ html << "</div>\n"
49
+ html << "</div>\n"
50
+ html << "</div>\n"
51
+
52
+ html << "<div class=\"container\">\n"
53
+ html << "<div class=\"row\">\n"
54
+ html << "<div class=\"span12\">\n"
55
+
30
56
  html << "<h1>%s</h1>\n" % [
31
57
  esc_ht(title),
32
58
  ]
@@ -35,7 +61,7 @@ class Script
35
61
  html << "<p>No events have been logged</p>\n"
36
62
  else
37
63
 
38
- html << "<table id=\"summaries\">\n"
64
+ html << "<table class=\"table table-striped\" id=\"summaries\">\n"
39
65
  html << "<thead>\n"
40
66
 
41
67
  html << "<tr>\n"
@@ -87,6 +113,10 @@ class Script
87
113
 
88
114
  end
89
115
 
116
+ html << "</div>\n"
117
+ html << "</div>\n"
118
+ html << "</div>\n"
119
+
90
120
  html << "</body>\n"
91
121
  html << "</html>\n"
92
122
 
@@ -103,6 +103,9 @@ class Script
103
103
  @icinga_elem =
104
104
  @config_elem.find_first("icinga")
105
105
 
106
+ @assets_elem =
107
+ @config_elem.find_first("assets")
108
+
106
109
  end
107
110
 
108
111
  def connect_db
@@ -32,9 +32,46 @@ class Script
32
32
  esc_ht(title),
33
33
  ]
34
34
 
35
+ html << "<link href=\"%s\" rel=\"stylesheet\">" % [
36
+ "%s/css/bootstrap-combined.min.css" % [
37
+ @assets_elem["bootstrap"],
38
+ ],
39
+ ]
40
+
41
+ html << "<script src=\"%s\"></script>" % [
42
+ "%s/js/bootstrap.min.js" % [
43
+ @assets_elem["bootstrap"],
44
+ ],
45
+ ]
46
+
35
47
  html << "</head>\n"
36
48
  html << "<body>\n"
37
49
 
50
+ html << "<div class=\"navbar navbar-static-top\">\n"
51
+ html << "<div class=\"navbar-inner\">\n"
52
+ html << "<div class=\"container\">\n"
53
+ html << "<ul class=\"nav\">\n"
54
+ html << "<li><a href=\"/\">Overview</a></li>\n"
55
+ html << "<li><a href=\"%s\">Service</a></li>\n" % [
56
+ esc_ht("/service/%s" % [
57
+ context[:service],
58
+ ]),
59
+ ]
60
+ html << "<li class=\"active\"><a href=\"%s\">Host</a></li>\n" % [
61
+ esc_ht("/service/%s/host/%s" % [
62
+ context[:service],
63
+ context[:host],
64
+ ])
65
+ ]
66
+ html << "</ul>\n"
67
+ html << "</div>\n"
68
+ html << "</div>\n"
69
+ html << "</div>\n"
70
+
71
+ html << "<div class=\"container\">\n"
72
+ html << "<div class=\"row\">\n"
73
+ html << "<div class=\"span12\">\n"
74
+
38
75
  html << "<h1>%s</h1>\n" % [
39
76
  esc_ht(title),
40
77
  ]
@@ -44,7 +81,7 @@ class Script
44
81
  "host</p>\n"
45
82
  else
46
83
 
47
- html << "<table id=\"events\">\n"
84
+ html << "<table id=\"events\" class=\"table table-striped\">\n"
48
85
  html << "<thead>\n"
49
86
 
50
87
  html << "<tr>\n"
@@ -96,6 +133,10 @@ class Script
96
133
 
97
134
  end
98
135
 
136
+ html << "</div>\n"
137
+ html << "</div>\n"
138
+ html << "</div>\n"
139
+
99
140
  html << "</body>\n"
100
141
  html << "</html>\n"
101
142
 
@@ -30,9 +30,38 @@ class Script
30
30
  esc_ht(title),
31
31
  ]
32
32
 
33
+ html << "<link href=\"%s\" rel=\"stylesheet\">" % [
34
+ "%s/css/bootstrap-combined.min.css" % [
35
+ @assets_elem["bootstrap"],
36
+ ],
37
+ ]
38
+
39
+ html << "<script src=\"%s\"></script>" % [
40
+ "%s/js/bootstrap.min.js" % [
41
+ @assets_elem["bootstrap"],
42
+ ],
43
+ ]
44
+
33
45
  html << "</head>\n"
34
46
  html << "<body>\n"
35
47
 
48
+ html << "<div class=\"navbar navbar-static-top\">\n"
49
+ html << "<div class=\"navbar-inner\">\n"
50
+ html << "<div class=\"container\">\n"
51
+ html << "<ul class=\"nav\">\n"
52
+ html << "<li><a href=\"/\">Overview</a></li>\n"
53
+ html << "<li class=\"active\"><a href=\"%s\">Service</a></li>\n" % [
54
+ "/service/#{context[:service]}",
55
+ ]
56
+ html << "</ul>\n"
57
+ html << "</div>\n"
58
+ html << "</div>\n"
59
+ html << "</div>\n"
60
+
61
+ html << "<div class=\"container\">\n"
62
+ html << "<div class=\"row\">\n"
63
+ html << "<div class=\"span12\">\n"
64
+
36
65
  html << "<h1>%s</h1>\n" % [
37
66
  esc_ht(title),
38
67
  ]
@@ -41,7 +70,7 @@ class Script
41
70
  html << "<p>No events have been logged for this service</p>\n"
42
71
  else
43
72
 
44
- html << "<table id=\"summaries\">\n"
73
+ html << "<table id=\"summaries\" class=\"table table-striped\">\n"
45
74
  html << "<thead>\n"
46
75
 
47
76
  html << "<tr>\n"
@@ -99,6 +128,10 @@ class Script
99
128
 
100
129
  end
101
130
 
131
+ html << "</div>\n"
132
+ html << "</div>\n"
133
+ html << "</div>\n"
134
+
102
135
  html << "</body>\n"
103
136
  html << "</html>\n"
104
137
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hq-log-monitor-server
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: