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

@ -33,7 +33,7 @@ const contentArray = ref([]);
const errorr = ref(false);
const switchTabs = ref(false);
const tabs = ref([]);
const primary = ref<string>("domestic");
const primary = ref<string>("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"
>
<div
v-for="similar in useArgFindRel(item.title)"
v-for="similar in useArgFindRel(item.title, item.publisher)"
:key="similar.item.id"
class="p-2 bg-gray-100 rounded text-sm cursor-pointer hover:bg-gray-200"
@click="openNews(similar.item.url.hash, item.title)"

View file

@ -1,6 +1,11 @@
<script setup lang="ts">
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);

View file

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

View file

@ -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