mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-08 13:42:39 +08:00
### Before <img width="1079" height="981" alt="Screenshot 2025-08-27 at 12 20 30 PM" src="https://github.com/user-attachments/assets/8b38ef86-e602-440f-8d59-321af1677c95" /> ### After <img width="1106" height="1059" alt="Screenshot 2025-08-27 at 12 20 01 PM" src="https://github.com/user-attachments/assets/1f9e3c61-5a17-4067-ad67-2c9a2e1ba382" />
29 lines
928 B
Ruby
29 lines
928 B
Ruby
# frozen_string_literal: true
|
|
|
|
class Admin::SearchController < Admin::AdminController
|
|
RESULT_TYPES = %w[page setting theme component report].freeze
|
|
|
|
def index
|
|
respond_to do |format|
|
|
format.json do
|
|
render_json_dump(
|
|
settings:
|
|
SiteSetting.all_settings(
|
|
filter_names: params[:filter_names],
|
|
filter_area: params[:filter_area],
|
|
filter_plugin: params[:plugin],
|
|
filter_categories: Array.wrap(params[:categories]),
|
|
include_locale_setting:
|
|
params[:filter_area].blank? || params[:filter_area] == "localization",
|
|
basic_attributes: true,
|
|
),
|
|
themes_and_components:
|
|
serialize_data(Theme.include_relations.order(:name), BasicThemeSerializer),
|
|
reports: Reports::ListQuery.call,
|
|
)
|
|
end
|
|
|
|
format.html { render body: nil }
|
|
end
|
|
end
|
|
end
|