mirror of
https://github.com/rickbarrette/simple-aircraft-manager-rails.git
synced 2026-11-17 23:50:36 -05:00
About page links to the source code and the running commit
APP_REPOSITORY_URL overrides the repository for a fork. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
61c3749793
commit
bed07386ef
3 files changed
+16
-2
No files matched your search
@@ -7,6 +7,9 @@ class SystemInfo
|
|||||||
omniauth omniauth_openid_connect rubyzip roo pdf-reader bcrypt
|
omniauth omniauth_openid_connect rubyzip roo pdf-reader bcrypt
|
||||||
].freeze
|
].freeze
|
||||||
|
|
||||||
|
# Where the source lives; APP_REPOSITORY_URL overrides it for a fork.
|
||||||
|
REPOSITORY_URL = ENV["APP_REPOSITORY_URL"].presence || "https://github.com/rickbarrette/simple-aircraft-manager-rails"
|
||||||
|
|
||||||
DATABASES = { "Main" => :primary, "Cache" => :cache, "Jobs" => :queue, "Cable" => :cable }.freeze
|
DATABASES = { "Main" => :primary, "Cache" => :cache, "Jobs" => :queue, "Cable" => :cable }.freeze
|
||||||
|
|
||||||
# Set by the Docker build (see Dockerfile); in development, read from git.
|
# Set by the Docker build (see Dockerfile); in development, read from git.
|
||||||
@@ -16,6 +19,13 @@ class SystemInfo
|
|||||||
"unknown"
|
"unknown"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def repository_url = REPOSITORY_URL.chomp("/")
|
||||||
|
|
||||||
|
# The running commit on the repository host, when the revision is known.
|
||||||
|
def revision_url
|
||||||
|
"#{repository_url}/commit/#{revision}" if revision.match?(/\A\h{7,40}\z/)
|
||||||
|
end
|
||||||
|
|
||||||
def built_at
|
def built_at
|
||||||
Time.zone.parse(ENV["APP_BUILT_AT"].to_s) if ENV["APP_BUILT_AT"].present?
|
Time.zone.parse(ENV["APP_BUILT_AT"].to_s) if ENV["APP_BUILT_AT"].present?
|
||||||
rescue ArgumentError
|
rescue ArgumentError
|
||||||
|
|||||||
@@ -8,7 +8,10 @@
|
|||||||
<div class="flex flex-wrap items-end justify-between gap-4">
|
<div class="flex flex-wrap items-end justify-between gap-4">
|
||||||
<div>
|
<div>
|
||||||
<p class="text-xs uppercase tracking-wide text-slate-500">Version</p>
|
<p class="text-xs uppercase tracking-wide text-slate-500">Version</p>
|
||||||
<p class="font-mono text-2xl font-semibold" data-revision><%= info.revision %></p>
|
<p class="font-mono text-2xl font-semibold" data-revision>
|
||||||
|
<%= info.revision_url ? link_to(info.revision, info.revision_url, class: "link", target: "_blank", rel: "noopener", title: "This commit on GitHub") : info.revision %>
|
||||||
|
</p>
|
||||||
|
<p class="mt-1 text-sm"><%= link_to "Source code", info.repository_url, class: "link", target: "_blank", rel: "noopener" %></p>
|
||||||
</div>
|
</div>
|
||||||
<dl class="grid grid-cols-2 gap-x-6 gap-y-1 text-sm sm:grid-cols-3">
|
<dl class="grid grid-cols-2 gap-x-6 gap-y-1 text-sm sm:grid-cols-3">
|
||||||
<div><dt class="text-slate-500">Built</dt><dd class="font-medium"><%= info.built_at ? l(info.built_at.in_time_zone, format: :short) : "—" %></dd></div>
|
<div><dt class="text-slate-500">Built</dt><dd class="font-medium"><%= info.built_at ? l(info.built_at.in_time_zone, format: :short) : "—" %></dd></div>
|
||||||
|
|||||||
@@ -15,7 +15,8 @@ class AdminAboutTest < ActionDispatch::IntegrationTest
|
|||||||
get admin_about_path
|
get admin_about_path
|
||||||
end
|
end
|
||||||
assert_response :success
|
assert_response :success
|
||||||
assert_select "[data-revision]", text: "abc1234"
|
assert_select "[data-revision] a[href='#{SystemInfo::REPOSITORY_URL}/commit/abc1234']", text: "abc1234"
|
||||||
|
assert_select "a[href='#{SystemInfo::REPOSITORY_URL}']", text: "Source code"
|
||||||
body = response.body
|
body = response.body
|
||||||
[ RUBY_VERSION, Rails.version, SQLite3::SQLITE_VERSION, Gem.loaded_specs["turbo-rails"].version.to_s ].each { assert_includes body, _1 }
|
[ RUBY_VERSION, Rails.version, SQLite3::SQLITE_VERSION, Gem.loaded_specs["turbo-rails"].version.to_s ].each { assert_includes body, _1 }
|
||||||
assert_includes body, "on (#{LogbookTranscriber::MODEL})"
|
assert_includes body, "on (#{LogbookTranscriber::MODEL})"
|
||||||
|
|||||||
Reference in new issue
Block a user