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

Merge branch 'issue-14169' of https://0xacab.org/sutty/sutty into 17.3.alpine.panel.sutty.nl

This commit is contained in:
Sutty 2023-08-31 17:44:43 +00:00
commit d920054e23
74 changed files with 234 additions and 5 deletions

View file

@ -22,7 +22,12 @@ class BuildStatsController < ApplicationController
@table = site.deployment_list.map do |deploy| @table = site.deployment_list.map do |deploy|
type = deploy.class.name.underscore type = deploy.class.name.underscore
urls = deploy.respond_to?(:urls) ? deploy.urls : [deploy.url].compact urls = (deploy.respond_to?(:urls) ? deploy.urls : [deploy.url].compact).map do |url|
URI.parse(url)
rescue URI::Error
nil
end.compact
urls = [nil] if urls.empty? urls = [nil] if urls.empty?
build_stat = deploy.build_stats.where(status: true).last build_stat = deploy.build_stats.where(status: true).last
seconds = build_stat&.seconds || 0 seconds = build_stat&.seconds || 0

View file

@ -51,7 +51,11 @@ class DeployJob < ApplicationJob
status = d.deploy(output: @output) status = d.deploy(output: @output)
seconds = d.build_stats.last.try(:seconds) || 0 seconds = d.build_stats.last.try(:seconds) || 0
size = d.size size = d.size
urls = d.respond_to?(:urls) ? d.urls : [d.url].compact urls = (d.respond_to?(:urls) ? d.urls : [d.url].compact).map do |url|
URI.parse url
rescue URI::Error
nil
end.compact
rescue StandardError => e rescue StandardError => e
status = false status = false
seconds ||= 0 seconds ||= 0

View file

@ -52,7 +52,7 @@ class DeployMailer < ApplicationMailer
t << (row.map do |k, v| t << (row.map do |k, v|
case k case k
when :seconds then v[:human] when :seconds then v[:human]
when :urls then url when :urls then url.to_s
else v else v
end end
end) end)

View file

@ -66,6 +66,22 @@ class Deploy < ApplicationRecord
}) })
end end
# Un entorno que solo tiene lo que necesitamos
#
# @return [Hash]
def env
# XXX: This doesn't support Windows paths :B
paths = [File.dirname(`which bundle`), '/usr/local/bin', '/usr/bin', '/bin']
# Las variables de entorno extra no pueden superponerse al local.
extra_env.merge({
'HOME' => home_dir,
'PATH' => paths.join(':'),
'JEKYLL_ENV' => Rails.env,
'LANG' => ENV['LANG'],
})
end
# Corre un comando, lo registra en la base de datos y devuelve el # Corre un comando, lo registra en la base de datos y devuelve el
# estado. # estado.
# #

View file

@ -14,7 +14,7 @@
- row[:urls].each do |url| - row[:urls].each do |url|
%tr %tr
%th{ scope: 'row' }= row[:title] %th{ scope: 'row' }= row[:title]
%td= link_to_if url.present?, url, url, class: 'word-break-all' %td= link_to_if (url.present? && uri.scheme.present?), url.to_s, url.to_s, class: 'word-break-all'
%td %td
%time{ datetime: row[:seconds][:machine] }= row[:seconds][:human] %time{ datetime: row[:seconds][:machine] }= row[:seconds][:human]
%td= row[:size] %td= row[:size]

View file

@ -13,7 +13,7 @@
%tr %tr
%td= row[:title] %td= row[:title]
%td= row[:status] %td= row[:status]
%td= link_to_if url.present?, url, url %td= link_to_if (url.present? && uri.scheme.present?), url.to_s, url.to_s
%td %td
%time{ datetime: row[:seconds][:machine] }= row[:seconds][:human] %time{ datetime: row[:seconds][:machine] }= row[:seconds][:human]
%td= row[:size] %td= row[:size]

Binary file not shown.

Binary file not shown.

BIN
public/packs/css/application-7d15ae94.css (Stored with Git LFS) Normal file

Binary file not shown.

BIN
public/packs/css/application-7d15ae94.css.br (Stored with Git LFS) Normal file

Binary file not shown.

BIN
public/packs/css/application-7d15ae94.css.br.br (Stored with Git LFS) Normal file

Binary file not shown.

BIN
public/packs/css/application-7d15ae94.css.gz (Stored with Git LFS) Normal file

Binary file not shown.

BIN
public/packs/js/application-fd20cd4c95f90c1a3ecd.js (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
public/packs/js/application-fd20cd4c95f90c1a3ecd.js.br (Stored with Git LFS) Normal file

Binary file not shown.

BIN
public/packs/js/application-fd20cd4c95f90c1a3ecd.js.br.br (Stored with Git LFS) Normal file

Binary file not shown.

BIN
public/packs/js/application-fd20cd4c95f90c1a3ecd.js.gz (Stored with Git LFS) Normal file

Binary file not shown.

BIN
public/packs/js/application-fd20cd4c95f90c1a3ecd.js.map (Stored with Git LFS) Normal file

Binary file not shown.

BIN
public/packs/js/application-fd20cd4c95f90c1a3ecd.js.map.br (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

BIN
public/packs/js/application-fd20cd4c95f90c1a3ecd.js.map.gz (Stored with Git LFS) Normal file

Binary file not shown.

BIN
public/packs/manifest.json.br.br (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
public/packs/media/images/layers-2x-8f2c4d11.png.br (Stored with Git LFS) Normal file

Binary file not shown.

BIN
public/packs/media/images/layers-416d9136.png.br (Stored with Git LFS) Normal file

Binary file not shown.

BIN
public/packs/media/images/marker-icon-2b3e1faf.png.br (Stored with Git LFS) Normal file

Binary file not shown.

BIN
public/packs/media/images/marker-icon-2x-680f69f3.png.br (Stored with Git LFS) Normal file

Binary file not shown.

BIN
public/packs/media/images/marker-shadow-a0c6cc14.png.br (Stored with Git LFS) Normal file

Binary file not shown.