Added mac logs, improved mac editing/viewing

This commit is contained in:
2013-02-01 00:06:13 -07:00
parent 04764af983
commit f3498ddcac
14 changed files with 98 additions and 27 deletions

View File

@@ -0,0 +1,10 @@
<table>
<% @mac_logs.each do |mac_log| %>
<tr>
<td><%= mac_log.mac %></td>
<td><%= mac_log.ip %></td>
<td><%= mac_log.action %></td>
<td><%= mac_log.created_at %></td>
</tr>
<% end %>
</table>

View File

@@ -0,0 +1 @@
<%= @output %>

View File

@@ -1,29 +1,42 @@
<h2>What machines are on our network?</h2>
<%= link_to "New Mac", new_mac_path %>
<ul>
<% @active_macs.each do |mac| %>
<li>
<%= mac.user.name unless mac.user.blank? %>
<%= mac.mac if mac.user.blank? %> <!--
<%= mac.since %>,
<%= mac.refreshed %>,
<%= mac.active %>--> |
<%= mac.mac if mac.user.blank? && mac.note.blank? %>
<%= mac.note if mac.user.blank? %> -
<%= ((Time.now - mac.since) / 1.hour).round(1).to_s+" hours" %> |
<%= link_to 'Edit', edit_mac_path(mac) %> <br/>
</li>
<% end %>
<hr>
</ul>
<ul style="display: none;">
<% @hidden_macs.each do |mac| %>
<li>
<%= mac.user.name unless mac.user.blank? %>
<%= mac.mac if mac.user.blank? %>
(<%= mac.note %>) <!--
<%= mac.mac if mac.user.blank? && mac.note.blank? %>
<%= mac.note if mac.user.blank? %> -
<%= ((Time.now - mac.since) / 1.hour).round(1).to_s+" hours" %> |
<%= link_to 'Edit', edit_mac_path(mac) %> <br/>
</li>
<% end %>
</ul>
<!--
<% @all_macs.each do |mac| %>
<%= '<span class="hidden">' if mac.hidden? %>
<%= mac.mac.downcase %>
(<%= mac.note %>)
<%= mac.user.name unless mac.user.blank? %>
<%= mac.since %>,
<%= mac.refreshed %>,
<%= mac.active %>--> |
<%= link_to 'Edit', edit_mac_path(mac) %> <br/>
<% end %>
<hr>
<% @inactive_macs.each do |mac| %>
<%= mac.user.name unless mac.user.blank? %>
<%= mac.mac if mac.user.blank? %>
(<%= mac.note %>) <!--
<%= mac.since %>,
<%= mac.refreshed %>,
<%= mac.active %>--> |
<%= mac.active %> |
<%= link_to 'Edit', edit_mac_path(mac) %> <br/>
<%= '</span>' if mac.hidden? %>
<% end %>
-->