create modify delete external users are working on the web
Former-commit-id: dd1ac3cd8b3f54b1be1aab9f452b12dce006b7cd
This commit is contained in:
parent
37686c2a79
commit
81b605d9be
3 changed files with 55 additions and 29 deletions
|
|
@ -88,20 +88,24 @@
|
|||
<td>{{.hostname}}</td>
|
||||
<td>{{.port}}</td>
|
||||
<td>
|
||||
<div class="btn-toolbar pull-right">
|
||||
<button class="btn btn-default btn-xs" data-toggle="modal"
|
||||
data-target="#extUserModal"
|
||||
data-id="{{.getId()}}"
|
||||
data-hostname="{{.hostname}}"
|
||||
data-port="{{.port}}">
|
||||
<span class="glyphicon glyphicon-pencil"></span>
|
||||
</button>
|
||||
<button class="btn btn-danger btn-xs" data-toggle="modal"
|
||||
data-target="#deleteModal"
|
||||
data-name="{{.hostname}}">
|
||||
<span class="glyphicon glyphicon-trash"></span>
|
||||
</button>
|
||||
</div>
|
||||
<form method="POST">
|
||||
<input type="hidden" name="action" value="remove_external_user">
|
||||
<input type="hidden" name="id" value="{{.getId()}}">
|
||||
|
||||
<div class="btn-toolbar pull-right">
|
||||
<button type="button" class="btn btn-default btn-xs" data-toggle="modal"
|
||||
data-target="#extUserModal"
|
||||
data-id="{{.getId()}}"
|
||||
data-hostname="{{.hostname}}"
|
||||
data-port="{{.port}}">
|
||||
<span class="glyphicon glyphicon-pencil"></span>
|
||||
</button>
|
||||
|
||||
<button type="submit" class="btn btn-danger btn-xs">
|
||||
<span class="glyphicon glyphicon-trash"></span>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{{/extUsers}}
|
||||
|
|
@ -129,8 +133,8 @@
|
|||
<td>{{.type}}</td>
|
||||
<td>{{.config}}</td>
|
||||
<td>
|
||||
<div class="btn-toolbar pull-right">
|
||||
<form method="POST">
|
||||
<form method="POST">
|
||||
<div class="btn-toolbar pull-right">
|
||||
<input type="hidden" name="action" value="modify_external_sensor">
|
||||
<input type="hidden" name="id" value="{{.getId()}}">
|
||||
{{^.sync}}
|
||||
|
|
@ -145,8 +149,8 @@
|
|||
<span class="glyphicon glyphicon-remove"></span>
|
||||
</button>
|
||||
{{/.sync}}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{{/extSensor}}
|
||||
|
|
@ -163,7 +167,7 @@
|
|||
var button = $(event.relatedTarget);
|
||||
var modal = $(this);
|
||||
if(button.data("id") >= 0){ // edit
|
||||
modal.find("#action").val(button.data("edit_external_user"));
|
||||
modal.find("#action").val("modify_external_user");
|
||||
modal.find("#id").val(button.data("id"));
|
||||
modal.find("#hostname").val(button.data("hostname"));
|
||||
modal.find("#port").val(button.data("port"));
|
||||
|
|
@ -182,26 +186,26 @@
|
|||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<button type="button" class="close" data-dismiss="modal">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="exampleModalLabel">External User</h4>
|
||||
</div>
|
||||
<form method="POST">
|
||||
<div class="modal-body">
|
||||
<input type="hidden" id="action" name="action">
|
||||
<input type="hidden" id="action" name="action" value="">
|
||||
<input type="hidden" id="id" name="id">
|
||||
<div class="form-group">
|
||||
<label for="hostname" class="control-label">Hostname/IP:</label>
|
||||
<input type="text" class="form-control" id="hostname">
|
||||
<input type="text" class="form-control" id="hostname" name="hostname">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="port" class="control-label">Port:</label>
|
||||
<input type="number" class="form-control" id="port" min="1">
|
||||
<input type="number" class="form-control" id="port" name="port" min="1">
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
|
||||
<button type="reset" class="btn btn-default" data-dismiss="modal">Cancel</button>
|
||||
<button type="submit" class="btn btn-primary">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue