Adds Messaging streaming
This commit is contained in:
@@ -2,7 +2,12 @@
|
||||
|
||||
<div class="shadow-lg rounded-lg">
|
||||
|
||||
<div class="text-lg font-bold">{{ props.content.title }}</div>
|
||||
<div class="text-lg font-bold">
|
||||
{{ props.content.title }}
|
||||
<span class="text-md-caption">
|
||||
{{ time_ago(props.content.createdAt) }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="h-48 object-cover bg-purple rounded-md">
|
||||
|
||||
@@ -39,11 +44,11 @@
|
||||
|
||||
<div class="border-b p-6">
|
||||
<h2 class="font-sans font-semibold">Commentaires</h2>
|
||||
<MessageList :content-id="props.content.id">
|
||||
<MessageList :subject-id="props.content.id">
|
||||
</MessageList>
|
||||
</div>
|
||||
<div class="border-b-2 p-6">
|
||||
<PostMessage :content-id="props.content.id">
|
||||
<PostMessage :subject-id="props.content.id">
|
||||
</PostMessage>
|
||||
</div>
|
||||
</div>
|
||||
@@ -57,6 +62,7 @@
|
||||
import {defineProps, computed} from 'vue';
|
||||
import MessageList from "@/views/messages/MessageList.vue";
|
||||
import PostMessage from "@/views/messages/PostMessage.vue";
|
||||
import {time_ago} from "@/internal_time_ago.js";
|
||||
|
||||
const isHttpUrl = computed(() => props.content?.uri?.startsWith('http'))
|
||||
|
||||
|
||||
@@ -37,13 +37,13 @@ const props = defineProps({
|
||||
|
||||
const client = useClient()
|
||||
const contents = ref([])
|
||||
const max_items = 10
|
||||
const page_size = 10
|
||||
const errorMessage = ref()
|
||||
let last_id = null
|
||||
|
||||
async function load({done}) {
|
||||
try {
|
||||
let uri = `/api/contents/user/${props.creatorId}?max_items=${max_items}`
|
||||
let uri = `/api/contents/user/${props.creatorId}?page_size=${page_size}`
|
||||
if (last_id !== null) uri = uri + `&last_id=${last_id}`
|
||||
|
||||
console.log(`Fetching content at: ${uri}`)
|
||||
@@ -59,7 +59,7 @@ async function load({done}) {
|
||||
last_id = last_content.id
|
||||
}
|
||||
|
||||
if (contentCount < max_items)
|
||||
if (contentCount < page_size)
|
||||
done('empty')
|
||||
else
|
||||
done('ok')
|
||||
|
||||
Reference in New Issue
Block a user