2019-08-14 09:48:44 +00:00
|
|
|
class DashboardController < ActionController::Base
|
2021-01-08 20:13:17 +00:00
|
|
|
include SwitchLocale
|
|
|
|
|
2020-05-12 07:15:28 +00:00
|
|
|
before_action :set_global_config
|
2021-01-08 20:13:17 +00:00
|
|
|
around_action :switch_locale
|
2021-01-17 08:37:18 +00:00
|
|
|
before_action :ensure_installation_onboarding, only: [:index]
|
2021-01-08 20:13:17 +00:00
|
|
|
|
2019-08-14 09:48:44 +00:00
|
|
|
layout 'vueapp'
|
|
|
|
|
2019-10-20 08:47:26 +00:00
|
|
|
def index; end
|
2020-05-12 07:15:28 +00:00
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def set_global_config
|
|
|
|
@global_config = GlobalConfig.get(
|
|
|
|
'LOGO',
|
|
|
|
'LOGO_THUMBNAIL',
|
|
|
|
'INSTALLATION_NAME',
|
|
|
|
'WIDGET_BRAND_URL',
|
|
|
|
'TERMS_URL',
|
|
|
|
'PRIVACY_URL',
|
2020-07-26 07:24:50 +00:00
|
|
|
'DISPLAY_MANIFEST',
|
2021-02-08 11:08:35 +00:00
|
|
|
'CREATE_NEW_ACCOUNT_FROM_DASHBOARD',
|
2021-06-07 18:52:36 +00:00
|
|
|
'CHATWOOT_INBOX_TOKEN',
|
|
|
|
'API_CHANNEL_NAME',
|
2021-09-07 17:41:01 +00:00
|
|
|
'API_CHANNEL_THUMBNAIL',
|
|
|
|
'ANALYTICS_TOKEN',
|
|
|
|
'ANALYTICS_HOST'
|
2020-07-26 16:20:59 +00:00
|
|
|
).merge(
|
|
|
|
APP_VERSION: Chatwoot.config[:version]
|
2020-05-12 07:15:28 +00:00
|
|
|
)
|
|
|
|
end
|
2021-01-17 08:37:18 +00:00
|
|
|
|
|
|
|
def ensure_installation_onboarding
|
|
|
|
redirect_to '/installation/onboarding' if ::Redis::Alfred.get(::Redis::Alfred::CHATWOOT_INSTALLATION_ONBOARDING)
|
|
|
|
end
|
2019-10-20 08:47:26 +00:00
|
|
|
end
|