Merge pull request #55 from treasure-data/autoreload_log_by_default

Auto reload fluentd log by default
This commit is contained in:
uu59 2014-07-22 13:19:41 +09:00
commit ded261c68e
2 changed files with 6 additions and 2 deletions

View File

@ -6,7 +6,7 @@
new Vue({ new Vue({
el: "#fluent-log", el: "#fluent-log",
paramAttributes: ["logUrl"], paramAttributes: ["logUrl", "initialAutoReload"],
data: { data: {
"autoFetch": false, "autoFetch": false,
"logs": [], "logs": [],
@ -15,6 +15,9 @@
}, },
created: function(){ created: function(){
if(this.initialAutoReload) {
this.autoFetch = true;
}
this.fetchLogs(); this.fetchLogs();
var self = this; var self = this;

View File

@ -1,5 +1,6 @@
<!-- vue.js --> <!-- vue.js -->
<div id="fluent-log" logUrl="<%= log_tail_fluentd_agent_path(fluentd) %>"> <% auto_reload ||= false %>
<div id="fluent-log" logUrl="<%= log_tail_fluentd_agent_path(fluentd) %>" initialAutoReload="<%= auto_reload ? "true" : "" %>">
<p> <p>
<button class="btn btn-primary" v-on="click: fetchLogs"> <button class="btn btn-primary" v-on="click: fetchLogs">
<%= t "terms.reload_log" %> <%= t "terms.reload_log" %>