mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-18 22:33:50 +02:00
improve: Add major issue indicator to VRC status
This commit is contained in:
@@ -116,7 +116,9 @@
|
||||
v-else
|
||||
class="flex items-center gap-1 px-2 h-[22px] whitespace-nowrap border-r border-border cursor-pointer hover:bg-accent"
|
||||
@click="vrcStatusStore.openStatusPage()">
|
||||
<span class="inline-block size-2 rounded-full shrink-0 bg-[#e6a23c]" />
|
||||
<span
|
||||
class="inline-block size-2 rounded-full shrink-0"
|
||||
:class="vrcStatusStore.isMajor ? 'bg-destructive' : 'bg-status-askme'" />
|
||||
<span class="text-foreground text-[11px]">{{ t('status_bar.servers') }}</span>
|
||||
</div>
|
||||
</HoverCardTrigger>
|
||||
@@ -127,7 +129,9 @@
|
||||
align="start"
|
||||
:side-offset="4">
|
||||
<div class="flex items-center gap-1.5 mb-1.5">
|
||||
<span class="inline-block size-2 rounded-full shrink-0 bg-[#e6a23c]" />
|
||||
<span
|
||||
class="inline-block size-2 rounded-full shrink-0"
|
||||
:class="vrcStatusStore.isMajor ? 'bg-destructive' : 'bg-status-askme'" />
|
||||
<span class="font-semibold text-xs text-foreground">{{
|
||||
t('status_bar.servers_issue')
|
||||
}}</span>
|
||||
|
||||
@@ -11,6 +11,7 @@ export const useVrcStatusStore = defineStore('VrcStatus', () => {
|
||||
const vrcStatusApiUrl = 'https://status.vrchat.com/api/v2';
|
||||
|
||||
const lastStatus = ref('');
|
||||
const lastStatusIndicator = ref('');
|
||||
const lastStatusTime = ref(null);
|
||||
const lastStatusSummary = ref('');
|
||||
const lastTimeFetched = ref(0);
|
||||
@@ -25,6 +26,8 @@ export const useVrcStatusStore = defineStore('VrcStatus', () => {
|
||||
|
||||
const hasIssue = computed(() => !!lastStatus.value);
|
||||
|
||||
const isMajor = computed(() => lastStatusIndicator.value === 'major');
|
||||
|
||||
/**
|
||||
* @returns {void}
|
||||
*/
|
||||
@@ -54,10 +57,12 @@ export const useVrcStatusStore = defineStore('VrcStatus', () => {
|
||||
lastStatusTime.value = new Date(data.page.updated_at);
|
||||
if (data.status.description === 'All Systems Operational') {
|
||||
lastStatus.value = '';
|
||||
lastStatusIndicator.value = '';
|
||||
pollingInterval.value = 15 * 60 * 1000; // 15 minutes
|
||||
return;
|
||||
}
|
||||
lastStatus.value = data.status.description;
|
||||
lastStatusIndicator.value = data.status.indicator || '';
|
||||
pollingInterval.value = 2 * 60 * 1000; // 2 minutes
|
||||
getVrcStatusSummary();
|
||||
}
|
||||
@@ -116,10 +121,12 @@ export const useVrcStatusStore = defineStore('VrcStatus', () => {
|
||||
|
||||
return {
|
||||
lastStatus,
|
||||
lastStatusIndicator,
|
||||
lastStatusTime,
|
||||
lastStatusSummary,
|
||||
statusText,
|
||||
hasIssue,
|
||||
isMajor,
|
||||
openStatusPage,
|
||||
onBrowserFocus,
|
||||
getVrcStatus
|
||||
|
||||
Reference in New Issue
Block a user