mirror of
https://github.com/elk-zone/elk.git
synced 2024-11-22 01:15:25 +03:00
TMP: initial draft of scheduled-posts page
This commit is contained in:
parent
2e81f4180b
commit
4ef4ce21fc
1 changed files with 33 additions and 0 deletions
33
pages/scheduled-posts.vue
Normal file
33
pages/scheduled-posts.vue
Normal 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>
|
Loading…
Reference in a new issue