diff options
Diffstat (limited to 'management-interface/views/satellites.htm')
-rw-r--r-- | management-interface/views/satellites.htm | 152 |
1 files changed, 123 insertions, 29 deletions
diff --git a/management-interface/views/satellites.htm b/management-interface/views/satellites.htm index 24adba1..2d151f7 100644 --- a/management-interface/views/satellites.htm +++ b/management-interface/views/satellites.htm @@ -1,44 +1,138 @@ - <div class="container"> +<check if="{{ @loggedin }}"> + <true> + <check if="{{ @action }}=='edit'"> <div class="jumbotron"> - <check if="{{ @loggedin }}"> - <true> - <h2>List of all satellite public keys</h2> - <table class="table"> + <h2>Edit</h2> + <form name="edit" action="{{ @hostname }}do/savesatellite" method="post" role="form"> + <div class="form-group"> + <label for="organization">Organization*</label> + <input type="text" class="form-control" name="organization" id="organization" value="{{ @editprefix["organization"] }}"> + </div> + <div class="form-group"> + <label for="address">Address*</label> + <input type="text" class="form-control" name="address" id="address" value="{{ @editprefix["address"] }}"> + </div> + <div class="form-group"> + <label for="name">Name*</label> + <input type="text" class="form-control" name="name" id="name" value="{{ @editprefix["name"] }}"> + </div> + <div class="form-group"> + <label for="prefix">Prefix*</label> + <input type="text" class="form-control" name="prefix" id="prefix" value="{{ @editprefix["prefix"] }}" disabled> + <span class="help-bock">If you use a prefix that is already in use, it will be overwritten</span> + </div> + <div class="form-group"> + <label for="prefix">Public key</label> + <textarea class="form-control" name="publickey" id="publickey">{{ @base64key }}</textarea> + </div> + <span class="help-block">Fields marked with * are mandatory</span> + <input type="hidden" name="prefix" value="{{ @editprefix["prefix"] }}"> + <div class="form-group"> + <button type="submit" class="btn btn-primary">Submit</button> + <a class="btn btn-danger" role="button" href="{{ @hostname }}site/satellites?action=edit&prefix={{ @@editprefix["prefix"] }}">Reset</a> + </div> + </form> + </div> + </check> + <check if="{{ @action }}=='new'"> + <div class="jumbotron"> + <h2>New</h2> + <form name="new" action="{{ @hostname }}do/newsatellite" method="post" role="form"> + <div class="form-group"> + <label for="organization">Organization*</label> + <input type="text" class="form-control" name="organization" id="organization" value="{{ @new["organization"] }}"> + </div> + <div class="form-group"> + <label for="address">Address*</label> + <input type="text" class="form-control" name="address" id="address" value="{{ @new["address"] }}"> + </div> + <div class="form-group"> + <label for="name">Name*</label> + <input type="text" class="form-control" name="name" id="name" value="{{ @new["name"] }}"> + </div> + <div class="form-group"> + <label for="prefix">Prefix*</label> + <input type="text" class="form-control" name="prefix" id="prefix" value="{{ @new["prefix"] }}"> + <span class="help-bock">If you use a prefix that is already in use, it will be overwritten</span> + </div> + <div class="form-group"> + <label for="prefix">Public key</label> + <textarea class="form-control" name="publickey" id="publickey">{{ @new['publickey'] }}</textarea> + </div> + <span class="help-block">Fields marked with * are mandatory</span> + <div class="form-group"> + <button type="submit" class="btn btn-primary">Submit</button> + <button class="btn btn-danger" role="button" type="reset">Reset</button> + </div> + <input type="hidden" name="action" value="new" /> + </form> + </div> + </check> + <div class="jumbotron"> + <h2>List of all satellite public keys</h2> + <form action="{{ @hostname }}site/satellites" method="get" class="form-inline" role="form"> + <table class="table table-striped table-responsive"> <thead> <tr> - <td> - <label> - <input type="checkbox"> - </label> - </td> - <td>Organization</td> - <td>Address</td> - <td>Name</td> - <td>Prefix</td> - <td>Public key</td> + <th> + <input name="checkall" type="checkbox"> + </th> + <th> + <a href="?order=organization&di=<check if='{{ @order }}=="organization" && {{ @di }}=="ASC"'><true>desc</true><false>asc</false></check>">Organization</a> + <check if="{{ @order }}=='organization'"> + <check if="{{ @di }}=='ASC'"><true>↑</true><false>↓</false></check> + </check> + </th> + <th> + <a href="?order=address&di=<check if='{{ @order }}=="address" && {{ @di }}=="ASC"'><true>desc</true><false>asc</false></check>">Address</a> + <check if="{{ @order }}=='address'"> + <check if="{{ @di }}=='ASC'"><true>↑</true><false>↓</false></check> + </check> + </th> + <th> + <a href="?order=name&di=<check if='{{ @order }}=="name" && {{ @di }}=="ASC"'><true>desc</true><false>asc</false></check>">Name</a> + <check if="{{ @order }}=='name'"> + <check if="{{ @di }}=='ASC'"><true>↑</true><false>↓</false></check> + </check> + </th> + <th> + <a href="?order=prefix&di=<check if='{{ @order }}=="prefix" && {{ @di }}=="ASC"'><true>desc</true><false>asc</false></check>">Prefix</a> + <check if="{{ @order }}=='prefix'"> + <check if="{{ @di }}=='ASC'"><true>↑</true><false>↓</false></check> + </check> + </th> + <th>Public key</th> </tr> </thead> <tbody> - <repeat group="{{ @result }}" value="{{ @item }}"> - <tr> + <repeat group="{{ @result }}" value="{{ @item }}"> + <tr class="organization"> <td> - <label> - <input type="checkbox"> - </label> + <input type="checkbox" name="prefix[]" value="{{ @item.prefix }}"> </td> <td>{{ @item.organization }}</td> <td>{{ @item.address }}</td> - <td>{{ @item.name }}</td> + <td><a href="{{ @hostname }}site/satellites/?action=edit&prefix={{ @item.prefix }}">{{ @item.name }}</a></td> <td>{{ @item.prefix}}</td> <td><check if="{{ @item.publickey}} == ''"><true>no</true><false>yes</false></check></td> </tr> - </repeat> + </repeat> </tbody> - </table> - </true> - <false> - <p class="bg-danger">Please <a href="{{ $hostname }}login">login</a></p> - </false> - </check> + </table> + <div class="form-group"> + <label for="action">Action:</label> + <select id="action" name="action" class="form-control"><option>delete</option></select> + </div> + <div class="form-group"> + <button class="btn btn-primary" type="submit">Go</button> </div> - </div> <!-- /container --> + <div style="float:right"> + <a href="{{ @hostname }}site/satellites?action=new" class="btn btn-default" role="button">New</a> + </div> + </form> + </true> + <false> + <p class="bg-danger">Please <a href="{{ $hostname }}site/login">login</a></p> + </false> +</check> +</div> |