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.

This commit is contained in:
yuanhau 2025-05-30 00:29:59 +08:00
parent 122a01fe73
commit b6f67d9db8
6 changed files with 36 additions and 15 deletions

View file

@ -1,6 +1,4 @@
# Please use .env.exmaple as an starting point. Rename it to .env and follow the instructions below to your platform. # Please use .env.exmaple as an starting point. Rename it to .env and fill in the values, the application needs it.
# 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.
# This is the default .env file. # This is the default .env file.

View file

@ -33,7 +33,7 @@ const contentArray = ref([]);
const errorr = ref(false); const errorr = ref(false);
const switchTabs = ref(false); const switchTabs = ref(false);
const tabs = ref([]); const tabs = ref([]);
const primary = ref<string>("domestic"); const primary = ref<string>("top"); // Hard code value fn
const canNotLoadTabUI = ref(false); const canNotLoadTabUI = ref(false);
const pullTabsData = async () => { const pullTabsData = async () => {
try { try {
@ -147,12 +147,12 @@ const findRel = async (title: string) => {
const req = await fetch("/api/sort"); const req = await fetch("/api/sort");
}; };
const useArgFindRel = (title) => { const useArgFindRel = (title, newsOrg) => {
const targetVector = tf(title); const targetVector = tf(title);
const similarities = []; const similarities = [];
for (const item of contentArray.value) { 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); console.log(item.title);
const itemVector = tf(item.title); const itemVector = tf(item.title);
console.log(itemVector); console.log(itemVector);
@ -277,7 +277,7 @@ const openPublisher = (text: string) => {
class="space-y-2" class="space-y-2"
> >
<div <div
v-for="similar in useArgFindRel(item.title)" v-for="similar in useArgFindRel(item.title, item.publisher)"
:key="similar.item.id" :key="similar.item.id"
class="p-2 bg-gray-100 rounded text-sm cursor-pointer hover:bg-gray-200" class="p-2 bg-gray-100 rounded text-sm cursor-pointer hover:bg-gray-200"
@click="openNews(similar.item.url.hash, item.title)" @click="openNews(similar.item.url.hash, item.title)"

View file

@ -1,6 +1,11 @@
<script setup lang="ts"> <script setup lang="ts">
import { SparklesIcon, UserIcon, NewspaperIcon } from "lucide-vue-next"; 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? // 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()}`); const { data, error, pending } = useFetch(`/api/news/get/lt/${slug.trim()}`);
console.log(data.value); console.log(data.value);

View file

@ -1,3 +1,13 @@
<script setup lang="ts">
const logoutAction = () => {
}
</script>
<template> <template>
<div></div> <div>
<div class="bg-gray-400 p-2 m-2 w-full">
<button @click="logoutAction">Logout</button>
</div>
<hr/>
</div>
</template> </template>

View file

@ -31,7 +31,12 @@ const displayHelp = () => {
}; };
// Great, there are now no errors ig // Great, there are now no errors ig
const emit = defineEmits(["windowopener", "error", "loadValue", "openArticles"]); const emit = defineEmits([
"windowopener",
"error",
"loadValue",
"openArticles",
]);
const props = defineProps<{ const props = defineProps<{
values?: string; values?: string;
}>(); }>();
@ -67,7 +72,7 @@ const findExecutable = (inputContent: string) => {
if (executeMatch) { if (executeMatch) {
const targetPath = executeMatch[1].trim(); const targetPath = executeMatch[1].trim();
if (targetPath === "newsView") { if (targetPath === "newsView") {
return return;
} }
openNewWindow(targetPath); openNewWindow(targetPath);
printData(`Running ${targetPath}...`); printData(`Running ${targetPath}...`);
@ -93,7 +98,11 @@ const openArticle = (inputContent: string) => {
emit("openArticles", articleId); emit("openArticles", articleId);
printData(`Opening article ${articleId}...`); printData(`Opening article ${articleId}...`);
} else { } 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 // scripts

View file

@ -274,10 +274,9 @@ const navBarDisplayText = (text: string) => {
return text; return text;
} }
const maxStay = text.match(regex); const maxStay = text.match(regex);
const filterToMax7Chars = maxStay[0] + "..." const filterToMax7Chars = maxStay[0] + "...";
return filterToMax7Chars; return filterToMax7Chars;
} };
const findAndOpenWindow = (windowName: string, windowTitle?: string) => { const findAndOpenWindow = (windowName: string, windowTitle?: string) => {
const app = associAppWindow.find((app) => app.name === windowName); const app = associAppWindow.find((app) => app.name === windowName);