diff --git a/app/javascript/packs/owned_plugin_section.js b/app/javascript/packs/owned_plugin_section.js deleted file mode 100644 index 75e9f99..0000000 --- a/app/javascript/packs/owned_plugin_section.js +++ /dev/null @@ -1,62 +0,0 @@ -import "lodash/lodash" -$(document).ready(() => { - let configUrl = (name) => { - return `/daemon/setting/${name}/configure` - } - function ownedSectionOnChange() { - const pluginName = _.last(document.documentURI.replace(/\/configure$/, "").split("/")) - $("#buffer-section select").on("change", (event) => { - $.ajax({ - url: configUrl(pluginName), - method: "GET", - data: { - buffer_type: $(event.target).val() - } - }).then((data) => { - $("#buffer-section").html($(data).find("#buffer-section").html()) - ownedSectionOnChange() - }) - }) - - $("#storage-section select").on("change", (event) => { - $.ajax({ - url: configUrl(pluginName), - method: "GET", - data: { - storage_type: $(event.target).val() - } - }).then((data) => { - $("#storage-section").html($(data).find("#storage-section").html()) - ownedSectionOnChange() - }) - }) - - $("#parse-section select").on("change", (event) => { - $.ajax({ - url: configUrl(pluginName), - method: "GET", - data: { - parse_type: $(event.target).val() - } - }).then((data) => { - $("#parse-section").html($(data).find("#parse-section").html()) - ownedSectionOnChange() - }) - }) - - $("#format-section select").on("change", (event) => { - $.ajax({ - url: configUrl(pluginName), - method: "GET", - data: { - format_type: $(event.target).val() - } - }).then((data) => { - $("#format-section").html($(data).find("#format-section").html()) - ownedSectionOnChange() - }) - }) - } - - ownedSectionOnChange() -}) diff --git a/app/views/shared/settings/show.html.haml b/app/views/shared/settings/show.html.haml index 6c16c75..89d9f01 100644 --- a/app/views/shared/settings/show.html.haml +++ b/app/views/shared/settings/show.html.haml @@ -1,6 +1,5 @@ - page_title t("fluentd.settings.#{target_plugin_name}.show.page_title") - add_javascript_pack_tag("nested_settings") -- add_javascript_pack_tag("owned_plugin_section") .card.mb-3 .card-body.bg-light