Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 50 lines (36 sloc) 1.21 kb
4f2bec6 basic lb/node editing
yellow authored
1 <% local.pieces.header(); %>
7a7f715 @erh cleaning
erh authored
2
3 <%
4 if ( request.action == "add" && request.new_nodes ){
9dd0a07 @erh fix for first ndoe redirect issue
erh authored
5
6 var redir = initialConfig && ! db.nodes.findOne();
7
0c212f4 @erh initial grid setup stuff
erh authored
8 for each ( var n in request.new_nodes.split( /[\r\n\s,]+/g ) ){
7a7f715 @erh cleaning
erh authored
9 n = n.trim();
10 if ( n.length == 0 )
11 continue;
12
13 if ( db.nodes.findOne( { machine : n } ) )
14 continue;
0c212f4 @erh initial grid setup stuff
erh authored
15
7a7f715 @erh cleaning
erh authored
16 db.nodes.save( { machine : n } );
9dd0a07 @erh fix for first ndoe redirect issue
erh authored
17
7a7f715 @erh cleaning
erh authored
18 }
9dd0a07 @erh fix for first ndoe redirect issue
erh authored
19
20 if ( redir )
21 throw Exception.Redirect( "/nodes" );
7a7f715 @erh cleaning
erh authored
22 }
23
24 if ( request.action == "delete" && request.machines ){
25 for each ( var n in request.getParameters( "machines" ) ){
26 db.nodes.remove( { machine : n } );
27 }
28 }
29
30 %>
31
a89bb92 DESIGN - added style
Jason Merriman authored
32 <h1>Nodes</h1>
33 <div class="container">
7a7f715 @erh cleaning
erh authored
34 <form action="/nodes/" >
35 <% local.pieces.nodePicker( "machines" , true , current ); %>
36 <input type="submit" name="action" value="delete">
37 </form>
38
39 <hr>
40
41 <h3>Add Nodes</h3>
42 <form method="post" action="/nodes" >
43 <textarea name="new_nodes" cols=60 rows=10 ></textarea>
44 <input type="submit" name="action" value="add">
45 </form>
a89bb92 DESIGN - added style
Jason Merriman authored
46 <div class="small">space or line seperated</div>
47 </div>
4f2bec6 basic lb/node editing
yellow authored
48 <% local.pieces.footer(); %>
49
Something went wrong with that request. Please try again.