From 195713cbfea63da64b67f796e839a145846f12ab Mon Sep 17 00:00:00 2001 From: Gabriel Jablonski Date: Tue, 3 Mar 2026 14:08:56 -0300 Subject: [PATCH] chore: general improvements (#232) --- app/controllers/health_controller.rb | 2 +- .../settings/account/components/BuildInfo.vue | 10 ++++++++++ app/javascript/v3/views/login/Index.vue | 16 ++++++++++++++++ app/views/layouts/mailer/base.liquid | 2 +- app/views/layouts/vueapp.html.erb | 1 + .../super_admin/devise/sessions/new.html.erb | 2 +- app/views/widgets/show.html.erb | 2 +- config/application.rb | 3 +++ lib/middleware/fazer_ai_platform_header.rb | 13 +++++++++++++ public/manifest.json | 2 +- spec/controllers/health_controller_spec.rb | 11 +++++++++++ 11 files changed, 59 insertions(+), 5 deletions(-) create mode 100644 lib/middleware/fazer_ai_platform_header.rb diff --git a/app/controllers/health_controller.rb b/app/controllers/health_controller.rb index fdf969a39..6f948cb57 100644 --- a/app/controllers/health_controller.rb +++ b/app/controllers/health_controller.rb @@ -2,6 +2,6 @@ # authentication, and callbacks. Used for health checks class HealthController < ActionController::Base # rubocop:disable Rails/ApplicationController def show - render json: { status: 'woot' } + render json: { status: 'woot', platform: 'fazer.ai', version: Chatwoot.config[:version] } end end diff --git a/app/javascript/dashboard/routes/dashboard/settings/account/components/BuildInfo.vue b/app/javascript/dashboard/routes/dashboard/settings/account/components/BuildInfo.vue index 05f206136..62073b1f0 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/account/components/BuildInfo.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/account/components/BuildInfo.vue @@ -51,6 +51,16 @@ const copyGitSha = () => { > {{ `Build ${gitSha}` }} + + + fazer.ai + + diff --git a/app/javascript/v3/views/login/Index.vue b/app/javascript/v3/views/login/Index.vue index 23e598dbd..c4ddbf53e 100644 --- a/app/javascript/v3/views/login/Index.vue +++ b/app/javascript/v3/views/login/Index.vue @@ -337,5 +337,21 @@ export default { + +

+ powered by + + fazer.ai + +

+ diff --git a/app/views/layouts/mailer/base.liquid b/app/views/layouts/mailer/base.liquid index 5fa07e139..3daa275bb 100644 --- a/app/views/layouts/mailer/base.liquid +++ b/app/views/layouts/mailer/base.liquid @@ -63,7 +63,7 @@
- +
diff --git a/app/views/layouts/vueapp.html.erb b/app/views/layouts/vueapp.html.erb index d97ece981..12a3bcd51 100644 --- a/app/views/layouts/vueapp.html.erb +++ b/app/views/layouts/vueapp.html.erb @@ -5,6 +5,7 @@ <%= @global_config['INSTALLATION_NAME'] %> + <% if @global_config['DISPLAY_MANIFEST'] %> diff --git a/app/views/super_admin/devise/sessions/new.html.erb b/app/views/super_admin/devise/sessions/new.html.erb index 6b79fbc6e..a8d80000f 100644 --- a/app/views/super_admin/devise/sessions/new.html.erb +++ b/app/views/super_admin/devise/sessions/new.html.erb @@ -1,7 +1,7 @@ - SuperAdmin | Chatwoot + SuperAdmin | fazer.ai <%= vite_client_tag %> <%= vite_javascript_tag 'superadmin' %> diff --git a/app/views/widgets/show.html.erb b/app/views/widgets/show.html.erb index 21e03cd6f..a0aca82e7 100644 --- a/app/views/widgets/show.html.erb +++ b/app/views/widgets/show.html.erb @@ -37,7 +37,7 @@ <%= vite_javascript_tag 'widget' %> -
+
<%= yield %> diff --git a/config/application.rb b/config/application.rb index 5e0367cf9..d1aaa2507 100644 --- a/config/application.rb +++ b/config/application.rb @@ -3,6 +3,7 @@ require_relative 'boot' require 'rails/all' +require_relative '../lib/middleware/fazer_ai_platform_header' # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. @@ -55,6 +56,8 @@ module Chatwoot # Application configuration can go into files in config/initializers # -- all .rb files in that directory are automatically loaded after loading # the framework and any gems in your application. + config.middleware.use FazerAiPlatformHeader + config.generators.javascripts = false config.generators.stylesheets = false diff --git a/lib/middleware/fazer_ai_platform_header.rb b/lib/middleware/fazer_ai_platform_header.rb new file mode 100644 index 000000000..f20f1a3ff --- /dev/null +++ b/lib/middleware/fazer_ai_platform_header.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class FazerAiPlatformHeader + def initialize(app) + @app = app + end + + def call(env) + status, headers, response = @app.call(env) + headers['X-Platform'] = 'fazer.ai' + [status, headers, response] + end +end diff --git a/public/manifest.json b/public/manifest.json index 78fcc4755..9f4bfa937 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -40,5 +40,5 @@ "start_url": "/", "display": "standalone", "background_color": "#1f93ff", - "theme_color": "#1f93ff" + "theme_color": "#1f93fe" } diff --git a/spec/controllers/health_controller_spec.rb b/spec/controllers/health_controller_spec.rb index 7eafdd589..22b28d4e3 100644 --- a/spec/controllers/health_controller_spec.rb +++ b/spec/controllers/health_controller_spec.rb @@ -7,5 +7,16 @@ RSpec.describe 'Health Check', type: :request do expect(response).to have_http_status(:success) expect(response.parsed_body['status']).to eq('woot') end + + it 'returns fazer.ai platform info' do + get '/health' + expect(response.parsed_body['platform']).to eq('fazer.ai') + expect(response.parsed_body['version']).to eq(Chatwoot.config[:version]) + end + + it 'includes X-Platform header' do + get '/health' + expect(response.headers['X-Platform']).to eq('fazer.ai') + end end end