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:
yuanhau 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,42 +174,37 @@ const submitUserPassword = async () => {
}; };
</script> </script>
<template> <template>
<div <form
class="justify-center align-center text-center absloute inset-0 p-1" 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"
v-if="!isLoggedIn" v-if="!isLoggedIn"
> >
<form <span class="text-2xl text-bold mb-0">{{ t("settings.login") }}</span>
class="flex flex-col items-center justify-center h-full" <span class="mb-4 text-sm mt-0"> {{ t("settings.loginmessage") }}</span>
@submit.prevent="submitUserPassword" <div class="">
v-if="!success" <Input
type="text"
:placeholder="t('settings.placeholder.user')"
class="mb-2 p-2 border rounded"
v-model="userAccount"
required
/>
<Input
type="password"
:placeholder="t('settings.placeholder.password')"
class="p-2 border rounded mb-2"
v-model="userPassword"
required
/>
</div>
<span v-if="error" class="text-red-600 text-xs m-2"
>Error: {{ errormsg }}</span
> >
<span class="text-2xl text-bold mb-0">{{ t("settings.login") }}</span> <button class="bg-black text-white p-2 rounded transition duration-200">
<span class="mb-4 text-sm mt-0"> {{ t("settings.loginmessage") }}</span> {{ t("settings.loginButton") }}
<div class=""> </button>
<Input </form>
type="text" <div class="justify-center align-center text-center">
:placeholder="t('settings.placeholder.user')"
class="mb-2 p-2 border rounded"
v-model="userAccount"
required
/>
<Input
type="password"
:placeholder="t('settings.placeholder.password')"
class="p-2 border rounded mb-2"
v-model="userPassword"
required
/>
</div>
<span v-if="error" class="text-red-600 text-xs m-2"
>Error: {{ errormsg }}</span
>
<button class="bg-black text-white p-2 rounded transition duration-200">
{{ t("settings.loginButton") }}
</button>
</form>
</div>
<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,