TMP: initial draft of scheduled-posts page

This commit is contained in:
TAKAHASHI Shuuji 2024-03-04 12:51:40 +09:00
parent 2e81f4180b
commit 4ef4ce21fc
No known key found for this signature in database
GPG key ID: F15C887632129F5E

33
pages/scheduled-posts.vue Normal file
View file

@ -0,0 +1,33 @@
<script setup lang="ts">
const client = useMastoClient()
const scheduledPosts = await client.v1.scheduledStatuses.list()
function cancelSchedule(id: string) {
client.v1.scheduledStatuses.$select(id).remove()
}
</script>
<template>
<div v-for="scheduledPost in scheduledPosts" :key="scheduledPost.id" p4>
<div flex items-center p2>
<div i-ri:calendar-schedule-line me-2 />
Scheduled: {{ new Date(scheduledPost.scheduledAt).toLocaleString() }}
</div>
<p p2>
{{ scheduledPost.params.text }}
</p>
<p>
<button
px3 py1 border-3 rounded-3 bg-primary text-white
@click="cancelSchedule(scheduledPost.id)"
>
Cancel schedule
</button>
</p>
<details>
<blockquote border-1 p2>
<code>{{ scheduledPost }}</code>
</blockquote>
</details>
</div>
</template>