| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- <!-- Generated by the tCMS Post Type Wizard. Regenerating this type will overwrite any hand edits. -->
- <div class="post <: $style :> <: $tiled ? 'tile' : '' :>">
- : if ( !$post.addpost ) {
- : if ( $post.unreachable ) {
- <h3 class='blogtitles'><: $post.title :></h3>
- <div class="postData responsive-text">
- Could not reach this hypervisor: <: $post.state :>
- </div>
- : } else {
- <h3 class='blogtitles'>
- <: $post.title :>
- <span class="tag guest-state guest-<: $post.is_active ? 'up bg-green' : 'down bg-red' :>"><: $post.state :></span>
- : if ( $post.is_self ) {
- <span class="guest-state guest-self tag" title="the server tCMS is running on">dom0</span>
- : }
- : if ( !$post.has_recipe ) {
- <span class="tag guest-state" title="no recipes.d entry for this guest">unprovisioned</span>
- : }
- </h3>
- <div class="postData responsive-text" id="postData-<: $post.id :>">
- : # Declared private in the sidecar, so a reader who cannot edit
- : # never receives it -- there is nothing here to remember to guard.
- : if ( $post.preview ) {
- <a href="<: $post.preview :>" class="undecorated" title="console of <: $post.title :>">
- <img src="<: $post.preview :>" class="responsive-img guest-screenshot" alt="console of <: $post.title :>" loading="lazy" />
- </a>
- <br />
- : }
- on <: $post.hypervisor_title :> — <: $post.vcpus :> vCPU
- : if ( $can_edit && $post.recipe ) {
- <details class="guest-recipe">
- <summary>Recipe — <: $post.recipe_path :></summary>
- <pre class="guest-recipe-body"><: $post.recipe :></pre>
- </details>
- : }
- : if ( $can_edit && $post.reprovision_log ) {
- <details class="guest-reprovision-log">
- <summary>Last reprovision</summary>
- <pre class="guest-recipe-body"><: $post.reprovision_log :></pre>
- </details>
- : }
- : if ( $can_edit ) {
- <br />
- <form class="Submissions guest-actions" action="/guest/act" method="POST">
- <input type="hidden" name="hypervisor" value="<: $post.hypervisor :>" />
- <input type="hidden" name="guest" value="<: $post.domain :>" />
- <input type="hidden" name="to" value="<: $route :>" />
- : # Trog::DataSource::Virt::act() refuses these for the
- : # server drawing the page. Not offering them is not the guard.
- : # (A semicolon in a Kolon comment ends the statement, so do not.)
- : if ( !$post.is_self ) {
- : if ( $post.is_active ) {
- <button class="coolbutton" type="submit" name="action" value="poweroff">Power Off</button>
- : } else {
- <button class="coolbutton" type="submit" name="action" value="poweron">Power On</button>
- : }
- : }
- <button class="coolbutton" type="submit" name="action" value="snapshot">Snapshot</button>
- : if ( !$post.is_self ) {
- <button class="coolbutton guest-destroy" type="submit" name="action" value="destroy"
- onclick="return confirm('Destroy <: $post.title :>? This stops the guest immediately.');">Destroy</button>
- : }
- </form>
- : # Separate form, because this one carries a passphrase and has
- : # no business sharing a submit with the buttons above.
- : if ( $post.can_reprovision ) {
- <form class="Submissions guest-reprovision" action="/guest/reprovision" method="POST" autocomplete="off">
- <input type="hidden" name="guest" value="<: $post.domain :>" />
- <input type="hidden" name="to" value="<: $route :>" />
- <label>
- Secrets passphrase
- <input required class="cooltext" type="password" name="passphrase" autocomplete="off"
- title="new_config asks for this on stdin; it is used for this run and not stored" />
- </label>
- <button class="coolbutton guest-destroy" type="submit"
- onclick="return confirm('Reprovision <: $post.title :>? This destroys the guest and builds it again from its recipe. Anything on it the recipe does not describe will not come back.');">Reprovision</button>
- </form>
- : }
- : }
- </div>
- : }
- : }
- </div>
|