still broken chatbot.

This commit is contained in:
吳元皓 2025-05-13 23:09:11 +08:00
parent 784b45451e
commit d6fb71d460
12 changed files with 100 additions and 62 deletions

9
.prettierignore Normal file
View File

@ -0,0 +1,9 @@
.nuxt
.output
*.lock
*.md
.env
.env*
sentry*
package.json
node_modules

View File

@ -33,6 +33,8 @@ App Design: [PDF Document](/design.pdf)
- MacOS
- Windows XP style X - UI
- Ghostty
- Some random chat app embeded to most business websites
- Treble's cool card effect (but not quite yet)
## Stack:
@ -48,6 +50,7 @@ App Design: [PDF Document](/design.pdf)
- Custom Infra
- Python
- BeautifulSoup4
- uv
## Folder Structure

View File

@ -10,7 +10,7 @@ const props = defineProps({
values: {
type: String,
required: true,
}
},
});
const {
@ -36,7 +36,6 @@ onMounted(() => {
scrambleText: fetchNewsOrgInfo.value?.title,
});
});
</script>
<template>
<div>

View File

@ -1,9 +1,11 @@
<script setup lang="ts">
import { History, Plus, Send } from "lucide-vue-next";
import { Input } from "~/components/ui/input"
import { Input } from "~/components/ui/input";
const { t } = useI18n();
const cookie = useCookie("lastChatId");
const lastChatId = cookie.value;
const message = ref();
const messages = ref([]);
onMounted(() => {
console.log(lastChatId);
if (lastChatId) {
@ -12,30 +14,49 @@ onMounted(() => {
</script>
<template>
<div class="flex flex-col h-full">
<div>
<div class="justify-center align-center text-center flex flex-col">
<div class="flex flex-row justify-between">
<div>Chat Name</div>
<h2 class="text-xl ml-4 text-bold">Chat Name</h2>
<div class="flex flex-row justify-center align-center text-center">
<div
class="flex flex-row justify-center align-center text-center gap-2"
>
<button class="p-2 rounded-t-xl hover:bg-gray-300 transition-all duration-400">
<button
class="p-2 rounded-t-xl hover:bg-gray-300 transition-all duration-400"
>
<History class="h-4 w-4" />
</button>
<button class="p-2 rounded-t-xl hover:bg-gray-300 transition-all duration-400">
<button
class="p-2 rounded-t-xl hover:bg-gray-300 transition-all duration-400"
>
<Plus class="h-4 w-4" />
</button>
</div>
</div>
</div>
<hr />
<div ref="chatContainerRef" class="flex-1 overflow-y-auto p-4 space-y-4">
</div>
<div
ref="chatContainerRef"
class="flex-1 overflow-y-auto p-4 space-y-4"
>
<div
v-for="message in messages"
class="max-w-[80%] rounded-lg p-3"
>
</div>
</div>
<div class="text-black w-full flex flex-row space-x-2">
<Input class="flex-1 rounded-xl" placeholder="Type a message..."
/>
<button class="pl-2 pr-2 mr-1 ml-1 bg-black text-white rounded-full hover:bg-gray-700 hover:translate-y-[-4px] transition-all duration-300 disabled:cursor-not-allowed disabled:hover:translate-y-0 disabled:bg-color-500" disabled="true"><Send class="w-5 h-5"/></button>
<Input class="flex-1 rounded-xl" placeholder="Type a message..." v-ref="message" />
<button
class="pl-2 pr-2 mr-1 ml-1 bg-black text-white rounded-full hover:bg-gray-700 hover:translate-y-[-4px] transition-all duration-300 disabled:cursor-not-allowed disabled:hover:translate-y-0 disabled:bg-color-500"
:disabled="() => {if (!message) return false; else return true;}"
>
<Send class="w-5 h-5" />
</button>
</div>
</div>
</div>

View File

@ -2,12 +2,12 @@
import noImageLogo from "~/public/geterrorassets/noImageLogo.svg";
const { t, locale } = useI18n();
const emit = defineEmits(['windowopener', 'loadValue'])
const emit = defineEmits(["windowopener", "loadValue"]);
const openNewWindow = (itemId: string) => {
emit('windowopener', "aboutNewsOrg")
emit('loadValue', itemId)
}
emit("windowopener", "aboutNewsOrg");
emit("loadValue", itemId);
};
const {
data: source,

View File

@ -1,3 +1 @@
<template>
</template>
<template></template>

View File

@ -1,24 +1,32 @@
<script setup lang="ts">
import type { HTMLAttributes } from 'vue'
import { cn } from '@/lib/utils'
import { useVModel } from '@vueuse/core'
import type { HTMLAttributes } from "vue";
import { cn } from "@/lib/utils";
import { useVModel } from "@vueuse/core";
const props = defineProps<{
defaultValue?: string | number
modelValue?: string | number
class?: HTMLAttributes['class']
}>()
defaultValue?: string | number;
modelValue?: string | number;
class?: HTMLAttributes["class"];
}>();
const emits = defineEmits<{
(e: 'update:modelValue', payload: string | number): void
}>()
(e: "update:modelValue", payload: string | number): void;
}>();
const modelValue = useVModel(props, 'modelValue', emits, {
const modelValue = useVModel(props, "modelValue", emits, {
passive: true,
defaultValue: props.defaultValue,
})
});
</script>
<template>
<input v-model="modelValue" :class="cn('flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50', props.class)">
<input
v-model="modelValue"
:class="
cn(
'flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50',
props.class,
)
"
/>
</template>

View File

@ -1 +1 @@
export { default as Input } from './Input.vue'
export { default as Input } from "./Input.vue";

View File

@ -61,6 +61,6 @@
"chatbot": "Chatbot",
"starred": "Starred",
"terminal": "Terminal",
"aboutNewsOrg": "About this news organization",
"aboutNewsOrg": "About this news organization"
}
}

View File

@ -157,7 +157,7 @@ const associAppWindow = [
id: "11",
title: t("app.terminal"),
component: Error404Window,
}
},
];
/*
@ -327,7 +327,7 @@ const openNewWindowViaApp = (windowId: string) => {
setTimeout(() => {
openingAppViaAnApp.value = false;
}, 1000);
}
};
const maxWindow = (windowId: string) => {};

0
prettier.config.js Normal file
View File