Compare commits

...

11 commits

Author SHA1 Message Date
8b73983278
Merge pull request #13 from hpware/beta
Some checks are pending
Build and Push Latest Image / build-and-push (push) Waiting to run
Fix kinks & Broken Stars.
2025-06-23 07:51:20 +08:00
af8e97ab17
Merge pull request #11 from hpware/snyk-upgrade-1803123c9c771449d05a98eacf27dd0a
[Snyk] Upgrade groq-sdk from 0.22.0 to 0.23.0
2025-06-23 07:48:58 +08:00
c045757c41
Merge pull request #12 from hpware/snyk-upgrade-d709799c08f8c939d2fb65e6fb912327
[Snyk] Upgrade shadcn-nuxt from 2.1.0 to 2.2.0
2025-06-23 07:48:45 +08:00
200e89f066 **Maybe** fix the sources system & fix logout system.
Some checks are pending
Build and Push Beta Image / build-and-push (push) Waiting to run
2025-06-23 07:13:57 +08:00
bf4e695676 What is this? undefined:undefined? A recipe for debugging hell. (I used
Some checks are pending
Build and Push Beta Image / build-and-push (push) Waiting to run
GitHub Copilot for this debugging session.), Also changes some broken
stuff like const res = req.json() req.status === "success", what even is
that 🙃
2025-06-23 01:10:24 +08:00
87d5620e34 Forgot useFetch uses .value 🤦‍♂️💀🙄 2025-06-23 00:55:49 +08:00
5f37fb5049 Update news view to check if the user has faved a news article or not &
the star button finally do something for the two weeks that is there.
Also done SOME user auth logic (aka revert bac kthe changes)
2025-06-23 00:20:02 +08:00
846c27293d Made a fav system.
Some checks are pending
Build and Push Beta Image / build-and-push (push) Waiting to run
2025-06-22 20:12:12 +08:00
snyk-bot
f61cfc7afd
fix: upgrade shadcn-nuxt from 2.1.0 to 2.2.0
Snyk has created this PR to upgrade shadcn-nuxt from 2.1.0 to 2.2.0.

See this package in npm:
shadcn-nuxt

See this project in Snyk:
87683307-fe2e-4cc5-ab03-68f884a73ad5?utm_source=github&utm_medium=referral&page=upgrade-pr
2025-06-20 09:54:29 +00:00
snyk-bot
ea2223b6a8
fix: upgrade groq-sdk from 0.22.0 to 0.23.0
Snyk has created this PR to upgrade groq-sdk from 0.22.0 to 0.23.0.

See this package in npm:
groq-sdk

See this project in Snyk:
87683307-fe2e-4cc5-ab03-68f884a73ad5?utm_source=github&utm_medium=referral&page=upgrade-pr
2025-06-20 09:54:25 +00:00
9e921980ed Thanks coderabbit, you broke my code!
Some checks failed
Build and Push Beta Image / build-and-push (push) Has been cancelled
2025-06-18 22:19:21 +08:00
9 changed files with 64 additions and 39 deletions

View file

@ -8,8 +8,16 @@ const openApp = (link: string) => {
</script>
<template>
<BlurPageBeforeLogin>
<div v-if="!favData.items">
<div
class="absolute inset-0 flex flex-col justify-center align-center text-center"
>
<h2>{{t("fav.haventaddedyet")}}</h2>
</div>
</div>
<div
class="justify-center text-center align-center flex flex-row flex-wrap"
v-else
>
<div v-for="items in favData.items">
<div

View file

@ -31,6 +31,7 @@ const isGenerating = ref(false);
const summaryText = ref("");
const { locale } = useI18n();
const likeart = ref([]);
const staredStatus = ref(false);
// Translating logic
const translateText = ref(false);
const translatedBefore = ref(false);
@ -105,6 +106,21 @@ const aiSummary = async () => {
isGenerating.value = false;
}
};
const starArticle = async () => {
const buildUrl = `/user/${slug}/fav`;
const req = await fetch(buildUrl);
const res = await req.json();
if (res.status === "success") {
staredStatus.value = res.starred;
}
};
onMounted(async () => {
const req = await fetch(`/user/${slug}/star`);
const res = await req.json();
staredStatus.value = res;
});
</script>
<template>
<div
@ -173,17 +189,25 @@ const aiSummary = async () => {
<div v-else>{{ summaryText }}</div>
</div>
</div>
<div class="flex flex-col bg-gray-500">
<!--<div class="flex flex-col bg-gray-500">
<!--Similar articles-->
<div class="flex flex-row" v-for="item in likeart">
<!--<div class="flex flex-row" v-for="item in likeart">
<img /><!--Image-->
<div class="flex flex-col">
<!--<div class="flex flex-col">
<h2>title</h2>
<span>description</span>
</div>
</div>
</div>
<button><StarIcon /></button>
</div>-->
<button
@click="starArticle"
:class="[
'duration-300 transition-all',
{ 'fill-blue-500 text-blue-500': staredStatus },
]"
>
<StarIcon />
</button>
</div>
</div>
</template>

View file

@ -11,8 +11,8 @@ const props = defineProps<{
}>();
const openNewWindow = (itemId: string) => {
emit("windowopener", "aboutNewsOrg");
emit("loadValue", itemId);
emit("windowopener", "aboutNewsOrg");
};
const {
@ -78,9 +78,9 @@ onMounted(async () => {
{{ errorMsg }}
</div>
</div>
<div class="flex flex-row flexw-wrap justify-center gap-2">
<div class="flex flex-row flex-wrap justify-center gap-2">
<div
class="flex flex-col group bg-gray-900/30 rounded-xl p-3 transition-all duration-500 shadow-lg hover:translate-y-[-2px] ransition-all duration-700"
class="flex flex-col group bg-gray-900/30 rounded-xl p-3 transition-all shadow-lg hover:translate-y-[-2px] ransition-all duration-500 max-w-1/2"
v-for="item in source?.data"
:key="item.id"
>

View file

@ -7,16 +7,6 @@ const error = ref(false);
const errorMsg = ref("");
const emit = defineEmits(["windowopener", "error", "loadValue"]);
/**
* return {
userAccount: fetchViaSQL[0].username,
firstName: fetchViaSQL[0].firstName,
requested_action: "CONTINUE",
current_spot: "KEEP_LOGIN",
email: fetchViaSQL[0].email,
avatarURL: fetchViaSQL[0].avatarurl,
};
*/
try {
// await :(
const { data, error: sendError } = await useFetch(
@ -25,11 +15,8 @@ try {
if (sendError.value) {
error.value = true;
}
if (data.requested_action === "LOGOUT_USER") {
logoutUser();
}
if (data.requested_action === "CONTINUE") {
if (data.userAccount && data.userAccount.length !== 0) {
if (data.value.requested_action === "CONTINUE") {
if (data.value.userAccount && data.value.userAccount.length !== 0) {
allowed.value = true;
} else {
allowed.value = false;

View file

@ -1,14 +1,12 @@
import currentVersion from "~/versionTag";
export default async function newestVersion() {
export default async function newestVersion() {
const current = currentVersion();
const req = await fetch("/api/version");
if (!req.ok) {
console.error("Version check failed:", req.statusText);
return true; // fail-closed → pretend we are up-to-date
return true; // fail-closed → pretend we are up-to-date
}
const { version: latest } = await req.json();
return current === latest; // `true` ➜ up-to-date
}
return current === latest; // `true` ➜ up-to-date
}

View file

@ -148,5 +148,8 @@
"nosimilararticles": "There aren't any similar articles.",
"articleopenpart1": "This will open a open a new window about this new org",
"articleopenpart2": ""
},
"fav": {
"haventaddedyet": "You haven't added any favorites yet."
}
}

View file

@ -71,7 +71,7 @@
"license": "授權",
"search": "搜尋",
"chatbot": "聊天機器人",
"starred": "收藏",
"starred": "我的最愛",
"terminal": "終端機",
"aboutNewsOrg": "關於這個新聞來源",
"newsview": "新聞",
@ -146,5 +146,8 @@
"nosimilararticles": "找不到類似文章",
"articleopenpart1": "會打開關於媒體",
"articleopenpart2": "的視窗"
},
"fav": {
"haventaddedyet": "你尚未把新聞加入我的最愛"
}
}

View file

@ -35,7 +35,7 @@
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"crypto-js": "^4.2.0",
"groq-sdk": "^0.22.0",
"groq-sdk": "^0.23.0",
"gsap": "^3.13.0",
"html-to-json-parser": "^2.0.1",
"js-confetti": "^0.12.0",
@ -45,7 +45,7 @@
"prettier": "^3.5.3",
"reka-ui": "^2.3.1",
"rss-parser": "^3.13.0",
"shadcn-nuxt": "2.1.0",
"shadcn-nuxt": "2.2.0",
"tailwind-merge": "^3.3.1",
"tailwind-scrollbar": "^4.0.2",
"tailwindcss": "^3.4.17",

View file

@ -1,16 +1,18 @@
import getUserTokenMinusSQLInjection from "~/server/components/getUserToken";
export default defineEventHandler(async (event) => {
const loginCookie = await getUserTokenMinusSQLInjection(event);
const userToken = await getUserTokenMinusSQLInjection(event);
if (userToken.error.length !== 0) {
return {
error: userToken.error,
};
}
try {
if (false) {
deleteCookie(event, "token");
return {
success: true,
error: null,
};
}
return "testing";
deleteCookie(event, "token");
return {
success: true,
error: null,
};
} catch (e) {
return {
success: false,