diff --git a/diskover-web/CHANGELOG.md b/diskover-web/CHANGELOG.md index 1ebda2e0..12290aae 100644 --- a/diskover-web/CHANGELOG.md +++ b/diskover-web/CHANGELOG.md @@ -1,5 +1,12 @@ # Diskover-web v2 Community Edition Change Log +# [2.0.4] - 2022-09-19 +### added +- all charts on search results page and dashboard are now clickable for searching results +### changed +- removed setting sort by size when clicking charts on search results and dashboard pages + + # [2.0.3] - 2022-07-20 ### fixed - view file info page file and full path links not finding any search results when file name has double quote " in name diff --git a/diskover-web/public/check_session.php b/diskover-web/public/check_session.php index c6c630ce..284e5f80 100644 --- a/diskover-web/public/check_session.php +++ b/diskover-web/public/check_session.php @@ -3,7 +3,7 @@ diskover-web https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ diff --git a/diskover-web/public/css/diskover-filetree-search.css b/diskover-web/public/css/diskover-filetree-search.css index 76d48609..ebcc4aee 100644 --- a/diskover-web/public/css/diskover-filetree-search.css +++ b/diskover-web/public/css/diskover-filetree-search.css @@ -3,7 +3,7 @@ diskover-web community edition (ce) https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ diff --git a/diskover-web/public/css/diskover.css b/diskover-web/public/css/diskover.css index 103f065e..cfb787a2 100644 --- a/diskover-web/public/css/diskover.css +++ b/diskover-web/public/css/diskover.css @@ -3,7 +3,7 @@ diskover-web community edition (ce) https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ diff --git a/diskover-web/public/d3_data_bar_mtime_dashboard.php b/diskover-web/public/d3_data_bar_mtime_dashboard.php index d68bb1f2..72fe0704 100644 --- a/diskover-web/public/d3_data_bar_mtime_dashboard.php +++ b/diskover-web/public/d3_data_bar_mtime_dashboard.php @@ -4,7 +4,7 @@ https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ diff --git a/diskover-web/public/d3_data_bar_mtime_searchresults.php b/diskover-web/public/d3_data_bar_mtime_searchresults.php index 31d01d2e..09319009 100644 --- a/diskover-web/public/d3_data_bar_mtime_searchresults.php +++ b/diskover-web/public/d3_data_bar_mtime_searchresults.php @@ -4,7 +4,7 @@ https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ diff --git a/diskover-web/public/d3_data_pie_ext_dashboard.php b/diskover-web/public/d3_data_pie_ext_dashboard.php index 70916fa5..00fdc4eb 100644 --- a/diskover-web/public/d3_data_pie_ext_dashboard.php +++ b/diskover-web/public/d3_data_pie_ext_dashboard.php @@ -4,7 +4,7 @@ https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ diff --git a/diskover-web/public/d3_data_pie_ext_searchresults.php b/diskover-web/public/d3_data_pie_ext_searchresults.php index 5525d003..af971d93 100644 --- a/diskover-web/public/d3_data_pie_ext_searchresults.php +++ b/diskover-web/public/d3_data_pie_ext_searchresults.php @@ -4,7 +4,7 @@ https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ diff --git a/diskover-web/public/d3_data_search.php b/diskover-web/public/d3_data_search.php index bf0acb58..bbe64ad4 100644 --- a/diskover-web/public/d3_data_search.php +++ b/diskover-web/public/d3_data_search.php @@ -4,7 +4,7 @@ https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ diff --git a/diskover-web/public/d3_data_search_dirsizechart.php b/diskover-web/public/d3_data_search_dirsizechart.php index 4b53903e..db3ce134 100644 --- a/diskover-web/public/d3_data_search_dirsizechart.php +++ b/diskover-web/public/d3_data_search_dirsizechart.php @@ -4,7 +4,7 @@ https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ diff --git a/diskover-web/public/d3_inc.php b/diskover-web/public/d3_inc.php index 108476e0..08d511ff 100644 --- a/diskover-web/public/d3_inc.php +++ b/diskover-web/public/d3_inc.php @@ -4,7 +4,7 @@ https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ diff --git a/diskover-web/public/dashboard.data.php b/diskover-web/public/dashboard.data.php index 1ac193b5..81cc10c1 100644 --- a/diskover-web/public/dashboard.data.php +++ b/diskover-web/public/dashboard.data.php @@ -4,7 +4,7 @@ https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ diff --git a/diskover-web/public/dashboard.php b/diskover-web/public/dashboard.php index 5e1c4cb8..4c41bff7 100644 --- a/diskover-web/public/dashboard.php +++ b/diskover-web/public/dashboard.php @@ -4,7 +4,7 @@ https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ diff --git a/diskover-web/public/error.php b/diskover-web/public/error.php index 5793fcf8..8a69b137 100644 --- a/diskover-web/public/error.php +++ b/diskover-web/public/error.php @@ -4,7 +4,7 @@ https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ diff --git a/diskover-web/public/help.php b/diskover-web/public/help.php index a39d8f2f..eb7f9c30 100644 --- a/diskover-web/public/help.php +++ b/diskover-web/public/help.php @@ -4,7 +4,7 @@ https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ diff --git a/diskover-web/public/js/diskover-dashboard.js b/diskover-web/public/js/diskover-dashboard.js index 7dbd4671..e483b292 100644 --- a/diskover-web/public/js/diskover-dashboard.js +++ b/diskover-web/public/js/diskover-dashboard.js @@ -3,7 +3,7 @@ diskover-web community edition (ce) https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ @@ -118,6 +118,24 @@ $(function () { title: { display: true, text: 'Top File Types by Size' + }, + onClick: function(event, clickedElements) { + if (clickedElements.length === 0) return; + var e = clickedElements[0]; + var ext = this.data.labels[e._index]; + //var size = this.data.datasets[0].data[e._index]; + if (ext == "NULL (no ext)") { + ext = "\"\""; + } + var pp = encodeURIComponent(escapeHTML(decodeURIComponent(path))); + window.location.href = "search.php?submitted=true&p=1&q=extension:" + ext + " AND parent_path:" + pp + "*&doctype=file"; + return false; + }, + onHover: function (event, legendItem, legend) { + $("#topFileTypesBySize-barChart").css("cursor", "pointer"); + }, + onLeave: function (event, legendItem, legend) { + $("#topFileTypesBySize-barChart").css("cursor", "default"); } } @@ -174,7 +192,7 @@ $(function () { if (ext == "NULL (no ext)") { ext = "\"\""; } - window.location.href = "search.php?submitted=true&p=1&q=extension:" + ext + " AND parent_path:" + encodeURIComponent(escapeHTML(path)) +"*&sort=size&sortorder=desc&sort2=name&sortorder2=asc&doctype=file"; + window.location.href = "search.php?submitted=true&p=1&q=extension:" + ext + " AND parent_path:" + encodeURIComponent(escapeHTML(path)) +"*&doctype=file"; return false; }, onHover: function (event, legendItem, legend) { @@ -201,6 +219,24 @@ $(function () { title: { display: true, text: 'Top File Types by Count' + }, + onClick: function(event, clickedElements) { + if (clickedElements.length === 0) return; + var e = clickedElements[0]; + var ext = this.data.labels[e._index]; + //var size = this.data.datasets[0].data[e._index]; + if (ext == "NULL (no ext)") { + ext = "\"\""; + } + var pp = encodeURIComponent(escapeHTML(decodeURIComponent(path))); + window.location.href = "search.php?submitted=true&p=1&q=extension:" + ext + " AND parent_path:" + pp + "*&doctype=file"; + return false; + }, + onHover: function (event, legendItem, legend) { + $("#topFileTypesByCount-pieChart").css("cursor", "pointer"); + }, + onLeave: function (event, legendItem, legend) { + $("#topFileTypesByCount-pieChart").css("cursor", "default"); } } @@ -280,7 +316,7 @@ $(function () { } else if (mtime == "> 2 years") { mtime = "[* TO now/m-2y/d}" } - window.location.href = "search.php?submitted=true&p=1&q=mtime:" + mtime + " AND parent_path:" + encodeURIComponent(escapeHTML(path)) +"*&sort=size&sortorder=desc&sort2=name&sortorder2=asc&doctype=file"; + window.location.href = "search.php?submitted=true&p=1&q=mtime:" + mtime + " AND parent_path:" + encodeURIComponent(escapeHTML(path)) +"*&doctype=file"; return false; }, onHover: function (event, legendItem, legend) { @@ -324,7 +360,34 @@ $(function () { } }] }, - maintainAspectRatio: false + maintainAspectRatio: false, + onClick: function(event, clickedElements) { + if (clickedElements.length === 0) return; + var activeElement = mtimebarChart.getElementAtEvent(event); + var mtime = this.data.datasets[activeElement[0]._datasetIndex].label; + if (mtime == "0 - 30 days") { + mtime = "[now/m-1M/d TO now/m}" + } else if (mtime == "30 - 90 days") { + mtime = "[now/m-3M/d TO now/m-1M/d}" + } else if (mtime == "90 - 180 days") { + mtime = "[now/m-6M/d TO now/m-3M/d}" + } else if (mtime == "180 days - 1 year") { + mtime = "[now/m-1y/d TO now/m-6M/d}" + } else if (mtime == "1 - 2 years") { + mtime = "[now/m-2y/d TO now/m-1y/d}" + } else if (mtime == "> 2 years") { + mtime = "[* TO now/m-2y/d}" + } + var pp = encodeURIComponent(escapeHTML(decodeURIComponent(path))); + window.location.href = "search.php?submitted=true&p=1&q=mtime:" + mtime + " AND parent_path:" + pp + "*&doctype=file"; + return false; + }, + onHover: function (event, legendItem, legend) { + $("#mtime-barChart").css("cursor", "pointer"); + }, + onLeave: function (event, legendItem, legend) { + $("#mtime-barChart").css("cursor", "default"); + } } var mtimebarChart = new Chart(mtimebarChartCanvas, { diff --git a/diskover-web/public/js/diskover.js b/diskover-web/public/js/diskover.js index 90f98d04..454d3153 100644 --- a/diskover-web/public/js/diskover.js +++ b/diskover-web/public/js/diskover.js @@ -3,7 +3,7 @@ diskover-web community edition (ce) https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ diff --git a/diskover-web/public/js/search.js b/diskover-web/public/js/search.js index e6812ab6..f37379e5 100644 --- a/diskover-web/public/js/search.js +++ b/diskover-web/public/js/search.js @@ -3,7 +3,7 @@ diskover-web community edition (ce) https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ @@ -527,7 +527,23 @@ $(function () { text: 'Top Directories by Size' }, maintainAspectRatio: false, - responsive: true + responsive: true, + onClick: function(event, clickedElements) { + if (clickedElements.length === 0) return; + var e = clickedElements[0]; + var dir = this.data.labels[e._index]; + //var size = this.data.datasets[0].data[e._index]; + var pp = encodeURIComponent(escapeHTML(decodeURIComponent(path) + '\/' + dir)); + var pp_path = encodeURIComponent(decodeURIComponent(path + '\/' + dir)); + window.location.href = "search.php?submitted=true&p=1&q=parent_path:" + pp + "*&path=" + pp_path; + return false; + }, + onHover: function (event, legendItem, legend) { + $("#topDirsBySize-barChart").css("cursor", "pointer"); + }, + onLeave: function (event, legendItem, legend) { + $("#topDirsBySize-barChart").css("cursor", "default"); + } } var topDirsBySizebarChart = new Chart(topDirsBySizebarChartCanvas, { @@ -580,7 +596,7 @@ $(function () { var dir = legendItem.text; var pp = encodeURIComponent(escapeHTML(decodeURIComponent(path) + '\/' + dir)); var pp_path = encodeURIComponent(decodeURIComponent(path + '\/' + dir)); - window.location.href = "search.php?submitted=true&p=1&q=parent_path:" + pp + "&sort=size&sortorder=desc&sort2=name&sortorder2=asc&path=" + pp_path; + window.location.href = "search.php?submitted=true&p=1&q=parent_path:" + pp + "*&path=" + pp_path; return false; }, onHover: function (event, legendItem, legend) { @@ -609,7 +625,23 @@ $(function () { text: 'Top Directories by Count' }, maintainAspectRatio: false, - responsive: true + responsive: true, + onClick: function(event, clickedElements) { + if (clickedElements.length === 0) return; + var e = clickedElements[0]; + var dir = this.data.labels[e._index]; + //var size = this.data.datasets[0].data[e._index]; + var pp = encodeURIComponent(escapeHTML(decodeURIComponent(path) + '\/' + dir)); + var pp_path = encodeURIComponent(decodeURIComponent(path + '\/' + dir)); + window.location.href = "search.php?submitted=true&p=1&q=parent_path:" + pp + "*&path=" + pp_path; + return false; + }, + onHover: function (event, legendItem, legend) { + $("#topDirsByCount-pieChart").css("cursor", "pointer"); + }, + onLeave: function (event, legendItem, legend) { + $("#topDirsByCount-pieChart").css("cursor", "default"); + } } var topDirsByCountpieChart = new Chart(topDirsByCountpieChartCanvas, { @@ -692,7 +724,25 @@ $(function () { text: 'Top File Types by Size' }, maintainAspectRatio: false, - responsive: true + responsive: true, + onClick: function(event, clickedElements) { + if (clickedElements.length === 0) return; + var e = clickedElements[0]; + var ext = this.data.labels[e._index]; + //var size = this.data.datasets[0].data[e._index]; + if (ext == "NULL (no ext)") { + ext = "\"\""; + } + var pp = encodeURIComponent(escapeHTML(decodeURIComponent(path))); + window.location.href = "search.php?submitted=true&p=1&q=extension:" + ext + " AND parent_path:" + pp + "*&doctype=file"; + return false; + }, + onHover: function (event, legendItem, legend) { + $("#topFileTypesBySize-barChart").css("cursor", "pointer"); + }, + onLeave: function (event, legendItem, legend) { + $("#topFileTypesBySize-barChart").css("cursor", "default"); + } } var topFileTypesBySizebarChart = new Chart(topFileTypesBySizebarChartCanvas, { @@ -749,7 +799,7 @@ $(function () { ext = "\"\""; } var pp = encodeURIComponent(escapeHTML(decodeURIComponent(path))); - window.location.href = "search.php?submitted=true&p=1&q=extension:" + ext + " AND parent_path:" + pp + "*&sort=size&sortorder=desc&sort2=name&sortorder2=asc&doctype=file"; + window.location.href = "search.php?submitted=true&p=1&q=extension:" + ext + " AND parent_path:" + pp + "*&doctype=file"; return false; }, onHover: function (event, legendItem, legend) { @@ -778,7 +828,25 @@ $(function () { text: 'Top File Types by Count' }, maintainAspectRatio: false, - responsive: true + responsive: true, + onClick: function(event, clickedElements) { + if (clickedElements.length === 0) return; + var e = clickedElements[0]; + var ext = this.data.labels[e._index]; + //var size = this.data.datasets[0].data[e._index]; + if (ext == "NULL (no ext)") { + ext = "\"\""; + } + var pp = encodeURIComponent(escapeHTML(decodeURIComponent(path))); + window.location.href = "search.php?submitted=true&p=1&q=extension:" + ext + " AND parent_path:" + pp + "*&doctype=file"; + return false; + }, + onHover: function (event, legendItem, legend) { + $("#topFileTypesByCount-pieChart").css("cursor", "pointer"); + }, + onLeave: function (event, legendItem, legend) { + $("#topFileTypesByCount-pieChart").css("cursor", "default"); + } } var topFileTypesByCountpieChart = new Chart(topFileTypesByCountpieChartCanvas, { @@ -892,7 +960,34 @@ $(function () { display: true, text: 'File Age by Size' }, - maintainAspectRatio: false + maintainAspectRatio: false, + onClick: function(event, clickedElements) { + if (clickedElements.length === 0) return; + var activeElement = mtimebarChart.getElementAtEvent(event); + var mtime = this.data.datasets[activeElement[0]._datasetIndex].label; + if (mtime == "0 - 30 days") { + mtime = "[now/m-1M/d TO now/m}" + } else if (mtime == "30 - 90 days") { + mtime = "[now/m-3M/d TO now/m-1M/d}" + } else if (mtime == "90 - 180 days") { + mtime = "[now/m-6M/d TO now/m-3M/d}" + } else if (mtime == "180 days - 1 year") { + mtime = "[now/m-1y/d TO now/m-6M/d}" + } else if (mtime == "1 - 2 years") { + mtime = "[now/m-2y/d TO now/m-1y/d}" + } else if (mtime == "> 2 years") { + mtime = "[* TO now/m-2y/d}" + } + var pp = encodeURIComponent(escapeHTML(decodeURIComponent(path))); + window.location.href = "search.php?submitted=true&p=1&q=mtime:" + mtime + " AND parent_path:" + pp + "*&doctype=file"; + return false; + }, + onHover: function (event, legendItem, legend) { + $("#mtime-barChart").css("cursor", "pointer"); + }, + onLeave: function (event, legendItem, legend) { + $("#mtime-barChart").css("cursor", "default"); + } } var mtimebarChart = new Chart(mtimebarChartCanvas, { diff --git a/diskover-web/public/js/treelist.js b/diskover-web/public/js/treelist.js index dd92dc4d..d5111b7c 100644 --- a/diskover-web/public/js/treelist.js +++ b/diskover-web/public/js/treelist.js @@ -3,7 +3,7 @@ diskover-web community edition (ce) https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ diff --git a/diskover-web/public/login.php b/diskover-web/public/login.php index 7f130b75..bd67580b 100644 --- a/diskover-web/public/login.php +++ b/diskover-web/public/login.php @@ -4,7 +4,7 @@ https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ diff --git a/diskover-web/public/logout.php b/diskover-web/public/logout.php index ea4993e2..62fb6a79 100644 --- a/diskover-web/public/logout.php +++ b/diskover-web/public/logout.php @@ -4,7 +4,7 @@ https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ diff --git a/diskover-web/public/modals.php b/diskover-web/public/modals.php index c3cff2b8..e007f4e8 100644 --- a/diskover-web/public/modals.php +++ b/diskover-web/public/modals.php @@ -4,7 +4,7 @@ https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ diff --git a/diskover-web/public/nav.php b/diskover-web/public/nav.php index cb12ba7a..31246ad7 100644 --- a/diskover-web/public/nav.php +++ b/diskover-web/public/nav.php @@ -4,7 +4,7 @@ https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ diff --git a/diskover-web/public/password.php b/diskover-web/public/password.php index 122f74e3..b78fa944 100644 --- a/diskover-web/public/password.php +++ b/diskover-web/public/password.php @@ -4,7 +4,7 @@ https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ diff --git a/diskover-web/public/results.php b/diskover-web/public/results.php index 7c419ed9..2e7d58e7 100644 --- a/diskover-web/public/results.php +++ b/diskover-web/public/results.php @@ -4,7 +4,7 @@ https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ diff --git a/diskover-web/public/savesearchfilters.php b/diskover-web/public/savesearchfilters.php index d4b6e844..13473385 100644 --- a/diskover-web/public/savesearchfilters.php +++ b/diskover-web/public/savesearchfilters.php @@ -4,7 +4,7 @@ https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ diff --git a/diskover-web/public/search.php b/diskover-web/public/search.php index 7781b3b8..4dba26bc 100644 --- a/diskover-web/public/search.php +++ b/diskover-web/public/search.php @@ -4,7 +4,7 @@ https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ diff --git a/diskover-web/public/searchfilters.php b/diskover-web/public/searchfilters.php index bbeef39a..505e6db6 100644 --- a/diskover-web/public/searchfilters.php +++ b/diskover-web/public/searchfilters.php @@ -4,7 +4,7 @@ https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ diff --git a/diskover-web/public/searchkeypress.php b/diskover-web/public/searchkeypress.php index f1f21fb8..4eda2d25 100644 --- a/diskover-web/public/searchkeypress.php +++ b/diskover-web/public/searchkeypress.php @@ -4,7 +4,7 @@ https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ diff --git a/diskover-web/public/selectindices.php b/diskover-web/public/selectindices.php index dba723b8..d6844c12 100644 --- a/diskover-web/public/selectindices.php +++ b/diskover-web/public/selectindices.php @@ -4,7 +4,7 @@ https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ diff --git a/diskover-web/public/settings.php b/diskover-web/public/settings.php index 89713f2d..e212fdb5 100644 --- a/diskover-web/public/settings.php +++ b/diskover-web/public/settings.php @@ -4,7 +4,7 @@ https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ @@ -95,7 +95,8 @@ function gtag(){dataLayer.push(arguments);} } ?>" size="1"> 
- +
+ If the file systems being indexed contain hardlinks, check this to show allocated sizes.
@@ -176,7 +177,7 @@ function gtag(){dataLayer.push(arguments);}

Send anonymous usage data

> -

Send anonymous usage data to Diskover Data to help improve diskover. No personal information is sent.

+

Send anonymous usage data to Diskover Data to help improve diskover. No personal information is sent.

diff --git a/diskover-web/public/view.php b/diskover-web/public/view.php index b570c09c..89eab1eb 100644 --- a/diskover-web/public/view.php +++ b/diskover-web/public/view.php @@ -4,7 +4,7 @@ https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ diff --git a/diskover-web/src/diskover/Auth.php b/diskover-web/src/diskover/Auth.php index 8a24cbf6..858023cc 100644 --- a/diskover-web/src/diskover/Auth.php +++ b/diskover-web/src/diskover/Auth.php @@ -4,7 +4,7 @@ https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ diff --git a/diskover-web/src/diskover/Config.php b/diskover-web/src/diskover/Config.php index df7e32ce..9cba45c1 100644 --- a/diskover-web/src/diskover/Config.php +++ b/diskover-web/src/diskover/Config.php @@ -4,7 +4,7 @@ https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ diff --git a/diskover-web/src/diskover/Constants.php.sample b/diskover-web/src/diskover/Constants.php.sample index 5c945ac7..5dd5500a 100644 --- a/diskover-web/src/diskover/Constants.php.sample +++ b/diskover-web/src/diskover/Constants.php.sample @@ -4,7 +4,7 @@ diskover-web community edition (ce) https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ @@ -55,6 +55,7 @@ class Constants { const SEARCH_RESULTS = 50; // default size field (size, size_du) to use for sizes on file tree and charts + // if the file systems being indexed contain hardlinks, set this to size_du to use allocated sizes const SIZE_FIELD = 'size'; // default file types, used by quick search (file type) and dashboard file type usage chart diff --git a/diskover-web/src/diskover/Diskover.php b/diskover-web/src/diskover/Diskover.php index 4f8c6215..73a1deb7 100644 --- a/diskover-web/src/diskover/Diskover.php +++ b/diskover-web/src/diskover/Diskover.php @@ -4,7 +4,7 @@ https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ diff --git a/diskover-web/src/diskover/Login.php b/diskover-web/src/diskover/Login.php index 734bcccf..0274fd0e 100644 --- a/diskover-web/src/diskover/Login.php +++ b/diskover-web/src/diskover/Login.php @@ -4,7 +4,7 @@ https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ diff --git a/diskover-web/src/diskover/User.php b/diskover-web/src/diskover/User.php index 7590ae59..1dcf43a6 100644 --- a/diskover-web/src/diskover/User.php +++ b/diskover-web/src/diskover/User.php @@ -4,7 +4,7 @@ https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ diff --git a/diskover-web/src/diskover/UserDatabase.php b/diskover-web/src/diskover/UserDatabase.php index 63468fdf..7b0048f1 100644 --- a/diskover-web/src/diskover/UserDatabase.php +++ b/diskover-web/src/diskover/UserDatabase.php @@ -4,7 +4,7 @@ https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ diff --git a/diskover-web/src/diskover/config_defaults.php b/diskover-web/src/diskover/config_defaults.php index fdb1fd8c..9d5004cd 100644 --- a/diskover-web/src/diskover/config_defaults.php +++ b/diskover-web/src/diskover/config_defaults.php @@ -4,7 +4,7 @@ https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ diff --git a/diskover-web/src/diskover/config_inc.php b/diskover-web/src/diskover/config_inc.php index bb77377b..3325525d 100644 --- a/diskover-web/src/diskover/config_inc.php +++ b/diskover-web/src/diskover/config_inc.php @@ -4,7 +4,7 @@ https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ diff --git a/diskover-web/src/diskover/version.php b/diskover-web/src/diskover/version.php index 9dd101d8..9770235b 100644 --- a/diskover-web/src/diskover/version.php +++ b/diskover-web/src/diskover/version.php @@ -4,7 +4,7 @@ https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ @@ -17,4 +17,4 @@ */ // diskover-web version -$VERSION = '2.0.3 community edition (ce)'; \ No newline at end of file +$VERSION = '2.0.4 community edition (ce)'; \ No newline at end of file diff --git a/diskover/CHANGELOG.md b/diskover/CHANGELOG.md index 633e999d..944175df 100644 --- a/diskover/CHANGELOG.md +++ b/diskover/CHANGELOG.md @@ -1,5 +1,11 @@ # Diskover v2 Community Edition Change Log +# [2.0.4] - 2022-09-19 +### fixed +- issue with replace paths config setting and using / as from path +- issue with ES bulk indexing and unicode encode error caused scan to crash + + # [2.0.3] - 2022-07-20 ### fixed - Windows scanning issue causing directories not to be found (long path fix) diff --git a/diskover/diskover.py b/diskover/diskover.py index 332eaa4d..84fae8cc 100644 --- a/diskover/diskover.py +++ b/diskover/diskover.py @@ -4,7 +4,7 @@ https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ @@ -40,7 +40,7 @@ get_file_name, load_plugins, list_plugins, get_plugins_info, set_times, \ get_mem_usage, get_win_path, rem_win_path -version = '2.0.3 community edition (ce)' +version = '2.0.4 community edition (ce)' __version__ = version # Windows check @@ -262,12 +262,16 @@ def close_app_critical_error(): pass os._exit(1) - + def start_bulk_upload(thread, root, docs): + """Bulk uploads docs to es index.""" global bulktime + global warnings + + doccount = len(docs) if DEBUG: - logger.debug('[{0}] bulk uploading {1} docs to ES...'.format(thread, len(docs))) + logger.debug('[{0}] bulk uploading {1} docs to ES...'.format(thread, doccount)) es_upload_start = time.time() try: bulk_upload(es, options.index, docs) @@ -276,13 +280,32 @@ def start_bulk_upload(thread, root, docs): logger.critical(logmsg, exc_info=1) if logtofile: logger_warn.critical(logmsg, exc_info=1) close_app_critical_error() - else: - es_upload_time = time.time() - es_upload_start - if DEBUG: - logger.debug('[{0}] bulk uploading completed in {1:.3f}s'.format( - thread, es_upload_time)) + except UnicodeEncodeError: + logmsg = '[{0}] Elasticsearch bulk index unicode encode error. Will try to index each doc individually.'.format(thread) + logger.warning(logmsg) + if logtofile: logger_warn.warning(logmsg) with crawl_thread_lock: - bulktime[root] += es_upload_time + warnings += 1 + for doc in docs: + try: + es.index(options.index, doc) + except UnicodeEncodeError: + file = os.path.join(doc['parent_path'], doc['name']) + logmsg = '[{0}] Elasticsearch index unicode encode error for {1}'.format(thread, file) + logger.warning(logmsg) + if logtofile: logger_warn.warning(logmsg) + with crawl_thread_lock: + warnings += 1 + doccount -= 1 + pass + es_upload_time = time.time() - es_upload_start + if DEBUG: + logger.debug('[{0}] bulk uploading {1} docs completed in {2:.3f}s'.format( + thread, doccount, es_upload_time)) + with crawl_thread_lock: + bulktime[root] += es_upload_time + + return doccount def log_stats_thread(root): @@ -549,7 +572,7 @@ def get_tree_size(thread, root, top, path, docs, sizes, inodes, depth=0, maxdept docs.append(data.copy()) doc_count = len(docs) if doc_count >= es_chunksize: - start_bulk_upload(thread, root, docs) + doc_count = start_bulk_upload(thread, root, docs) tot_doc_count += doc_count docs.clear() @@ -671,7 +694,7 @@ def get_tree_size(thread, root, top, path, docs, sizes, inodes, depth=0, maxdept docs.append(data.copy()) doc_count = len(docs) if doc_count >= es_chunksize: - start_bulk_upload(thread, root, docs) + doc_count = start_bulk_upload(thread, root, docs) tot_doc_count += doc_count docs.clear() @@ -744,7 +767,7 @@ def crawl_thread(root, top, depth, maxdepth, sizes, inodes): size, size_du, file_count, dir_count = get_tree_size(thread, root, top, top, docs, sizes, inodes, depth, maxdepth) doc_count = len(docs) if doc_count > 0: - start_bulk_upload(thread, root, docs) + doc_count = start_bulk_upload(thread, root, docs) with crawl_thread_lock: total_doc_count[root] += doc_count docs.clear() diff --git a/diskover/diskover_elasticsearch.py b/diskover/diskover_elasticsearch.py index 1c1f221e..f98de927 100644 --- a/diskover/diskover_elasticsearch.py +++ b/diskover/diskover_elasticsearch.py @@ -4,7 +4,7 @@ https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ @@ -24,7 +24,6 @@ import elasticsearch import warnings from elasticsearch import helpers -from elasticsearch.helpers.errors import BulkIndexError from diskover_helpers import load_plugins @@ -399,14 +398,9 @@ def bulk_upload(es, indexname, docs): # wait for es health to be at least yellow es.cluster.health(wait_for_status='yellow', request_timeout=es_timeout) - try: - # bulk load data to Elasticsearch index - helpers.bulk(es, docs, index=indexname, - chunk_size=es_chunksize, request_timeout=es_timeout) - except BulkIndexError as e: - logger.critical( - 'ERROR: Elasticsearch bulk index error! ({})'.format(e)) - raise BulkIndexError(e) + # bulk load data to Elasticsearch index + helpers.bulk(es, docs, index=indexname, + chunk_size=es_chunksize, request_timeout=es_timeout) def tune_index(es, indexname, defaults=False): diff --git a/diskover/diskover_helpers.py b/diskover/diskover_helpers.py index 02440a7b..14478663 100644 --- a/diskover/diskover_helpers.py +++ b/diskover/diskover_helpers.py @@ -4,7 +4,7 @@ https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com -Copyright 2017-2021 Diskover Data, Inc. +Copyright 2017-2022 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ @@ -389,6 +389,7 @@ def replace_path(path): path = path.replace('\\', '/') if replacepaths_from and replacepaths_to: path = path.replace(replacepaths_from, replacepaths_to, 1) + path = path.rstrip('/') return path