Sha256: 48cec3336205c736848d76b8b0393c5592d5c2f830ad78520f02d0e8a70d9c01
Contents?: true
Size: 1.6 KB
Versions: 3
Compression:
Stored size: 1.6 KB
Contents
/* global _ */ "use strict"; import "lodash/lodash"; import ConfigField from "./config_field"; $(document).ready(() => { new Vue({ el: "#transport-section", components: { "config-field": ConfigField }, filters: { toUpper: function(value) { return _.toUpper(value); } }, props: { "transportType": { default: "tcp", type: String } }, data: function() { return { pluginType: null, pluginName: null, options: ["tcp", "tls"], commonOptions: [], advancedOptions: [] }; }, computed: { token: function() { return Rails.csrfToken(); } }, beforeMount: function() { this.pluginType = this.$el.attributes.pluginType.nodeValue; this.pluginName = this.$el.attributes.pluginName.nodeValue; }, mounted: function() { }, methods: { onChange: function() { console.log(this.pluginType, this.pluginName, this.transportType); this.updateSection(); }, updateSection: function() { if (this.transportType === "tcp") { return; } $.ajax({ method: "GET", url: `${relativeUrlRoot}/api/config_definitions`, headers: { "X-CSRF-Token": this.token }, data: { type: this.pluginType, name: this.pluginName } }).then((data) => { this.commonOptions = data.transport.commonOptions; this.advancedOptions = data.transport.advancedOptions; }); } } }); });
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
fluentd-ui-1.1.0 | app/javascript/packs/transport_section.js |
fluentd-ui-1.0.1 | app/javascript/packs/transport_section.js |
fluentd-ui-1.0.0 | app/javascript/packs/transport_section.js |