mirror of
https://github.com/fluent/fluentd-ui.git
synced 2025-08-13 09:47:07 +02:00
32 lines
576 B
JavaScript
32 lines
576 B
JavaScript
(function(){
|
|
"use strict";
|
|
|
|
$(function(){
|
|
if($('#fluent-log').length === 0) return;
|
|
|
|
new Vue({
|
|
el: "#fluent-log",
|
|
paramAttributes: ["logUrl"],
|
|
data: {
|
|
"logs": [],
|
|
},
|
|
|
|
created: function(){
|
|
this.fetchLogs();
|
|
},
|
|
|
|
methods: {
|
|
fetchLogs: function() {
|
|
var self = this;
|
|
new Promise(function(resolve, reject) {
|
|
$.getJSON(self.logUrl, resolve).fail(reject);
|
|
}).then(function(logs){
|
|
self.logs = logs;
|
|
});
|
|
},
|
|
}
|
|
});
|
|
});
|
|
})();
|
|
|