mirror of
https://github.com/funamitech/mastodon
synced 2024-11-23 22:57:05 +09:00
Add ffmpeg and ImageMagick versions to admin dashboard (#30710)
This commit is contained in:
parent
09dca8ba3d
commit
4a5442edaa
@ -10,7 +10,7 @@ class Admin::Metrics::Dimension::SoftwareVersionsDimension < Admin::Metrics::Dim
|
||||
protected
|
||||
|
||||
def perform_query
|
||||
[mastodon_version, ruby_version, postgresql_version, redis_version, elasticsearch_version, libvips_version].compact
|
||||
[mastodon_version, ruby_version, postgresql_version, redis_version, elasticsearch_version, libvips_version, imagemagick_version, ffmpeg_version].compact
|
||||
end
|
||||
|
||||
def mastodon_version
|
||||
@ -82,6 +82,34 @@ class Admin::Metrics::Dimension::SoftwareVersionsDimension < Admin::Metrics::Dim
|
||||
}
|
||||
end
|
||||
|
||||
def imagemagick_version
|
||||
return if Rails.configuration.x.use_vips
|
||||
|
||||
version = `convert -version`.match(/Version: ImageMagick ([\d\.]+)/)[1]
|
||||
|
||||
{
|
||||
key: 'imagemagick',
|
||||
human_key: 'ImageMagick',
|
||||
value: version,
|
||||
human_value: version,
|
||||
}
|
||||
rescue Errno::ENOENT
|
||||
nil
|
||||
end
|
||||
|
||||
def ffmpeg_version
|
||||
version = `ffmpeg -version`.match(/ffmpeg version ([\d\.]+)/)[1]
|
||||
|
||||
{
|
||||
key: 'ffmpeg',
|
||||
human_key: 'FFmpeg',
|
||||
value: version,
|
||||
human_value: version,
|
||||
}
|
||||
rescue Errno::ENOENT
|
||||
nil
|
||||
end
|
||||
|
||||
def redis_info
|
||||
@redis_info ||= if redis.is_a?(Redis::Namespace)
|
||||
redis.redis.info
|
||||
|
Loading…
Reference in New Issue
Block a user