Skip to content

Commit 46f9360

Browse files
author
Ali Razmjoo
authored
Merge pull request #287 from OWASP/development
Development
2 parents db2156f + 755649a commit 46f9360

3 files changed

Lines changed: 30 additions & 27 deletions

File tree

requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
setuptools==56.2.0
1+
setuptools==57.0.0
22
pymongo==3.11.4
33
netaddr==0.8.0
4-
flask==2.0.0
4+
flask==2.0.1
55
terminable_thread==0.7.1
6-
watchdog==2.1.1
6+
watchdog==2.1.2
77
pyshark==0.4.3
88
oschmod==0.3.12
99
argparse==1.4.0

web/static/js/explore.js

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -193,27 +193,29 @@ $.fn.dataTable.pipeline = function ( opts ) {
193193
}
194194
}
195195
json = tmpj
196-
index = Object.keys(json['data'][0])[settings.aLastSort[0].col]
197-
order = settings.aLastSort[0].dir
198-
if (order == "asc"){
199-
json['data'].sort(
200-
(a, b) => {
201-
if (a[index] < b[index])
202-
return -1;
203-
if (a[index] > b[index])
204-
return 1;
205-
return 0;
206-
})
207-
208-
} else {
209-
json['data'].sort(
210-
(a, b) => {
211-
if (a[index] > b[index])
212-
return -1;
213-
if (a[index] < b[index])
214-
return 1;
215-
return 0;
216-
})
196+
if(json['data'].length > 0){
197+
index = Object.keys(json['data'][0])[settings.aLastSort[0].col]
198+
order = settings.aLastSort[0].dir
199+
if (order == "asc") {
200+
json['data'].sort(
201+
(a, b) => {
202+
if (a[index] < b[index])
203+
return -1;
204+
if (a[index] > b[index])
205+
return 1;
206+
return 0;
207+
})
208+
209+
} else {
210+
json['data'].sort(
211+
(a, b) => {
212+
if (a[index] > b[index])
213+
return -1;
214+
if (a[index] < b[index])
215+
return 1;
216+
return 0;
217+
})
218+
}
217219
}
218220
return JSON.stringify( json );
219221
},
@@ -295,7 +297,8 @@ function get_event_data(api_endpoint, column_list, api_params) {
295297
processing: true,
296298
language:{
297299
loadingRecords: '&nbsp;',
298-
processing: '<div class="spinner">Loading...</div>'
300+
processing: '<div class="spinner">Loading...</div>',
301+
sEmptyTable: '<div>No records are present for given request</div>'
299302
},
300303
oLanguage: {
301304
sStripClasses: "",

web/static/js/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ window.chartColors = {
1111
blue: "rgb(54, 162, 235)",
1212
purple: "rgb(153, 102, 255)",
1313
grey: "rgb(201, 203, 207)",
14-
cyan: "rgb(0, 255, 255"
14+
cyan: "rgb(0, 255, 255)"
1515
};
1616

1717
var colors_array = ["rgb(255, 0, 0)", "rgb(255, 0, 191)", "rgb(255, 159, 64)", "rgb(255, 205, 86)", "rgb(75, 192, 192)",
18-
"rgb(191, 255, 0)", "rgb(54, 162, 235)", "rgb(153, 102, 255)", "rgb(201, 203, 207)", "rgb(0, 255, 255"]
18+
"rgb(191, 255, 0)", "rgb(54, 162, 235)", "rgb(153, 102, 255)", "rgb(201, 203, 207)", "rgb(0, 255, 255)"]
1919

2020
var color = Chart.helpers.color;
2121
var chartColors = window.chartColors;

0 commit comments

Comments
 (0)