mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 15:25:35 +08:00
FEATURE: Use git describe
for dashboard version
This commit is contained in:
parent
34dc1f9e10
commit
f1b606bf08
|
@ -14,7 +14,7 @@
|
|||
{{#unless loading}}
|
||||
<tbody>
|
||||
<td class="title">{{i18n 'admin.dashboard.version'}}</td>
|
||||
<td class="version-number"><a {{bind-attr href="versionCheck.gitLink"}} target="_blank">{{ versionCheck.installed_version }}</a></td>
|
||||
<td class="version-number"><a {{bind-attr href="versionCheck.gitLink"}} target="_blank">{{ versionCheck.installed_describe }}</a></td>
|
||||
|
||||
{{#if versionCheck.noCheckPerformed}}
|
||||
<td class="version-number"> </td>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
class DiscourseVersionCheck
|
||||
include ActiveModel::Model
|
||||
|
||||
attr_accessor :latest_version, :critical_updates, :installed_version, :installed_sha, :missing_versions_count, :updated_at, :version_check_pending
|
||||
end
|
||||
attr_accessor :latest_version, :critical_updates, :installed_version, :installed_sha, :installed_describe, :missing_versions_count, :updated_at, :version_check_pending
|
||||
end
|
||||
|
|
|
@ -7,6 +7,7 @@ module DiscourseUpdates
|
|||
DiscourseVersionCheck.new(
|
||||
installed_version: Discourse::VERSION::STRING,
|
||||
installed_sha: (Discourse.git_version == 'unknown' ? nil : Discourse.git_version),
|
||||
installed_describe: `git describe --dirty`,
|
||||
updated_at: nil
|
||||
)
|
||||
else
|
||||
|
@ -15,11 +16,17 @@ module DiscourseUpdates
|
|||
critical_updates: critical_updates_available?,
|
||||
installed_version: Discourse::VERSION::STRING,
|
||||
installed_sha: (Discourse.git_version == 'unknown' ? nil : Discourse.git_version),
|
||||
installed_describe: `git describe --dirty`,
|
||||
missing_versions_count: missing_versions_count,
|
||||
updated_at: updated_at
|
||||
)
|
||||
end
|
||||
|
||||
# replace -commit_count with +commit_count
|
||||
if version_info.installed_describe =~ /-(\d+)-/
|
||||
version_info.installed_describe = version_info.installed_describe.gsub(/-(\d+)-.*/, " +#{$1}")
|
||||
end
|
||||
|
||||
if SiteSetting.version_checks?
|
||||
|
||||
# Handle cases when version check data is old so we report something that makes sense
|
||||
|
@ -130,4 +137,4 @@ module DiscourseUpdates
|
|||
'missing_version'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user