Skip to content

Commit 2cee9a5

Browse files
committed
VRC status timestamp, move bottom right
1 parent 6ee6696 commit 2cee9a5

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/stores/vrcStatus.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ import { defineStore } from 'pinia';
22
import webApiService from '../service/webapi';
33
import { ref, computed } from 'vue';
44
import { ElNotification } from 'element-plus';
5-
import { openExternalLink } from '../shared/utils';
5+
import { openExternalLink, formatDateFilter } from '../shared/utils';
66

77
export const useVrcStatusStore = defineStore('VrcStatus', () => {
88
const vrcStatusApiUrl = 'https://status.vrchat.com/api/v2';
99

1010
const lastStatus = ref('');
11+
const lastStatusTime = ref(null);
1112
const lastStatusSummary = ref('');
1213
const lastTimeFetched = ref(0);
1314
const pollingInterval = ref(0);
@@ -32,10 +33,11 @@ export const useVrcStatusStore = defineStore('VrcStatus', () => {
3233
alertRef.value.close();
3334
alertRef.value = ElNotification({
3435
title: 'VRChat Status',
35-
message: 'All Systems Operational',
36+
message: `${formatDateFilter(lastStatusTime.value, 'short')}: All Systems Operational`,
3637
type: 'success',
37-
duration: 0,
38+
duration: 5000,
3839
showClose: true,
40+
position: 'bottom-right',
3941
onClick: () => {
4042
openStatusPage();
4143
}
@@ -47,10 +49,11 @@ export const useVrcStatusStore = defineStore('VrcStatus', () => {
4749
alertRef.value?.close();
4850
alertRef.value = ElNotification({
4951
title: 'VRChat Status',
50-
message: statusText.value,
52+
message: `${formatDateFilter(lastStatusTime.value, 'short')}: ${statusText.value}`,
5153
type: 'warning',
5254
duration: 0,
5355
showClose: true,
56+
position: 'bottom-right',
5457
onClick: () => {
5558
openStatusPage();
5659
}
@@ -71,6 +74,7 @@ export const useVrcStatusStore = defineStore('VrcStatus', () => {
7174
});
7275
lastTimeFetched.value = Date.now();
7376
const data = JSON.parse(response.data);
77+
lastStatusTime.value = new Date(data.page.updated_at);
7478
if (data.status.description === 'All Systems Operational') {
7579
lastStatus.value = '';
7680
pollingInterval.value = 15 * 60 * 1000; // 15 minutes

0 commit comments

Comments
 (0)