mirror of
https://github.com/simon987/od-database.git
synced 2025-04-18 18:06:44 +00:00
Added more extension types and adjusted global stats histograms
This commit is contained in:
parent
10e1afb2e4
commit
14037c5f21
@ -45,6 +45,8 @@ category_map = {
|
|||||||
'torrent': 'application', 'rpm': 'application', 'deb': 'application',
|
'torrent': 'application', 'rpm': 'application', 'deb': 'application',
|
||||||
'atr': 'application', 'class': 'application', 'ttf': 'application',
|
'atr': 'application', 'class': 'application', 'ttf': 'application',
|
||||||
'img': 'application', 'msi': 'application', 'run': 'application',
|
'img': 'application', 'msi': 'application', 'run': 'application',
|
||||||
|
'drpm': 'application', 'udeb': 'application', 'patch': 'application',
|
||||||
|
'nes': 'application', 'ebuild': 'application', 'scr': 'application',
|
||||||
# Text category
|
# Text category
|
||||||
'java': 'text', 'cpp': 'text', 'rb': 'text',
|
'java': 'text', 'cpp': 'text', 'rb': 'text',
|
||||||
'bat': 'text', 'latex': 'text', 'xml': 'text',
|
'bat': 'text', 'latex': 'text', 'xml': 'text',
|
||||||
@ -59,6 +61,7 @@ category_map = {
|
|||||||
'cbz': 'text', 'docx': 'text', 'mobi': 'text',
|
'cbz': 'text', 'docx': 'text', 'mobi': 'text',
|
||||||
'chm': 'text', 'xlsx': "text", 'djvu': 'text',
|
'chm': 'text', 'xlsx': "text", 'djvu': 'text',
|
||||||
'rtf': 'text', 'log': 'text', 'md': 'text',
|
'rtf': 'text', 'log': 'text', 'md': 'text',
|
||||||
|
'dsc': 'text', 'info': 'text',
|
||||||
# Video category
|
# Video category
|
||||||
'3g2': 'video', '3gp': 'video', 'asf': 'video',
|
'3g2': 'video', '3gp': 'video', 'asf': 'video',
|
||||||
'asx': 'video', 'avi': 'video', 'flv': 'video',
|
'asx': 'video', 'avi': 'video', 'flv': 'video',
|
||||||
@ -68,7 +71,8 @@ category_map = {
|
|||||||
'mp4': 'video', 'mpa': 'video', 'mpe': 'video',
|
'mp4': 'video', 'mpa': 'video', 'mpe': 'video',
|
||||||
'mpeg': 'video', 'mpg': 'video', 'mkv': 'video',
|
'mpeg': 'video', 'mpg': 'video', 'mkv': 'video',
|
||||||
'wmv': 'video', 'm4s': 'video', 'ogv': 'video',
|
'wmv': 'video', 'm4s': 'video', 'ogv': 'video',
|
||||||
'm4b': 'video', 'm4v': 'video',
|
'm4b': 'video', 'm4v': 'video', 'ts': 'video',
|
||||||
|
|
||||||
# Audio category
|
# Audio category
|
||||||
'wav': 'audio', 'snd': 'audio', 'mp2': 'audio',
|
'wav': 'audio', 'snd': 'audio', 'mp2': 'audio',
|
||||||
'aif': 'audio', 'iff': 'audio', 'm4a': 'audio',
|
'aif': 'audio', 'iff': 'audio', 'm4a': 'audio',
|
||||||
@ -86,7 +90,7 @@ category_map = {
|
|||||||
'ppm': 'image', 'xpm': 'image', 'xbm': 'image',
|
'ppm': 'image', 'xpm': 'image', 'xbm': 'image',
|
||||||
'rgb': 'image', 'svg': 'image', 'psd': 'image',
|
'rgb': 'image', 'svg': 'image', 'psd': 'image',
|
||||||
'yuv': 'image', 'ai': 'image', 'eps': 'image',
|
'yuv': 'image', 'ai': 'image', 'eps': 'image',
|
||||||
'bw': 'image',
|
'bw': 'image', 'hdr': 'image',
|
||||||
# Archive category
|
# Archive category
|
||||||
'ar': 'archive', 'cpio': 'archive', 'shar': 'archive',
|
'ar': 'archive', 'cpio': 'archive', 'shar': 'archive',
|
||||||
'iso': 'archive', 'lbr': 'archive', 'mar': 'archive',
|
'iso': 'archive', 'lbr': 'archive', 'mar': 'archive',
|
||||||
@ -119,6 +123,7 @@ category_map = {
|
|||||||
'zipx': 'archive', 'zoo': 'archive', 'zpaq': 'archive',
|
'zipx': 'archive', 'zoo': 'archive', 'zpaq': 'archive',
|
||||||
'zz': 'archive', 'xpi': 'archive', 'tgz': 'archive',
|
'zz': 'archive', 'xpi': 'archive', 'tgz': 'archive',
|
||||||
'tbz': 'archive', 'tar': 'archive', 'bz': 'archive',
|
'tbz': 'archive', 'tar': 'archive', 'bz': 'archive',
|
||||||
|
'diz': 'archive',
|
||||||
}
|
}
|
||||||
|
|
||||||
colors = {
|
colors = {
|
||||||
|
@ -330,15 +330,15 @@ class ElasticSearchEngine(SearchEngine):
|
|||||||
"sizes": {
|
"sizes": {
|
||||||
"histogram": {
|
"histogram": {
|
||||||
"field": "size",
|
"field": "size",
|
||||||
"interval": 10000000, # 10Mb
|
"interval": 50000000, # 50Mb
|
||||||
"min_doc_count": 5
|
"min_doc_count": 100
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dates": {
|
"dates": {
|
||||||
"date_histogram": {
|
"date_histogram": {
|
||||||
"field": "mtime",
|
"field": "mtime",
|
||||||
"interval": "1y",
|
"interval": "1y",
|
||||||
"min_doc_count": 5,
|
"min_doc_count": 100,
|
||||||
"format": "yyyy"
|
"format": "yyyy"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,7 @@ function drawWebsiteScatter(rData) {
|
|||||||
},
|
},
|
||||||
tooltips: {
|
tooltips: {
|
||||||
callbacks: {
|
callbacks: {
|
||||||
label: function(tooltipItem, data) {
|
label: function (tooltipItem, data) {
|
||||||
return data.labels[tooltipItem.index];
|
return data.labels[tooltipItem.index];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -91,7 +91,7 @@ function drawSizeHistogram(rData) {
|
|||||||
|
|
||||||
let slice = rData["sizes_histogram"][i];
|
let slice = rData["sizes_histogram"][i];
|
||||||
dataSet.push(slice[1]);
|
dataSet.push(slice[1]);
|
||||||
labels.push("[" + humanFileSize(slice[0]) + ", " + humanFileSize(slice[0] + 10000000) + "]")
|
labels.push("[" + humanFileSize(slice[0]) + ", " + humanFileSize(slice[0] + 50000000) + "]")
|
||||||
}
|
}
|
||||||
|
|
||||||
let ctx = document.getElementById('sizeHistogram').getContext('2d');
|
let ctx = document.getElementById('sizeHistogram').getContext('2d');
|
||||||
@ -292,38 +292,31 @@ function getRandomTintOfColor(color) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
category_map = {
|
category_map = {
|
||||||
|
// Application category
|
||||||
//Application category
|
'bcpio': 'application', 'bin': 'application', 'cdf': 'application',
|
||||||
'bcpio': 'application', 'bin': 'application',
|
'csh': 'application', 'dll': 'application', 'doc': 'application',
|
||||||
'cdf': 'application', 'csh': 'application',
|
'dot': 'application', 'dvi': 'application', 'eml': 'application',
|
||||||
'dll': 'application', 'doc': 'application',
|
'exe': 'application', 'hdf': 'application',
|
||||||
'dot': 'application', 'dvi': 'application',
|
'man': 'application', 'me': 'application', 'mht': 'application',
|
||||||
'eml': 'application', 'exe': 'application',
|
'mhtml': 'application', 'mif': 'application', 'ms': 'application',
|
||||||
'hdf': 'application', 'man': 'application',
|
'nc': 'application', 'nws': 'application', 'o': 'application',
|
||||||
'me': 'application', 'mht': 'application',
|
'obj': 'application', 'oda': 'application', 'p12': 'application',
|
||||||
'mhtml': 'application', 'mif': 'application',
|
'p7c': 'application', 'pfx': 'application', 'tr': 'application',
|
||||||
'ms': 'application', 'nc': 'application',
|
'ppa': 'application', 'pps': 'application', 'ppt': 'application',
|
||||||
'nws': 'application', 'o': 'application',
|
'ps': 'application', 'pwz': 'application', 'pyc': 'application',
|
||||||
'obj': 'application', 'oda': 'application',
|
'pyo': 'application', 'ram': 'application', 'rdf': 'application',
|
||||||
'p12': 'application', 'p7c': 'application',
|
'roff': 'application', 'sh': 'application', 'so': 'application',
|
||||||
'pfx': 'application', 'tr': 'application',
|
'src': 'application', 'sv4cpio': 'application', 'sv4crc': 'application',
|
||||||
'ppa': 'application', 'pps': 'application',
|
't': 'application', 'tcl': 'application', 'tex': 'application',
|
||||||
'ppt': 'application', 'ps': 'application',
|
'texi': 'application', 'texinfo': 'application', 'ustar': 'application',
|
||||||
'pwz': 'application', 'pyc': 'application',
|
'wiz': 'application', 'wsdl': 'application', 'xlb': 'application',
|
||||||
'pyo': 'application', 'ram': 'application',
|
'xls': 'application', 'xpdl': 'application', 'xsl': 'application',
|
||||||
'rdf': 'application', 'roff': 'application',
|
'torrent': 'application', 'rpm': 'application', 'deb': 'application',
|
||||||
'sh': 'application', 'so': 'application',
|
'atr': 'application', 'class': 'application', 'ttf': 'application',
|
||||||
'src': 'application', 'sv4cpio': 'application',
|
'img': 'application', 'msi': 'application', 'run': 'application',
|
||||||
'sv4crc': 'application', 't': 'application',
|
'drpm': 'application', 'udeb': 'application', 'patch': 'application',
|
||||||
'tcl': 'application', 'tex': 'application',
|
'nes': 'application', 'ebuild': 'application', 'scr': 'application',
|
||||||
'texi': 'application', 'texinfo': 'application',
|
// Text category
|
||||||
'ustar': 'application', 'wiz': 'application',
|
|
||||||
'wsdl': 'application', 'xlb': 'application',
|
|
||||||
'xls': 'application', 'xpdl': 'application',
|
|
||||||
'xsl': 'application', 'torrent': 'application',
|
|
||||||
'deb': 'application', 'rpm': 'application',
|
|
||||||
'atr': 'application',
|
|
||||||
//Text category
|
|
||||||
'java': 'text', 'cpp': 'text', 'rb': 'text',
|
'java': 'text', 'cpp': 'text', 'rb': 'text',
|
||||||
'bat': 'text', 'latex': 'text', 'xml': 'text',
|
'bat': 'text', 'latex': 'text', 'xml': 'text',
|
||||||
'etx': 'text', 'htm': 'text', 'c': 'text',
|
'etx': 'text', 'htm': 'text', 'c': 'text',
|
||||||
@ -333,8 +326,12 @@ category_map = {
|
|||||||
'h': 'text', 'tsv': 'text', 'rtx': 'text',
|
'h': 'text', 'tsv': 'text', 'rtx': 'text',
|
||||||
'sgm': 'text', 'sgml': 'text', 'txt': 'text',
|
'sgm': 'text', 'sgml': 'text', 'txt': 'text',
|
||||||
'vcf': 'text', 'pdf': 'text', 'epub': 'text',
|
'vcf': 'text', 'pdf': 'text', 'epub': 'text',
|
||||||
'srt': 'text', 'cbr': 'text', 'inc': 'text',
|
'srt': 'text', 'inc': 'text', 'php': 'text',
|
||||||
//Video category
|
'cbz': 'text', 'docx': 'text', 'mobi': 'text',
|
||||||
|
'chm': 'text', 'xlsx': "text", 'djvu': 'text',
|
||||||
|
'rtf': 'text', 'log': 'text', 'md': 'text',
|
||||||
|
'dsc': 'text', 'info': 'text',
|
||||||
|
// Video category
|
||||||
'3g2': 'video', '3gp': 'video', 'asf': 'video',
|
'3g2': 'video', '3gp': 'video', 'asf': 'video',
|
||||||
'asx': 'video', 'avi': 'video', 'flv': 'video',
|
'asx': 'video', 'avi': 'video', 'flv': 'video',
|
||||||
'swf': 'video', 'vob:': 'video', 'qt': 'video',
|
'swf': 'video', 'vob:': 'video', 'qt': 'video',
|
||||||
@ -342,14 +339,17 @@ category_map = {
|
|||||||
'm3u': 'video', 'm3u8': 'video', 'movie': 'video',
|
'm3u': 'video', 'm3u8': 'video', 'movie': 'video',
|
||||||
'mp4': 'video', 'mpa': 'video', 'mpe': 'video',
|
'mp4': 'video', 'mpa': 'video', 'mpe': 'video',
|
||||||
'mpeg': 'video', 'mpg': 'video', 'mkv': 'video',
|
'mpeg': 'video', 'mpg': 'video', 'mkv': 'video',
|
||||||
'wmv': 'video', 'm4s': 'video', 'm4v': 'video',
|
'wmv': 'video', 'm4s': 'video', 'ogv': 'video',
|
||||||
'mp4a': 'video',
|
'm4b': 'video', 'm4v': 'video', 'ts': 'video',
|
||||||
|
|
||||||
// Audio category
|
// Audio category
|
||||||
'wav': 'audio', 'snd': 'audio', 'mp2': 'audio',
|
'wav': 'audio', 'snd': 'audio', 'mp2': 'audio',
|
||||||
'aif': 'audio', 'iff': 'audio', 'm4a': 'audio',
|
'aif': 'audio', 'iff': 'audio', 'm4a': 'audio',
|
||||||
'mid': 'audio', 'midi': 'audio', 'mp3': 'audio',
|
'mid': 'audio', 'midi': 'audio', 'mp3': 'audio',
|
||||||
'wma': 'audio', 'ra': 'audio', 'aifc': 'audio',
|
'wma': 'audio', 'ra': 'audio', 'aifc': 'audio',
|
||||||
'aiff': 'audio', 'au': 'audio', 'flac': 'audio',
|
'aiff': 'audio', 'au': 'audio', 'flac': 'audio',
|
||||||
|
'ogg': 'audio', 'oga': 'audio', 'mka': 'video',
|
||||||
|
'ac3': 'audio',
|
||||||
// Image category
|
// Image category
|
||||||
'bmp': 'image', 'gif': 'image', 'jpg': 'image',
|
'bmp': 'image', 'gif': 'image', 'jpg': 'image',
|
||||||
'xwd': 'image', 'tif': 'image', 'tiff': 'image',
|
'xwd': 'image', 'tif': 'image', 'tiff': 'image',
|
||||||
@ -359,6 +359,7 @@ category_map = {
|
|||||||
'ppm': 'image', 'xpm': 'image', 'xbm': 'image',
|
'ppm': 'image', 'xpm': 'image', 'xbm': 'image',
|
||||||
'rgb': 'image', 'svg': 'image', 'psd': 'image',
|
'rgb': 'image', 'svg': 'image', 'psd': 'image',
|
||||||
'yuv': 'image', 'ai': 'image', 'eps': 'image',
|
'yuv': 'image', 'ai': 'image', 'eps': 'image',
|
||||||
|
'bw': 'image', 'hdr': 'image',
|
||||||
// Archive category
|
// Archive category
|
||||||
'ar': 'archive', 'cpio': 'archive', 'shar': 'archive',
|
'ar': 'archive', 'cpio': 'archive', 'shar': 'archive',
|
||||||
'iso': 'archive', 'lbr': 'archive', 'mar': 'archive',
|
'iso': 'archive', 'lbr': 'archive', 'mar': 'archive',
|
||||||
@ -390,7 +391,8 @@ category_map = {
|
|||||||
'xp3': 'archive', 'yz1': 'archive', 'zip': 'archive',
|
'xp3': 'archive', 'yz1': 'archive', 'zip': 'archive',
|
||||||
'zipx': 'archive', 'zoo': 'archive', 'zpaq': 'archive',
|
'zipx': 'archive', 'zoo': 'archive', 'zpaq': 'archive',
|
||||||
'zz': 'archive', 'xpi': 'archive', 'tgz': 'archive',
|
'zz': 'archive', 'xpi': 'archive', 'tgz': 'archive',
|
||||||
'tbz': 'archive',
|
'tbz': 'archive', 'tar': 'archive', 'bz': 'archive',
|
||||||
|
'diz': 'archive',
|
||||||
};
|
};
|
||||||
|
|
||||||
colors_map = {
|
colors_map = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user