rustploy-gui 0.1.35

Rustploy — desktop client (glacier-ui) for the Rustploy PaaS daemon
// Janela "Exportar serviço": motor Glacier próprio, aberto por open_window a partir do app principal (handlers/bundle.luau).
screen(title = "{t('service_export_window.export_service_rustploy')}") {
  resources {
    style """
    .dialog__check { color: var(--surface); padding: 5 10; border-radius: 4; }
    .dialog__yaml  { width: fill; height: 150; padding: 10 12; font: mono; }
    """

    script(src = "scripts/service_export_window.luau")
  }

  column(class = dialog__screen) {
    row(class = titlebar) {
      row(class = titlebar__drag, on_press = window:drag) {
        text("●", class = titlebar__dot)
        text("{t('service_export_window.export_service_rustploy')}", class = titlebar__title)
      }

      button(class = titlebar__btn, on_click = window:minimize, text = "—")
      button(class = "titlebar__btn titlebar__btn--close", on_click = window:close, text = "✕")
    }

    scrollable(class = dialog__body, direction = vertical) {
      column(class = form-panel) {
        text("{t('service_export_window.export', export_service=export_service)}", class = u-label-cap)

        text(
          "{t('service_export_window.generates_a_file_to_recreate_this')}",
          class = u-muted,
        )

        if @export_blocked != "" {
          text("@export_blocked", class = u-error)
        } else {
          text("{t('service_export_window.service_variables_all_of_them', export_service_count=export_service_count)}", class = u-label-cap)
          text("@export_service_vars", class = u-muted)

          text("{t('service_export_window.project_variables_tick_the_ones', export_project=export_project)}", class = u-label-cap)

          text(
            "{t('service_export_window.the_container_receives_all_of_the')}",
            class = u-muted,
          )

          if @export_has_vars == "true" {
            row(class = dialog__actions) {
              button(
                class = "btn btn--ghost",
                on_click = export_suggested,
                disabled = @busy_export_suggested,
                text = "{t('service_export_window.suggested')}",
              )
              button(class = "btn btn--ghost", on_click = export_all, disabled = @busy_export_all, text = "{t('service_export_window.all')}")
              button(class = "btn btn--ghost", on_click = export_none, disabled = @busy_export_none, text = "{t('service_export_window.none')}")
              text("{t('service_export_window.ticked', export_picked_count=export_picked_count)}", class = u-muted)
            }

            column(class = kv-list) {
              template(:for-each = export_vars, var = v) {
                row(class = dialog__actions) {
                  button(
                    class = dialog__check,
                    on_click = export_toggle:@v.key,
                    disabled = @busy_export_toggle,
                    text = "@v.mark  @v.key",
                  )
                  text("@v.tag", class = u-muted)
                }
              }
            }
          } else {
            text("{t('service_export_window.the_project_has_no_variables')}", class = u-muted)
          }

          checkbox(
            :checked = export_values,
            on_toggle = field:export_values,
            label = "{t('service_export_window.include_the_variable_values')}",
          )

          text(
            "{t('service_export_window.the_file_will_contain_secrets_in')}",
            if = @export_values,
            equals = true,
            class = u-error,
          )

          text(
            "{t('service_export_window.no_values_the_file_carries')}",
            if = @export_values,
            equals = false,
            class = u-muted,
          )

          row(class = dialog__actions) {
            button(
              class = "btn btn--primary",
              on_click = export_save,
              disabled = @busy_export_save,
              text = "{t('service_export_window.save_file')}",
            )
            button(
              class = "btn btn--blue btn--wide",
              on_click = export_show,
              disabled = @busy_export_show,
              text = "{t('service_export_window.show_as_text')}",
            )
          }

          text("@export_message", class = u-muted, if = @export_message, not_equals = "")
          text("@export_error", class = u-error, if = @export_error, not_equals = "")

          if @export_yaml != "" {
            textarea(class = dialog__yaml, font = mono, :value = export_yaml)
            button(
              class = "btn btn--ghost btn--xs",
              on_click = copy_ctx:export_yaml,
              text = "{t('service_export_window.copy_text')}",
            )
          }
        }
      }
    }
  }
}