Added mac logs, improved mac editing/viewing
This commit is contained in:
10
app/views/mac_logs/index.html.erb
Normal file
10
app/views/mac_logs/index.html.erb
Normal 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>
|
||||
1
app/views/macs/import.html.erb
Normal file
1
app/views/macs/import.html.erb
Normal file
@@ -0,0 +1 @@
|
||||
<%= @output %>
|
||||
@@ -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 %>
|
||||
-->
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user