diff options
Diffstat (limited to 'modules-available/statistics/templates')
3 files changed, 107 insertions, 3 deletions
diff --git a/modules-available/statistics/templates/machine-main.html b/modules-available/statistics/templates/machine-main.html index 19deb8b3..d8f2c521 100644 --- a/modules-available/statistics/templates/machine-main.html +++ b/modules-available/statistics/templates/machine-main.html @@ -144,11 +144,11 @@ <tr> <td class="text-nowrap">{{lang_screens}}</td> <td> - <form method="post" action="?do=statistics" id="delprojector"> + <form method="post" action="?do=statistics&show=projectors" id="delprojector"> <input type="hidden" name="token" value="{{token}}"> <input type="hidden" name="action" value="delprojector"> </form> - <form method="post" action="?do=statistics" id="addprojector"> + <form method="post" action="?do=statistics&show=projectors" id="addprojector"> <input type="hidden" name="token" value="{{token}}"> <input type="hidden" name="action" value="addprojector"> </form> diff --git a/modules-available/statistics/templates/page-replace.html b/modules-available/statistics/templates/page-replace.html new file mode 100644 index 00000000..f87610a2 --- /dev/null +++ b/modules-available/statistics/templates/page-replace.html @@ -0,0 +1,104 @@ +<h1>{{lang_replaceMachinesHeading}}</h1> + +<style> + .reptable { + border-collapse: separate; + border-spacing: 2px; + } + .reptable td.a { + padding: 2px; + border:1px solid #ccc; + border-radius: 3px; + background: #eee; + vertical-align: top; + } + .reptable td.b { + font-size: 300%; + } +</style> + +<form method="post" action="?do=statistics&show=replace"> + <input type="hidden" name="token" value="{{token}}"> + <table class="reptable"> + <thead> + <tr> + <th>{{lang_replaceOld}}</th> + <th></th> + <th>{{lang_replaceNew}}</th> + <th></th> + </tr> + </thead> + <tbody> + {{#pairs}} + <tr> + <td class="a"> + <div><b>{{oldhost}}</b> {{oldip}}</div> + <div class="slx-bold">{{oldmodel}}</div> + <div class="small">{{oldmac}} – {{olduuid}}</div> + <div>{{lang_lastSeen}}: {{oldlastseen_s}}</div> + </td> + <td class="b">→</td> + <td class="a"> + <div><b>{{newhost}}</b> {{newip}}</div> + <div class="slx-bold">{{newmodel}}</div> + <div class="small">{{newmac}} – {{newuuid}}</div> + <div>{{lang_firstSeen}}: {{newfirstseen_s}}</div> + </td> + <td> + <div class="checkbox checkbox-inline"> + <input type="checkbox" name="replace[]" value="{{olduuid}}x{{newuuid}}"> + <label></label> + </div> + </td> + </tr> + {{/pairs}} + </tbody> + </table> + + <div class="text-right"> + <button type="button" class="btn btn-danger" name="action" value="replace" data-toggle="modal" data-target="#confirm-dialog"> + <span class="glyphicon glyphicon-floppy-disk"></span> + {{lang_replace}} + (<span id="rep-count">0</span>) + </button> + </div> + + <div class="modal fade" id="confirm-dialog" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> + <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"><span aria-hidden="true">×</span></button> + <h4 class="modal-title" id="myModalLabel">{{lang_replace}}</h4> + </div> + <div class="modal-body"> + {{lang_sureReplaceNoUndo}} + </div> + <div class="modal-footer"> + <button type="button" class="btn btn-default" data-dismiss="modal">{{lang_cancel}}</button> + <button type="submit" name="action" value="replace" class="btn btn-danger"> + <span class="glyphicon glyphicon-floppy-disk"></span> + {{lang_replace}} + </button> + </div> + </div> + </div> + </div> +</form> + +<script type="application/javascript"><!-- + document.addEventListener('DOMContentLoaded', function () { + $('td.a').click(function () { + var $cb = $(this).parent().find('input:checkbox'); + $cb.prop('checked', !$cb.is(':checked')); + cbChanged(); + }); + $('input:checkbox').change(function () { + cbChanged(); + }); + function cbChanged() { + var cnt = $('input:checkbox:checked').length; + $('#rep-count').text(cnt).parent().prop('disabled', cnt === 0); + } + cbChanged(); + }); +//--></script>
\ No newline at end of file diff --git a/modules-available/statistics/templates/projector-list.html b/modules-available/statistics/templates/projector-list.html index bc9ecdbd..c33aae09 100644 --- a/modules-available/statistics/templates/projector-list.html +++ b/modules-available/statistics/templates/projector-list.html @@ -1,7 +1,7 @@ <div class="panel panel-default"> <div class="panel-heading">{{lang_projectors}}</div> <div class="panel-body"> - <form method="post" action="?do=statistics" id="delprojector"> + <form method="post" action="?do=statistics&show=projectors" id="delprojector"> <input type="hidden" name="token" value="{{token}}"> <input type="hidden" name="action" value="delprojector"> <p>{{lang_thoseAreProjectors}}</p> |