Class: Docit::UiController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- Docit::UiController
- Defined in:
- app/controllers/docit/ui_controller.rb
Instance Method Summary collapse
- #index ⇒ Object
- #scalar ⇒ Object
- #spec ⇒ Object
- #swagger ⇒ Object
- #system ⇒ Object
- #system_insights ⇒ Object
- #system_spec ⇒ Object
Instance Method Details
#index ⇒ Object
7 8 9 |
# File 'app/controllers/docit/ui_controller.rb', line 7 def index render_ui(Docit.configuration.default_ui) end |
#scalar ⇒ Object
15 16 17 |
# File 'app/controllers/docit/ui_controller.rb', line 15 def scalar render_ui(:scalar) end |
#spec ⇒ Object
44 45 46 47 |
# File 'app/controllers/docit/ui_controller.rb', line 44 def spec RouteInspector.eager_load_controllers! render json: SchemaGenerator.generate end |
#swagger ⇒ Object
11 12 13 |
# File 'app/controllers/docit/ui_controller.rb', line 11 def swagger render_ui(:swagger) end |
#system ⇒ Object
19 20 21 |
# File 'app/controllers/docit/ui_controller.rb', line 19 def system render_ui(:system) end |
#system_insights ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 |
# File 'app/controllers/docit/ui_controller.rb', line 32 def system_insights graph = system_graph insight = Ai::SystemInsightGenerator.new( graph: graph, selected_node_ids: selected_node_ids, mode: insight_mode ).generate render json: { insight: insight } rescue Docit::Error => e render json: { error: e. }, status: :unprocessable_entity end |
#system_spec ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'app/controllers/docit/ui_controller.rb', line 23 def system_spec unless Docit.configuration.system_graph_enabled return render(json: { error: "System graph disabled" }, status: :not_found) end RouteInspector.eager_load_controllers! render json: SystemGraph::Generator.generate end |