You are viewing a plain text version of this content. The canonical link for it is here.
Posted to alois-commits@incubator.apache.org by fl...@apache.org on 2010/11/04 18:27:42 UTC

svn commit: r1031127 [11/22] - in /incubator/alois/trunk: ./ bin/ debian/ doc/ etc/ etc/alois/ etc/alois/apache2/ etc/alois/environments/ etc/alois/prisma/ etc/cron.d/ etc/default/ etc/logrotate.d/ prisma/ prisma/bin/ prisma/conf/ prisma/conf/prisma/ p...

Added: incubator/alois/trunk/rails/app/views/help/_munin_help.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/help/_munin_help.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/help/_munin_help.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/help/_munin_help.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,2 @@
+<%= help_title("Munin") %>
+We use munin for host overall statistics. It includes statistics about processor, memory and harddisk-space. Alois comes with some munin-plugins that gives a short overview of the message amount processed by alois. To learn more of munin see: <a href="http://munin.sourceforge.net/" target="_blank">Munin at sourceforge</a>
\ No newline at end of file

Added: incubator/alois/trunk/rails/app/views/help/_prisma_help.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/help/_prisma_help.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/help/_prisma_help.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/help/_prisma_help.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,6 @@
+<%= help_title("Prisma") %>
+<p>Prisma is the log message parsing
+daemon. It reads log messages from the
+ <%= help_link "pumpy" %> database, interprets
+its contents (disassembling) and writes it
+into the <%= help_link "Dobby" %> database.</p>

Added: incubator/alois/trunk/rails/app/views/help/_pumpy_count_help.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/help/_pumpy_count_help.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/help/_pumpy_count_help.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/help/_pumpy_count_help.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,4 @@
+<%= help_title("Pumpy incoming rate") %>
+<p>The amount of messages that is coming into
+the pumpy database.</p>
+<p>The unit is messages per second.</p>

Added: incubator/alois/trunk/rails/app/views/help/_pumpy_help.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/help/_pumpy_help.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/help/_pumpy_help.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/help/_pumpy_help.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,8 @@
+<%= help_title("Pumpy") %>
+<p>The Pumpy database appliance is the first stage
+where the messages flowing into alois are
+stored. It's some sort of buffer - means, that
+if <%= help_link "Prisma", "prisma" %> is not running (e.g. for
+administrative purpose) all messages are stored
+here until the disassembling of the messages
+can be resumed.</p>

Added: incubator/alois/trunk/rails/app/views/help/_pumpy_in.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/help/_pumpy_in.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/help/_pumpy_in.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/help/_pumpy_in.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1 @@
+

Added: incubator/alois/trunk/rails/app/views/help/_pumpy_in_help.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/help/_pumpy_in_help.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/help/_pumpy_in_help.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/help/_pumpy_in_help.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,8 @@
+<%= help_title("Sink input rate") %>
+<p>The total amount of messages reaching the sink
+host. This is measured before any message is thrown
+away.</p>
+<p>Currently this value is the amount of syslog packages
+reaching the sink host.</p>
+<p>The unit is messages per second.</p>
+

Added: incubator/alois/trunk/rails/app/views/help/_pumpy_out_help.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/help/_pumpy_out_help.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/help/_pumpy_out_help.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/help/_pumpy_out_help.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,5 @@
+<%= help_title("Pumpy outgoing rate") %>
+<p>The amount of messages leaving
+the pumpy database. This means these messages
+have been processed by prisma.</p>
+<p>The unit is messages per second.</p>

Added: incubator/alois/trunk/rails/app/views/help/_reporter_help.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/help/_reporter_help.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/help/_reporter_help.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/help/_reporter_help.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,11 @@
+<%= help_title("Reporter") %>
+<p>Generating reports and graphics of the gathered information. It includes the OSSIM webpage for alarming and incident management. Regular checks of log the incoming log messages by executing SQL queries to ensure that network environment network fullfills the declared guideline.</p>
+<p>The reporter appliance is a rails based web application
+where you can do the following tasks:
+  <ul>
+    <li>configure your <%= help_link "Sentinels" %></li>
+    <li>get statistic information about the alois system itself</li>
+    <li>survey your logs</li>
+    <li>building charts</li>
+  </ul>
+</p>
\ No newline at end of file

Added: incubator/alois/trunk/rails/app/views/help/_sentinel_help.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/help/_sentinel_help.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/help/_sentinel_help.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/help/_sentinel_help.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,3 @@
+<%= help_title("Sentinel") %>
+
+<p>Sentinels are periodical executed SQL queries to perform user actions when specified constraints match in the log database. It is possible to check if some known bad logs have been reported to alois or else if some logs are missed that were expected to be available. The sentinel executions are performed by using the crond daemon and execution the desired SQL queries trough the prisma package. It is possible to send alarm mails if the query exceeds a defined amount of records.</p>
\ No newline at end of file

Added: incubator/alois/trunk/rails/app/views/help/_sink_help.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/help/_sink_help.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/help/_sink_help.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/help/_sink_help.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,10 @@
+<%= help_title("Sink") %>
+<p>Queue for log messages before they get processed by the ALOIS system. The queues are implemented as MySql tables in a database called <% help_link "Pumpy" %>.</p>
+<p>At the moment this appliance consists of
+the <%= help_link "syslog-ng","syslog_ng" %> daemon. It
+recieves the log messages (from UDP 514), filters them and
+writes them into the <%= help_link "Pumpy" %>
+database.</p>
+<p>It is planned that this appliance will be 
+able to recieve Mails and other messages that
+can transport logs.</p>

Added: incubator/alois/trunk/rails/app/views/help/_survey_help.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/help/_survey_help.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/help/_survey_help.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/help/_survey_help.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,32 @@
+<%= help_title("Survey Page") %>
+
+<p>This page is splited into 3 Parts:
+<ul>
+ <li>Condition part: Here you can modify the conditions 
+which should be applied to your current dataset.</li>
+ <li>Information part: Informations about the selected
+data.</li>
+ <li>Viewing part: Displaying the current selected data in
+a table or graphic.</li>
+</ul>
+</p>
+
+<%= help_subtitle("Condition part") %>
+<p>Here are all the currently selected conditions and filters
+displayed. These conditions and rules are applied to the current
+data set.</p>
+<p>Here you can do the following tasks:
+<ul>
+  <li>Add a filter <%= help_goto "survey", "add_filter" %></li>
+  <li>Remove a filter  <%= help_goto "survey", "remove_filter" %></li>
+  <li>Add a condition  <%= help_goto "filters", "add_condition" %></li>
+  <li>Remove a condition  <%= help_goto "filters", "remove_condition" %></li>
+  <li>Create a filter of the currently selected conditions and filters  <%= help_goto "survey", "create_filter" %></li>
+</ul>
+
+<%= help_subtitle("Information part") %>
+
+
+<%= help_subtitle("Viewing part") %>
+
+<p>
\ No newline at end of file

Added: incubator/alois/trunk/rails/app/views/help/_syslog_ng_help.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/help/_syslog_ng_help.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/help/_syslog_ng_help.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/help/_syslog_ng_help.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,4 @@
+<%= help_title("syslog-ng") %>
+syslog-ng uses the quasi-standard BSD syslog protocol, specified in RFC 3164. As the text of RFC 3164 is vague and was never intended to be a standard, various incompatible extensions of it emerged. syslog-ng tries it hard to interoperate a wide variety of devices, and with user control the format of relayed messages can be customized.
+
+<br><a href="http://en.wikipedia.org/wiki/Syslog-ng">See Wikipedia</a>
\ No newline at end of file

Added: incubator/alois/trunk/rails/app/views/help/_tablelist_help.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/help/_tablelist_help.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/help/_tablelist_help.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/help/_tablelist_help.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,6 @@
+<%= help_title("Table list") %>
+<p>On this page you can see all tables used to store the
+processed information. These tables are only used to store
+information. To analyze the logs you should better use
+the <%= help_link "Views" %>.</p>
+<p><%= link_to "All tables", :controller => "tablelist" %></p>

Added: incubator/alois/trunk/rails/app/views/help/_view_help.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/help/_view_help.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/help/_view_help.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/help/_view_help.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,3 @@
+<%= help_title("View") %>
+<p>A view is basically a query that is stored in the database. It gives you another sight to your data. Normally a view should contain a column "date" so that you can filter out a specific set and the system does not have to search the whole table for your request.</p>
+<p><%= link_to "All views", :controller => "views" %></p>

Added: incubator/alois/trunk/rails/app/views/help/index.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/help/index.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/help/index.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/help/index.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,2 @@
+<%= render :partial => get_page %>
+<%= render :partial => "index_help" %>
\ No newline at end of file

Added: incubator/alois/trunk/rails/app/views/help/inline.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/help/inline.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/help/inline.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/help/inline.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,8 @@
+<div id="help">
+  <% if params[:title] and params[:text] %>
+    <%= help_title(h params[:title]) %>
+    <p><%= params[:text] %></p>
+  <% else %> 
+    <%= render :partial => get_page %>
+  <% end %> 
+</div>
\ No newline at end of file

Added: incubator/alois/trunk/rails/app/views/hidden.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/hidden.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/hidden.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/hidden.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,2 @@
+<div id="help">
+</div>
\ No newline at end of file

Added: incubator/alois/trunk/rails/app/views/ip_ranges/_form.html.erb
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/ip_ranges/_form.html.erb?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/ip_ranges/_form.html.erb (added)
+++ incubator/alois/trunk/rails/app/views/ip_ranges/_form.html.erb Thu Nov  4 18:27:22 2010
@@ -0,0 +1,29 @@
+<%= error_messages_for 'ip_range' %>
+
+  <tr>
+    <th class="form_header" colspan="2">Ip Range</th>
+  </tr>
+  <tr>
+    <th><label for="ip_range_name">Name</label></th>
+    <td><%= text_field 'ip_range', 'name'  %></td>
+   </tr>
+   <tr>
+     <th><label for="ip_range_description">Description</label></th>
+    <td><%= text_area 'ip_range', 'description', :style => 'width: 98%', :rows => 4 %></td>
+   </tr>
+  <tr>
+    <th><label for="ip_range_from_ip">From IP</label></th>
+    <td><%= text_field 'ip_range', 'from_ip'  %></td>
+  </tr>
+  <tr>
+    <th><label for="ip_range_to_ip">To IP</label></th>
+    <td><%= text_field 'ip_range', 'to_ip'  %></td>
+  </tr>
+  <tr>
+    <th><label for="ip_range_netmask"></label>Netmask</th>
+    <td><%= text_field 'ip_range', 'netmask'  %></td>
+  </tr>
+  <tr>
+    <th><label for="ip_range_"></label>Enabled</th>
+    <td><%= check_box 'ip_range', 'enabled'  %></td>
+  </tr>

Added: incubator/alois/trunk/rails/app/views/ip_ranges/edit.html.erb
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/ip_ranges/edit.html.erb?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/ip_ranges/edit.html.erb (added)
+++ incubator/alois/trunk/rails/app/views/ip_ranges/edit.html.erb Thu Nov  4 18:27:22 2010
@@ -0,0 +1,13 @@
+<%= title "#{@controller.action_name.humanize} #{@controller.controller_name.singularize.humanize} - #{@ip_range.name}" %>
+
+<div id="page">
+
+  <table class="form">
+  <% form_for(@ip_range) do |f| %>
+    <%= render :partial => 'form' %>
+    <tr>
+      <td class="button-bar" colspan="2"><%= f.submit "Update" %> <%= f.submit "Cancel" %></td>
+    </tr>
+  <% end %>
+  </table>
+</div>

Added: incubator/alois/trunk/rails/app/views/ip_ranges/index.html.erb
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/ip_ranges/index.html.erb?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/ip_ranges/index.html.erb (added)
+++ incubator/alois/trunk/rails/app/views/ip_ranges/index.html.erb Thu Nov  4 18:27:22 2010
@@ -0,0 +1,34 @@
+<%= title @controller.controller_name.humanize %>
+
+<div id="page">
+<%= error_messages %>
+
+<table class="form">
+  <tr>
+    <th class="form_header" style="width:0px;">ID</th>
+    <th class="form_header">Name</th>
+    <th class="form_header">Description</th>
+    <th class="form_header">From IP</th>
+    <th class="form_header">To IP</th>
+    <th class="form_header" style="width: 320px"/>
+  </tr>
+<% for ip_range in @ip_ranges %>
+  <tr>
+    <td><%=h ip_range.id %></td>
+    <td><%=h ip_range.name %></td>
+    <td><%=h ip_range.description %></td>
+    <td><%=h ip_range.from_ip %></td>
+    <td><%=h ip_range.to_ip %></td>
+    <td>
+    <%= link_to image_tag('show.png'), ip_range %>
+    <%= link_to image_tag('edit.png'), edit_ip_range_path(ip_range) %>
+    <%= link_to image_tag('delete.png'), ip_range, :confirm => 'Are you sure?', :method => :delete %></td>
+    </td>
+  </tr>
+<% end %>
+  <tr>
+    <td class="button-bar" colspan="6">
+      <%= button_to "New #{@controller.controller_name.singularize.humanize}", new_ip_range_path %>
+    </td>
+  </tr>
+</table>

Added: incubator/alois/trunk/rails/app/views/ip_ranges/new.html.erb
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/ip_ranges/new.html.erb?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/ip_ranges/new.html.erb (added)
+++ incubator/alois/trunk/rails/app/views/ip_ranges/new.html.erb Thu Nov  4 18:27:22 2010
@@ -0,0 +1,13 @@
+<%= title "New #{@controller.action_name.humanize} #{@controller.controller_name.singularize.humanize} - #{@ip_range.name}" %>
+
+<div id="page">
+
+  <table class="form">
+  <% form_for(@ip_range) do |f| %>
+    <%= render :partial => 'form' %>
+    <tr>
+      <td class="button-bar" colspan="2"><%= f.submit "Create" %> <%= f.submit "Cancel" %></td>
+    </tr>
+  <% end %>
+  </table>
+</div>

Added: incubator/alois/trunk/rails/app/views/ip_ranges/show.html.erb
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/ip_ranges/show.html.erb?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/ip_ranges/show.html.erb (added)
+++ incubator/alois/trunk/rails/app/views/ip_ranges/show.html.erb Thu Nov  4 18:27:22 2010
@@ -0,0 +1,46 @@
+<%= title "Ip Range - #{@ip_range.name}" %>
+  
+<div id="page">
+<table class="form">
+    <tr>
+      <th class="form_header" colspan="2">Ip Range</th>
+    </tr>
+  <tr>
+    <th><label for="ip_range_name">Name</label></th>
+    <td><%=h @ip_range.name %></td>
+  </tr>
+  <tr>
+    <th><label for="ip_range_description">Description</label></th>
+    <td><%=h @ip_range.description %></td>
+  </tr>
+  <tr>
+    <th><label for="ip_range_from_ip">From IP</label></th>
+    <td><%=h @ip_range.from_ip %></td>
+  </tr>
+  <tr>
+    <th><label for="ip_range_to_ip">To IP</label></th>
+    <td><%= @ip_range.to_ip %></td>
+  </tr>
+  <tr>
+    <th><label for="ip_range_netmask">Netmask</label></th>
+    <td><%=h @ip_range.netmask %></td>
+  </tr>
+  <tr>
+    <th><label for="ip_range_enabled">Enabled</label></th>
+    <td><%=h @ip_range.enabled ? "Yes" : "No" %></td>
+  </tr>
+
+  <%= post_attributes_show %>
+    
+    <tr>
+      <td class="button-bar" colspan="2">
+	<%= link_to 'Edit', edit_ip_range_path(@ip_range) %> |
+	<%= link_to 'List all', ip_ranges_path %>
+<!--        <%= button_to 'Edit',  :action => "edit", :id => @ip_range %>
+        <%= button_to 'List all', ip_range_path %> -->
+      </td>
+    </tr>
+  </table>
+</div>
+
+

Added: incubator/alois/trunk/rails/app/views/layouts/application.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/layouts/application.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/layouts/application.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/layouts/application.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,41 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
+<html>
+<head>
+  <title><%=h page_title %></title>
+  <%= stylesheet_link_tag 'menu' %>
+  <%= stylesheet_link_tag 'common' %>
+  <%= stylesheet_link_tag 'logintas' %>
+  <%= javascript_include_tag :defaults %>
+</head>
+
+<body>	
+  <table id="header" summary="Table for formatting header">
+    <tr>
+      <td  id="header-logo" width="60">
+        <a href="http://www.logintas.ch"><%= image_tag "logo_logintas.png", :size => "50x50", :alt => "Logintas AG - Information Services" %></a>
+      </td>
+      <td id="header-text">
+        Alois <%= main_menu(common_menu) %> <%= status_traffic_light(:width => 15) rescue $! %> <%= bookmark_add_link %> <%= main_help_link nil,{} %>
+      </td>
+    </tr>
+  </table>
+
+<div style="margin-left:12px;">
+  <%= @controller.flash_text %>
+
+<!-- main page -->
+<table border="0" cellspacing="0" cellpadding="0" summary="Main formatting table">
+  <tr>
+   <td valign="top" width="0"><% if @controller.controller_name != "help" %><div id='help'></div><% end %></td>
+   <td valign="top"><%= @content_for_layout %></td>
+  </tr>
+</table>
+
+
+<!-- footer -->
+<span class="footer"><a href="http://public.logintas.ch/public/ProDucts/AloIs" style="font-family: Arial,Helvetica,Verdana; font-size: 10px">Alois</a> <%= ALOIS_VERSION %> &copy; <a href="http://www.logintas.ch" style="font-family: Arial,Helvetica,Verdana; font-size: 10px">Logintas AG</a>
+</span>
+</div>
+
+</body>
+</html>

Added: incubator/alois/trunk/rails/app/views/prisma/_connection.html.erb
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/prisma/_connection.html.erb?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/prisma/_connection.html.erb (added)
+++ incubator/alois/trunk/rails/app/views/prisma/_connection.html.erb Thu Nov  4 18:27:22 2010
@@ -0,0 +1,52 @@
+<%= title "Database - #{@connection.name}" %>
+  
+<div id="page">
+<table class="form">
+    <tr>
+      <th class="form_header" colspan="2">Connection</th>
+    </tr>
+  <tr>
+    <th><label for="connection_name">Id</label></th>
+    <td><%=h @connection.name %></td>
+  </tr>
+  <tr>
+    <th><label for="adapter_name">Adapter</label></th>
+    <td><%=h @connection.adapter %></td>
+  </tr>
+  <tr>
+    <th><label for="connection_database">Current Database</label></th>
+    <td><%=h @connection.database  %></td>
+  </tr>
+  <tr>
+    <th><label for="connection_host">Host</label></th>
+    <td><%=h @connection.host %></td>
+  </tr>
+  <tr>
+    <th><label for="connection_username">Username</label></th>
+    <td><%=h @connection.username %></td>
+  </tr>
+  <tr>
+    <th><label for="connection_view">Current Queries</label></th>
+    <td><%= render :partial => "queries" %> </td>
+  </tr>
+  <tr>
+    <th><label for="connection_view">Innodb Status</label></th>
+    <td><pre><%= h @connection.status rescue $!.to_s  %></pre></td>
+  </tr>
+  <tr>
+    <th><label for="connection_view">Variables</label></th>
+    <td><pre><%=h @connection.variables_text rescue $!.to_s  %></pre></td>
+  </tr>
+  <tr>
+    <th><label for="connection_description">Tables</label></th>
+    <td><%= @connection.activerecord_connection.tables.map{|t| h(t)}.join("<br>") %></td>
+  </tr>
+    <tr>
+      <td class="button-bar" colspan="2">
+        <%= button_to 'Edit connection', :action => 'edit', :id => @connection %>
+        <%= button_to 'List all connections', :action => 'list' %>
+        <%= button_to 'Manually execute', :action => 'manually_execute', :id => @connection %>
+      </td>
+    </tr>
+  </table>
+</div>

Added: incubator/alois/trunk/rails/app/views/prisma/_overview_help.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/prisma/_overview_help.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/prisma/_overview_help.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/prisma/_overview_help.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,40 @@
+<%= help_title("Overview") %>
+
+<p>A square in dark color represent a host of 
+your Alois configuration. Each host contains one
+or more appliances, indicated with squares in light
+color.</p>
+
+<%= help_subtitle("Host") %>
+<p>A square in dark color.</p>
+<p>The name at the top of the host is its short
+name. By clicking on it all measured
+<%= help_link "Munin" %>-statistics for that host 
+are displayed.</p>
+<p>There are the following hosts:
+ <%= help_link "Insink" %>,
+ <%= help_link "Dobby" %>,
+ <%= help_link "Reptor" %>
+</p>
+
+<%= help_subtitle("Appliance") %>
+<p>A square in light color.</p>
+<p>Represents an appliance installed on the host
+surrounded by the appliance square. The first line
+is the appliance's name followed by relevant status
+values.</p>
+<p>There are the following appliances: 
+ <%= help_link "Sink" %>,
+ <%= help_link "Pumpy" %>,
+ <%= help_link "Prisma" %>,
+ <%= help_link "Dobby" %>,
+ <%= help_link "Lizard" %>,
+ <%= help_link "Reporter" %>
+</p>
+
+<%= help_subtitle("Arrows") %>
+<p>The arrows indicate the flow of the messages.
+If you click on a number over or near the arrow,
+you get to the statistic page of this message flow.</p>
+
+

Added: incubator/alois/trunk/rails/app/views/prisma/_queries.html.erb
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/prisma/_queries.html.erb?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/prisma/_queries.html.erb (added)
+++ incubator/alois/trunk/rails/app/views/prisma/_queries.html.erb Thu Nov  4 18:27:22 2010
@@ -0,0 +1,15 @@
+<% @queries = @connection.current_queries %>
+<% if @queries and @queries.length > 0 %>
+<table>
+<tr>
+  <% @queries[0].keys.sort.each {|col| %>
+  <th><%=h col %></th>
+  <% } %>
+</tr>
+<% @connection.current_queries.each {|@query| %>
+<%= render :partial => "query" %>
+<% } %>
+</table>
+<% else %>
+No queries.
+<% end %>

Added: incubator/alois/trunk/rails/app/views/prisma/_query.html.erb
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/prisma/_query.html.erb?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/prisma/_query.html.erb (added)
+++ incubator/alois/trunk/rails/app/views/prisma/_query.html.erb Thu Nov  4 18:27:22 2010
@@ -0,0 +1,15 @@
+<tr>
+  <% @query.keys.sort.each {|key| %>
+    <% if key == "Info" %>
+      <td><%= create_links_in_query(@query[key]) %></td>
+    <% else %>
+      <td  style="background-color:<%= query_background_color(@query) %>;"><%= @query[key] %></td>
+    <% end %>
+  <% } %>
+  <td>
+    <% if @query["Time"].to_i > 5 and @query["Command"] == "Query" %>
+      <%= button_to "Kill", :action => "kill_query", :id => @query["Id"], :connection_id => @connection.object_id %>
+    <% end %>
+  </td>
+</tr>
+  
\ No newline at end of file

Added: incubator/alois/trunk/rails/app/views/prisma/_statistic.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/prisma/_statistic.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/prisma/_statistic.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/prisma/_statistic.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,2 @@
+<a href="<%= @statistic[:link_prefix] %>.html">
+<img src="<%= @statistic[:link_prefix] %>-<%= @interval %>.png" alt="<%= @statistic[:desc] %> <%= @interval %>" />

Added: incubator/alois/trunk/rails/app/views/prisma/databases.html.erb
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/prisma/databases.html.erb?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/prisma/databases.html.erb (added)
+++ incubator/alois/trunk/rails/app/views/prisma/databases.html.erb Thu Nov  4 18:27:22 2010
@@ -0,0 +1,3 @@
+<% @connections.each {|@connection| %>
+<%= render :partial => "connection" %>
+<% } %>
\ No newline at end of file

Added: incubator/alois/trunk/rails/app/views/prisma/load_default_working_items.html.erb
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/prisma/load_default_working_items.html.erb?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/prisma/load_default_working_items.html.erb (added)
+++ incubator/alois/trunk/rails/app/views/prisma/load_default_working_items.html.erb Thu Nov  4 18:27:22 2010
@@ -0,0 +1 @@
+<pre><%=h @text %></pre>
\ No newline at end of file

Added: incubator/alois/trunk/rails/app/views/prisma/overview-1tier.html.erb
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/prisma/overview-1tier.html.erb?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/prisma/overview-1tier.html.erb (added)
+++ incubator/alois/trunk/rails/app/views/prisma/overview-1tier.html.erb Thu Nov  4 18:27:22 2010
@@ -0,0 +1,70 @@
+<%= title("Alois Overview") %>
+<div id="page" style="padding: 20px; min-width: 870px;">
+<div style="position:relative;font-weight:bold;height:300px;width:870px;">
+  <%= image_tag "overview-1tier-flowchart.png", :border => 0, :size => "850", :style => "position:relative;" %>
+
+  <!-- sinkhost -->
+  <%= host_name_div("localhost", 100, 3) %>
+
+  <!-- left from sink -->
+  <%= arrow_div('pumpy_in', 22, 71) %>
+  
+  <!-- sink -->
+  <div style="position:absolute;top:35px;left:102px;" class="paint_host">
+   sink <%= help_button "sink" %><br/>
+  </div>
+
+  <!--  sink to pumpy -->
+  <%= arrow_div('pumpy_count', 214, 71) %>
+
+  <!-- pumpy -->
+  <div style="position:absolute;top:35px;left:274px;" class="paint_host">   
+    pumpy <%= help_button "pumpy" %><br/>
+    <%= Prisma::Database.get_classes(:raw).length %> Tables <br/>
+    <%= updating_value "pumpy_queue" %>% Full
+  </div>
+
+  <!-- pumpy to prisma -->
+  <%= arrow_div('pumpy_out', 335, 157) %>
+
+  <!-- dobby -->
+  <div style="position:absolute;top:35px;left:440px;" class="paint_host">
+    dobby <%= help_button "dobby" %><br/>
+    <%= Prisma::Database.get_classes(:meta).length %> Tables<br/>
+   </div>
+ 
+  <!-- dobby to prism -->
+  <%= arrow_div('alois_in', 500, 157) %>
+
+  <!-- lizard -->
+  <div style="position:absolute;top:35px;left:600px;" class="paint_host">
+    lizard <%= help_button "lizard" %><br/>
+    <%= Sentinel.find(:all).select {|s| s.enabled }.length %> Sentinels<br/>
+    <%= updating_value("alarms_today") %> Alarms Today<br/>
+    <%= updating_value("yellow_alarms") %> Yellow Alarms<br/>
+    <%= updating_value("red_alarms") %> Red Alarms<br/>
+  </div>
+
+  <!-- reporter -->
+  <div style="position:absolute;top:35px;left:730px;" class="paint_host">
+    reporter  <%= help_button "reporter" %><br/>
+    <%= View.find(:all, :order => 'name').length %> Views<br/>
+    <%= updating_value("reports_today") %> Reports Today
+  </div>
+
+  <!-- prisma -->
+  <div style="position:absolute;top:200px;left:100px;" class="paint_host">
+    prisma <%= help_button "prisma" %><br/>
+<!--    Archiv: <span id="prisma_archiv">< @controller.measure('prisma_archiv') ></span>% Full -->
+
+  </div>
+  
+  <div style="position:absolute;top:150px;left:670px;"><%= status_traffic_light(:height => 100) %></div>
+
+
+</div>
+</div>
+<% for stat in PrismaController::STAT_NAMES %>
+  <%= periodically_call_remote(:update => stat, :frequency => 300, 
+	:url => {:action => 'measure_inline', :params => {:type => stat} }) %>
+<% end %>

Added: incubator/alois/trunk/rails/app/views/prisma/overview-3tier.html.erb
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/prisma/overview-3tier.html.erb?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/prisma/overview-3tier.html.erb (added)
+++ incubator/alois/trunk/rails/app/views/prisma/overview-3tier.html.erb Thu Nov  4 18:27:22 2010
@@ -0,0 +1,77 @@
+<%= title("Alois Overview") %>
+<div id="page" style="padding: 20px; min-width: 870px;">
+<div style="position:relative;font-weight:bold;height:300px;width:870px;">
+  <%= image_tag "overview-3tier-flowchart.png", :border => 0, :size => "850", :style => "position:relative;" %>
+
+  <!-- sinkhost -->
+  <%= host_name_div(@sink, 100, 3) %>
+
+  <!-- left from sink -->
+  <%= arrow_div('pumpy_in', 22, 71) %>
+  
+  <!-- sink -->
+  <div style="position:absolute;top:35px;left:102px;">
+   sink <%= help_button "sink" %><br/>
+  </div>
+
+  <!--  sink to pumpy -->
+  <%= arrow_div('pumpy_count', 214, 71) %>
+
+  <!-- pumpy -->
+  <div style="position:absolute;top:35px;left:274px;">   
+    pumpy <%= help_button "pumpy" %><br/>
+    <%= Prisma::Database.get_classes(:raw).length %> Tables <br/>
+    <%= updating_value "pumpy_queue" %>% Full
+  </div>
+
+  <!-- pumpy to prisma -->
+  <%= arrow_div('pumpy_out', 335, 157) %>
+
+  <!-- dobby-host -->
+  <%= host_name_div(@dobby, 433, 3) %>
+
+  <!-- dobby -->
+  <div style="position:absolute;top:35px;left:440px;">
+    dobby <%= help_button "dobby" %><br/>
+    <%= Prisma::Database.get_classes(:meta).length %> Tables<br/>
+   </div>
+ 
+  <!-- dobby to prism -->
+  <%= arrow_div('alois_in', 500, 157) %>
+
+
+  <!-- reporter-host -->
+  <%= host_name_div(@reporter, 620, 3) %>
+
+  <!-- lizard -->
+  <div style="position:absolute;top:35px;left:600px;">
+    lizard <%= help_button "lizard" %><br/>
+    <%= Sentinel.find(:all).select {|s| s.enabled }.length %> Sentinels<br/>
+    <%= updating_value("alarms_today") %> Alarms Today<br/>
+    <%= updating_value("yellow_alarms") %> Yellow Alarms<br/>
+    <%= updating_value("red_alarms") %> Red Alarms<br/>
+  </div>
+
+  <!-- reporter -->
+  <div style="position:absolute;top:35px;left:730px;">
+    reporter  <%= help_button "reporter" %><br/>
+    <%= View.find(:all, :order => 'name').length %> Views<br/>
+    <%= updating_value("reports_today") %> Reports Today
+  </div>
+
+  <!-- prisma -->
+  <div style="position:absolute;top:200px;left:100px;">
+    prisma <%= help_button "prisma" %><br/>
+<!--    Archiv: <span id="prisma_archiv">< @controller.measure('prisma_archiv') ></span>% Full -->
+
+  </div>
+  
+  <div style="position:absolute;top:150px;left:670px;"><%= status_traffic_light(:height => 100) %></div>
+
+
+</div>
+</div>
+<% for stat in PrismaController::STAT_NAMES %>
+  <%= periodically_call_remote(:update => stat, :frequency => 300, 
+	:url => {:action => 'measure_inline', :params => {:type => stat} }) %>
+<% end %>

Added: incubator/alois/trunk/rails/app/views/prisma/statistics.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/prisma/statistics.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/prisma/statistics.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/prisma/statistics.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,19 @@
+<%= title("Statistics") %>
+<div id="page" style="padding: 20px; min-width: 870px">
+	<table>
+	<% for item in @statistic_items %>
+	<tr>
+		<td>
+		<a href="<%= item[:link_prefix] %>.html">
+			<img src="<%= item[:link_prefix] %>-day.png" alt="<%= item[:desc] %> today" />
+		</a>
+		</td>
+		<td>
+		<a href="<%= item[:link_prefix] %>.html">
+			<img src="<%= item[:link_prefix] %>-week.png" alt="<%= item[:desc] %> last days" />
+		</a>
+		</td>
+	</tr>
+	<% end %>
+	</table>
+</div>

Added: incubator/alois/trunk/rails/app/views/prisma/status.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/prisma/status.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/prisma/status.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/prisma/status.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,3 @@
+<center>
+ <%= image_tag "traffic_light_green.png" %>
+</center>
\ No newline at end of file

Added: incubator/alois/trunk/rails/app/views/report_mailer/_common_simple.html.erb
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/report_mailer/_common_simple.html.erb?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/report_mailer/_common_simple.html.erb (added)
+++ incubator/alois/trunk/rails/app/views/report_mailer/_common_simple.html.erb Thu Nov  4 18:27:22 2010
@@ -0,0 +1,7 @@
+A Report has been generated for you.
+ ID: <%= @report.id %>
+ Name: <%= @report.name %>
+ Generated by: <%= @report.generated_by %>
+<% if s = @report.sentinel -%> Sentinel: <%= s.name %><% end -%>
+<% if a = @report.alarm -%> Alarm: #<%= a.id %><% end -%>
+ Link: <%= url_for :only_path => false, :controller => :reports, :action => :show, :id => @report %>

Added: incubator/alois/trunk/rails/app/views/report_mailer/normal.html.erb
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/report_mailer/normal.html.erb?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/report_mailer/normal.html.erb (added)
+++ incubator/alois/trunk/rails/app/views/report_mailer/normal.html.erb Thu Nov  4 18:27:22 2010
@@ -0,0 +1,3 @@
+<h1>Report <%= @report.name %></h1>
+<%= link_to "Report \##{@report.id}", :only_path => false, :controller => "reports", :action => "show", :id => @report %>
+<%= BaseMailer.translate_image_links(@report.html) %>

Added: incubator/alois/trunk/rails/app/views/report_mailer/normal.plain.erb
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/report_mailer/normal.plain.erb?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/report_mailer/normal.plain.erb (added)
+++ incubator/alois/trunk/rails/app/views/report_mailer/normal.plain.erb Thu Nov  4 18:27:22 2010
@@ -0,0 +1 @@
+<%= render :partial => "common_simple" %>

Added: incubator/alois/trunk/rails/app/views/report_mailer/simple.html.erb
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/report_mailer/simple.html.erb?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/report_mailer/simple.html.erb (added)
+++ incubator/alois/trunk/rails/app/views/report_mailer/simple.html.erb Thu Nov  4 18:27:22 2010
@@ -0,0 +1,40 @@
+A Report has been generated for you:
+<table class="form">
+
+<!-- sentinel -->
+  <tr>
+    <th><label>ID</label></th>
+    <td><%=h @report.id %></td>
+  </tr>
+
+  <tr>
+    <th><label>Name</label></th>
+    <td><%=h @report.name %></td>
+  </tr>
+
+  <tr>
+    <th><label>Generated by</label></th>
+    <td><%=h @report.generated_by %></td>
+  </tr>
+
+<% if s = @report.sentinel -%>
+  <tr>
+    <th><label>Sentinel</label></th>
+    <td><%=h s.name %></td>
+  </tr>
+<% end -%>
+
+<% if a = @report.alarm -%> 
+  <tr>
+    <th><label>Alarm</label></th>
+    <td><%=h a.id %></td>
+  </tr>
+<% end -%>
+
+  <tr>
+    <th><label>Link</label></th>
+    <td><%= link_to "Report \##{@report.id}", :only_path => false, :controller => "reports", :action => "show", :id => @report %></td>
+  </tr>
+
+</table>
+

Added: incubator/alois/trunk/rails/app/views/report_mailer/simple.plain.erb
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/report_mailer/simple.plain.erb?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/report_mailer/simple.plain.erb (added)
+++ incubator/alois/trunk/rails/app/views/report_mailer/simple.plain.erb Thu Nov  4 18:27:22 2010
@@ -0,0 +1 @@
+<%= render :partial => "common_simple" %>
\ No newline at end of file

Added: incubator/alois/trunk/rails/app/views/report_templates/_edit_charts.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/report_templates/_edit_charts.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/report_templates/_edit_charts.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/report_templates/_edit_charts.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,10 @@
+<% @report_template.charts.each{|@chart| %>
+<%= @chart.name %> <%= link_to "Remove", :action => "remove_chart", :id => @report_template, :chart => @chart %><br>
+<% } %>
+
+<% form_tag :action => :add_chart, :id => @report_template do %>
+<%= select_tag('chart', options_for_select(
+	Chart.charts_for_datasource(@report_template.view).map {|s| [s.name,s.id] 
+ 	}.sort{|x,y| x[0]<=>y[0]}), {:include_blank => true}) %>
+<%= submit_tag "Add"%>
+<% end %>

Added: incubator/alois/trunk/rails/app/views/report_templates/_edit_objects.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/report_templates/_edit_objects.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/report_templates/_edit_objects.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/report_templates/_edit_objects.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,8 @@
+   <tr>
+     <th class="form_header">Charts</th>
+     <th class="form_header">Tables</th>
+   </tr>
+   <tr>
+     <td><%= render :partial => "edit_charts" %></td>
+     <td><%= render :partial => "edit_tables" %></td>
+   </tr>
\ No newline at end of file

Added: incubator/alois/trunk/rails/app/views/report_templates/_edit_tables.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/report_templates/_edit_tables.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/report_templates/_edit_tables.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/report_templates/_edit_tables.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,12 @@
+<% @report_template.tables.each{|@table| %>
+<%= @table.name %> <%= link_to "Remove", :action => "remove_table", :id => @report_template, :table => @table %><br>
+<% } %>
+
+<% form_tag :action => :add_table, :id => @report_template do %>
+<%= select_tag('table', options_for_select(
+	Table.find(:all, :order => "name").select{|table| 
+		table.applyable?(@report_template.view)
+	}.map {|s| [s.name,s.id] 
+ 	}.sort{|x,y| x[0]<=>y[0]}), {:include_blank => true}) %>
+<%= submit_tag "Add"%>
+<% end %>

Added: incubator/alois/trunk/rails/app/views/report_templates/_form.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/report_templates/_form.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/report_templates/_form.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/report_templates/_form.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,35 @@
+<%= error_messages_for 'report_template' %>
+
+   <tr>
+     <th><label for="report_template_title">Name</label></th>
+     <td><%= text_field 'report_template', 'name'  %></td>
+   </tr>
+   <tr>
+     <th><label for="report_template_title">Description</label></th>
+     <td><%= text_field 'report_template', 'description'  %></td>
+   </tr>
+   <tr>
+     <th><label for="report_template_title">Title</label></th>
+     <td><%= text_field 'report_template', 'title'  %></td>
+   </tr>
+   <tr>
+     <th><label for="report_template_text">Text</label></th>
+     <td><%= text_area 'report_template', 'text'  %><br>
+       <%=h "<<TABLE>> will be replaced with the selected tables." %><br>
+       <%=h "<<CHART>> will be replaced with the selected charts." %><br>
+       <%=h "<<COUNT>> will be replaced with the total count of records of the view/datasource." %>
+     </td>
+   </tr>
+   <tr>
+     <th><label for="report_template_view_id">View</label></th>
+     <td><%= select("report_template", "view_id", 
+	View.find(:all).select{|v| @report_template.charts.reject{|c| c.applyable?(v)}.length == 0}.collect {|v| [v.name , v.id]}, {:include_blank => true}) %></td>
+   </tr>
+<% if params[:action] == "new" %>
+   <tr>
+     <th><label for="report_template_chart_tables">Charts and Tables:</label></th>
+     <td>Please create the template before adding charts and tables.</td>
+   </tr>
+<% else %>
+<%= render :partial => "edit_objects" %>
+<% end %>

Added: incubator/alois/trunk/rails/app/views/report_templates/edit.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/report_templates/edit.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/report_templates/edit.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/report_templates/edit.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,17 @@
+<h1>Edit <%= @report_template.name %></h1>
+<div id="page">
+
+  <table class="form">
+
+<% form_tag :action => 'update', :id => @report_template do %>
+    <tr>
+      <th class="form_header" colspan="2">Report Template</th>
+    </tr>
+  <%= render :partial => 'form' %>
+    <tr>
+      <td class="button-bar" colspan="2"><%= submit_tag "Update" %> <%= submit_tag "Cancel" %></td>
+    </tr>
+<% end %>
+
+  </table>
+</div>

Added: incubator/alois/trunk/rails/app/views/report_templates/list.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/report_templates/list.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/report_templates/list.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/report_templates/list.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,30 @@
+<%= title @controller.controller_name.humanize %>
+
+<div id="page">
+<%= error_messages %>
+
+<table class="form">
+	<tr>
+		<th class="form_header">Name</th>
+		<th class="form_header">Description</th>
+		<th class="form_header" style="width: 160px"/>
+	</tr>  
+<% for report_template in @report_templates %>
+	<tr>
+		<td><%=h report_template.name %></td>
+		<td><%=h report_template.description %></td>
+		<td>
+			<%= link_to image_tag( 'show.png' ), :action => 'show', :id => report_template %><%= link_to image_tag( 'edit.png' ), :action => 'edit', :id => report_template %>	<%= link_to image_tag('delete.png'), { :action => 'destroy', :id => report_template }, :confirm => 'Are you sure?', :method => :post %>
+  		</td>
+	</tr>
+<% end %>
+	<tr>
+		<td class="button-bar" colspan="3">
+			<%= button_to "New #{@controller.controller_name.singularize.humanize}", :action => 'new' %>
+			<%= will_paginate(@reports) %>
+		</td>
+	</tr>
+</table>
+</div>
+
+

Added: incubator/alois/trunk/rails/app/views/report_templates/new.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/report_templates/new.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/report_templates/new.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/report_templates/new.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,17 @@
+<div id="page">
+
+  <table class="form">
+
+<% form_tag :action => 'create' do %>
+    <tr>
+      <th class="form_header" colspan="2">New Report Template</th>
+    </tr>
+  <%= render :partial => 'form' %>
+    <tr>
+      <td class="button-bar" colspan="2">  <%= submit_tag "Create" %> <%= submit_tag "Cancel" %></td>
+    </tr>
+<% end %>
+
+    <%= post_attribute_new %>
+  </table>
+</div>

Added: incubator/alois/trunk/rails/app/views/report_templates/show.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/report_templates/show.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/report_templates/show.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/report_templates/show.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,76 @@
+<%= title("Report Template - #{@report_template.name}") %>
+
+<div class="page">
+<table class="form">
+  <tr>
+    <th class="form_header" colspan="2">Report Template</th>
+  </tr>
+  <tr>
+    <th><label for="report_template_name">Name</label></th>
+    <td><%=h @report_template.name %></td>
+  </tr>
+  <tr>
+    <th><label for="report_template_description">Description</label></th>
+    <td><%=h @report_template.description %></td>
+  </tr>
+  <tr>
+    <th><label for="report_template_title">Title</label></th>
+    <td><%=h @report_template.title %></td>
+  </tr>
+  <tr>
+    <th><label for="report_template_text">Text</label></th>
+    <td>
+      <% if @preview %>
+        <%= @report_template.text(@options) rescue $! %>
+      <% else %>
+        <pre><%=h @report_template.text %>
+        </pre>
+      <% end %>
+    </td>
+  </tr>
+
+  <tr>
+    <th><label for="report_template_view">View</label></th>
+    <td><%= fobj(@report_template.view) %></td>
+  </tr>
+  <tr>
+    <th><label for="report_template_version">Version</label></th>
+    <td><%=h @report_template.version %></td>
+  </tr>
+
+  <%= post_attributes_show %>
+<%= render :partial => "edit_objects" %>
+
+  <tr>
+    <td class="button-bar" colspan="2">
+ <% if @preview %>
+   <%= button_to "Disable Preview", :delete_cache => true, :id => @report_template %>
+ <% else %>
+   <%= button_to "Edit", :action => :edit, :id => @report_template %>
+   <%= button_to "Delete", { :action => :destroy, :id => @report_template }, :confirm => 'Are you sure?' %>
+   <%= button_to "List all", :action => :list %></td>
+ <% end %>
+  </tr>
+
+<% unless @preview %>
+   <tr>
+    <th class="form_header" colspan="2">Render</th>
+  </tr>
+  <tr>
+    <td colspan="2">
+<% form_tag :action => :show, :render => true, :id => @report_template do %>
+	<%= datasource_fields {|ds| @report_template.applyable?(ds) }%>	
+	
+
+        <%= submit_tag "Preview with fake data" %>
+        <%= submit_tag "Preview with real data" %>
+	<%= submit_tag "Save as Report" %><br>
+<!-- Disabled, use function in report/show	 and send Email to: <%=  text_field_tag "email" %><br> -->
+
+<% end %>
+
+    </td>
+  </tr>
+<% end %>
+</table>
+</div>

Added: incubator/alois/trunk/rails/app/views/reports/_form.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/reports/_form.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/reports/_form.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/reports/_form.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,19 @@
+<%= error_messages_for 'report' %>
+
+<!--[form:report]-->
+<p><label for="report_name">Name</label><br/>
+<%= text_field 'report', 'name'  %></p>
+
+<p><label for="report_date">Date</label><br/>
+<%= date_select 'report', 'date'  %></p>
+
+<p><label for="report_time">Time</label><br/>
+<%= time_select 'report', 'time'  %></p>
+
+<p><label for="report_path">Path</label><br/>
+<%= text_field 'report', 'path'  %></p>
+
+<p><label for="report_generated_by">Generated by</label><br/>
+<%= text_field 'report', 'generated_by'  %></p>
+<!--[eoform:report]-->
+

Added: incubator/alois/trunk/rails/app/views/reports/deliver_to_email.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/reports/deliver_to_email.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/reports/deliver_to_email.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/reports/deliver_to_email.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1 @@
+Report sent to <%= params[:addresses].inspect %>.<br>
\ No newline at end of file

Added: incubator/alois/trunk/rails/app/views/reports/edit.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/reports/edit.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/reports/edit.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/reports/edit.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,9 @@
+<h1>Editing report</h1>
+
+<% form_tag :action => 'update', :id => @report do %>
+  <%= render :partial => 'form' %>
+  <%= submit_tag 'Edit' %>
+<% end %>
+
+<%= link_to 'Show', :action => 'show', :id => @report %> |
+<%= link_to 'Back', :action => 'list' %>

Added: incubator/alois/trunk/rails/app/views/reports/list.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/reports/list.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/reports/list.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/reports/list.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,31 @@
+<%= title @controller.controller_name.humanize %>
+
+<div id="page">
+<%= error_messages %>
+
+<table class="form">
+	<tr>
+		<th class="form_header">Name</th>
+		<th class="form_header">Date</th>
+		<th class="form_header">Time</th>
+		<th class="form_header">Sentinel</th>
+		<th class="form_header">Generated by</th>
+		<th class="form_header" style="width: 160px"/>
+	</tr>  
+<% for report in @reports %>
+	<tr>
+		<td><%=h report.name %></td>
+		<td><%=h report.date %></td>
+		<td><%=h report.time %></td>
+		<td><%= fobj(report.sentinel) %></td>
+		<td><%=h report.generated_by %></td>
+		<td>
+			<%= link_to image_tag( 'show.png' ), :action => 'show', :id => report %><%= link_to image_tag('delete.png'), { :action => 'destroy', :id => report }, :confirm => 'Are you sure?', :method => :post %>
+  		</td>
+	</tr>
+<% end %>
+	<tr>
+		<td class="button-bar" colspan="5"><%= will_paginate(@reports) %></td>
+	</tr>
+</table>
+</div>

Added: incubator/alois/trunk/rails/app/views/reports/new.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/reports/new.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/reports/new.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/reports/new.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,8 @@
+<h1>New report</h1>
+
+<% form_tag :action => 'create' do %>
+  <%= render :partial => 'form' %>
+  <%= submit_tag "Create" %>
+<% end %>
+
+<%= link_to 'Back', :action => 'list' %>

Added: incubator/alois/trunk/rails/app/views/reports/send_to_email.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/reports/send_to_email.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/reports/send_to_email.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/reports/send_to_email.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,9 @@
+Please select a type:
+<% form_tag :action => :deliver_to_email, :id => @report do %>
+ <% @email_types.each {|et| %>
+  <%= et %>: <%= radio_button_tag "type", et, (@email_types[0] == et) %> <%= link_to "Preview", {:action => "email_preview", :type => et, :id => params[:id]},:popup => ['email_preview', 'height=600,width=600'] %><br>
+<% } %>
+
+ <%= text_field_tag 'addresses' %>
+ <%= submit_tag "Send to email" %>
+<% end %>

Added: incubator/alois/trunk/rails/app/views/reports/show.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/reports/show.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/reports/show.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/reports/show.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,51 @@
+<%= title("Report - #{@report.name}") %>
+
+<div class="page">
+<table class="form">
+  <tr>
+    <th class="form_header" colspan="2">Report</th>
+  </tr>
+  <tr>
+    <th><label for="report_name">Name</label></th>
+    <td><%=h @report.name %></td>
+  </tr>
+  <tr>
+    <th><label for="report_datetime">Datetime</label></th>
+    <td><%=h @report.date %> <%=h @report.time %></td>
+  </tr>
+  <tr>
+    <th><label for="report_text">Text</label></th>
+    <td>
+      <%= @report_text%>
+    </td>
+  </tr>
+  <tr>
+   <th>Data:</th>
+   <td><ul><% @report.objects.each_with_index {|d,i| %><li><%= link_to "#{d.class.name} #{d.name}", :action => "get_data", :id => @report, :number => i %></li><% } rescue ""%></ul></td>
+  </tr>
+  <tr>
+    <th><label for="report_generated_by">Generated by</label></th>
+    <td><%=h @report.generated_by%></td>
+  </tr>
+  <tr>
+    <th><label for="report_sentinel">Sentinel</label></th>
+    <td><%= fobj(@report.sentinel) %></td>
+  </tr>
+  <tr>
+    <th><label for="report_report_template">Report template</label></th>
+    <td><%= fobj @report.report_template %></td>
+  </tr>  
+  <tr>
+    <th><label for="report_path">Path</label></th>
+    <td><%=h @report.path %></td>
+  </tr>
+  <%= post_attributes_show %>
+  <tr>
+    <td class="button-bar" colspan="2">
+      <%= button_to "Delete", { :action => :destroy, :id => @report }, :confirm => 'Are you sure?' %>
+      <%= button_to "List all", :action => :list %>
+      <%= button_to "Send As Mail", :action => :send_to_email, :id => @report %>
+    </td>
+  </tr>
+</table>
+</div>

Added: incubator/alois/trunk/rails/app/views/sentinels/_form.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/sentinels/_form.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/sentinels/_form.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/sentinels/_form.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,79 @@
+<%= error_messages_for 'sentinel' %>
+
+  <tr>
+    <th class="form_header" colspan="2">Sentinel</th>
+  </tr>
+  <tr>
+    <th><label for="sentinel_name">Name</label></th>
+    <td><%= text_field 'sentinel', 'name'  %></td>
+   </tr>
+   <tr>
+     <th><label for="sentinel_description">Description</label></th>
+    <td><%= text_area 'sentinel', 'description', :style => 'width: 98%', :rows => 4 %></td>
+   </tr>
+   <tr>
+     <th><label for="sentinel_action">Action</label></th>
+     <td><%= select "sentinel", "action", Sentinel::ACTIONS.invert %></td>
+   </tr>
+   <tr>
+     <th><label for="sentinel_cron_interval">Cron interval</label><%= help_button "cron" %></th>
+     <td><%= text_field 'sentinel', 'cron_interval'  %></td>
+   </tr>
+   <tr>
+     <th><label for="sentinel_send_mail">Send mail</label></th>
+     <td><%= check_box "sentinel", "send_mail" %></td>
+   </tr>
+   <tr>
+     <th><label for="sentinel_include_csv_in_email">Include csv in email:</label></th>
+     <td><%= check_box "sentinel", "include_csv_in_email" %></td>
+   </tr>
+   <tr>
+     <th><label for="sentinel_include_report_in_email">Include report in email:</label></th>
+     <td><%= check_box "sentinel", "include_report_in_email" %></td>
+   </tr>
+
+   <tr>
+     <th><label for="sentinel_mail_to">Mail to</label><%= short_help "Mailto","A email address where the alarm should be sent to. Can be a list seperated by ','." %></th>
+     <td><%= text_field 'sentinel', 'mail_to'  %></td>
+   </tr>
+   <tr>
+     <th><label for="sentinel_threshold">Threshold</label><%= short_help "Threshold","Normally you should set here 0 - this means if the query contains any row a alarm is sent. If you want to send an alarm only if the query more than 1000 records. Set this to 1000. In other words this is the maximum allowed records that will not initiate an alarm."%></th>
+     <td><%= text_field 'sentinel', 'threshold'  %></td>
+   </tr>
+
+<!-- view -->
+  <tr><th style="text-align:center" colspan="2">View</th></tr>
+   <tr>
+     <th><label for="sentinel_view_id">View</label><%= short_help "View","The selected view is the datasource for your sentinel. The count of this view will be compared to the threshold. This datasource can also be used for your report. If the report template has no view selected, this view will be taken."%></th>
+     <td><%= select("sentinel", "view_id", View.find(:all,:order => "name").collect {|v| [v.name , v.id]}) %></td>
+   </tr>
+   <tr>
+     <th><label for="sentinel_time_range">Time range</label></th>
+    <td><%=  text_field_with_auto_complete :sentinel, :time_range, :autocomplete => "off", :style => 'width: 98%', :rows => 4 %></td>
+   </tr>
+   <tr>
+     <th><label for="sentinel_filters">Filters</label></th>
+    <td><%=  text_field "sentinel", "filters" %> (id, id, id)<br>
+        Possible Filters for view <%= fobj(@sentinel.view) %>: <%= Filter.find(:all,:order => "name").select {|f| f.valid_for_table?(@sentinel.view)}.map{|f| "#{f.id}:'#{fobj(f)}'"}.join(", ") %></td>
+   </tr>
+
+
+<!-- alarm -->
+  <tr><th style="text-align:center" colspan="2">Alarm</th></tr>
+   <tr>
+     <th><label for="sentinel_alarm_level">Alarm Level</label><%= short_help "Alarm Level","If no level is selected, no alarm will be created. This is useful for reporting only purpuse"%></th>
+     <td><%= select("sentinel", "alarm_level",Alarm::ALARM_LEVELS.sort{|a,b| a[0] <=> b[0]}.map{|a,b| ["#{a}: #{b}",a]}, { :include_blank => true} ) %></td>
+   </tr>
+
+
+<!-- report -->
+  <tr><th style="text-align:center" colspan="2">Report</th></tr>
+   <tr>
+     <th><label for="sentinel_report_template_id">Report Template</label></th>
+     <td><%= select("sentinel", "report_template_id", ReportTemplate.find(:all).collect {|v| [v.name , v.id]}, :include_blank => true) %></td>
+   </tr>
+
+     <!-- <p><label for="sentinel_send_ossim">Send ossim</label><br/>
+     <select id="sentinel_send_ossim" name="sentinel[send_ossim]"><option value="false">False</option><option value="true">True</option></select></p> -->
+     <!-- <p><label for="sentinel_external_program">External program</label><br/>
+     <%= text_area 'sentinel', 'external_program'  %></p> -->

Added: incubator/alois/trunk/rails/app/views/sentinels/edit.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/sentinels/edit.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/sentinels/edit.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/sentinels/edit.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,13 @@
+<%= title "#{@controller.action_name.humanize} #{@controller.controller_name.singularize.humanize} - #{@sentinel.name}" %>
+
+<div id="page">
+
+  <table class="form">
+  <% form_tag :action => 'update', :id => @sentinel do %>
+    <%= render :partial => 'form' %>
+    <tr>
+      <td class="button-bar" colspan="2"><%= submit_tag "Update" %> <%= submit_tag "Cancel" %></td>
+    </tr>
+  <% end %>
+  </table>
+</div>

Added: incubator/alois/trunk/rails/app/views/sentinels/list.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/sentinels/list.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/sentinels/list.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/sentinels/list.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,37 @@
+<%= title @controller.controller_name.humanize %>
+
+<div id="page">
+<%= error_messages %>
+
+<table class="form">
+  <tr>
+    <th class="form_header" style="width:0px;">ID</th>
+    <th class="form_header">Name</th>
+    <th class="form_header">Description</th>
+    <th class="form_header">View</th>
+    <th class="form_header">Action</th>
+    <th class="form_header">Alarm Level</th>
+    <th class="form_header">Mail</th>
+    <th class="form_header" style="width: 320px"/>
+  </tr>
+<% for sentinel in @sentinels %>
+  <tr>
+    <td><%=h sentinel.id %></td>
+    <td><%=h sentinel.name %></td>
+    <td><%=h sentinel.description %></td>
+    <td><%=h begin View.find(sentinel.view_id).name rescue "NOT FOUND (#{sentinel.view_id})" end %></td>
+    <td><%=h sentinel.action_name %></td>
+    <td style="background-color:<%= sentinel.alarm_level_color %>"><%=h sentinel.alarm_level %></td>
+    <td><%=h sentinel.send_mail? ? h(sentinel.mail_to) : "No" %></td>
+    <td>
+      <%= link_to image_tag( 'show.png', :title => 'Detail anzeigen'), :action => 'show', :id => sentinel %><%= link_to image_tag( 'edit.png', :title => 'Editieren' ), :action => 'edit', :id => sentinel %><%= link_to image_tag('delete.png', :title => 'Löschen'), { :action => 'destroy', :id => sentinel }, :confirm => 'Are you sure?', :method => :post %>
+    </td>
+  </tr>
+<% end %>
+  <tr>
+    <td class="button-bar" colspan="8">
+      <%= button_to "New #{@controller.controller_name.singularize.humanize}", :action => 'new' %>
+    </td>
+  </tr>
+</table>
+</div>

Added: incubator/alois/trunk/rails/app/views/sentinels/new.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/sentinels/new.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/sentinels/new.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/sentinels/new.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,13 @@
+<%= title "#{h @controller.action_name.humanize} #{h @controller.controller_name.singularize.humanize}" %>
+
+<div id="page">  
+  <table class="form">
+  <% form_tag :action => 'create' do %>
+    <%= render :partial => 'form' %>
+    <tr>
+      <td class="button-bar" colspan="2"><%= submit_tag "Create" %><%= submit_tag "Cancel" %></td>
+    </tr>
+  <% end %>
+    <%= post_attribute_new %>
+  </table>
+</div>

Added: incubator/alois/trunk/rails/app/views/sentinels/show.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/sentinels/show.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/sentinels/show.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/sentinels/show.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,113 @@
+<%= title "Sentinel - #{@sentinel.name}" %>
+  
+<div id="page">
+<table class="form">
+  <tr>
+    <th class="form_header" colspan="2">Sentinel</th>
+  </tr>
+
+<!-- sentinel -->
+  <tr>
+    <th><label for="sentinel_name">Name</label></th>
+    <td><%=h @sentinel.name %></td>
+  </tr>
+  <tr>
+    <th><label for="sentinel_description">Description</label></th>
+    <td><%=h @sentinel.description %></td>
+  </tr>
+  <tr>
+    <th><label for="sentinel_action">Action</label></th>
+    <td><%=h @sentinel.action_name %></td>
+  </tr>
+  <tr>
+    <th><label for="sentinel_cron_interval">Cron interval</label></th>
+    <td><%=h @sentinel.cron_interval %></td>
+  </tr>
+  <tr>
+    <th><label for="sentinel_send_mail">Send mail</label></th>
+    <td><%=h @sentinel.send_mail %></td>
+  </tr>
+  <tr>
+    <th><label for="sentinel_include_csv_in_email">Include csv in email:</label></th>
+    <td><%=h @sentinel.include_csv_in_email %></td>
+  </tr>
+  <tr>
+    <th><label for="sentinel_include_report_in_email">Include report in email:</label></th>
+    <td><%=h @sentinel.include_report_in_email %></td>
+  </tr>
+  <tr>
+    <th><label for="sentinel_mail_to">Mail to</label></th>
+    <td><%=h @sentinel.mail_to %></td>
+  </tr>
+  <tr>
+    <th><label for="sentinel_threshold">Threshold</label></th>
+    <td><%=h @sentinel.threshold %></td>
+  </tr>
+
+<!-- view -->
+  <tr><th style="text-align:center" colspan="2">View</th></tr>
+  <tr>
+    <th><label for="sentinel_view">View</label></th>
+    <td><%= fobj(@sentinel.view) %></td>
+  </tr>
+  <tr>
+    <th><label for="sentinel_time_range">Time range</label></th>
+    <td><%=h @sentinel.time_range %> (currently: <%= @sentinel.time_range.to_time_range_str rescue "ERROR:#{$!}" %>)</td>
+  </tr>
+  <tr>
+    <th><label for="sentinel_filters">Filters</label></th>
+    <td><%= @sentinel.filters.map {|f| "'#{fobj(f)}'"}.join(", ") rescue "#{$!}" %></td>
+  </tr>
+  <tr>
+    <th><label for="sentinel_conditions">Conditions</label></th>
+    <td>Time Range plus Filters: <%=h @sentinel.conditions rescue "#{$!}" %></td>
+  </tr>
+  <tr>
+    <th><label for="sentinel_current_data">Link to current data</label></th>
+    <td><%= link_to "#{@sentinel.view.table_name} WHERE #{@sentinel.conditions}",
+			:controller => "survey", :action => :list, 
+			:table => @sentinel.view.table_name,
+			:default_filter => @sentinel.conditions rescue "<span syle='color:red'>#{h($!.to_s)}</span>" %></td>
+  </tr>
+  
+<!-- alarm -->
+  <tr><th style="text-align:center" colspan="2">Alarm</th></tr>
+  <tr>
+    <th><label for="sentinel_alarm_level">Alarm level</label></th>
+    <td><%=h @sentinel.alarm_level %></td>
+  </tr>
+  <tr>
+    <th><label for="sentinel_alarms">Active Aalrms of this Sentinel</label></th>
+    <td><% @sentinel.alarms.reject {|a| a.acknowledge}.each {|a| %>
+	<%=h a.created_at %>: <%= fobj(a) %><br>
+	<% } %>
+    </td>
+  </tr>
+  
+
+<!-- report -->
+  <tr><th style="text-align:center" colspan="2">Report</th></tr>
+  <tr>
+    <th><label for="sentinel_report_template">Report template</label></th>
+    <td><%= fobj(@sentinel.report_template) %></td>
+  </tr>
+  <tr>
+    <th><label for="sentinel_reports">Latest 10 Reports generated by this Sentinel</label></th>
+    <td><% @sentinel.reports.find(:all,:limit => 10, :order => "id DESC").each {|r| %>
+	<%=h r.date.strftime("%F") %>: <%= fobj(r) %><br>
+	<% } %>
+    </td>
+  </tr>
+  <tr><th style="text-align:center" colspan="2"></th></tr>
+
+  <%= post_attributes_show %>
+    
+    <tr>
+      <td class="button-bar" colspan="2">
+        <%= button_to 'Edit sentinel', :action => 'edit', :id => @sentinel %>
+        <%= button_to 'List all sentinels', :action => 'list' %>
+        <%= button_to 'Manually execute', :action => 'manually_execute', :id => @sentinel %>
+      </td>
+    </tr>
+  </table>
+</div>

Added: incubator/alois/trunk/rails/app/views/surveillance/index.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/surveillance/index.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/surveillance/index.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/surveillance/index.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,13 @@
+<table width="100%">
+<tr>
+  <td width="50%"><%= PrismaController.statistic_image("sink_flows","day") %></td>
+  <td style="vertical-align:top" width="50%" rowspan="2">
+    <%= render_remote({:controller=>"bookmarks",:action=>"list"},:frequency => 60) %>
+  </td>
+</tr>
+<tr>
+ <td>
+    <%= render_remote({:controller=>"alarms",:action=>"survey_component"},:frequency => 60) %>
+ </td>
+</tr>
+</table>
\ No newline at end of file

Added: incubator/alois/trunk/rails/app/views/survey/_add_filter_help.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/survey/_add_filter_help.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/survey/_add_filter_help.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/survey/_add_filter_help.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,4 @@
+<%= help_title "Add Filter" %>
+<p>Select the filter to add with the dropdown near the 'Add Filter' button in the condition section.
+If you cannot select a filter, there is no filter that can be applied to that datasource. Check if
+all rows used by the desired filter are available in the current datasource. To add the filter press the button 'Add Filter'.</p>
\ No newline at end of file

Added: incubator/alois/trunk/rails/app/views/survey/_auto_refresh.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/survey/_auto_refresh.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/survey/_auto_refresh.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/survey/_auto_refresh.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,20 @@
+<% if params[:auto_refresh] %>
+  <%= periodically_call_remote :frequency => params[:auto_refresh],
+	:before => "table_reload()",
+        :loaded => "update_table()",
+        :update => 'auto_refresh_info', 
+	:url => { :controller=> 'survey', :action => 'auto_refresh_info', :auto_refresh => params[:auto_refresh],:state_id => @state_id } %>
+  Enabled. Reload every <%= params[:auto_refresh] %> seconds.
+  <%= link_to "Stop", { :controller=> 'survey', :action => params[:old_action], :state_id => @state_id } %>
+
+ <span id="auto_refresh_info"><%= render :partial => "auto_refresh_info" %></span>
+
+<% else %>
+  <% form_remote_tag(:update => 'auto_refresh', 
+	:url => { :controller=> 'survey', :action => "auto_refresh_inline", :state_id => @state_id, :old_action => (params[:old_action] or @controller.action_name) }) do %>
+    Refresh content every <%= text_field_tag "auto_refresh", 60, {:size => 3} %> seconds.
+    <%= submit_tag 'Start' %> 
+  <% end %>
+
+<% end %>
+

Added: incubator/alois/trunk/rails/app/views/survey/_auto_refresh_info.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/survey/_auto_refresh_info.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/survey/_auto_refresh_info.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/survey/_auto_refresh_info.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1 @@
+Next update <%= params[:auto_refresh].to_i.seconds.from_now.strftime("%c") %>.
\ No newline at end of file

Added: incubator/alois/trunk/rails/app/views/survey/_chart.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/survey/_chart.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/survey/_chart.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/survey/_chart.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,86 @@
+<div id="survey_chart">
+
+  <%= javascript_tag("function update_table() {" + remote_function(:update => 'survey_chart', :url => { :controller=> 'survey', :action => 'chart_inline', :state_id => @state_id }) + "}") %>
+
+<%= javascript_tag("function table_invalid(){Element.setStyle('graphic', {'background-color' : '#FFBBBB'})}") %>
+<%= javascript_tag("function table_reload(){Element.setStyle('graphic', {'background-color' : '#FFFF66'})}") %>
+<%= javascript_tag("function table_valid(){Element.setStyle('graphic', {'background-color' : 'transparent'})}") %>
+
+<table class="form">
+  <tr>
+    <th colspan="2" class="form_header">Chart</th>
+  </tr>
+  <tr>
+   <td colspan="2" class="button-bar">
+	<%= button_to 'Data', {:action => 'list',:state_id => @state_id }%>
+	<%= button_to_function('Hide query', "Element.toggle('action_hide_query','action_show_query', 'query')", :id => 'action_hide_query', :style => 'display: none' ) %>
+	Download data as: <%= button_to 'CSV', {:action => 'csv',:type=>"chart",:state_id => @state_id }%>
+	<%= button_to 'Text', {:action => 'text',:type=>"chart",:state_id => @state_id }%>
+	<%= button_to 'PDF', {:action => 'pdf',:type=>"chart",:state_id => @state_id }%>
+   </td>
+  <tr>
+<% if @chart %> 
+  <% unless @chart.valid? %>
+    <%= error_messages_for 'chart', :header_message => nil %>
+  <% else %>
+  <tr>
+    <th style="width: 20%; text-align: left">Zoom</th>
+    <td style="white-space: nowrap;">
+      <%= render :partial => 'zoom_form' %>
+    </td>
+  </tr>
+
+  <tr id="query">
+    <th style="width: 20%; text-align: left">Query <%= short_help("Query","This query describes the current datasource containing all selected conditions  and filters.") %></th>
+    <td>
+	<%= create_links_in_query(@query_string) %>
+    </td>
+  </tr>
+  <tr>
+    <th style="width: 20%; text-align: left">Count <%= short_help("Count","For big datasources the first counting is done approximately and cannot be taken as a matter of fact") %></th>
+    <td>  <span id="count_text"><%= render :partial => 'count_text' %></span>
+    </td>
+  </tr>
+ 
+  <tr>
+    <td colspan="2">
+      <a name="chart"/>
+      <div id='graphic'>
+	<div style="width:<%= @chart.width %>px;height:<%= @chart.height %>px;">
+          <legend>Bild wird geladen... </legend>
+	</div>
+      </div>
+
+      <%= javascript_tag remote_function(:update => 'graphic', 
+	:url => url_for(:action => "chart_map", :state_id => @state_id)) %>
+    </td>
+  </tr>       
+<% end %>
+<% else %>
+<div id="graphic">No chart defined.</div>
+<% end %>
+  <tr>
+    <th>Chart</th>
+    <td>
+  <% form_tag :action => 'chart', :state_id => @state_id do %><%= render :partial => '/charts/column_fields' %>
+    </td>
+  </tr>
+  <tr>
+    <td colspan="2" class="button-bar">
+        <%= submit_tag "Update" %>
+  <% end %></div>
+      <%= button_to "Reset Chart", :reset_chart => true, :state_id => @state_id %>
+      <%= button_to "Save Chart", :controller => "charts", :action => "new", 	
+	:state_id => @state_id, "chart[name]" => "New chart" %>
+
+<% form_tag :action => :chart, :state_id => @state_id do %>
+<%= submit_tag "Load chart:"%>       
+<%= select_tag('chart_id', options_for_select(Chart.charts_for_datasource(current_datasource).map {|c| [c.name,c.id]}.sort {|x,y| (x[0] or "") <=> (y[0] or "")})) %>
+<% end %>
+
+
+    </td>
+  </tr>
+</table>
+</div>
+

Added: incubator/alois/trunk/rails/app/views/survey/_chart_map.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/survey/_chart_map.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/survey/_chart_map.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/survey/_chart_map.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,24 @@
+<%= @chart_image_tag %>
+<%= @chart_image_map %>
+<% if @chart.data_date %>
+  Data generated: <%= @chart.data_date.strftime("%c") %>
+(<%= link_to_remote "Text", 
+	:before => "document.getElementById('chart_data').innerHTML = 'Loading Text. Please wait...<br>';",
+        :update => 'chart_data', 
+	:url => { :controller=> 'survey', :action => 'chart_data', :state_id => @state_id} %>,
+<%= link_to_remote "CSV", 
+	:before => "document.getElementById('chart_data').innerHTML = 'Loading CSV. Please wait...<br>';",
+        :update => 'chart_data', 
+	:url => { :controller=> 'survey', :action => 'chart_data', :state_id => @state_id, :type => "csv"} %>
+)
+<% end %>
+<% if @chart.image_date %>
+  Image generated: <%= @chart.image_date.strftime("%c") %>
+<% end %>
+
+<%= link_to_remote "Reload", 
+	:before => "table_reload()",
+        :update => 'survey_chart', 
+	:url => { :controller=> 'survey', :action => 'chart_inline', :state_id => @state_id, :recreate_data => true} %>
+
+<div id="chart_data">&nbsp;</div>

Added: incubator/alois/trunk/rails/app/views/survey/_conditions.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/survey/_conditions.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/survey/_conditions.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/survey/_conditions.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,81 @@
+<% form_tag :action => 'add_condition', :loaded => update_table, :params => @current_filter.get_params, :id => nil do %>
+
+<table>
+  <tr>
+    <% for i in 0...@raw_descriptions.length %>
+      <th>
+        <span onmouseout="document.getElementById('titalt_<%= i %>').style.visibility = 'hidden';" onmouseover="document.getElementById('titalt_<%= i %>').style.visibility = 'visible';" >
+          <%= @raw_descriptions[i][1] %>
+        </span>
+
+        <div id="titalt_<%= i %>" style="position:absolute;background-color:yellow;visibility:hidden;">
+          <%= @raw_descriptions[i][0] %>
+        </div>
+      </th>
+    <% end %>
+  </tr>
+  <% if not @conditions == nil || @conditions.length == 0 then %>
+    <% for i in 0...@descriptions.length %>
+      <tr <% if @global_rule_number==i then %>style="background-color:lightgreen;"<% end %> >
+        <% for j in 0...@descriptions[i].length %>
+          <td>
+            <span onmouseout="document.getElementById('alt_<%= j %>_<%= i %>').style.visibility = 'hidden';" onmouseover="document.getElementById('alt_<%= j %>_<%= i %>').style.visibility = 'visible';">
+              <%= @descriptions[i][j][1] %>
+            <div id="alt_<%= j %>_<%= i %>" style="position:absolute;background-color:yellow;visibility:hidden;">
+
+              <% if @descriptions[i][j][0] != nil then %>
+                <table style="boder:10px solid black;">
+                  <tr>
+                    <td><%= @descriptions[i][j][2] %>#(<%= @descriptions[i][j][0][2] %>)</td>
+                    <td><% if @descriptions[i][j][0][3] != nil  %> - <% end %> </td>
+                    <td><% if @descriptions[i][j][0][3] != nil  %><%= @descriptions[i][j][3] %>#(<%= @descriptions[i][j][0][3] %>) <% end %></td>
+                  </tr>
+                    <% if @descriptions[i][j][0][4] != nil  %>
+                    <tr><td colspan="3" style="border:1 solid  black;">geteiltdurch</td></tr>
+                    <tr><td algin="center" colspan="3"><%= @descriptions[i][j][4] %>#(<%= @descriptions[i][j][0][4] %>)</td></tr>
+                  <% end %>
+                </table>
+              <% end %>
+            </div>
+          </span>
+          <% if @descriptions[i][j][0][6] != nil%>
+            <%= link_to  @descriptions[i][j][0][7],:action => @descriptions[i][j][0][6], :id => i, :params => @current_filter.get_params  %>
+          <% end %>
+        </td>
+      <% end %>  
+    </tr>
+  <% end %>
+<% end %>
+
+  <tr>
+  <td>
+  <select name="column_name">
+   <option value="ANY">ANY</option>
+   <% for column in @table.columns %>
+   <option value="<%= column.name %>"> 
+     <%= column.name %>
+   </option>
+   <% end %>
+  </select> 
+  </td>
+  <td>
+   <select name="operator">
+     <option value="LIKE">LIKE</option>
+     <option value="NOT LIKE">NOT LIKE</option>
+     <option value="=">=</option>
+     <option value="!=">!=</option>
+     <option value="IS NULL">IS NULL</option>
+     <option value="IS NOT NULL">IS NOT NULL</option>
+     <option value="SQL">SQL</option>
+   </select>
+  </td>
+  <td>
+    <input name="value"/>
+  </td>
+  <td><input type="submit" value="Create"/></td>
+  </tr>
+  <tr><td  <% if @negative_set %> style="background-color:red;"<%end%> ><%= link_to 'display negative set', :action => 'negative_set', :params => @current_filter.get_params  %></td></tr>
+ </table>
+<% end %>
+<% form_tag :action => 'add_sql_condition', :params => @current_filter.get_params ,:id => nil do %>
+<% end %>

Added: incubator/alois/trunk/rails/app/views/survey/_count_text.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/survey/_count_text.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/survey/_count_text.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/survey/_count_text.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,11 @@
+<span id="inner_count_text">
+  <%= get_count_text() %>
+  <% unless params[:slow_count] %>
+      <%= link_to_remote "Calculate", 
+	:update => 'count_text', 
+	:url => { :action => 'count_text', :slow_count => true, :state_id => @state_id}, 
+	:before => "Element.setStyle('inner_count_text', {'background-color' : '#FFBBBB'})"
+	 %> This can take a very long time.
+  <% end %>
+</span>
+

Added: incubator/alois/trunk/rails/app/views/survey/_create_filter_help.rhtml
URL: http://svn.apache.org/viewvc/incubator/alois/trunk/rails/app/views/survey/_create_filter_help.rhtml?rev=1031127&view=auto
==============================================================================
--- incubator/alois/trunk/rails/app/views/survey/_create_filter_help.rhtml (added)
+++ incubator/alois/trunk/rails/app/views/survey/_create_filter_help.rhtml Thu Nov  4 18:27:22 2010
@@ -0,0 +1,2 @@
+<%= help_title "Create Filter" %>
+<p>To create a new filter out of the current selected conditions press the button "Create Filter" in the condition section.</p>
\ No newline at end of file