--- /dev/null
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
* the top of the compiled file, but it's generally better to create a new file per style scope.
*= require_self
*= require_tree .
-*/
\ No newline at end of file
+*/
+
+.contain-align-left {
+ text-align: left;
+}
Place all the styles related to the matching controller here.
They will automatically be included in application.css.
*/
+.node-status {
+ /* unknown status - might be bad */
+ background: #ff8888;
+}
+.node-status-running {
+ background: #88ff88;
+}
+.node-status-missing {
+ background: #ff8888;
+}
+.node-status-terminated {
+ background: #ffffff;
+}
--- /dev/null
+// Place all the styles related to the Nodes controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
--- /dev/null
+class NodesController < ApplicationController
+ def index
+ @objects = model_class.order("created_at desc")
+ end
+end
super
end
+ def status
+ if !self.last_ping_at
+ if Time.now - self.created_at > 5.minutes
+ 'startup-fail'
+ else
+ 'pending'
+ end
+ elsif Time.now - self.last_ping_at > 1.hours
+ 'missing'
+ else
+ 'alive'
+ end
+ end
+
def ping(o)
raise "must have :ip and :ping_secret" unless o[:ip] and o[:ping_secret]
--- /dev/null
+<table>
+ <tr class="contain-align-left">
+ <th>
+ status
+ </th><th>
+ uuid
+ </th><th>
+ hostname
+ </th><th>
+ domain
+ </th><th>
+ ip address
+ </th><th>
+ created
+ </th><th>
+ startup delay
+ </th><th>
+ last ping
+ </th>
+ </tr>
+
+ <% @objects.each do |o| %>
+
+ <tr class="node-status node-status-<%= o.status %>">
+ <td>
+ <%= o.status %>
+ </td><td>
+ <%= o.uuid %>
+ </td><td>
+ <%= o.hostname %>
+ </td><td>
+ <%= o.domain %>
+ </td><td>
+ <%= o.ip_address %>
+ </td><td>
+ <%= o.created_at %>
+ </td><td>
+ <%= distance_of_time_in_words(o.first_ping_at, o.created_at, true) if o.first_ping_at %>
+ </td><td>
+ <%= distance_of_time_in_words(o.last_ping_at, Time.now, true) + ' ago' if o.last_ping_at %>
+ </td><td>
+ <%= o.info[:ec2_instance_id] %>
+ </td>
+ </tr>
+
+ <% if o.info[:ec2_start_command] and (!o.first_ping_at or !o.info[:ec2_start_result].match /\bi-[0-9a-f]{8}\b/ rescue nil) %>
+ <tr>
+ <td colspan="8">
+ <%= o.info[:ec2_start_command] %>
+ <br />
+ <%= o.info[:ec2_start_result] %>
+ </td>
+ </tr>
+
+ <% end %>
+ <% end %>
+</table>
Server::Application.routes.draw do
+ resources :collections
+ resources :metadata
+ resources :nodes
+ resources :pipelines
+ resources :pipeline_invocations
+
# The priority is based upon order of creation:
# first created -> highest priority.