mirror of
https://codeberg.org/nobody/LocalCDN.git
synced 2025-01-23 07:51:48 +01:00
Improved display of bundles on the statistics page
This commit is contained in:
parent
a083de7d43
commit
25638f8a44
@ -26,29 +26,30 @@ var targets = {};
|
||||
|
||||
targets.determineBundle = function (path) {
|
||||
path = path.replace('resources', '');
|
||||
let val = '';
|
||||
if (path.startsWith('/findify')) {
|
||||
return 'Findify';
|
||||
val = 'Findify';
|
||||
} else if (path.startsWith('/bootstrap-datepicker')) {
|
||||
return 'Bootstrap Datepicker';
|
||||
val = 'Bootstrap Datepicker';
|
||||
} else if (path.startsWith('/jquery.lazy/')) {
|
||||
return 'jQuery Lazy';
|
||||
val = 'jQuery Lazy';
|
||||
} else if (path.startsWith('/waypoints/')) {
|
||||
return 'Waypoints';
|
||||
val = 'Waypoints';
|
||||
} else if (path.startsWith('/highlight.js/')) {
|
||||
return 'highlight.js';
|
||||
val = 'highlight.js';
|
||||
} else if (path.startsWith('/element-ui/')) {
|
||||
return 'ElementUI';
|
||||
val = 'ElementUI';
|
||||
} else if (path.startsWith('/select2/')) {
|
||||
return 'Select2';
|
||||
val = 'Select2';
|
||||
} else if (path.startsWith('/gsap/')) {
|
||||
return 'GSAP';
|
||||
val = 'GSAP';
|
||||
} else if (Regex.FONT_AWESOME_FONTS_ONLY.test(path)) {
|
||||
return 'Font Awesome (Fonts)';
|
||||
val = 'Font Awesome (Fonts)';
|
||||
} else if (Regex.BOOTSTRAP_FONTS_ONLY.test(path)) {
|
||||
return 'Bootstrap (Fonts)';
|
||||
} else {
|
||||
return '';
|
||||
val = 'Bootstrap (Fonts)';
|
||||
}
|
||||
|
||||
return val === '' ? val : val + ' (Bundle)';
|
||||
};
|
||||
|
||||
targets.setLastVersion = function (type, version) {
|
||||
@ -502,6 +503,7 @@ targets.determineResourceName = function (filename) {
|
||||
};
|
||||
|
||||
const ListOfFiles = {
|
||||
'highlight.min.jsm': 'highlight.js (Bundle)',
|
||||
'jquery.cookie.min.jsm': 'jquery-cookie',
|
||||
'jquery.scrollbar.min.jsm': 'jQuery Scrollbar',
|
||||
'dayjs.min.jsm': 'Day.js',
|
||||
|
@ -89,6 +89,11 @@ statistics._filterAndSortData = function () {
|
||||
|
||||
statistics._mergeObjects = function (obj, arr) {
|
||||
for (let [key, value] of Object.entries(obj)) {
|
||||
let bundle = targets.determineBundle(key);
|
||||
if (bundle !== '') {
|
||||
bundle = key.split('/');
|
||||
key = bundle[0] + '/' + bundle[1] + '/' + bundle[2] + '/';
|
||||
}
|
||||
// If CDN/Framework exists, add it, otherwise create new one
|
||||
if (arr[key]) {
|
||||
arr[key] += value;
|
||||
|
Loading…
Reference in New Issue
Block a user