Fix open articles in the TTY, as it is broken while in the demo. And

Added YouTube OnBoarding to the App (Currently in testing and this is
the beta branch :) Oh also updated some more stuff as well!
This commit is contained in:
吳元皓 2025-06-10 22:52:10 +08:00
parent 378689da87
commit 3d392dd788
5 changed files with 54 additions and 36 deletions

View File

@ -0,0 +1,15 @@
<template>
<!--YouTube Embed-->
<div class="justify-center absolute inset-0 flex flex-col">
<iframe
width="560"
height="315"
src="https://www.youtube-nocookie.com/embed/8P3qgVm6m6g?si=0t8eR0wtWv6b3REE"
title="YouTube video player"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
referrerpolicy="strict-origin-when-cross-origin"
allowfullscreen
></iframe>
</div>
</template>

View File

@ -174,14 +174,10 @@ const submitUserPassword = async () => {
}; };
</script> </script>
<template> <template>
<div
class="justify-center align-center text-center absloute inset-0 p-1"
v-if="!isLoggedIn"
>
<form <form
class="flex flex-col items-center justify-center h-full" class="flex flex-col items-center justify-center h-full align-center text-center absloute inset-0 p-1 bg-gray-200/50 backdrop-blur-sm text-black w-full absolute align-middle z-[20]"
@submit.prevent="submitUserPassword" @submit.prevent="submitUserPassword"
v-if="!success" v-if="!isLoggedIn"
> >
<span class="text-2xl text-bold mb-0">{{ t("settings.login") }}</span> <span class="text-2xl text-bold mb-0">{{ t("settings.login") }}</span>
<span class="mb-4 text-sm mt-0"> {{ t("settings.loginmessage") }}</span> <span class="mb-4 text-sm mt-0"> {{ t("settings.loginmessage") }}</span>
@ -208,8 +204,7 @@ const submitUserPassword = async () => {
{{ t("settings.loginButton") }} {{ t("settings.loginButton") }}
</button> </button>
</form> </form>
</div> <div class="justify-center align-center text-center">
<div class="justify-center align-center text-center" v-if="isLoggedIn">
<h1 class="text-3xl text-bold p-2"> <h1 class="text-3xl text-bold p-2">
{{ t("settings.greet") {{ t("settings.greet")
}}{{ user || userData.userAccount || t("settings.defaultname") }} }}{{ user || userData.userAccount || t("settings.defaultname") }}

View File

@ -26,7 +26,7 @@ const printData = (content: any, userinput?: boolean, error?: boolean) => {
const displayHelp = () => { const displayHelp = () => {
const helpContent = const helpContent =
"Here are the commands for the Terminal \n\n execute [app]: This command opens an application in the [app] slot. \n article [id]: This command will open a LINE Today article in a window. \n about: This displays the about text window \n clear/clean: Wipe the terminal log. \n help: This help text system :D \n\n For more info, please view the documentation: https://news.yuanhau.com/docs"; "Here are the commands for the Terminal \n\n execute [app]: This command opens an application in the [app] slot. \n article [id]: This command will open a LINE Today article in a window. \n about: This displays the about text window \n clear/clean: Wipe the terminal log. \n help: This help text system :D";
printData(helpContent); printData(helpContent);
}; };
@ -94,7 +94,7 @@ const cleanTTY = () => {
const openArticle = (inputContent: string) => { const openArticle = (inputContent: string) => {
const match = inputContent.match(/^article\s+[a-zA-Z0-9]{7}$/); const match = inputContent.match(/^article\s+[a-zA-Z0-9]{7}$/);
if (match) { if (match) {
const articleId = match[1].trim(); const articleId = match[0].trim();
emit("openArticles", articleId); emit("openArticles", articleId);
printData(`Opening article ${articleId}...`); printData(`Opening article ${articleId}...`);
} else { } else {

View File

@ -60,6 +60,7 @@ import NewsViewWindow from "~/components/app/windows/newsView.vue";
import SettingsWindow from "~/components/app/windows/settings.vue"; import SettingsWindow from "~/components/app/windows/settings.vue";
import PrivacyPolicyWindow from "~/components/app/windows/privacypolicy.vue"; import PrivacyPolicyWindow from "~/components/app/windows/privacypolicy.vue";
import TOSWindow from "~/components/app/windows/tos.vue"; import TOSWindow from "~/components/app/windows/tos.vue";
import onBoardingWindow from "~/components/app/windows/onBoarding.vue";
// Import Icons // Import Icons
import { import {
@ -203,6 +204,13 @@ const associAppWindow = [
component: TOSWindow, component: TOSWindow,
translatable: false, translatable: false,
}, },
{
name: "onboard",
id: "14",
title: "OnBoarding",
component: onBoardingWindow,
translatable: false,
},
]; ];
// OnBoarding // OnBoarding

View File

@ -2,7 +2,7 @@ import sql from "~/server/components/postgres";
import getUserTokenMinusSQLInjection from "~/server/components/getUserToken"; import getUserTokenMinusSQLInjection from "~/server/components/getUserToken";
export default defineEventHandler(async (event) => { export default defineEventHandler(async (event) => {
// Check user data. // Check user data.
const user = getUserTokenMinusSQLInjection(event); const user = await getUserTokenMinusSQLInjection(event);
if (user.error.length !== 0) { if (user.error.length !== 0) {
return { return {
error: user.error, error: user.error,