mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-23 13:04:23 +00:00
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:
parent
122a01fe73
commit
b6f67d9db8
6 changed files with 36 additions and 15 deletions
|
@ -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.
|
||||
|
||||
|
|
|
@ -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)"
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue