diff options
Diffstat (limited to 'modules-available/passthrough/templates/hardware-list.html')
-rw-r--r-- | modules-available/passthrough/templates/hardware-list.html | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/modules-available/passthrough/templates/hardware-list.html b/modules-available/passthrough/templates/hardware-list.html new file mode 100644 index 00000000..2450e457 --- /dev/null +++ b/modules-available/passthrough/templates/hardware-list.html @@ -0,0 +1,96 @@ +<form method="post" action="?do=passthrough&show=hwlist"> + <input type="hidden" name="token" value="{{token}}"> + <table class="table"> + <thead> + <tr> + <th class="slx-smallcol">{{lang_class}}</th> + <th class="slx-smallcol">{{lang_deviceIdNumeric}}</th> + <th>{{lang_deviceName}}</th> + <th class="slx-smallcol">{{lang_useCount}}</th> + <th>{{lang_passthroughGroup}}</th> + </tr> + </thead> + <tbody> + {{#list}} + <tr> + <td>{{class}}</td> + <td>{{vendor}}:{{device}}</td> + <td> + <table class="slx-ellipsis"> + <tr> + <td>{{device_name}}</td> + </tr> + </table> + <div class="small">{{vendor_name}}</div> + </td> + <td class="text-right">{{connected_count}}</td> + <td> + <select name="ptgroup[{{hwid}}]" class="form-control ptgroup-select"> + <option value="">{{lang_noPassthroughGroup}}</option> + {{#ptlist}} + <option value="{{ptid}}" {{selected}}>{{ptname}}</option> + {{/ptlist}} + </select> + </td> + </tr> + {{/list}} + </tbody> + </table> + <div id="new-groups"></div> + <div class="buttonbar text-right"> + <button type="button" data-target="#add-group-form" data-toggle="modal" class="btn btn-default"> + <span class="glyphicon glyphicon-plus"></span> + {{lang_add}} + </button> + <button type="submit" name="action" value="save-hwlist" class="btn btn-success"> + <span class="glyphicon glyphicon-floppy-disk"></span> + {{lang_save}} + </button> + </div> +</form> + +<div class="modal fade" id="add-group-form" tabindex="-1" role="dialog"> + <div class="modal-dialog" role="document"> + <div class="modal-content"> + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal">×</button> + <b>{{lang_addPassthroughGroup}}</b> + </div> + <div class="modal-body"> + <div class="form-group"> + <label for="group-id">{{lang_groupId}}</label> + <input type="text" name="group-id" id="group-id" class="form-control"> + </div> + <div class="form-group"> + <label for="group-title">{{lang_groupTitle}}</label> + <input type="text" name="group-title" id="group-title" class="form-control"> + </div> + </div> + <div class="modal-footer"> + <button type="button" class="btn btn-default" + data-dismiss="modal">{{lang_cancel}}</button> + <button id="add-group-button" type="button" class="btn btn-success" data-dismiss="modal"> + <span class="glyphicon glyphicon-plus"></span> + {{lang_addGroup}} + </button> + </div> + </div> + </div> +</div> + +<script> + document.addEventListener('DOMContentLoaded', function() { + $('#add-group-button').click(function () { + var gid = $('#group-id').val().replace(/[^a-zA-Z0-9_\-]/g, '').toUpperCase(); + var title = $('#group-title').val().trim(); + if (gid.length === 0) + return; + $('#new-groups').append($('<input type="hidden">') + .attr('name', 'newgroup[' + gid + ']') + .attr('value', title)); + $('.ptgroup-select').each(function() { + $(this).append($('<option>').attr('value', gid).text(gid + ' (' + title + ')')); + }); + }); + }); +</script>
\ No newline at end of file |