More VRC status checking

This commit is contained in:
Natsumi
2025-10-03 14:39:35 +13:00
parent 61bc798b91
commit 9ff9315d34
3 changed files with 64 additions and 11 deletions

View File

@@ -1,20 +1,39 @@
<template>
<el-alert
v-if="lastStatus"
:title="lastStatus"
type="warning"
show-icon
center
:closable="true"
@close="onAlertClose"></el-alert>
<el-alert v-if="statusText" type="warning" show-icon center :closable="true" @close="onAlertClose">
<template #title>
<span @click="openStatusPage" class="status-text">
{{ statusText }}
</span>
</template>
</el-alert>
</template>
<script setup>
import { storeToRefs } from 'pinia';
import { useVrcStatusStore } from '../stores';
import { openExternalLink } from '../shared/utils';
const { lastStatus, isAlertClosed } = storeToRefs(useVrcStatusStore());
const { statusText, isAlertClosed } = storeToRefs(useVrcStatusStore());
isAlertClosed.value = false;
function onAlertClose() {
isAlertClosed.value = true;
}
function openStatusPage() {
if (isAlertClosed.value) {
return;
}
openExternalLink('https://status.vrchat.com');
}
</script>
<style scoped>
.status-text {
cursor: pointer;
}
.status-text:hover {
text-decoration: underline;
}
</style>