Commit bfe38391 authored by Jérome Perrin's avatar Jérome Perrin

make a "widget" for debug json

parent a9f7ce10
......@@ -516,6 +516,10 @@
});
}
function debug_json_widget(input_data, output_data) {
$("#json_output").val(JSON.stringify(input_data, undefined, " "));
$("#json_result").val(JSON.stringify(output_data, undefined, " "));
}
scope.Dream = function (configuration) {
var that = jsonPlumb(),
......@@ -851,6 +855,9 @@
if (configuration['Dream-Configuration'].gui.job_gantt){
job_gantt_widget(input, result);
}
if (configuration['Dream-Configuration'].gui.debug_json){
debug_json_widget(input, result);
}
// hack: make the tabs full width
$("#reports li").width((100/$("#reports li:visible").length) - 1 +'%');
......
......@@ -69,7 +69,6 @@
$('#result_zone').hide();
$('#shift_spreadsheet').hide();
$("#debug_json").hide();
$("#wip_part_spreadsheet").hide();
if (configuration['Dream-Configuration'].gui.wip_part_spreadsheet){
......@@ -78,9 +77,6 @@
if (configuration['Dream-Configuration'].gui.shift_spreadsheet){
$("#shift_spreadsheet").show();
}
if (configuration['Dream-Configuration'].gui.debug_json){
$("#debug_json").show();
}
try {
// spreadsheets
......@@ -124,8 +120,7 @@
dream_instance.updateGeneralProperties(data.general);
dream_instance.prepareDialogForGeneralProperties();
$("#json_output").val(JSON.stringify(dream_instance.getData(),
undefined, " "));
if ($.isEmptyObject(coordinates)) {
dream_instance.positionGraph();
} else {
......@@ -145,7 +140,6 @@
}
// once the data is read, we can subscribe to every changes
$.subscribe("Dream.Gui.onDataChange", function (event, data) {
$("#json_output").val(JSON.stringify(data, undefined, " "));
jio.put({
_id: "dream_demo",
data: data
......@@ -186,7 +180,6 @@
$('#result_list').empty();
$('#error').empty();
if (data['success']) {
$("#json_result").val(JSON.stringify(data.data, undefined, " "));
$.each(data.data, function (idx, result) {
$('#result_list').append('<li class="result"></li>');
......@@ -263,7 +256,6 @@
},
success: function (data, textStatus, jqXHR) {
form.reset();
$("#json_output").val(JSON.stringify(data));
loadData(data);
}
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment