mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-23 07:41:02 +08:00
still broken chatbot.
This commit is contained in:
parent
784b45451e
commit
d6fb71d460
9
.prettierignore
Normal file
9
.prettierignore
Normal file
@ -0,0 +1,9 @@
|
||||
.nuxt
|
||||
.output
|
||||
*.lock
|
||||
*.md
|
||||
.env
|
||||
.env*
|
||||
sentry*
|
||||
package.json
|
||||
node_modules
|
@ -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
|
||||
|
||||
|
@ -24,10 +24,10 @@ import copyrightInfo from "~/components/app/info/copyright.vue";
|
||||
></span
|
||||
>
|
||||
</div>
|
||||
<hr/>
|
||||
<hr />
|
||||
<div class="flex flex-col">
|
||||
<span class="text-xl">版權資訊</span>
|
||||
<copyrightInfo />
|
||||
<span class="text-xl">版權資訊</span>
|
||||
<copyrightInfo />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -7,10 +7,10 @@ const loading = ref(true);
|
||||
const { t, locale } = useI18n();
|
||||
|
||||
const props = defineProps({
|
||||
values: {
|
||||
type: String,
|
||||
required: true,
|
||||
}
|
||||
values: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
|
||||
const {
|
||||
@ -36,7 +36,6 @@ onMounted(() => {
|
||||
scrambleText: fetchNewsOrgInfo.value?.title,
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
<template>
|
||||
<div>
|
||||
@ -70,4 +69,4 @@ onMounted(() => {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
|
@ -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,31 +14,50 @@ onMounted(() => {
|
||||
</script>
|
||||
<template>
|
||||
<div class="flex flex-col h-full">
|
||||
<div class="justify-center align-center text-center flex flex-col">
|
||||
<div class="flex flex-row justify-between">
|
||||
<div>Chat Name</div>
|
||||
<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">
|
||||
<History class="h-4 w-4" />
|
||||
</button>
|
||||
<button class="p-2 rounded-t-xl hover:bg-gray-300 transition-all duration-400">
|
||||
<Plus class="h-4 w-4" />
|
||||
</button>
|
||||
<div>
|
||||
<div class="justify-center align-center text-center flex flex-col">
|
||||
<div class="flex flex-row justify-between">
|
||||
<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"
|
||||
>
|
||||
<History class="h-4 w-4" />
|
||||
</button>
|
||||
<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>
|
||||
<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>
|
||||
<hr />
|
||||
<div ref="chatContainerRef" class="flex-1 overflow-y-auto p-4 space-y-4">
|
||||
</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>
|
||||
|
||||
<div class="text-black w-full flex flex-row space-x-2">
|
||||
<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>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -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,
|
||||
|
@ -1,3 +1 @@
|
||||
<template>
|
||||
|
||||
</template>
|
||||
<template></template>
|
||||
|
@ -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>
|
||||
|
@ -1 +1 @@
|
||||
export { default as Input } from './Input.vue'
|
||||
export { default as Input } from "./Input.vue";
|
||||
|
@ -61,6 +61,6 @@
|
||||
"chatbot": "Chatbot",
|
||||
"starred": "Starred",
|
||||
"terminal": "Terminal",
|
||||
"aboutNewsOrg": "About this news organization",
|
||||
"aboutNewsOrg": "About this news organization"
|
||||
}
|
||||
}
|
||||
|
@ -157,7 +157,7 @@ const associAppWindow = [
|
||||
id: "11",
|
||||
title: t("app.terminal"),
|
||||
component: Error404Window,
|
||||
}
|
||||
},
|
||||
];
|
||||
|
||||
/*
|
||||
@ -304,14 +304,14 @@ const findAndOpenWindow = (windowName: string) => {
|
||||
const obtainTopWindowPosition = (windowId: string) => {
|
||||
if (!openingAppViaAnApp.value) {
|
||||
const windowIndex = activeWindows.value.findIndex(
|
||||
(window) => window.id === windowId,
|
||||
);
|
||||
if (windowIndex !== -1) {
|
||||
const [window] = activeWindows.value.splice(windowIndex, 1);
|
||||
titleAppName.value = window.name;
|
||||
activeWindows.value.push(window);
|
||||
(window) => window.id === windowId,
|
||||
);
|
||||
if (windowIndex !== -1) {
|
||||
const [window] = activeWindows.value.splice(windowIndex, 1);
|
||||
titleAppName.value = window.name;
|
||||
activeWindows.value.push(window);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const closeWindow = (windowId: string) => {
|
||||
@ -326,8 +326,8 @@ const openNewWindowViaApp = (windowId: string) => {
|
||||
findAndOpenWindow(windowId);
|
||||
setTimeout(() => {
|
||||
openingAppViaAnApp.value = false;
|
||||
},1000);
|
||||
}
|
||||
}, 1000);
|
||||
};
|
||||
|
||||
const maxWindow = (windowId: string) => {};
|
||||
|
||||
|
0
prettier.config.js
Normal file
0
prettier.config.js
Normal file
Loading…
x
Reference in New Issue
Block a user