rustploy-gui 0.1.36

Rustploy — desktop client (glacier-ui) for the Rustploy PaaS daemon
// Botão "⋯" de uma linha de job, que abre o painel sobreposto com todas as ações do job.
component {
  props {
    prop(name = job_id)
    prop(name = job_name)
    prop(name = running)
    prop(name = enabled)
    prop(name = enabled_label)
    prop(name = last_run_id)
    prop(name = is_warm)
    prop(name = is_warming)
    prop(name = warm_kind)
    prop(name = warm_label)
    prop(name = warm_reason)
    prop(name = warmed_at_label)
  }

  resources {
    style """
    .job-actions__panel {
      background: var(--raised);
      border_width: 1;
      border_color: var(--border);
      border_radius: 8;
      padding: 18 20;
      spacing: 8;
      width: 340;
    }

    .job-actions__title  { size: 14; bold: true; color: var(--text); }
    .job-actions__status { spacing: 4; padding: 0 0 8 0; }
    .job-actions__item   { width: fill; }
    """
  }

  popup(value = "job_actions_open_@job_id") {
    button(
      slot = anchor,
      class = "btn btn--ghost btn--xs",
      text = "⋯",
      tooltip = "{t('job_actions.job_actions')}",
    )

    column(class = job-actions__panel) {
      text("@job_name", class = job-actions__title)

      column(class = job-actions__status) {
        StateCell(kind = @warm_kind, label = @warm_label)

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

        text(
          "{t('job_actions.warmed', warmed_at_label=warmed_at_label)}",
          class = u-muted,
          if = @is_warm,
          equals = true,
        )
      }

      button(
        class = "btn btn--ghost btn--sm job-actions__item",
        if = @running,
        not_equals = true,
        on_click = job_run_now:@job_id,
        disabled = @busy_job_run_now,
        text = "{t('job_actions.run_now')}",
      )

      button(
        class = "btn btn--danger btn--sm job-actions__item",
        if = @running,
        equals = true,
        on_click = job_run_cancel:@last_run_id,
        disabled = @busy_job_run_cancel,
        text = "{t('job_actions.cancel_run')}",
      )

      button(
        class = "btn btn--ghost btn--sm job-actions__item",
        on_click = job_warm:@job_id,
        disabled = @busy_job_warm,
        text = "{t('job_actions.warm')}",
      )

      button(
        class = "btn btn--ghost btn--sm job-actions__item",
        if = @is_warm,
        equals = true,
        on_click = job_rebuild:@job_id,
        disabled = @busy_job_rebuild,
        text = "{t('job_actions.rebuild_no_cache')}",
        tooltip = "{t('job_actions.redoes_the_build_from_scratch')}",
      )

      button(
        class = "btn btn--ghost btn--sm job-actions__item",
        if = @last_run_id,
        not_equals = "",
        on_click = open_job_logs_window:@last_run_id,
        disabled = @busy_open_job_logs_window,
        text = "{t('job_actions.view_logs')}",
      )

      button(
        class = "btn btn--ghost btn--sm job-actions__item",
        on_click = job_toggle:@job_id,
        disabled = @busy_job_toggle,
        text = "‖  @enabled_label",
      )

      button(
        class = "btn btn--ghost btn--sm job-actions__item",
        on_click = open_edit_job_window:@job_id,
        disabled = @busy_open_edit_job_window,
        text = "{t('job_actions.edit')}",
      )

      button(
        class = "btn btn--danger btn--sm job-actions__item",
        on_click = job_delete:@job_id,
        disabled = @busy_job_delete,
        text = "{t('job_actions.remove')}",
      )
    }
  }
}