From 84b038b5eea427ca14d8e7d96fe7a039b256cddd Mon Sep 17 00:00:00 2001 From: Jesse Malotaux Date: Thu, 17 Apr 2025 11:23:20 +0200 Subject: [PATCH] Frontend update Alpha version --- fe/src/services/ApiService.js | 2 +- fe/src/services/EncryptService.js | 4 +++- fe/src/stores/panel.js | 4 +++- fe/src/views/DashboardView.vue | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/fe/src/services/ApiService.js b/fe/src/services/ApiService.js index 74697d8..f1e8dc0 100644 --- a/fe/src/services/ApiService.js +++ b/fe/src/services/ApiService.js @@ -7,7 +7,7 @@ export const appUrl = () => { return `http://${window.location.hostname}:${port}` } -export const isLocal = () => { +export const isLocal = () => { return window.location.hostname === '127.0.0.1' || window.location.hostname === 'localhost' } diff --git a/fe/src/services/EncryptService.js b/fe/src/services/EncryptService.js index 8890b72..1b2574a 100644 --- a/fe/src/services/EncryptService.js +++ b/fe/src/services/EncryptService.js @@ -24,9 +24,11 @@ export const decryptAES = (key, str) => { return encrypted.toString(enc.Utf8) } -export const AuthCall = (data) => { +export const AuthCall = (data = false) => { if (isLocal()) return data + if (!data) data = {empty: true} + const device = useDeviceStore() return { diff --git a/fe/src/stores/panel.js b/fe/src/stores/panel.js index 915bec9..5896c10 100644 --- a/fe/src/stores/panel.js +++ b/fe/src/stores/panel.js @@ -39,7 +39,9 @@ export const usePanelStore = defineStore('panel', () => { const getList = async () => { if (list.value.length > 0) return list.value - const resp = await axios.post(appUrl() + '/panel/list') + const data = AuthCall() + + const resp = await axios.post(appUrl() + '/panel/list', data) list.value = resp.data return list.value diff --git a/fe/src/views/DashboardView.vue b/fe/src/views/DashboardView.vue index 962b7cc..20239dc 100644 --- a/fe/src/views/DashboardView.vue +++ b/fe/src/views/DashboardView.vue @@ -5,7 +5,7 @@
This is the server dashboard. - This is the server dashboard. + This is the remote dashboard.

Start: Authenticate a device