system_report_controller.rb 726 B

1234567891011121314151617181920212223242526272829303132
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class SystemReportController < ApplicationController
  3. prepend_before_action :authenticate_and_authorize!
  4. # GET /api/v1/system_report
  5. def index
  6. render json: {
  7. descriptions: SystemReport.descriptions,
  8. fetch: SystemReport.fetch
  9. }
  10. end
  11. # GET /api/v1/system_report/download
  12. def download
  13. instance = SystemReport.fetch_with_create
  14. send_data(
  15. instance.data.to_json,
  16. filename: instance.filename,
  17. type: 'application/json',
  18. disposition: 'attachment'
  19. )
  20. end
  21. # GET /api/v1/system_report/plugins
  22. def plugins
  23. render json: { plugins: SystemReport.plugins }
  24. end
  25. end