1
0
mirror of https://github.com/axllent/mailpit.git synced 2025-06-15 00:05:15 +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:
Yuuki Takahashi
2024-06-01 20:32:11 +09:00
committed by Ralph Slooten
parent 31390e4b82
commit e87b98b73b
11 changed files with 106 additions and 21 deletions

View File

@ -2,6 +2,7 @@
import { mailbox } from '../stores/mailbox'
import CommonMixins from '../mixins/CommonMixins'
import dayjs from 'dayjs'
import {pagination} from "../stores/pagination";
export default {
mixins: [
@ -99,6 +100,14 @@ export default {
}
}
},
toTagUrl: function (t) {
const params = new URLSearchParams({
start: String(0),
limit: pagination.limit.toString(),
})
return '/search?q=' + this.tagEncodeURI(t) + '&' + params.toString()
},
}
}
</script>
@ -143,7 +152,7 @@ export default {
{{ message.Snippet }}
</div>
<div v-if="message.Tags.length">
<RouterLink class="badge me-1" v-for="t in message.Tags" :to="'/search?q=' + tagEncodeURI(t)"
<RouterLink class="badge me-1" v-for="t in message.Tags" :to="toTagUrl(t)"
:style="mailbox.showTagColors ? { backgroundColor: colorHash(t) } : { backgroundColor: '#6c757d' }"
:title="'Filter messages tagged with ' + t">
{{ t }}