page.list.machine.php 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. global $myUser;
  3. User::check_access('host','read');
  4. require_once(__DIR__.SLASH.'Machine.class.php');
  5. $types = array();
  6. foreach (Machine::types() as $key => $type) {
  7. $types[$key] = $type['label'];
  8. }
  9. ?>
  10. <div class="plugin-host">
  11. <div class="row">
  12. <!-- search results -->
  13. <div class="col-xl-3">
  14. <div class="row">
  15. <div class="col-md-12 no-embedded">
  16. <div class="d-flex my-2 w-100">
  17. <h5 class="d-inline-block my-auto mx-0 text-uppercase results-count"><span></span> Machine(s)</h5>
  18. <div class="my-auto ml-auto mr-0 noPrint">
  19. <a class="btn btn-small px-1" data-tooltip data-placement="bottom" href="index.php?module=host&page=plan" target="_BLANK" title="Plan d'adressage">
  20. <i class="fas fa-sitemap"></i>
  21. </a>
  22. <a class="btn btn-small" data-tooltip data-placement="bottom" href="index.php?module=host&page=ping" target="_BLANK" title="Ping des ndd">
  23. <i class="fas fa-table-tennis"></i>
  24. </a>
  25. <div onclick="window.print();" class="btn btn-small px-1" data-tooltip data-placement="bottom" title="Imprimer la page"><i class="fas fa-print"></i></div>
  26. <div onclick="host_machine_search(null,true);" id="export-hosts-btn" data-tooltip data-placement="bottom" class="btn btn-export px-1" title="Exporter les résultats"><i class="fas fa-file-export"></i></div>
  27. <?php if($myUser->can('host', 'edit')) : ?>
  28. <div onclick="host_machine_edit();" class="btn btn-small btn-success rounded-0 btn-squarred" data-tooltip data-placement="bottom" title="Ajouter une machine"><i class="fas fa-plus"></i></div>
  29. <?php endif; ?>
  30. </div>
  31. </div>
  32. <div class="clear noPrint"></div>
  33. </div>
  34. </div>
  35. <select id="filters" data-type="filter" data-autosearch="false" data-label="Rech." data-function="host_machine_search"></select>
  36. <div class="machines-preloader hidden p-2"><small class="text-muted"><i class="fas fa-circle-notch fa-spin-fast"></i> <div class="mt-2">Chargement...</div></small></div>
  37. <ul id="machines" class="list-group mt-2" data-entity-search="host_machine_search">
  38. <li data-id="{{id}}" class="hidden {{class}} item-line list-group-item p-2" onclick="host_machine_edit(this);">
  39. <i class="{{type.icon}}"></i> <span class="font-weight-bold">{{label}}</span> {{#client}}- {{client.label}}{{/client}} <i title="Supprimer machine" onclick="event.stopPropagation();host_machine_delete(this);" class="far fa-trash-alt right text-muted noReadOnly"></i>
  40. <br/><span class="text-muted">{{ip}} {{#os}}({{os.label}}){{/os}}</span>
  41. </li>
  42. </ul><br>
  43. <!-- Pagination (data-range définit le nombre de pages max affichées avant et après la page courante) -->
  44. <ul class="pagination justify-content-center" data-range="5">
  45. <li class="page-item hidden" data-value="{{value}}" title="Voir la page {{label}}" onclick="$(this).parent().find('li').removeClass('active');$(this).addClass('active');host_machine_search();">
  46. <span class="page-link">{{label}}</span>
  47. </li>
  48. </ul>
  49. </div>
  50. <div class="col-xl-9 host-sheet-container">
  51. <!-- fiche -->
  52. </div>
  53. </div>
  54. </div>