5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-26 20:06:22 +00:00

Merge branch 'informative-deploys' into panel.sutty.nl

This commit is contained in:
f 2022-04-06 20:43:00 -03:00
commit a2476ae86a
5 changed files with 7 additions and 1 deletions

View file

@ -33,6 +33,7 @@ class DeployJob < ApplicationJob
deploy_local: { deploy_local: {
status: deploy_locally, status: deploy_locally,
seconds: deploy_local.build_stats.last.seconds, seconds: deploy_local.build_stats.last.seconds,
size: deploy_local.build_stats.last.size,
url: deploy_local.url url: deploy_local.url
} }
} }
@ -71,6 +72,7 @@ class DeployJob < ApplicationJob
@deployed[d.type.underscore.to_sym] = { @deployed[d.type.underscore.to_sym] = {
status: d.deploy(output: @output), status: d.deploy(output: @output),
seconds: d.build_stats.last.seconds, seconds: d.build_stats.last.seconds,
size: d.build_stats.last.size,
url: d.url url: d.url
} }
end end

View file

@ -10,6 +10,7 @@
%th= t('.th.status') %th= t('.th.status')
%th= t('.th.url') %th= t('.th.url')
%th= t('.th.seconds') %th= t('.th.seconds')
%th= t('.th.size')
%tbody %tbody
- @deploys.each_pair do |deploy, value| - @deploys.each_pair do |deploy, value|
%tr %tr
@ -18,5 +19,6 @@
%td= link_to value[:url], value[:url] %td= link_to value[:url], value[:url]
%td %td
%time{ datetime: "PT#{value[:seconds]}S" }= distance_of_time_in_words value[:seconds].seconds %time{ datetime: "PT#{value[:seconds]}S" }= distance_of_time_in_words value[:seconds].seconds
%td= number_to_human_size value[:size], precision: 2
= sanitize_markdown t('.help'), tags: %w[p a strong em] = sanitize_markdown t('.help'), tags: %w[p a strong em]

View file

@ -6,6 +6,6 @@
- table << [t('.th.type'), t('.th.status'), t('.th.url'), t('.th.seconds')] - table << [t('.th.type'), t('.th.status'), t('.th.url'), t('.th.seconds')]
- table.add_separator - table.add_separator
- @deploys.each_pair do |deploy, value| - @deploys.each_pair do |deploy, value|
- table << [ t(".#{deploy}.title"), value[:status] ? t(".#{deploy}.success") : t(".#{deploy}.error"), value[:url], distance_of_time_in_words(value[:seconds].seconds) ] - table << [t(".#{deploy}.title"), value[:status] ? t(".#{deploy}.success") : t(".#{deploy}.error"), value[:url], distance_of_time_in_words(value[:seconds].seconds), number_to_human_size(value[:size], precision: 2)]
\ \
= t('.help') = t('.help')

View file

@ -79,6 +79,7 @@ en:
type: Type type: Type
status: Status status: Status
seconds: Duration seconds: Duration
size: Space used
url: Address url: Address
deploy_local: deploy_local:
title: Build the site title: Build the site

View file

@ -79,6 +79,7 @@ es:
type: Tipo type: Tipo
status: Estado status: Estado
seconds: Duración seconds: Duración
size: Espacio ocupado
url: Dirección url: Dirección
deploy_local: deploy_local:
title: Generar el sitio title: Generar el sitio