page.sheet.docker.environment.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. global $conf;
  3. User::check_access('docker','read');
  4. require_once(__DIR__.SLASH.'DockerEnvironment.class.php');
  5. require_once(__DIR__.SLASH.'DockerMachine.class.php');
  6. $environment = DockerEnvironment::provide();
  7. $machine = new DockerMachine();
  8. if($environment->id == 0){
  9. $environment->memory = '256';
  10. $environment->cpu = '0.5';
  11. $environment->port = DockerEnvironment::lastPort()+2;
  12. }else{
  13. $machine = DockerMachine::getById($environment->machine);
  14. }
  15. ?>
  16. <div class="docker">
  17. <div id="docker-environment-form" class="row docker-environment-form justify-content-md-center" data-action="docker_environment_save" data-id="<?php echo $environment->id; ?>">
  18. <div class="col-md-5 shadow-sm bg-white p-3">
  19. <h3>Docker Environment <a class="btn px-1" data-scope="docker" data-uid="<?php echo $environment->id; ?>" data-show-important="true" data-type="history"><i class="far fa-comment-dots"></i></a>
  20. <div onclick="docker_environment_save();" class="btn btn-success right ml-2"><i class="fas fa-check"></i> Enregistrer</div>
  21. <a class="btn btn-dark right" href="index.php?module=docker">Retour</a>
  22. </h3>
  23. <label for="machine">Machine</label>
  24. <select id="machine" name="machine" class="form-control" placeholder="" value="<?php echo $environment->machine; ?>" required>
  25. <?php foreach(DockerMachine::loadAll() as $machine): ?>
  26. <option <?php echo $machine->id==$environment->machine?'selected="selected"':'' ?> value="<?php echo $machine->id; ?>"><?php echo $machine->label; ?></option>
  27. <?php endforeach; ?>
  28. </select>
  29. <label for="client">Client</label>
  30. <input id="client" name="client" data-type="client" class="form-control" placeholder="" type="text" value="<?php echo $environment->client; ?>">
  31. <label for="comment">Commentaire</label>
  32. <textarea id="comment" data-type="wysiwyg"><?php echo $environment->comment; ?></textarea>
  33. </div>
  34. <div class="col-md-5 shadow-sm bg-white p-3 ml-2 environment-detail hidden">
  35. <ul class="nav nav-tabs" id="docker-environment-tab" role="tablist">
  36. <li class="nav-item" role="presentation">
  37. <a class="nav-link" data-toggle="tab" href="#docker" role="tab" aria-selected="false"><i class="fab fa-docker"></i> Environnement</a>
  38. </li>
  39. <li class="nav-item" role="presentation">
  40. <a class="nav-link" data-toggle="tab" href="#domain" role="tab" aria-selected="false"><i class="fas fa-globe"></i> Nom de domaine</a>
  41. </li>
  42. <li class="nav-item" role="presentation">
  43. <a class="nav-link" data-toggle="tab" href="#proxy" role="tab" aria-selected="false"><i class="fas fa-shield-alt"></i> Reverse Proxy</a>
  44. </li>
  45. <li class="nav-item" role="presentation">
  46. <a class="nav-link" data-toggle="tab" href="#git" role="tab" aria-selected="false"><i class="fab fa-git"></i> Git</a>
  47. </li>
  48. <li class="nav-item" role="presentation">
  49. <a class="nav-link" data-toggle="tab" href="#migration" role="tab" aria-selected="false"><i class="fas fa-dove"></i> Migration</a>
  50. </li>
  51. </ul>
  52. <div class="tab-content" id="docker-environment-tab-content"></div>
  53. <hr>
  54. <div id="logs"></div>
  55. </div>
  56. </div>
  57. </div>