Compare commits
No commits in common. "4da2ede58a9fe4faa766211fec7ca526dae933af" and "57f31d487e3ba45b0ad48caec05b686682c7750a" have entirely different histories.
4da2ede58a
...
57f31d487e
6 changed files with 16 additions and 18 deletions
|
@ -20,7 +20,7 @@ const route = useRoute();
|
||||||
|
|
||||||
async function generateInvite(): Promise<void> {
|
async function generateInvite(): Promise<void> {
|
||||||
const createdInvite: InviteResponse | undefined = await fetchWithApi(
|
const createdInvite: InviteResponse | undefined = await fetchWithApi(
|
||||||
`/guilds/${route.params.serverId}/invites`,
|
`/servers/${route.params.serverId}/invites`,
|
||||||
{ method: "POST", body: { custom_id: "oijewfoiewf" } }
|
{ method: "POST", body: { custom_id: "oijewfoiewf" } }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else ref="messageElement" class="message grouped-message">
|
<div v-else ref="messageElement" class="message compact-message">
|
||||||
<div class="left-column">
|
<div class="left-column">
|
||||||
<div>
|
<div>
|
||||||
<span :class="{ 'invisible': dateHidden }" class="message-date" :title="date.toString()">
|
<span :class="{ 'invisible': dateHidden }" class="message-date" :title="date.toString()">
|
||||||
|
@ -42,7 +42,7 @@ const props = defineProps<{
|
||||||
text: string,
|
text: string,
|
||||||
timestamp: number,
|
timestamp: number,
|
||||||
format: "12" | "24",
|
format: "12" | "24",
|
||||||
type: "normal" | "grouped",
|
type: "normal" | "compact",
|
||||||
marginBottom: boolean
|
marginBottom: boolean
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
|
|
|
@ -27,13 +27,12 @@ import scrollToBottom from '~/utils/scrollToBottom';
|
||||||
const props = defineProps<{ channelUrl: string, amount?: number, offset?: number }>();
|
const props = defineProps<{ channelUrl: string, amount?: number, offset?: number }>();
|
||||||
|
|
||||||
const messageTimestamps = ref<Record<string, number>>({});
|
const messageTimestamps = ref<Record<string, number>>({});
|
||||||
const messagesType = ref<Record<string, "normal" | "grouped">>({});
|
const messagesType = ref<Record<string, "normal" | "compact">>({});
|
||||||
|
|
||||||
const messagesRes: MessageResponse[] | undefined = await fetchWithApi(
|
const messagesRes: MessageResponse[] | undefined = await fetchWithApi(
|
||||||
`${props.channelUrl}/messages`,
|
`${props.channelUrl}/messages`,
|
||||||
{ query: { "amount": props.amount ?? 100, "offset": props.offset ?? 0 } }
|
{ query: { "amount": props.amount ?? 100, "offset": props.offset ?? 0 } }
|
||||||
);
|
);
|
||||||
|
|
||||||
if (messagesRes) {
|
if (messagesRes) {
|
||||||
messagesRes.reverse();
|
messagesRes.reverse();
|
||||||
console.log("messages res:", messagesRes.map(msg => msg.message));
|
console.log("messages res:", messagesRes.map(msg => msg.message));
|
||||||
|
@ -78,7 +77,7 @@ if (messagesRes) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
console.log("RETURNING " + lessThanMax.toString().toUpperCase());
|
console.log("RETURNING " + lessThanMax.toString().toUpperCase());
|
||||||
messagesType.value[message.uuid] = "grouped";
|
messagesType.value[message.uuid] = "compact";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
<Icon name="lucide:house" class="white" size="2rem" />
|
<Icon name="lucide:house" class="white" size="2rem" />
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
<div id="servers-list">
|
<div id="servers-list">
|
||||||
<NuxtLink v-for="guild of guilds" :href="`/servers/${guild.uuid}`">
|
<NuxtLink v-for="server of servers" :href="`/servers/${server.uuid}`">
|
||||||
<Icon name="lucide:server" class="white" size="2rem" />
|
<Icon name="lucide:server" class="white" size="2rem" />
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
</div>
|
</div>
|
||||||
|
@ -26,7 +26,7 @@ import type { GuildResponse } from '~/types/interfaces';
|
||||||
|
|
||||||
const loading = useState("loading", () => false);
|
const loading = useState("loading", () => false);
|
||||||
|
|
||||||
const guilds: GuildResponse[] | undefined = await fetchWithApi("/me/guilds");
|
const servers: GuildResponse[] | undefined = await fetchWithApi("/me/guilds");
|
||||||
|
|
||||||
//const servers = await fetchWithApi("/servers") as { uuid: string, name: string, description: string }[];
|
//const servers = await fetchWithApi("/servers") as { uuid: string, name: string, description: string }[];
|
||||||
//console.log("servers:", servers);
|
//console.log("servers:", servers);
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<h3>
|
<h3>
|
||||||
{{ server?.name }}
|
{{ server?.name }}
|
||||||
<span>
|
<span>
|
||||||
<button @click="showGuildSettings">
|
<button @click="showServerSettings">
|
||||||
<Icon name="lucide:settings" />
|
<Icon name="lucide:settings" />
|
||||||
</button>
|
</button>
|
||||||
</span>
|
</span>
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
<div id="channels-list">
|
<div id="channels-list">
|
||||||
<Channel v-for="channel of channels" :name="channel.name"
|
<Channel v-for="channel of channels" :name="channel.name"
|
||||||
:uuid="channel.uuid" :current-uuid="(route.params.channelId as string)"
|
:uuid="channel.uuid" :current-uuid="(route.params.channelId as string)"
|
||||||
:href="`/servers/${route.params.serverId}/channels/${channel.uuid}`" />
|
:href="`/guilds/${route.params.serverId}/channels/${channel.uuid}`" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<MessageArea :channel-url="channelUrlPath" />
|
<MessageArea :channel-url="channelUrlPath" />
|
||||||
|
@ -40,7 +40,7 @@ const route = useRoute();
|
||||||
|
|
||||||
const loading = useState("loading");
|
const loading = useState("loading");
|
||||||
|
|
||||||
const channelUrlPath = `channels/${route.params.channelId}`;
|
const channelUrlPath = `/channels/${route.params.channelId}`;
|
||||||
|
|
||||||
const server = ref<GuildResponse | undefined>();
|
const server = ref<GuildResponse | undefined>();
|
||||||
const channels = ref<ChannelResponse[] | undefined>();
|
const channels = ref<ChannelResponse[] | undefined>();
|
||||||
|
@ -102,19 +102,18 @@ const members = [
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
console.log("channelid: set loading to true");
|
console.log("channelid: set loading to true");
|
||||||
const guildUrl = `guilds/${route.params.serverId}`;
|
server.value = await fetchWithApi(`servers/${route.params.serverId}`);
|
||||||
server.value = await fetchWithApi(guildUrl);
|
|
||||||
|
|
||||||
channels.value = await fetchWithApi(`${guildUrl}/channels`);
|
channels.value = await fetchWithApi(`/channels`);
|
||||||
console.log("channels:", channels.value);
|
console.log("channels:", channels.value);
|
||||||
channel.value = await fetchWithApi(`/channels/${route.params.channelId}`);
|
channel.value = await fetchWithApi(route.path);
|
||||||
console.log("channel:", channel.value);
|
console.log("channel:", channel.value);
|
||||||
|
|
||||||
console.log("channelid: channel:", channel);
|
console.log("channelid: channel:", channel);
|
||||||
console.log("channelid: set loading to false");
|
console.log("channelid: set loading to false");
|
||||||
});
|
});
|
||||||
|
|
||||||
function showGuildSettings() { }
|
function showServerSettings() { }
|
||||||
|
|
||||||
function toggleInvitePopup(e: Event) {
|
function toggleInvitePopup(e: Event) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
const guild = await fetchWithApi(`/guilds/${useRoute().params.serverId}`);
|
const server = await fetchWithApi(`/guilds/${useRoute().params.serverId}`);
|
||||||
console.log("guild:", guild);
|
console.log("server:", server);
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue