guests.tx 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <!-- Generated by the tCMS Post Type Wizard. Regenerating this type will overwrite any hand edits. -->
  2. <div class="post <: $style :> <: $tiled ? 'tile' : '' :>">
  3. : if ( !$post.addpost ) {
  4. : if ( $post.unreachable ) {
  5. <h3 class='blogtitles'><: $post.title :></h3>
  6. <div class="postData responsive-text">
  7. Could not reach this hypervisor: <: $post.state :>
  8. </div>
  9. : } else {
  10. : if ( $tiled ) {
  11. <p class="midtitle">
  12. <: $post.title :>
  13. <span class="guest-state guest-<: $post.is_active ? 'up' : 'down' :>"><: $post.state :></span>
  14. </p>
  15. : # The capture is declared private in guests.json, so a reader
  16. : # who cannot edit never receives it -- there is nothing here
  17. : # to remember to guard.
  18. : if ( $post.preview ) {
  19. <a href="<: $post.preview :>" class="undecorated" title="<: $post.title :> (<: $post.state :>)">
  20. <img src="<: $post.preview :>" class="responsive-img guest-screenshot" alt="console of <: $post.title :>" loading="lazy" />
  21. </a>
  22. : }
  23. : } else {
  24. <h3 class='blogtitles'>
  25. <: $post.title :>
  26. <span class="guest-state guest-<: $post.is_active ? 'up' : 'down' :>"><: $post.state :></span>
  27. </h3>
  28. <div class="postData responsive-text" id="postData-<: $post.id :>">
  29. : if ( $post.preview ) {
  30. <a href="<: $post.preview :>" class="undecorated" title="console of <: $post.title :>">
  31. <img src="<: $post.preview :>" class="responsive-img guest-screenshot" alt="console of <: $post.title :>" loading="lazy" />
  32. </a>
  33. <br />
  34. : }
  35. on <: $post.hypervisor_title :> &mdash; <: $post.vcpus :> vCPU
  36. : if ( $can_edit ) {
  37. <br />
  38. <form class="Submissions guest-actions" action="/guest/act" method="POST">
  39. <input type="hidden" name="hypervisor" value="<: $post.hypervisor :>" />
  40. <input type="hidden" name="guest" value="<: $post.domain :>" />
  41. <input type="hidden" name="to" value="<: $route :>" />
  42. : if ( $post.is_active ) {
  43. <button class="coolbutton" type="submit" name="action" value="poweroff">Power Off</button>
  44. : } else {
  45. <button class="coolbutton" type="submit" name="action" value="poweron">Power On</button>
  46. : }
  47. <button class="coolbutton" type="submit" name="action" value="snapshot">Snapshot</button>
  48. <button class="coolbutton guest-destroy" type="submit" name="action" value="destroy"
  49. onclick="return confirm('Destroy <: $post.title :>? This stops the guest immediately.');">Destroy</button>
  50. </form>
  51. : }
  52. </div>
  53. : }
  54. : }
  55. : }
  56. </div>