rustploy-gui 0.1.78

Rustploy — desktop client (glacier-ui) for the Rustploy PaaS daemon
// Atualizações: pergunta ao daemon se há release mais nova
// (Command::CheckUpdate). Só consulta — instalar é manual por enquanto
// (docs/plano-updaters-daemon-e-gui.md).
component {
  scrollable(direction = vertical, class = u-fill-all) {
    column(class = form-stack) {
      // ── Daemon ──
      column(class = "form-panel form-panel--grouped") {
        text("{t('settings_updates.daemon')}", class = u-label-cap)

        column(class = info-list) {
          row(class = info-row) {
            text(
              "{t('settings_updates.installed_version')}",
              class = info-row__key
            )
            text("@update_current_version", class = info-row__value)
          }

          row(class = info-row) {
            text(
              "{t('settings_updates.latest_version')}",
              class = info-row__key
            )
            text("@update_latest_version", class = info-row__value)
          }

          row(class = info-row) {
            text("{t('settings_updates.checked_at')}", class = info-row__key)
            text("@update_checked_at_label", class = info-row__value)
          }
        }

        row(class = form-panel__actions) {
          button(
            "{t('settings_updates.check_for_updates')}",
            class = "btn btn--ghost",
            on_click = update_check_now
          )
          text("@update_message", class = u-muted)
        }

        if @update_is_helper_available == "true" {
          column(class = form-panel__body) {
            column(class = form-panel__head) {
              text(
                "{t('settings_updates.update_from_the_app')}",
                class = u-label-cap
              )
              text(
                "{t('settings_updates.the_daemon_downloads_the_new_version')}",
                class = u-muted,
              )
            }

            row(class = form-panel__actions) {
              if @update_is_available == "true" {
                button(
                  "{t('settings_updates.update_daemon')}",
                  class = "btn btn--primary",
                  on_click = update_apply
                )
              }

              button(
                "{t('settings_updates.roll_back_to_the_previous')}",
                class = "btn btn--ghost",
                on_click = update_rollback
              )
            }
          }
        }

        text(
          "@update_progress_message",
          if = @update_progress_message,
          not_equals = "",
          class = u-muted
        )

        if @update_is_available == "true" {
          field(
            label = "{t('settings_updates.how_to_update_by_hand')}",
            label_class = u-label-cap
          ) {
            text(
              "{t('settings_updates.there_is_a_new_version_for')}",
              class = u-muted,
            )

            row(class = copy-row) {
              container(class = copy-row__value) {
                text("@update_install_command", class = copy-row__text)
              }
              button(
                "{t('common.copy')}",
                class = "btn btn--ghost btn--sm",
                on_click = copy_ctx:update_install_command
              )
            }
          }

          field(
            label = "{t('settings_updates.release_notes')}",
            label_class = u-label-cap
          ) {
            row(class = copy-row) {
              container(class = copy-row__value) {
                text("@update_release_url", class = copy-row__text)
              }
              button(
                "{t('common.copy')}",
                class = "btn btn--ghost btn--sm",
                on_click = copy_ctx:update_release_url
              )
            }
          }
        }
      }

      // ── App desktop ──
      if @update_app_current_version != "" {
        column(class = "form-panel form-panel--grouped") {
          text("{t('settings_updates.desktop_app')}", class = u-label-cap)

          column(class = info-list) {
            row(class = info-row) {
              text(
                "{t('settings_updates.installed_version')}",
                class = info-row__key
              )
              text("@update_app_current_version", class = info-row__value)
            }

            row(class = info-row) {
              text(
                "{t('settings_updates.latest_version')}",
                class = info-row__key
              )
              text("@update_app_latest_version", class = info-row__value)
            }
          }

          text("@update_app_message", class = u-muted)

          if @update_app_is_available == "true" {
            if @update_app_can_update == "true" {
              row(class = form-panel__actions) {
                button(
                  "{t('settings_updates.update_app')}",
                  class = "btn btn--primary",
                  on_click = update_app_apply
                )

                button(
                  "{t('common.cancel')}",
                  class = "btn btn--ghost",
                  on_click = update_app_cancel,
                  if = @update_app_running,
                  equals = true
                )
              }

              progressbar(
                if = @update_app_running,
                equals = true,
                :value = update_app_percent
              )

              text("@update_app_apply_hint", class = u-muted)
            }

            if @update_app_can_update == "false" {
              column(class = form-panel__head) {
                text(
                  "{t('settings_updates.this_app_was_not_installed')}",
                  class = u-muted,
                )

                row(class = copy-row) {
                  container(class = copy-row__value) {
                    text("@update_app_manual_command", class = copy-row__text)
                  }
                  button(
                    "{t('common.copy')}",
                    class = "btn btn--ghost btn--sm",
                    on_click = copy_ctx:update_app_manual_command
                  )
                }
              }
            }
          }
        }
      }
    }
  }
}