5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-29 15:56:21 +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:53:09 +00:00
commit 655a8d4dc1
3 changed files with 7 additions and 2 deletions

View file

@ -22,7 +22,7 @@ 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).map do |url| urls = deploy.urls.map do |url|
URI.parse(url) URI.parse(url)
rescue URI::Error rescue URI::Error
nil nil

View file

@ -51,7 +51,7 @@ 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).map do |url| urls = d.urls.map do |url|
URI.parse url URI.parse url
rescue URI::Error rescue URI::Error
nil nil

View file

@ -23,6 +23,11 @@ class Deploy < ApplicationRecord
raise NotImplementedError raise NotImplementedError
end end
# @return [Array]
def urls
[url].compact
end
def limit def limit
raise NotImplementedError raise NotImplementedError
end end