2026-01-02 13:41:09 +00:00
|
|
|
# Copyright (C) 2012-2026 Zammad Foundation, https://zammad-foundation.org/
|
2024-04-22 15:51:11 +00:00
|
|
|
|
|
|
|
|
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
|