Fix bugs
This commit is contained in:
@@ -227,6 +227,22 @@ jQuery(document).ready(function($){
|
||||
}
|
||||
}
|
||||
|
||||
// Helper function to get output setting by key
|
||||
function getOutputSetting(output, key) {
|
||||
// Convert output object to array if needed
|
||||
if (Array.isArray(output)) {
|
||||
return output.find(function(o) { return o.key === key; });
|
||||
} else {
|
||||
// output is an object, find by matching key property
|
||||
for (var prop in output) {
|
||||
if (output[prop].key === key) {
|
||||
return output[prop];
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// Render vertical table display
|
||||
function renderVerticalTable(checkerId, res) {
|
||||
var thisChecker = $('#checker-' + checkerId);
|
||||
@@ -240,7 +256,7 @@ jQuery(document).ready(function($){
|
||||
|
||||
$.each(row, function(q, r) {
|
||||
var id = q.replace(/\s/g, '_').replace(/\./g, '_').toLowerCase();
|
||||
var outputSetting = res.output.find(function(o) { return o.key === q; });
|
||||
var outputSetting = getOutputSetting(res.output, q);
|
||||
|
||||
if (!outputSetting || outputSetting.hide === 'yes') return;
|
||||
|
||||
@@ -283,7 +299,7 @@ jQuery(document).ready(function($){
|
||||
// Headers
|
||||
if (res.rows.length > 0) {
|
||||
$.each(res.rows[0], function(q, r) {
|
||||
var outputSetting = res.output.find(function(o) { return o.key === q; });
|
||||
var outputSetting = getOutputSetting(res.output, q);
|
||||
if (!outputSetting || outputSetting.hide === 'yes') return;
|
||||
resultDiv += '<th style="color:'+res.settings.header+'">'+q+'</th>';
|
||||
});
|
||||
@@ -295,7 +311,7 @@ jQuery(document).ready(function($){
|
||||
resultDiv += '<tr>';
|
||||
$.each(row, function(q, r) {
|
||||
var id = q.replace(/\s/g, '_').replace(/\./g, '_').toLowerCase();
|
||||
var outputSetting = res.output.find(function(o) { return o.key === q; });
|
||||
var outputSetting = getOutputSetting(res.output, q);
|
||||
|
||||
if (!outputSetting || outputSetting.hide === 'yes') return;
|
||||
|
||||
@@ -343,7 +359,7 @@ jQuery(document).ready(function($){
|
||||
|
||||
$.each(row, function(q, r) {
|
||||
var id = q.replace(/\s/g, '_').replace(/\./g, '_').toLowerCase();
|
||||
var outputSetting = res.output.find(function(o) { return o.key === q; });
|
||||
var outputSetting = getOutputSetting(res.output, q);
|
||||
|
||||
if (!outputSetting || outputSetting.hide === 'yes') return;
|
||||
|
||||
@@ -391,7 +407,7 @@ jQuery(document).ready(function($){
|
||||
|
||||
$.each(row, function(q, r) {
|
||||
var id = q.replace(/\s/g, '_').replace(/\./g, '_').toLowerCase();
|
||||
var outputSetting = res.output.find(function(o) { return o.key === q; });
|
||||
var outputSetting = getOutputSetting(res.output, q);
|
||||
|
||||
if (!outputSetting || outputSetting.hide === 'yes') return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user