diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a264f8..9cb849f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ## Changelog +* 2.9.8 + - fixed wrong duration for shards (#157) + * 2.9.7 - fixed eol for unix diff --git a/lib/utils/util.js b/lib/utils/util.js index 7e617b6..cad049d 100644 --- a/lib/utils/util.js +++ b/lib/utils/util.js @@ -338,15 +338,16 @@ const Util = { }, getDuration: (dateRanges, durationStrategy) => { - dateRanges.sort((a, b) => { - if (a.start === b.start) { - return a.end - b.end; - } - return a.start - b.start; - }); if (durationStrategy === 'exclude-idle') { + dateRanges.sort((a, b) => { + if (a.start === b.start) { + return a.end - b.end; + } + return a.start - b.start; + }); + dateRanges.reduce((prevRange, range) => { // same start if (range.start === prevRange.start) { @@ -387,8 +388,8 @@ const Util = { return duration; } // normal - const dateStart = dateRanges[0].start; - const endDate = dateRanges[dateRanges.length - 1].end; + const dateStart = Math.min.apply(null, dateRanges.map((it) => it.start)); + const endDate = Math.max.apply(null, dateRanges.map((it) => it.end)); const duration = endDate - dateStart; return duration; }, diff --git a/package.json b/package.json index d0b5d8f..d73166f 100644 --- a/package.json +++ b/package.json @@ -49,27 +49,27 @@ "lz-utils": "^2.1.0", "monocart-coverage-reports": "^2.11.1", "monocart-locator": "^1.0.2", - "nodemailer": "^6.9.15" + "nodemailer": "^6.9.16" }, "devDependencies": { - "@babel/code-frame": "^7.25.7", - "@playwright/test": "^1.48.0", + "@babel/code-frame": "^7.26.2", + "@playwright/test": "^1.48.2", "ansi-to-html": "^0.7.2", "async-tick": "^1.0.0", "autolinker": "^4.0.0", "axios": "^1.7.7", "commander": "^12.1.0", "dotenv": "^16.4.5", - "eslint": "^9.12.0", + "eslint": "^9.14.0", "eslint-config-plus": "^2.0.2", "eslint-plugin-html": "^8.1.2", - "eslint-plugin-vue": "^9.28.0", + "eslint-plugin-vue": "^9.30.0", "file-saver": "^2.0.5", "find-up": "^7.0.0", "github-markdown-css": "^5.7.0", "glob": "^11.0.0", - "marked": "^14.1.2", - "mermaid": "^11.3.0", + "marked": "^14.1.3", + "mermaid": "^11.4.0", "mitt": "^3.0.1", "monocart-code-viewer": "^1.1.4", "monocart-formatter": "^3.0.0", @@ -78,12 +78,12 @@ "open": "8.4.2", "sanitize-filename": "^1.6.3", "stack-utils": "^2.0.6", - "stylelint": "^16.9.0", + "stylelint": "^16.10.0", "stylelint-config-plus": "^1.1.3", "supports-color": "^9.4.0", "turbogrid": "^3.2.0", "vine-ui": "^3.1.16", "ws": "^8.18.0", - "yazl": "^2.5.1" + "yazl": "^3.2.1" } } diff --git a/packages/app/src/components/detail/attachments/audit.vue b/packages/app/src/components/detail/attachments/audit.vue index 8823c88..4a07e36 100644 --- a/packages/app/src/components/detail/attachments/audit.vue +++ b/packages/app/src/components/detail/attachments/audit.vue @@ -38,29 +38,32 @@ watchEffect(() => {