feat: support more actions for user

This commit is contained in:
三咲智子 2022-11-26 20:58:10 +08:00
parent 3d7d2ca405
commit 84478984dc
No known key found for this signature in database
GPG key ID: 69992F2250DFD93E
12 changed files with 184 additions and 37 deletions

View file

@ -10,7 +10,7 @@ const { data: context } = useAsyncData(`context:${id}`, () => masto.statuses.fet
</script>
<template>
<MainContent>
<MainContent back>
<template v-if="status">
<template v-if="context">
<template v-for="comment of context?.ancestors" :key="comment.id">

View file

@ -12,7 +12,11 @@ if (account) {
</script>
<template>
<MainContent>
<MainContent back>
<template #title>
<span text-lg font-bold>{{ account ? getDisplayName(account) : 'Profile' }}</span>
</template>
<template v-if="account">
<AccountHeader :account="account" border="b base" />
<NuxtPage />

20
pages/blocks.vue Normal file
View file

@ -0,0 +1,20 @@
<script setup lang="ts">
definePageMeta({
middleware: 'auth',
})
const paginator = masto.blocks.getIterator()
useHead({
title: 'Blocked users',
})
</script>
<template>
<MainContent back>
<template #title>
<span text-lg font-bold>Blocked users</span>
</template>
<AccountPaginator :paginator="paginator" />
</MainContent>
</template>

34
pages/domain_blocks.vue Normal file
View file

@ -0,0 +1,34 @@
<script setup lang="ts">
definePageMeta({
middleware: 'auth',
})
const paginator = masto.domainBlocks.getIterator()
useHead({
title: 'Blocked domains',
})
const unblock = async (domain: string) => {
await masto.domainBlocks.unblock(domain)
}
</script>
<template>
<MainContent back>
<template #title>
<span text-lg font-bold>Blocked domains</span>
</template>
<CommonPaginator :paginator="paginator">
<template #default="{ item }">
<CommonDropdownItem class="!cursor-auto">
{{ item }}
<template #actions>
<div i-ri:lock-unlock-line text-primary cursor-pointer @click="unblock(item)" />
</template>
</CommonDropdownItem>
</template>
</CommonPaginator>
</MainContent>
</template>

20
pages/mutes.vue Normal file
View file

@ -0,0 +1,20 @@
<script setup lang="ts">
definePageMeta({
middleware: 'auth',
})
const paginator = masto.mutes.getIterator()
useHead({
title: 'Muted users',
})
</script>
<template>
<MainContent back>
<template #title>
<span text-lg font-bold>Muted users</span>
</template>
<AccountPaginator :paginator="paginator" />
</MainContent>
</template>

22
pages/pinned.vue Normal file
View file

@ -0,0 +1,22 @@
<script setup lang="ts">
definePageMeta({
middleware: 'auth',
})
const paginator = masto.accounts.getStatusesIterable(currentUser.value!.account.id, { pinned: true })
useHead({
title: 'Pinned',
})
</script>
<template>
<MainContent>
<template #title>
<div i-ri:pushpin-line h-6 mr-1 />
<span>Pinned</span>
</template>
<TimelinePaginator :paginator="paginator" />
</MainContent>
</template>

View file

@ -2,16 +2,16 @@
const paginator = masto.timelines.getPublicIterable()
useHead({
title: 'Federated'
title: 'Federated',
})
</script>
<template>
<MainContent>
<template #title>
<span text-lg font-bold>Federated Timeline</span>
<span text-lg font-bold>Federated Timeline</span>
</template>
<slot>
<TimelinePaginator :paginator="paginator" />
</slot>

View file

@ -10,7 +10,7 @@ useHead({
</script>
<template>
<MainContent>
<MainContent back>
<template #title>
<span text-lg font-bold>#{{ tag }}</span>
</template>