diff --git a/components/app/windows/newsView.vue b/components/app/windows/newsView.vue
index 8133512..c9ba914 100644
--- a/components/app/windows/newsView.vue
+++ b/components/app/windows/newsView.vue
@@ -85,11 +85,17 @@ const aiSummary = async () => {
>
-
{{ data.title }}
+
+ {{ translateText ? translateItem[data.title] : data.title }}
+
{{ data.origin }} •
- {{ data.author }}{{
+ translateText ? translateItem[data.origin] : data.origin
+ }}
+ • {{
+ translateText ? translateItem[data.author] : data.author
+ }}
diff --git a/pages/desktop.vue b/pages/desktop.vue
index ab2c0ee..97462b0 100644
--- a/pages/desktop.vue
+++ b/pages/desktop.vue
@@ -23,6 +23,7 @@ interface associAppWindowInterface {
width: string;
height: string;
black: boolean;
+ translatable: boolean;
}
interface minAppWindowInterface {
@@ -34,6 +35,7 @@ interface minAppWindowInterface {
width: string;
height: string;
black: boolean;
+ translatable: boolean;
lastpositionw: string;
lastpositionh: string;
}
@@ -347,6 +349,7 @@ const findAndOpenWindow = (windowName: string, windowTitle?: string) => {
width: app.width || "600px",
height: app.height || "400px",
black: app.black || false,
+ translatable: app.translatable || false,
});
currentOpenAppId.value++;
// Add to navbar
@@ -418,6 +421,7 @@ const toggleMinWindow = (windowUUId: string) => {
width: activeWindow.width,
height: activeWindow.height,
black: activeWindow.black || false,
+ translatable: activeWindow.translatable || false,
lastpositionw: "",
lastpositionh: "",
});
@@ -512,6 +516,7 @@ const toggleTranslate = (id: string) => {
console.log("windowId", id);
applyForTranslation.value = true;
};
+
const translateAvailable = () => {};
// Load user config via HTTP requests to the server.
diff --git a/server/api/ai/loadCustomGroqApi.ts b/server/api/ai/loadCustomGroqApi.ts
index 62719d0..6bd37f6 100644
--- a/server/api/ai/loadCustomGroqApi.ts
+++ b/server/api/ai/loadCustomGroqApi.ts
@@ -17,5 +17,14 @@ export default defineEventHandler(async (event) => {
error: "ERR_NOT_USER_LOGIN",
};
}
- const checkUser = await sql``;
+ const verifyUserToken = await sql`
+ SELECT * FROM usertokens
+ where token=${readUserToken}
+ `;
+ if (verifyUserToken.length === 0) {
+ return {
+ error: "ERR_NOT_USER_LOGIN",
+ requested_action: "LOGOUT_USER",
+ };
+ }
});
diff --git a/server/api/user/loadInfo.ts b/server/api/user/loadInfo.ts
new file mode 100644
index 0000000..71188b0
--- /dev/null
+++ b/server/api/user/loadInfo.ts
@@ -0,0 +1,15 @@
+// Fixed data for testing
+export default defineEventHandler(async (event) => {
+ return {
+ langPref: "en",
+ doNotShowLangPrefPopUp: false,
+ email: "test@yuanhau.com",
+ name: "Howard",
+ useCustomGroqKey: true,
+ translate: {
+ enabled: true,
+ lang: "en",
+ provider: "google", // Default provider
+ },
+ };
+});