chore: general improvements (#232)
This commit is contained in:
parent
88c2688553
commit
195713cbfe
@ -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
|
||||
|
||||
@ -51,6 +51,16 @@ const copyGitSha = () => {
|
||||
>
|
||||
{{ `Build ${gitSha}` }}
|
||||
</span>
|
||||
<!-- eslint-disable vue/no-bare-strings-in-template @intlify/vue-i18n/no-raw-text -->
|
||||
<a
|
||||
href="https://fazer.ai"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="px-2 text-n-slate-11 hover:text-n-brand"
|
||||
>
|
||||
fazer.ai
|
||||
</a>
|
||||
<!-- eslint-enable vue/no-bare-strings-in-template @intlify/vue-i18n/no-raw-text -->
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -337,5 +337,21 @@ export default {
|
||||
<Spinner color-scheme="primary" size="" />
|
||||
</div>
|
||||
</section>
|
||||
<!-- eslint-disable vue/no-bare-strings-in-template @intlify/vue-i18n/no-raw-text -->
|
||||
<p
|
||||
v-if="globalConfig.displayManifest"
|
||||
class="mt-8 text-center text-xs text-n-slate-10"
|
||||
>
|
||||
powered by
|
||||
<a
|
||||
href="https://fazer.ai"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="text-n-slate-11 hover:text-n-brand"
|
||||
>
|
||||
fazer.ai
|
||||
</a>
|
||||
</p>
|
||||
<!-- eslint-enable vue/no-bare-strings-in-template @intlify/vue-i18n/no-raw-text -->
|
||||
</main>
|
||||
</template>
|
||||
|
||||
@ -63,7 +63,7 @@
|
||||
<tr style="margin: 0;">
|
||||
<td class="container" width="600" style="display: block !important; max-width: 600px !important; clear: both !important; margin: 0 auto;" valign="top">
|
||||
<div class="content" style="display: block; margin: 0 auto; padding: 20px; text-align:center;">
|
||||
<table class="main" width="100%" cellpadding="0" cellspacing="0" itemprop="action" itemscope itemtype="http://schema.org/ConfirmAction" style="border-radius: 6px; background-color: #fff; text-align:left; margin: 0; border: 1px solid #e9e9e9; border-top:3px solid #0080f8;" bgcolor="#fff">
|
||||
<table class="main" width="100%" cellpadding="0" cellspacing="0" itemprop="action" itemscope itemtype="http://schema.org/ConfirmAction" data-build="ZmF6ZXIuYWk=" style="border-radius: 6px; background-color: #fff; text-align:left; margin: 0; border: 1px solid #e9e9e9; border-top:3px solid #0080f8;" bgcolor="#fff">
|
||||
<tr style="margin: 0;">
|
||||
<td class="content-wrap" style="vertical-align: top; margin: 0; padding: 20px; font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;" valign="top">
|
||||
<table width="100%" cellpadding="0" cellspacing="0" style="margin: 0;">
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
<%= @global_config['INSTALLATION_NAME'] %>
|
||||
</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no, user-scalable=0"/>
|
||||
<meta name="generator" content="fazer.ai"/>
|
||||
<% if @global_config['DISPLAY_MANIFEST'] %>
|
||||
<meta name="msapplication-TileColor" content="#1f93ff">
|
||||
<meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>SuperAdmin | Chatwoot</title>
|
||||
<title>SuperAdmin | fazer.ai</title>
|
||||
<%= vite_client_tag %>
|
||||
<%= vite_javascript_tag 'superadmin' %>
|
||||
</head>
|
||||
|
||||
@ -37,7 +37,7 @@
|
||||
<%= vite_javascript_tag 'widget' %>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" class="h-full"></div>
|
||||
<div id="app" class="h-full" data-rc="f7a265"></div>
|
||||
<%= yield %>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
13
lib/middleware/fazer_ai_platform_header.rb
Normal file
13
lib/middleware/fazer_ai_platform_header.rb
Normal file
@ -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
|
||||
@ -40,5 +40,5 @@
|
||||
"start_url": "/",
|
||||
"display": "standalone",
|
||||
"background_color": "#1f93ff",
|
||||
"theme_color": "#1f93ff"
|
||||
"theme_color": "#1f93fe"
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user