2019-05-03 06:17:27 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-10-31 20:02:26 +08:00
|
|
|
class Admin::PluginsController < Admin::StaffController
|
2015-02-07 06:32:59 +08:00
|
|
|
def index
|
2023-12-18 09:42:55 +08:00
|
|
|
render_serialized(
|
2023-12-21 09:37:20 +08:00
|
|
|
Discourse.plugins_sorted_by_name(enabled_only: false),
|
2023-12-18 09:42:55 +08:00
|
|
|
AdminPluginSerializer,
|
|
|
|
root: "plugins",
|
|
|
|
)
|
2015-02-07 06:32:59 +08:00
|
|
|
end
|
2023-12-21 09:37:20 +08:00
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def preload_additional_json
|
|
|
|
store_preloaded(
|
|
|
|
"enabledPluginAdminRoutes",
|
|
|
|
MultiJson.dump(Discourse.plugins_sorted_by_name.filter_map(&:admin_route)),
|
|
|
|
)
|
|
|
|
end
|
2015-02-07 06:32:59 +08:00
|
|
|
end
|