mirror of
https://github.com/axllent/mailpit.git
synced 2025-07-15 01:25:10 +02:00
Feature: Add pagination & limits to URL parameters (#303)
* Set search conditions to query parameters * Fixed by review * Update query parameters when new message notified
This commit is contained in:
committed by
Ralph Slooten
parent
31390e4b82
commit
e87b98b73b
server/ui-src
@ -33,17 +33,25 @@ export default {
|
||||
|
||||
watch: {
|
||||
$route(to, from) {
|
||||
this.doSearch(true)
|
||||
this.doSearch()
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
const paginationParams = this.getPaginationParams()
|
||||
if (paginationParams?.start) {
|
||||
pagination.start = paginationParams.start
|
||||
}
|
||||
if (paginationParams?.limit) {
|
||||
pagination.limit = paginationParams.limit
|
||||
}
|
||||
|
||||
mailbox.searching = this.getSearch()
|
||||
this.doSearch(false)
|
||||
this.doSearch()
|
||||
},
|
||||
|
||||
methods: {
|
||||
doSearch: function (resetPagination) {
|
||||
doSearch: function () {
|
||||
let s = this.getSearch()
|
||||
|
||||
if (!s) {
|
||||
@ -54,10 +62,6 @@ export default {
|
||||
|
||||
mailbox.searching = s
|
||||
|
||||
if (resetPagination) {
|
||||
pagination.start = 0
|
||||
}
|
||||
|
||||
this.apiURI = this.resolve(`/api/v1/search`) + '?query=' + encodeURIComponent(s)
|
||||
if (mailbox.timeZone != '' && (s.indexOf('after:') != -1 || s.indexOf('before:') != -1)) {
|
||||
this.apiURI += '&tz=' + encodeURIComponent(mailbox.timeZone)
|
||||
|
Reference in New Issue
Block a user