Fix #4668: Add running commit to /status page.

This commit is contained in:
evazion
2021-01-16 12:13:14 -06:00
parent 32dd14f461
commit 6f6ec6592d
2 changed files with 11 additions and 2 deletions

View File

@@ -9,6 +9,7 @@ class ServerStatus
hostname: hostname, hostname: hostname,
uptime: uptime, uptime: uptime,
loadavg: loadavg, loadavg: loadavg,
danbooru_version: danbooru_version,
ruby_version: RUBY_VERSION, ruby_version: RUBY_VERSION,
distro_version: distro_version, distro_version: distro_version,
kernel_version: kernel_version, kernel_version: kernel_version,
@@ -41,6 +42,10 @@ class ServerStatus
File.read("/proc/loadavg").chomp File.read("/proc/loadavg").chomp
end end
def danbooru_version
Rails.application.config.x.git_hash
end
def kernel_version def kernel_version
File.read("/proc/version").chomp File.read("/proc/version").chomp
end end

View File

@@ -2,6 +2,10 @@
<div id="a-show" class="fixed-width-container"> <div id="a-show" class="fixed-width-container">
<h1>Status</h1> <h1>Status</h1>
<p>Running <%= external_link_to "#{Danbooru.config.source_code_url}/commits/#{@status.danbooru_version}", @status.danbooru_version.first(7) %>.</p>
<h2>Server</h2>
<details> <details>
<summary> <summary>
Server: <%= @status.hostname %> Server: <%= @status.hostname %>
@@ -9,7 +13,7 @@
<%= render "list", hash: @status.serializable_hash[:status] %> <%= render "list", hash: @status.serializable_hash[:status] %>
</details> </details>
<h1>Postgres</h1> <h2>Postgres</h2>
<details> <details>
<summary> <summary>
@@ -19,7 +23,7 @@
<%= render "table", rows: @status.serializable_hash[:postgres][:connection_stats] %> <%= render "table", rows: @status.serializable_hash[:postgres][:connection_stats] %>
</details> </details>
<h1>Redis</h1> <h2>Redis</h2>
<details> <details>
<summary> <summary>