zammad/app/controllers/system_report_controller.rb
2026-01-02 15:41:09 +02:00

32 lines
726 B
Ruby

# Copyright (C) 2012-2026 Zammad Foundation, https://zammad-foundation.org/
class SystemReportController < ApplicationController
prepend_before_action :authenticate_and_authorize!
# GET /api/v1/system_report
def index
render json: {
descriptions: SystemReport.descriptions,
fetch: SystemReport.fetch
}
end
# GET /api/v1/system_report/download
def download
instance = SystemReport.fetch_with_create
send_data(
instance.data.to_json,
filename: instance.filename,
type: 'application/json',
disposition: 'attachment'
)
end
# GET /api/v1/system_report/plugins
def plugins
render json: { plugins: SystemReport.plugins }
end
end