Fix dashboard not to show JSON as '[object Object]' (#5126)

This commit is contained in:
Yoshiki Shibukawa 2022-05-13 20:16:57 +09:00 committed by GitHub
parent babbd21814
commit 32b662c896
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -89,7 +89,7 @@
{{#each this}}
<tr>
{{#each this}}
<td>{{@key}}: {{this}}</td>
<td>{{@key}}: {{{json this}}}</td>
{{/each}}
</tr>
{{else}}
@ -152,7 +152,9 @@
}
$(document).ready(function (){
Handlebars.registerHelper("json", function (context) {
return JSON.stringify(context);
});
$.getJSON("/moto-api/data.json", function(data) {
var source = $('#template').html();
var template = Handlebars.compile(source);