<tr id='sensor_<%= sensor.sid %>' class='sensor <%= "deleted" if sensor.pending_delete %>' data-sensor-id='<%= sensor.sid %>'>
	<td class='id first'><%= sensor.sid %></td>
	
	<td class='name <%= "edit-sensor-name" if current_user.admin %>' data-sensor-id='<%= sensor.sid %>'><%= sensor.name %></td>
	
	<td class='hostname'><%= sensor.hostname %></td>
	<td class='interface'><%= sensor.interface %></td>
	
	<% if sensor.last %>
		<td class='last_event_time'><%= sensor.last.timestamp.strftime('%m/%d/%Y %l:%M %p') %></td>
	<% else %>
		<td class='last_event_time'>N/A</td>
	<% end %>
	
	<td class='event_count'><%= number_with_delimiter sensor.events_count %></td>
	
	<td class='chart'>
		<%= css_chart(sensor.event_percentage) %>
	</td>
	
  <td class='last <%= current_user.admin ? "admin-sensor-actions" : "sensor-actions" %>'>
  	<%= link_to 'View Events', results_path(:title => "#{sensor.sensor_name}", "match_all"=>"true", "search"=>{"sensor"=>{"column"=>"sensor", "operator"=>"is", "value"=> sensor.sid } }) %>

  <% if current_user.admin? %>
	  <% if Snorby::Worker.running? %>
	    	<%= link_to image_tag("icons/destroy.png", :size => '16x16', :class => 'trash'), sensor, :method => :delete, 
	    	:confirm => "WARNING: Are you sure you want to destroy this sensor? All events and metrics associated with this sensor will be permentantly deleted!" %>
	  <% else %>
	      	<%= link_to image_tag("icons/destroy.png", :size => '16x16', :class => 'trash'), "#", 
	      	:class => "disabled add_tipsy", :title => "The Snorby worker must be running!" %>
	  <% end %>
	<% end %>

  </td>
	
</tr>
