1
0
forked from bot/app

📝 [docs]: 新增在线展示

This commit is contained in:
远野千束 2024-09-01 17:20:33 +08:00
parent 8b77ced05e
commit 83a2d36209
6 changed files with 25 additions and 6 deletions

View File

@ -1,5 +1,5 @@
<script setup> <script setup>
import getText from "../scripts/i18nData"; import getText from "../components/scripts/i18nData.ts";
import {ref} from "vue"; import {ref} from "vue";
const onlineText = getText('online'); const onlineText = getText('online');
@ -38,14 +38,14 @@ setInterval(updateData, 10000);
<span class=dot style="background-color: #00a6ff"></span> <span class=dot style="background-color: #00a6ff"></span>
<span class="text">{{ totalText }}</span> <span class="text">{{ totalText }}</span>
</div> </div>
<div class="number">{{total.valueOf() < 0 ? getText('fetching') : total.valueOf()}}</div> <div class="number">{{ total }}</div>
</div> </div>
<div id="online" class="section"> <div id="online" class="section">
<div class="line"> <div class="line">
<span class=dot style="background-color: #00ff00"></span> <span class=dot style="background-color: #00ff00"></span>
<span class="text">{{ onlineText }}</span> <span class="text">{{ onlineText }}</span>
</div> </div>
<div class="number">{{ online.valueOf() < 0 ? getText('fetching') : online.valueOf()}}</div> <div class="number">{{ online }}</div>
</div> </div>
</div> </div>
</template> </template>

View File

@ -21,6 +21,7 @@ export default function getText(key: string): string {
// en-US -> en // en-US -> en
if (useData().site.value.lang.includes('-')) { if (useData().site.value.lang.includes('-')) {
return i18nData[useData().site.value.lang.split('-')[0]][key]; return i18nData[useData().site.value.lang.split('-')[0]][key];
} } else {
return i18nData[useData().site.value.lang][key]; return i18nData[useData().site.value.lang][key];
} }
}

View File

@ -59,7 +59,9 @@ features:
details: The project follows the LSO LICENSE and is open to contributions details: The project follows the LSO LICENSE and is open to contributions
link: https://github.com/LiteyukiStudio/LiteyukiStudioOpensourceLICENSE link: https://github.com/LiteyukiStudio/LiteyukiStudioOpensourceLICENSE
--- ---
<script setup> <script setup>
import StatsBar from '../components/StatsBar.vue' import StatsBar from '../components/StatsBar.vue'
</script> </script>
<StatsBar></Statsbar> <StatsBar />

15
docs/tsconfig.json Normal file
View File

@ -0,0 +1,15 @@
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
},
"include": [
"components/**/*.ts"
],
"exclude": [
"node_modules"
]
}

View File

@ -60,7 +60,8 @@ features:
link: https://github.com/LiteyukiStudio/LiteyukiStudioOpensourceLICENSE link: https://github.com/LiteyukiStudio/LiteyukiStudioOpensourceLICENSE
--- ---
<script setup> <script setup>
import StatsBar from '../components/StatsBar.vue' import StatsBar from '../components/StatsBar.vue'
</script> </script>
<StatsBar></Statsbar> <StatsBar />