This repository has been archived by the owner on Mar 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgroups.erb
51 lines (42 loc) · 2.17 KB
/
groups.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<% @title = 'Security Groups' %>
<p>
<%= link_to(
image_tag('add.png', :alt => 'Create a new Security Group'),
'#', :onclick => "$('#group_create').toggle();$('#overlay').toggle()"
) %> Create a new Security Group
</p>
<br/>
<% @groups.each do |group| %>
<div id="group_<%= group[:aws_group_name] %>" class="group">
<b><%= group[:aws_group_name] %></b> <%= group[:aws_description] %>
<%= link_to(
image_tag('minus.png', :alt => 'Delete Security Group'),
"/group/#{group[:aws_group_name]}/delete", :onclick => "return confirm('Delete Security Group: Are you sure?')"
) %>
<br/><br/>
<%= table(group[:aws_perms]) { |perm| link_to('Revoke', "/#{@project}/group/#{group[:aws_group_name]}/revoke?#{to_query(perm)}")} %>
<%= link_to'+ Add new rule', '#', :onclick => "$('#add_rule_#{group[:aws_group_name]}').toggle()" %>
<div id="add_rule_<%= group[:aws_group_name] %>" class="add_rule">
<form action="/<%= @project %>/group/<%= group[:aws_group_name] %>/authorize" method="POST">
<select name="protocol">
<option value="tcp">tcp</option>
<option value="udp">udp</option>
<option value="icmp">icmp</option>
</select>
IP <input name="ip" type="text"/>
From <input name="from" type="text" size="4"/>
to <input name="to" type="text" size="4"/>
<input type="submit" value="add"/> <%= link_to 'Cancel', '#', :onclick => "$('#add_rule_#{group[:aws_group_name]}').toggle()" %>
</form>
</div>
</div>
<% end %>
<div id="group_create" class="lightbox">
<h2>Create A Security Group</h2>
<form action="/group" method="POST">
<p>Group Name: <input type="text" name="name" /></p>
<p>Group Description: <input type="text" name="description" /></p>
<p><input type="submit" value="create"/> <%= link_to 'Cancel', '#', :onclick => "$('#group_create').toggle();$('#overlay').toggle()" %></p>
</form>
</div>
<div id="overlay" class="lightbox_overlay"/>