mirror of
https://github.com/fluent/fluentd-ui.git
synced 2025-08-16 03:07:06 +02:00
Change return value of /api/settings
Current version returns like the following: ``` { "ROOT" => { "sources" => [], "filters" => [], "matches" => [], }, "@INPUT" => { "sources" => [], "filters" => [], "matches" => [], } } ``` Signed-off-by: Kenji Okimoto <okimoto@clear-code.com>
This commit is contained in:
parent
91c28f2ce8
commit
741c23f335
@ -1,4 +1,6 @@
|
||||
json.id element_id(element)
|
||||
json.id element_id(current_label, element)
|
||||
json.current_label current_label || "ROOT"
|
||||
json.label element["@label"] || element["label"]
|
||||
json.name element.name
|
||||
json.type element["@type"] || element["type"]
|
||||
json.arg element.arg
|
||||
|
@ -1,3 +1,11 @@
|
||||
json.array! @config.elements do |elm|
|
||||
json.partial! "api/settings/element", element: elm
|
||||
@config.group_by_label.each do |label_name, types|
|
||||
json.set!(label_name) do
|
||||
types.each do |type, elements|
|
||||
json.set!(type) do
|
||||
json.array!(elements) do |element|
|
||||
json.partial! "api/settings/element", current_label: label_name, element: element
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user