Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
$(trs[i]).mouseenter(function(e) {
// Hackish over event from:
// https://github.com/wenzhixin/bootstrap-table/issues/782
var row = $(e.currentTarget)
.parents('table')
.data()['bootstrap.table']
.data[$(e.currentTarget).data('index')];
if (!row) { return; }
var feature = this.loader.getFeatureFromRow(row);
var source = this.featuresTablesCtrl.fOverlay.getSource();
source.clear();
if (feature && feature.getGeometry()) {
source.addFeature(feature);
}
}.bind(this));
$(trs[i]).mouseleave(function(e) {
for (var detail of row.subconfigs) {
var statRowDetail = document.importNode($('#stat-row-template').prop('content').cloneNode(true), true).children[0];
if (detail.subconfig !== null) {
$(statRowDetail).find('.config-ref').attr('href', `/configs/${detail.subconfig}`);
}
$(statRowDetail).find('.config-ref').text(detail.subconfig === null ? 'N/A' : `${detail.subconfig}`);
$(statRowDetail).find('.sut').text(row.sut);
$(statRowDetail).find('.exec').text(detail.exec);
$(statRowDetail).find('.issues').text(detail.issues);
$(statRowDetail).find('.unique').text(detail.unique);
$(statRowDetail).appendTo($(mainDiv));
}
return mainDiv.outerHTML;
}
var bst = $('#stats-table').bootstrapTable(fz.utils.bstOptions({
columnNames: ['fuzzer', 'exec', 'issues', 'unique', 'sut'],
formatter: statRowFormatter,
detailFormatter: statRowDetailFormatter,
sortName: 'exec',
sortOrder: 'desc',
cookieIdTable: 'statTableCookie',
getRows: fz.api.getStats,
showAll: true,
})).data()['bootstrap.table'];
fz.notifications.onmessage['refresh_stats'] = function () {
bst.refresh({ silent: true });
};
});
$(document).ready(function () {
'use strict';
var bst = $('.bootstrap-table .table').data()['bootstrap.table'];
$('#table-search').off('keyup drop blur').on('keyup drop blur', function (event) {
clearTimeout(0);
setTimeout(function () {
bst.onSearch(event);
}, 500);
});
$('.sort-menu .sort-name').off('click').on('click', function (event) {
bst.options.sortName = $(event.currentTarget).data('value');
bst.onSort();
});
$('.sort-menu .sort-order').off('click').on('click', function (event) {
bst.options.sortOrder = $(event.currentTarget).data('value');
bst.onSort();
}
return $(issueRow)[0].outerHTML;
}
var options = fz.utils.bstOptions({
columnNames: ['sut', 'fuzzer', 'id', 'first_seen', 'last_seen', 'count', 'reduced', 'reported'],
formatter: issueRowFormatter,
sortName: 'first_seen',
sortOrder: 'desc',
cookieIdTable: 'issueTableCookie',
getRows: fz.api.getIssues,
showAll: true,
includeInvalid: false,
});
var bst = $('#issues-table').bootstrapTable(options).data()['bootstrap.table'];
fz.notifications.onmessage['refresh_issues'] = function () {
bst.refresh({ silent: true });
};
});