# coding: utf-8 module ApplicationHelper def has_td_agent_system? File.exist?("/etc/init.d/td-agent") || File.exist?("/opt/td-agent/embedded/bin/fluentd") end def fluentd_ui_logo image_tag(ENV["FLUENTD_UI_LOGO"] || "/fluentd-logo-right-text.png") end def fluentd_status_icon return unless Fluentd.instance Fluentd.instance.agent.running? ? icon('fa-circle running') : icon('fa-circle stopped') end def fluentd_status_message return unless Fluentd.instance Fluentd.instance.agent.running? ? I18n.t('messages.fluentd_status_running') : I18n.t('messages.fluentd_status_stopped') end def language_name(locale) # NOTE: these are fixed terms, not i18n-ed { en: "English", ja: "日本語", }[locale] || locale end def language_menu html = "" I18n.available_locales.each do |locale| text = (locale == current_locale ? icon("fa-check") : "") text << language_name(locale) html << %Q|