From b6f67d9db8b89413cb0f2f507aa764ed191b4347 Mon Sep 17 00:00:00 2001 From: Howard Date: Fri, 30 May 2025 00:29:59 +0800 Subject: [PATCH] Made the basic newsView, the only issue? You need to luanch the window TWICE in order to see the window, strange behavior? this also exists before btw. --- .env.example | 4 +--- components/app/windows/news.vue | 8 ++++---- components/app/windows/newsView.vue | 7 ++++++- components/app/windows/settings.vue | 12 +++++++++++- components/app/windows/tty.vue | 15 ++++++++++++--- pages/desktop.vue | 5 ++--- 6 files changed, 36 insertions(+), 15 deletions(-) diff --git a/.env.example b/.env.example index a4a0588..ce3291e 100644 --- a/.env.example +++ b/.env.example @@ -1,6 +1,4 @@ -# Please use .env.exmaple as an starting point. Rename it to .env and follow the instructions below to your platform. -# If you are using Mac / Linux, run bash clone-env.sh in the terminal. -# If you are using Windows, run ps1 clone-env.ps1 in the terminal. +# Please use .env.exmaple as an starting point. Rename it to .env and fill in the values, the application needs it. # This is the default .env file. diff --git a/components/app/windows/news.vue b/components/app/windows/news.vue index b4d1260..7e5305f 100644 --- a/components/app/windows/news.vue +++ b/components/app/windows/news.vue @@ -33,7 +33,7 @@ const contentArray = ref([]); const errorr = ref(false); const switchTabs = ref(false); const tabs = ref([]); -const primary = ref("domestic"); +const primary = ref("top"); // Hard code value fn const canNotLoadTabUI = ref(false); const pullTabsData = async () => { try { @@ -147,12 +147,12 @@ const findRel = async (title: string) => { const req = await fetch("/api/sort"); }; -const useArgFindRel = (title) => { +const useArgFindRel = (title, newsOrg) => { const targetVector = tf(title); const similarities = []; for (const item of contentArray.value) { - if (item.title !== title && item.contentType === "GENERAL") { + if (item.title !== title && item.contentType === "GENERAL" item.publisher = newsOrg) { console.log(item.title); const itemVector = tf(item.title); console.log(itemVector); @@ -277,7 +277,7 @@ const openPublisher = (text: string) => { class="space-y-2" >
import { SparklesIcon, UserIcon, NewspaperIcon } from "lucide-vue-next"; -const slug = "kEJjxKw"; +const props = defineProps<{ + values?: string; +}>(); + +const slug = props.values; // Make the props.values static to the window NOT the entire thing and no arrays. + // FOR THIS MODULE DO NOT USE THE ?APPNAME URL TYPE, IT WILL FALL AT ALL TIMES, I HAVE NO CLUE WHY IS BEHAVIOR HAPPENING RN? const { data, error, pending } = useFetch(`/api/news/get/lt/${slug.trim()}`); console.log(data.value); diff --git a/components/app/windows/settings.vue b/components/app/windows/settings.vue index 7b8b46c..bfbdf89 100644 --- a/components/app/windows/settings.vue +++ b/components/app/windows/settings.vue @@ -1,3 +1,13 @@ + diff --git a/components/app/windows/tty.vue b/components/app/windows/tty.vue index 9216d6c..8767b53 100644 --- a/components/app/windows/tty.vue +++ b/components/app/windows/tty.vue @@ -31,7 +31,12 @@ const displayHelp = () => { }; // Great, there are now no errors ig -const emit = defineEmits(["windowopener", "error", "loadValue", "openArticles"]); +const emit = defineEmits([ + "windowopener", + "error", + "loadValue", + "openArticles", +]); const props = defineProps<{ values?: string; }>(); @@ -67,7 +72,7 @@ const findExecutable = (inputContent: string) => { if (executeMatch) { const targetPath = executeMatch[1].trim(); if (targetPath === "newsView") { - return + return; } openNewWindow(targetPath); printData(`Running ${targetPath}...`); @@ -93,7 +98,11 @@ const openArticle = (inputContent: string) => { emit("openArticles", articleId); printData(`Opening article ${articleId}...`); } else { - printData("Invalid article ID format. Please use 'openarticle' followed by a 7-character alphanumeric ID.", false, true); + printData( + "Invalid article ID format. Please use 'openarticle' followed by a 7-character alphanumeric ID.", + false, + true, + ); } }; // scripts diff --git a/pages/desktop.vue b/pages/desktop.vue index b7d339d..70e4967 100644 --- a/pages/desktop.vue +++ b/pages/desktop.vue @@ -274,10 +274,9 @@ const navBarDisplayText = (text: string) => { return text; } const maxStay = text.match(regex); - const filterToMax7Chars = maxStay[0] + "..." + const filterToMax7Chars = maxStay[0] + "..."; return filterToMax7Chars; -} - +}; const findAndOpenWindow = (windowName: string, windowTitle?: string) => { const app = associAppWindow.find((app) => app.name === windowName);