Permalink
Browse files

rules ui

  • Loading branch information...
1 parent d9a5ac5 commit 1fc8436263b0eea43a63a4673bd3faffc5162311 @fetep committed Mar 11, 2012
Showing with 94 additions and 0 deletions.
  1. +9 −0 static/cepmon.css
  2. +3 −0 views/alert_row.erb
  3. +1 −0 views/alert_table.erb
  4. +1 −0 views/layout.erb
  5. +43 −0 views/rule_detail.erb
  6. +15 −0 views/rule_row.erb
  7. +15 −0 views/rule_table.erb
  8. +7 −0 views/rules.erb
View
@@ -0,0 +1,9 @@
+.rule-grid {
+ margin-top: 10px;
+ margin-bottom: 10px;
+ line-height: 20px;
+}
+
+.rule-grid:hover {
+ background: #ddd;
+}
View
@@ -2,6 +2,9 @@
<td>
<%= Time.at(@alert.timestamp) %>
</td>
+ <td>
+ <%= rule_link(@alert.statement, @alert.statement) %>
+ </td>
<td>
<% if @alert.expired? %>
<span class="label">expired</span>
View
@@ -2,6 +2,7 @@
<thead>
<tr>
<td>Timestamp</td>
+ <td>Rule</td>
<td>State</td>
<td>Metric Name</td>
<td>Cluster</td>
View
@@ -5,6 +5,7 @@
<script src="/lib/jquery-1.7.min.js" type="text/javascript"></script>
<script src="/lib/bootstrap/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.min.css">
+ <link rel="stylesheet" href="/cepmon.css">
</head>
<body style="padding-top: 50px;">
<div class="navbar navbar-fixed-top">
View
@@ -0,0 +1,43 @@
+<div class="container">
+
+ <div class="row rule-grid">
+ <div class="span2">
+ <strong>Rule Name</strong>
+ </div>
+ <div class="span6">
+ <%=h @rule[:statement] %>
+ </div>
+ </div>
+
+ <div class="row rule-grid">
+ <div class="span2">
+ <strong>Metric</strong>
+ </div>
+ <div class="span6">
+ <%=h @rule[:name] %>
+ </div>
+ </div>
+
+ <div class="row rule-grid">
+ <div class="span2">
+ <strong>Condition</strong>
+ </div>
+ <div class="span6">
+ <%=h @rule[:operator] %>
+ <%=h @rule[:threshold] %>
+ <%=h @rule[:units] %>
+ for
+ <%=h @rule[:average_over] %>
+ </div>
+ </div>
+
+ <div class="row rule-grid">
+ <div class="span2">
+ <strong>EPL</strong>
+ </div>
+ <div class="span6">
+ <code><%=h @rule[:epl] %></code>
+ </div>
+ </div>
+
+</div>
View
@@ -0,0 +1,15 @@
+<tr>
+ <td>
+ <%= rule_link(@rule[:statement], @rule[:statement]) %>
+ </td>
+ <td>
+ <%=h @rule[:name] %>
+ </td>
+ <td>
+ <%=h @rule[:operator] %>
+ <%=h @rule[:threshold] %>
+ <%=h @rule[:units] %>
+ for
+ <%=h @rule[:average_over] %>
+ </td>
+</tr>
View
@@ -0,0 +1,15 @@
+<table class="table table-condensed table-bordered table-striped">
+ <thead>
+ <tr>
+ <td>Name</td>
+ <td>Metric</td>
+ <td>Condition</td>
+ </tr>
+ </thead>
+ <tbody>
+ <% @rules.sort_by { |r| r[:name] }.each do |rule| %>
+ <% @rule = rule %>
+ <%= erb :rule_row %>
+ <% end %>
+ </tbody>
+</table>
View
@@ -0,0 +1,7 @@
+<div class="page-header">
+ <h1>
+ Alert Rules
+ </h1>
+</div>
+
+<%= erb :rule_table %>

0 comments on commit 1fc8436

Please sign in to comment.