mirror of
https://github.com/Macrame-App/Macrame
synced 2025-12-29 15:29:26 +00:00
Frontend update Alpha version
This commit is contained in:
parent
e1b13b3930
commit
84b038b5ee
4 changed files with 8 additions and 4 deletions
|
|
@ -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'
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<div class="panel__content">
|
||||
<div class="grid gap-1 opacity-50 h-fit">
|
||||
<em v-if="isLocal()">This is the server dashboard.</em>
|
||||
<em v-else>This is the server dashboard.</em>
|
||||
<em v-else>This is the remote dashboard.</em>
|
||||
</div>
|
||||
<div v-if="isLocal()">
|
||||
<h4>Start: Authenticate a device</h4>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue