Add instance selection to modlog
This commit is contained in:
1 parent
e5d7e7824e
commit
189a4e1e32
2 files changed
+19
-1
No files matched your search
@@ -74,6 +74,22 @@
|
||||
</Select>
|
||||
</div>
|
||||
<div class="flex flex-col md:flex-row md:items-center gap-2 w-full">
|
||||
<ObjectAutocomplete
|
||||
type="instance"
|
||||
placeholder="Filter by instance"
|
||||
jwt={$profile?.jwt}
|
||||
showWhenEmpty={true}
|
||||
label="Instance"
|
||||
class="flex-1"
|
||||
q={$page.url.searchParams.get('instance') || ''}
|
||||
on:select={(e) =>
|
||||
searchParam(
|
||||
$page.url,
|
||||
'instance',
|
||||
e.detail?.domain.toString() ?? '',
|
||||
'page', 'community', 'user', 'mod_id'
|
||||
)}
|
||||
/>
|
||||
<ObjectAutocomplete
|
||||
placeholder="Filter by community"
|
||||
jwt={$profile?.jwt}
|
||||
@@ -91,6 +107,7 @@
|
||||
)}
|
||||
/>
|
||||
<UserAutocomplete
|
||||
instance={$page.url.searchParams.get('instance') || undefined}
|
||||
placeholder="Filter by user"
|
||||
jwt={$profile?.jwt}
|
||||
listing_type="All"
|
||||
|
||||
@@ -203,6 +203,7 @@ export const _toModLog = (item: ModAction): ModLog => {
|
||||
}
|
||||
|
||||
export async function load({ url }) {
|
||||
let instance = url.searchParams.get('instance') || undefined
|
||||
let community = Number(url.searchParams.get('community')) || undefined
|
||||
let user = Number(url.searchParams.get('user')) || undefined
|
||||
let modId = Number(url.searchParams.get('mod_id')) || undefined
|
||||
@@ -210,7 +211,7 @@ export async function load({ url }) {
|
||||
let type: ModlogActionType =
|
||||
(url.searchParams.get('type') as ModlogActionType) || 'All'
|
||||
|
||||
const results = await getClient().getModlog({
|
||||
const results = await getClient(instance).getModlog({
|
||||
community_id: community,
|
||||
limit: 40,
|
||||
type_: type,
|
||||
|
||||
Reference in new issue
Block a user