feat: 添加API连接状态显示页脚
在应用底部添加固定页脚显示当前连接的API地址
This commit is contained in:
2
.env
2
.env
@@ -49,3 +49,5 @@ API_KEY=22c64b60-6e60-433c-991d-f6d658024b9e
|
|||||||
# 是否启用 Basic Auth 认证(true/false)
|
# 是否启用 Basic Auth 认证(true/false)
|
||||||
ENABLE_BASIC_AUTH=true
|
ENABLE_BASIC_AUTH=true
|
||||||
|
|
||||||
|
PORT=3300
|
||||||
|
HOST=0.0.0.0
|
||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -19,3 +19,5 @@ qingyun
|
|||||||
plan
|
plan
|
||||||
.trae
|
.trae
|
||||||
plans
|
plans
|
||||||
|
android
|
||||||
|
docs
|
||||||
@@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
|
<div id="api-footer" style="position: fixed; bottom: 0; left: 0; right: 0; z-index: 99999; background: var(--ion-toolbar-background, #f8f9fa); padding: 10px; text-align: center; font-size: 12px; color: var(--ion-text-color, #333); border-top: 1px solid #ddd;"></div>
|
||||||
<script type="module" src="/src/main.ts"></script>
|
<script type="module" src="/src/main.ts"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,5 +1,15 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { IonApp, IonRouterOutlet } from '@ionic/vue'
|
import { IonApp, IonRouterOutlet } from '@ionic/vue'
|
||||||
|
import { onMounted } from 'vue'
|
||||||
|
|
||||||
|
const apiHost = import.meta.env.VITE_API_BASE_URL || 'http://localhost:3001'
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
const footer = document.getElementById('api-footer')
|
||||||
|
if (footer) {
|
||||||
|
footer.textContent = `连接: ${apiHost}`
|
||||||
|
}
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
Reference in New Issue
Block a user