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”
|
> 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
|
### Packages to release
|
||||||
|
|
||||||
> When modifying a package, add it here with its release type.
|
> When modifying a package, add it here with its release type.
|
||||||
|
|||||||
@@ -209,7 +209,7 @@ export default {
|
|||||||
},
|
},
|
||||||
'start'
|
'start'
|
||||||
)
|
)
|
||||||
let j =
|
const j =
|
||||||
before === undefined
|
before === undefined
|
||||||
? logs.length
|
? logs.length
|
||||||
: sortedIndexBy(
|
: sortedIndexBy(
|
||||||
@@ -220,11 +220,7 @@ export default {
|
|||||||
'start'
|
'start'
|
||||||
)
|
)
|
||||||
|
|
||||||
limit += i
|
logs = logs.slice(Math.max(i, j - limit), j)
|
||||||
if (limit < j) {
|
|
||||||
j = limit
|
|
||||||
}
|
|
||||||
logs = logs.slice(i, j)
|
|
||||||
|
|
||||||
return logs
|
return logs
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user