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