mirror of
https://github.com/fluent/fluentd-ui.git
synced 2025-08-11 16:57:11 +02:00
Use double quotes for string literal
Signed-off-by: Kenji Okimoto <okimoto@clear-code.com>
This commit is contained in:
parent
74c1bf5ef3
commit
9502a63cf4
@ -7,33 +7,33 @@
|
||||
// To reference this file, add <%= javascript_pack_tag 'application' %> to the appropriate
|
||||
// layout file, like app/views/layouts/application.html.erb
|
||||
|
||||
console.log('Hello World from Webpacker');
|
||||
console.log("Hello World from Webpacker");
|
||||
|
||||
import jQuery from 'jquery/dist/jquery';
|
||||
import jQuery from "jquery/dist/jquery";
|
||||
|
||||
window.$ = jQuery;
|
||||
window.jQuery = jQuery;
|
||||
|
||||
import Rails from 'rails-ujs/lib/assets/compiled/rails-ujs.js';
|
||||
import Rails from "rails-ujs/lib/assets/compiled/rails-ujs.js";
|
||||
|
||||
window.Rails = Rails;
|
||||
Rails.start();
|
||||
|
||||
import 'popper.js/dist/popper';
|
||||
import 'bootstrap/dist/js/bootstrap';
|
||||
import 'datatables.net/js/jquery.dataTables';
|
||||
import 'startbootstrap-sb-admin/js/sb-admin';
|
||||
import 'startbootstrap-sb-admin/js/sb-admin-datatables';
|
||||
import "popper.js/dist/popper";
|
||||
import "bootstrap/dist/js/bootstrap";
|
||||
import "datatables.net/js/jquery.dataTables";
|
||||
import "startbootstrap-sb-admin/js/sb-admin";
|
||||
import "startbootstrap-sb-admin/js/sb-admin-datatables";
|
||||
|
||||
import Vue from 'vue/dist/vue.esm';
|
||||
import Vue from "vue/dist/vue.esm";
|
||||
|
||||
Vue.filter('to_json', function (value) {
|
||||
Vue.filter("to_json", function (value) {
|
||||
return JSON.stringify(value);
|
||||
});
|
||||
|
||||
window.Vue = Vue;
|
||||
|
||||
import '../stylesheets/application.scss';
|
||||
import "../stylesheets/application.scss";
|
||||
|
||||
$(document).ready(() => {
|
||||
$("[data-toggle=tooltip]").tooltip();
|
||||
|
@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
"use strict";
|
||||
|
||||
import ConfigField from './config_field';
|
||||
import ConfigField from "./config_field";
|
||||
|
||||
const AwsCredential = {
|
||||
template: "#vue-aws-credential",
|
||||
@ -45,7 +45,7 @@ const AwsCredential = {
|
||||
method: "GET",
|
||||
url: "/api/config_definitions",
|
||||
headers: {
|
||||
'X-CSRF-Token': this.token
|
||||
"X-CSRF-Token": this.token
|
||||
},
|
||||
data: {
|
||||
type: this.pluginType,
|
||||
|
@ -1,10 +1,10 @@
|
||||
import CodeMirror from 'codemirror/lib/codemirror';
|
||||
import 'lodash/lodash';
|
||||
import CodeMirror from "codemirror/lib/codemirror";
|
||||
import "lodash/lodash";
|
||||
|
||||
// See: http://codemirror.net/doc/manual.html#modeapi
|
||||
// and sample mode files: https://github.com/codemirror/CodeMirror/tree/master/mode
|
||||
|
||||
CodeMirror.defineMode('fluentd', function(){
|
||||
CodeMirror.defineMode("fluentd", function(){
|
||||
return {
|
||||
startState: function(aa){
|
||||
return { "context" : null };
|
||||
@ -70,18 +70,18 @@ function codemirrorify(el) {
|
||||
}
|
||||
|
||||
$(function(){
|
||||
$('.js-fluentd-config-editor').each(function(_, el){
|
||||
$(".js-fluentd-config-editor").each(function(_, el){
|
||||
codemirrorify(el);
|
||||
});
|
||||
});
|
||||
|
||||
Vue.directive('config-editor', {
|
||||
Vue.directive("config-editor", {
|
||||
bind: function(el, binding, vnode, oldVnode){
|
||||
// NOTE: needed delay for waiting CodeMirror setup
|
||||
_.delay(function(textarea){
|
||||
let cm = codemirrorify(textarea);
|
||||
// textarea.codemirror = cm; // for test, but doesn't work for now (working on Chrome, but Poltergeist not)
|
||||
cm.on('change', function(code_mirror){
|
||||
cm.on("change", function(code_mirror){
|
||||
// bridge Vue - CodeMirror world
|
||||
el.dataset.content = code_mirror.getValue();
|
||||
});
|
||||
|
@ -1,5 +1,5 @@
|
||||
'use strict';
|
||||
import 'lodash/lodash';
|
||||
"use strict";
|
||||
import "lodash/lodash";
|
||||
|
||||
const ConfigField = {
|
||||
template: "#vue-config-field",
|
||||
|
@ -1,4 +1,4 @@
|
||||
'use strict';
|
||||
"use strict";
|
||||
$(document).ready(()=> {
|
||||
new Vue({
|
||||
el: "#fluent-log",
|
||||
|
@ -1,12 +1,12 @@
|
||||
'use strict';
|
||||
import 'lodash/lodash';
|
||||
import 'popper.js/dist/popper';
|
||||
import 'bootstrap/dist/js/bootstrap';
|
||||
import OwnedPluginForm from './owned_plugin_form';
|
||||
"use strict";
|
||||
import "lodash/lodash";
|
||||
import "popper.js/dist/popper";
|
||||
import "bootstrap/dist/js/bootstrap";
|
||||
import OwnedPluginForm from "./owned_plugin_form";
|
||||
|
||||
$(document).ready(() => {
|
||||
new Vue({
|
||||
el: '#in-tail-parse',
|
||||
el: "#in-tail-parse",
|
||||
props: [
|
||||
"path",
|
||||
"parseType"
|
||||
@ -22,18 +22,18 @@ $(document).ready(() => {
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'owned-plugin-form': OwnedPluginForm
|
||||
"owned-plugin-form": OwnedPluginForm
|
||||
},
|
||||
watch: {
|
||||
'parse.expression': function() {
|
||||
"parse.expression": function() {
|
||||
console.log(`parse.expression: ${this.parse.expression}`);
|
||||
this.preview();
|
||||
},
|
||||
'parse.time_format': function() {
|
||||
"parse.time_format": function() {
|
||||
console.log(`parse.time_format: ${this.parse.time_format}`);
|
||||
this.preview();
|
||||
},
|
||||
'parseType': function() {
|
||||
"parseType": function() {
|
||||
this.preview();
|
||||
},
|
||||
},
|
||||
@ -71,7 +71,7 @@ $(document).ready(() => {
|
||||
return;
|
||||
}
|
||||
|
||||
let $container = $('<div>');
|
||||
let $container = $("<div>");
|
||||
_.each(matches, (match) => {
|
||||
const colors = ["#ff9", "#cff", "#fcf", "#dfd"];
|
||||
const whole = match.whole;
|
||||
@ -99,7 +99,7 @@ $(document).ready(() => {
|
||||
"data-toggle": "tooltip",
|
||||
"data-placement": "top",
|
||||
"title": m.key,
|
||||
'style': 'background-color:' + currentColor
|
||||
"style": "background-color:" + currentColor
|
||||
});
|
||||
let highlightedHtml = $highlighted.wrap("<div>").parent().html();
|
||||
let pos = {
|
||||
@ -132,7 +132,7 @@ $(document).ready(() => {
|
||||
method: "POST",
|
||||
url: "/api/regexp_preview",
|
||||
headers: {
|
||||
'X-CSRF-Token': this.token
|
||||
"X-CSRF-Token": this.token
|
||||
},
|
||||
data: {
|
||||
parse_type: _.isEmpty(this.parseType) ? "regexp" : this.parseType,
|
||||
|
@ -1,40 +1,40 @@
|
||||
'use strict';
|
||||
import 'lodash/lodash';
|
||||
"use strict";
|
||||
import "lodash/lodash";
|
||||
$(document).ready(()=> {
|
||||
var $firstSetting = $('.js-nested-column.js-multiple:first');
|
||||
var $firstSetting = $(".js-nested-column.js-multiple:first");
|
||||
|
||||
if ($firstSetting.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
var counter = 0;
|
||||
$('.js-append', $firstSetting).on('click', function(ev){
|
||||
$(".js-append", $firstSetting).on("click", function(ev){
|
||||
ev.preventDefault();
|
||||
var $new = $firstSetting.clone(true);
|
||||
counter++;
|
||||
|
||||
var fields = $('input,select,textarea', $new);
|
||||
var fields = $("input,select,textarea", $new);
|
||||
_.each(fields, function(elm){
|
||||
elm.name = elm.name.replace("0", counter);
|
||||
});
|
||||
$('label', $new).each(function(_, label){
|
||||
$("label", $new).each(function(_, label){
|
||||
var $label = $(label);
|
||||
$label.attr('for', $label.attr('for').replace("0", counter));
|
||||
$label.attr("for", $label.attr("for").replace("0", counter));
|
||||
});
|
||||
|
||||
$('.js-remove', $new).show();
|
||||
$('.js-append', $new).hide();
|
||||
$(".js-remove", $new).show();
|
||||
$(".js-append", $new).hide();
|
||||
$new.appendTo($firstSetting.parent());
|
||||
});
|
||||
|
||||
$('.js-remove').on('click', function(ev){
|
||||
$(".js-remove").on("click", function(ev){
|
||||
ev.preventDefault();
|
||||
$(this).closest('.js-nested-column').remove();
|
||||
$(this).closest(".js-nested-column").remove();
|
||||
});
|
||||
|
||||
var $allSettings = $('.js-nested-column.js-multiple');
|
||||
$('.js-append', $allSettings).hide();
|
||||
$('.js-remove', $allSettings).show();
|
||||
$('.js-append', $firstSetting).show();
|
||||
$('.js-remove', $firstSetting).hide();
|
||||
var $allSettings = $(".js-nested-column.js-multiple");
|
||||
$(".js-append", $allSettings).hide();
|
||||
$(".js-remove", $allSettings).show();
|
||||
$(".js-append", $firstSetting).show();
|
||||
$(".js-remove", $firstSetting).hide();
|
||||
});
|
||||
|
@ -30,11 +30,11 @@ $(document).ready(()=> {
|
||||
}
|
||||
});
|
||||
};
|
||||
window.addEventListener('focus', function(ev){
|
||||
window.addEventListener("focus", function(ev){
|
||||
currentInterval = POLLING_INTERVAL;
|
||||
timer = setTimeout(fetch, currentInterval);
|
||||
}, false);
|
||||
window.addEventListener('blur', function(ev){
|
||||
window.addEventListener("blur", function(ev){
|
||||
clearTimeout(timer);
|
||||
}, false);
|
||||
fetch();
|
||||
|
@ -1,4 +1,4 @@
|
||||
'use strict';
|
||||
"use strict";
|
||||
|
||||
import TransportConfig from "./transport_config";
|
||||
import OwnedPluginForm from "./owned_plugin_form";
|
||||
|
@ -1,4 +1,4 @@
|
||||
'use strict';
|
||||
"use strict";
|
||||
|
||||
import OwnedPluginForm from "./owned_plugin_form";
|
||||
import AwsCredential from "./aws_credential";
|
||||
|
@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
"use strict";
|
||||
|
||||
import ParserMultilineForm from './parser_multiline_form';
|
||||
import ConfigField from './config_field';
|
||||
import ParserMultilineForm from "./parser_multiline_form";
|
||||
import ConfigField from "./config_field";
|
||||
|
||||
const OwnedPluginForm = {
|
||||
template: "#vue-owned-plugin-form",
|
||||
@ -78,7 +78,7 @@ const OwnedPluginForm = {
|
||||
method: "GET",
|
||||
url: "/api/config_definitions",
|
||||
headers: {
|
||||
'X-CSRF-Token': this.token
|
||||
"X-CSRF-Token": this.token
|
||||
},
|
||||
data: {
|
||||
type: this.pluginType,
|
||||
|
@ -1,5 +1,5 @@
|
||||
'use strict';
|
||||
import 'lodash/lodash';
|
||||
"use strict";
|
||||
import "lodash/lodash";
|
||||
const ParserMultilineForm = {
|
||||
template: "#vue-parser-multiline-form",
|
||||
props: [
|
||||
|
@ -1,17 +1,17 @@
|
||||
'use strict';
|
||||
import 'lodash/lodash';
|
||||
import 'popper.js/dist/popper';
|
||||
import 'bootstrap/dist/js/bootstrap';
|
||||
import OwnedPluginForm from './owned_plugin_form';
|
||||
"use strict";
|
||||
import "lodash/lodash";
|
||||
import "popper.js/dist/popper";
|
||||
import "bootstrap/dist/js/bootstrap";
|
||||
import OwnedPluginForm from "./owned_plugin_form";
|
||||
|
||||
window.addEventListener('load', () => {
|
||||
window.addEventListener("load", () => {
|
||||
new Vue({
|
||||
el: '#plugin-setting',
|
||||
el: "#plugin-setting",
|
||||
data: () => {
|
||||
return {};
|
||||
},
|
||||
components: {
|
||||
'owned-plugin-form': OwnedPluginForm
|
||||
"owned-plugin-form": OwnedPluginForm
|
||||
},
|
||||
methods: {
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
$(document).ready(() => {
|
||||
const SettingSection = {
|
||||
template: '#vue-setting-section',
|
||||
props: ['id', 'content', 'type', 'name', 'arg'],
|
||||
template: "#vue-setting-section",
|
||||
props: ["id", "content", "type", "name", "arg"],
|
||||
data: function() {
|
||||
return {
|
||||
mode: 'default',
|
||||
mode: "default",
|
||||
processing: false
|
||||
};
|
||||
},
|
||||
@ -13,7 +13,7 @@ $(document).ready(() => {
|
||||
},
|
||||
computed: {
|
||||
endpoint: function() {
|
||||
return '/api/settings/' + this.id;
|
||||
return "/api/settings/" + this.id;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -30,7 +30,7 @@ $(document).ready(() => {
|
||||
this.destroy();
|
||||
},
|
||||
onSubmit: function(ev) {
|
||||
const token = document.getElementsByName("csrf-token")[0].getAttribute('content');
|
||||
const token = document.getElementsByName("csrf-token")[0].getAttribute("content");
|
||||
this.processing = true;
|
||||
this.content = $(`#${this.id} textarea.form-control`)[0].dataset.content;
|
||||
$.ajax({
|
||||
@ -42,7 +42,7 @@ $(document).ready(() => {
|
||||
content: this.content
|
||||
},
|
||||
headers: {
|
||||
'X-CSRF-Token': token
|
||||
"X-CSRF-Token": token
|
||||
}
|
||||
}).then((data)=> {
|
||||
_.each(data, function(v,k){
|
||||
@ -55,10 +55,10 @@ $(document).ready(() => {
|
||||
},
|
||||
initialState: function(){
|
||||
this.processing = false;
|
||||
this.mode = 'default';
|
||||
this.mode = "default";
|
||||
},
|
||||
destroy: function(){
|
||||
const token = document.getElementsByName("csrf-token")[0].getAttribute('content');
|
||||
const token = document.getElementsByName("csrf-token")[0].getAttribute("content");
|
||||
$.ajax({
|
||||
url: this.endpoint,
|
||||
method: "POST",
|
||||
@ -67,7 +67,7 @@ $(document).ready(() => {
|
||||
id: this.id
|
||||
},
|
||||
headers: {
|
||||
'X-CSRF-Token': token
|
||||
"X-CSRF-Token": token
|
||||
}
|
||||
}).then(()=> {
|
||||
this.$parent.update();
|
||||
@ -94,7 +94,7 @@ $(document).ready(() => {
|
||||
});
|
||||
},
|
||||
components: {
|
||||
'setting-section': SettingSection
|
||||
"setting-section": SettingSection
|
||||
},
|
||||
methods: {
|
||||
update: function() {
|
||||
|
@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
"use strict";
|
||||
|
||||
import ConfigField from './config_field';
|
||||
import ConfigField from "./config_field";
|
||||
|
||||
const TransportConfig = {
|
||||
template: "#vue-transport-config",
|
||||
@ -44,7 +44,7 @@ const TransportConfig = {
|
||||
method: "GET",
|
||||
url: "/api/config_definitions",
|
||||
headers: {
|
||||
'X-CSRF-Token': this.token
|
||||
"X-CSRF-Token": this.token
|
||||
},
|
||||
data: {
|
||||
type: this.pluginType,
|
||||
|
@ -1,11 +1,11 @@
|
||||
'use strict';
|
||||
import 'lodash/lodash';
|
||||
"use strict";
|
||||
import "lodash/lodash";
|
||||
|
||||
import ConfigField from './config_field';
|
||||
import ConfigField from "./config_field";
|
||||
|
||||
$(document).ready(() => {
|
||||
new Vue({
|
||||
el: '#transport-section',
|
||||
el: "#transport-section",
|
||||
components: {
|
||||
"config-field": ConfigField
|
||||
},
|
||||
@ -55,7 +55,7 @@ $(document).ready(() => {
|
||||
method: "GET",
|
||||
url: "/api/config_definitions",
|
||||
headers: {
|
||||
'X-CSRF-Token': this.token
|
||||
"X-CSRF-Token": this.token
|
||||
},
|
||||
data: {
|
||||
type: this.pluginType,
|
||||
|
@ -1,5 +1,5 @@
|
||||
'use strict';
|
||||
import 'lodash/lodash';
|
||||
"use strict";
|
||||
import "lodash/lodash";
|
||||
$(document).ready(() => {
|
||||
new Vue({
|
||||
el: "#treeview",
|
||||
|
Loading…
Reference in New Issue
Block a user