diff options
Diffstat (limited to 'app/views/node')
-rw-r--r-- | app/views/node/_plist.rhtml | 17 | ||||
-rw-r--r-- | app/views/node/_pshow.rhtml | 54 | ||||
-rw-r--r-- | app/views/node/edit.rhtml | 34 | ||||
-rw-r--r-- | app/views/node/edit.rhtml.bak | 25 | ||||
-rw-r--r-- | app/views/node/list.rhtml | 2 | ||||
-rw-r--r-- | app/views/node/new.rhtml | 44 |
6 files changed, 176 insertions, 0 deletions
diff --git a/app/views/node/_plist.rhtml b/app/views/node/_plist.rhtml new file mode 100644 index 0000000..c329d4c --- /dev/null +++ b/app/views/node/_plist.rhtml @@ -0,0 +1,17 @@ +<table> + <th>Name</th> + <th>Location</th> + <th>Kommentar</th> + +<% @nodes.each do |node| %> + <tr> + <td><%= node.name %></td> + <td><%= node.location.name %></td> + <td><%= node.comment %></td> + <td><%= link_to 'Show', :action => 'show', :controller => 'node', :id => node %></td> + <td><%= link_to 'Edit', :action => 'edit', :controller => 'node', :id => node %></td> + <td><%= link_to 'Destroy', { :action => 'destroy', :controller => 'node', :id => node }, :confirm => 'Are you sure?', :post => true %></td> + </tr> +<% end %> +</table> + diff --git a/app/views/node/_pshow.rhtml b/app/views/node/_pshow.rhtml new file mode 100644 index 0000000..df7b132 --- /dev/null +++ b/app/views/node/_pshow.rhtml @@ -0,0 +1,54 @@ + +<% @nodes.each do |node| %> +<table border="1" width="600"> + <tr> + <td width="120"><strong>Name</strong></td> + <td colspan="5"><%= node.name %></td> + </tr> + <tr> + <td><strong>Kommentar</strong></td> + <td colspan="5"><%= node.comment %></td> + </tr> + <tr> + <% if node.person %> + <td><strong>Administrator</strong></td> + <td colspan="5"><%= node.person.email %></td> + <% end %> + <tr> + <td rowspan="<%= node.ip.length()+1 %>"><strong>Interfaces</strong></td> + <td><strong>Name</strong></td> + <td><strong>IP</strong></td> + <td><strong>Netmask</strong></td> + <td colspan="2"><strong>Link</strong></td> + <% node.ip.each do |ip| %> + <tr> + <td><%= ip.name %></td> + <td><%= link_to ip.ip, "http://#{ip.ip}" %></td> + <% if ip.nets != nil %> + <% if ip.nets.netmask != '255.255.255.255' %> + <td><%= ip.nets.netmask %></td> + <% else %> + <td><%= '255.255.0.0' %></td> + <% end %> + <% else %> + <td><%= ip.net_id %></td> + <% end %> + <td><%= link_to "intern", "http://#{ip.name}.#{node.name}.#{node.location.name}.graz.funkfeuer.at" %> | <%= link_to "extern", "http://#{ip.name}.#{node.name}.#{node.location.name}.ext.graz.funkfeuer.at" %></td> + </tr> + <% end %> + </tr> + <tr> + <td><strong>Smokeping</strong></td> + <% if node.smokeping %> + <td colspan="5">enabled</td> + <% else %> + <td colspan="5">disabled</td> + <% end %> + </tr> +</table> +<p> + <%= link_to 'Edit', { :controller =>'node', :action => 'edit' , :id => node.id } %> | + <%= link_to 'Destroy', { :controller => 'node', :action => 'destroy', :id => node.id } %> +</p> +<p></p> +<% end %> diff --git a/app/views/node/edit.rhtml b/app/views/node/edit.rhtml new file mode 100644 index 0000000..3686853 --- /dev/null +++ b/app/views/node/edit.rhtml @@ -0,0 +1,34 @@ +<%= render :partial => "person/nav" %> + +<h1>Node</h1> +<%= start_form_tag :action => 'update', :id => @node %> + <table> + <tr> + <td>Name</td><td><%= text_field 'node', 'name' %></td> + </tr> + <tr> + <td>Kommentar</td><td><%= text_area('node', 'comment', :cols => 40, :rows => 5) %></td> + </tr> + <tr> + <td>Administrator</td> + <td> + <select name="node[person_id]"> + <option value="0"> - </option + <% @persons.each do |person| %> + <option value="<%= person.id %>" + <%= ' selected' if @node.person != nil && @node.person.id == person.id %>> + <%= person.email %> + </option> + <% end %> + </select> + </td> + </tr> + <tr> + <td>Smokeping</td> + <td><%= check_box "node", "smokeping" %></td> + </tr> + </table> + <%= submit_tag 'Edit' %> +<%= end_form_tag %> +<hr /> +<%= link_to 'Back', { :controller => 'location', :action => 'show', :id => @node.location.id } %> diff --git a/app/views/node/edit.rhtml.bak b/app/views/node/edit.rhtml.bak new file mode 100644 index 0000000..c14bd94 --- /dev/null +++ b/app/views/node/edit.rhtml.bak @@ -0,0 +1,25 @@ +<h1>Node</h1> +<%= start_form_tag :action => 'update', :id => @node %> + <table> + <tr> + <td>Name</td><td><%= text_field 'node', 'name' %></td> + </tr> + <tr> + <td>Kommentar</td><td><%= text_field 'location', 'comment' %></td> + </tr> + <tr> + <td>Administrator</td><td> + <select name="node[person_id]"> + <option value="0"> - </option + <% @persons.each do |person| %> + <option value="<%= person.id %>" + <%= ' selected' if @node.person != nil && person.id == @node.person.id %>> + <%= person.email %> + </option> + <% end %> + </select> + </td> + </tr> + </table> + <%= submit_tag 'Edit' %> +<%= end_form_tag %> diff --git a/app/views/node/list.rhtml b/app/views/node/list.rhtml new file mode 100644 index 0000000..a6f4ed4 --- /dev/null +++ b/app/views/node/list.rhtml @@ -0,0 +1,2 @@ +<h1>Nodes</h1> +<%= render :partial => "plist", :object => @nodes %> diff --git a/app/views/node/new.rhtml b/app/views/node/new.rhtml new file mode 100644 index 0000000..a1585fc --- /dev/null +++ b/app/views/node/new.rhtml @@ -0,0 +1,44 @@ +<%= render :partial => "person/nav" %> + +<h1>Neuer Router</h1> + +<%= start_form_tag :action => 'do_new' %> + <table> + <tr> + <td>Location:</td> + <td> + <%= @node.location.name %> + </td> + </tr> + <tr> + <td>Name:</td><td><%= text_field 'node', 'name' %></td> + </tr> + <tr> + <td>Kommentar:</td><td><%= text_area 'node', 'comment', 'rows' => 4 %></td> + </tr> + <tr> + <td>Administrator</td> + <td> + <select name="node[person_id]"> + <option value="0"> - </option + <% @persons.each do |person| %> + <option value="<%= person.id %>" + <%= ' selected' if @session[:person].id == person.id %>> + <%= person.email %> + </option> + <% end %> + </select> + </td> + </tr> + <tr> + <td>Smokeping</td> + <td><%= check_box "node", "smokeping" %></td> + </tr> + </table> + <%= hidden_field 'node', 'location_id' %> + <%= submit_tag "Create" %> +<%= end_form_tag %> + + +<h2>Hinweise</h2> +<p>Als <strong>Name</strong> bitte z.B <strong>'omni'</strong> oder einen anden anderen, die Abstrahlcharakteristik bezeichenden Namen.</p> |