rustploy-gui 0.1.72

Rustploy — desktop client (glacier-ui) for the Rustploy PaaS daemon
// Healthcheck (editável)
component {
  resources {
    component(name = SemChecks) {
      text(
        "{t('healthcheck.no_check_configured_the_deploy')}",
        class = u-muted,
      )
    }
  }

  form(
    error_prefix = error_,
    name = healthcheck,
    on_submit = healthcheck_save,
    class = form-panel,
  ) {
    field(label = "{t('healthcheck.kind')}", label_class = u-label-cap) {
      scroll(class = tabs__scroll, direction = horizontal) {
        tabbar(
          :value = service_form_healthcheck_kind, active = @service_form_healthcheck_kind, :items = healthcheck_kinds,
          tab_class = tabs__tab, tab_active_class = "tabs__tab tabs__tab--active", padding = "9 16", size = 14,
        )
      }
    }

    if @service_form_healthcheck_kind == "http" {
      field(label = "{t('healthcheck.http_path')}", label_class = u-label-cap) {
        input(
          class = field__input,
          form_control = service_form_healthcheck_path,
          :value = service_form_healthcheck_path,
          on_change = field:service_form_healthcheck_path,
          placeholder = "{t('healthcheck.health')}",
        )
      }

      field(label = "{t('healthcheck.expected_status')}", label_class = u-label-cap) {
        spinbox(
          field_class = field__spin,
          form_control = service_form_healthcheck_status,
          :value = service_form_healthcheck_status,
          min = 100,
          max = 599,
          width = 90,
          placeholder = 200,
        )
      }
    }

    row(class = healthcheck__grid) {
      column(class = healthcheck__field) {
        field(label = "{t('healthcheck.interval_s')}", label_class = u-label-cap) {
          spinbox(
            field_class = field__spin,
            form_control = service_form_healthcheck_interval,
            :value = service_form_healthcheck_interval,
            min = 1,
            max = 3600,
            width = 90,
          )
        }
      }

      column(class = healthcheck__field) {
        field(label = "{t('healthcheck.timeout_s')}", label_class = u-label-cap) {
          spinbox(
            field_class = field__spin,
            form_control = service_form_healthcheck_timeout,
            :value = service_form_healthcheck_timeout,
            min = 1,
            max = 3600,
            width = 90,
          )
        }
      }
    }

    row(class = healthcheck__grid) {
      column(class = healthcheck__field) {
        field(label = "{t('healthcheck.retries')}", label_class = u-label-cap) {
          spinbox(
            field_class = field__spin,
            form_control = service_form_healthcheck_retries,
            :value = service_form_healthcheck_retries,
            min = 1,
            max = 10,
            width = 90,
          )
        }
      }

      column(class = healthcheck__field) {
        field(label = "{t('healthcheck.start_period_s')}", label_class = u-label-cap) {
          spinbox(
            field_class = field__spin,
            form_control = service_form_healthcheck_start,
            :value = service_form_healthcheck_start,
            min = 0,
            max = 3600,
            width = 90,
          )
        }
      }
    }

    row(class = env__add) {
      button("{t('common.save_2')}", class = "btn btn--primary", type = submit, disabled = @busy_healthcheck_save)
      text("@service_action_message", class = u-muted)
    }
  }
}