fix(xo-server/rest-api): limit applies at the end for {backups,restore}/logs
Fixes https://xcp-ng.org/forum/post/64880
This commit is contained in:
@@ -11,6 +11,8 @@
|
||||
|
||||
> Users must be able to say: “I had this issue, happy to know it's fixed”
|
||||
|
||||
- [REST API] `limit` parameter now applies at the end of the `backups/logs` and `restore/logs` collections, i.e. it selects the last entries [Forum#64880](https://xcp-ng.org/forum/post/64880)
|
||||
|
||||
### Packages to release
|
||||
|
||||
> When modifying a package, add it here with its release type.
|
||||
|
||||
@@ -209,7 +209,7 @@ export default {
|
||||
},
|
||||
'start'
|
||||
)
|
||||
let j =
|
||||
const j =
|
||||
before === undefined
|
||||
? logs.length
|
||||
: sortedIndexBy(
|
||||
@@ -220,11 +220,7 @@ export default {
|
||||
'start'
|
||||
)
|
||||
|
||||
limit += i
|
||||
if (limit < j) {
|
||||
j = limit
|
||||
}
|
||||
logs = logs.slice(i, j)
|
||||
logs = logs.slice(Math.max(i, j - limit), j)
|
||||
|
||||
return logs
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user