Fix requests offenders

This commit is contained in:
Gaël Métais
2015-06-19 18:45:34 +02:00
parent 2620f75955
commit 8d4a0c34e7
3 changed files with 3 additions and 4 deletions
+1 -2
View File
@@ -137,9 +137,8 @@
<file-and-line-button file="offender.file" line="offender.line" column="offender.column"></file-and-line-button>
</div>
<div ng-if="policyName === 'requests' || policyName === 'smallJsFiles' || policyName === 'smallCssFiles' || policyName === 'smallImages'">
<div ng-if="policyName === 'requests'">
<url-link url="offender.file" max-length="100"></url-link>
<span ng-if="offender.size || offender.size === 0">({{offender.size}} KB)</span>
</div>
<div ng-if="policyName === 'notFound' || policyName === 'closedConnections' || policyName === 'multipleRequests' || policyName === 'cachingDisabled' || policyName === 'cachingNotSpecified'">
+1 -1
View File
@@ -900,7 +900,7 @@ var policies = {
"isBadThreshold": 100,
"isAbnormalThreshold": 200,
"hasOffenders": true,
"takeOffendersFrom": ["htmlCount", "jsCount", "cssCount", "imageCount", "webfontCount", "videoCount", "jsonCount", "jsonCount"],
"takeOffendersFrom": ["htmlCount", "jsCount", "cssCount", "imageCount", "webfontCount", "videoCount", "jsonCount", "otherCount"],
"offendersTransformFn": function(offenders) {
return {
count: offenders.length,
+1 -1
View File
@@ -168,7 +168,7 @@ var OffendersHelpers = function() {
};
this.fileWithSizePattern = function(fileWithSize) {
var parts = /^([^ ]*) \((\d+\.\d{2}) kB\)$/.exec(fileWithSize);
var parts = /^([^ ]*) \((\d+\.\d{2}|NaN) kB\)$/.exec(fileWithSize);
if (!parts) {
return {