discourse-translator/app/services/problem_check/microsoft_azure_key.rb
锦心 95e20430d2
FEATURE: Add Azure key ProblemChecker (#155)
* FEATURE: Add Azure key ProblemChecker

Added a Problem checker with a "high" priority for the Azure key, so
sit administrators can see the problem of missing Azure key on the
dashboard in real time when the translator is configured as Microsoft.

Co-authored-by: Natalie Tay <natalie.tay@gmail.com>
2024-07-29 22:12:40 +08:00

13 lines
345 B
Ruby

# frozen_string_literal: true
class ProblemCheck::MicrosoftAzureKey < ProblemCheck
self.priority = "high"
def call
return no_problem unless SiteSetting.translator_enabled
return no_problem if SiteSetting.translator != "Microsoft"
return problem if SiteSetting.translator_azure_subscription_key.blank?
no_problem
end
end