mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-07 06:56:04 +02:00
fix statusbar
This commit is contained in:
@@ -278,7 +278,6 @@
|
|||||||
|
|
||||||
const wsCanvasRef = ref(null);
|
const wsCanvasRef = ref(null);
|
||||||
const now = useNow({ interval: 1000 });
|
const now = useNow({ interval: 1000 });
|
||||||
const appStartAt = dayjs();
|
|
||||||
|
|
||||||
useIntervalFn(() => {
|
useIntervalFn(() => {
|
||||||
const delta = wsState.messageCount - lastMsgCount;
|
const delta = wsState.messageCount - lastMsgCount;
|
||||||
@@ -360,13 +359,14 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
const appUptimeText = computed(() => {
|
const appUptimeText = computed(() => {
|
||||||
const elapsedSeconds = dayjs(now.value).diff(appStartAt, 'second');
|
const elapsedSeconds = Math.floor((now.value - vrcxStore.appStartAt) / 1000);
|
||||||
return formatAppUptime(elapsedSeconds);
|
return formatAppUptime(elapsedSeconds);
|
||||||
});
|
});
|
||||||
|
|
||||||
const CLOCKS_KEY = 'VRCX_statusBarClocks';
|
const CLOCKS_KEY = 'VRCX_statusBarClocks';
|
||||||
const CLOCK_COUNT_KEY = 'VRCX_statusBarClockCount';
|
const CLOCK_COUNT_KEY = 'VRCX_statusBarClockCount';
|
||||||
const defaultClocks = [{ offset: normalizeUtcHour(dayjs().utcOffset() / 60) }, { offset: 0 }, { offset: -5 }];
|
const localOffset = normalizeUtcHour(dayjs().utcOffset() / 60);
|
||||||
|
const defaultClocks = [{ offset: localOffset }, { offset: 0 }, { offset: localOffset < 0 ? 9 : -5 }];
|
||||||
|
|
||||||
const clocks = ref(loadClocks(localStorage, defaultClocks));
|
const clocks = ref(loadClocks(localStorage, defaultClocks));
|
||||||
const clockCount = ref(loadClockCount(localStorage));
|
const clockCount = ref(loadClockCount(localStorage));
|
||||||
@@ -397,6 +397,7 @@
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param clock
|
* @param clock
|
||||||
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
function formatClock(clock) {
|
function formatClock(clock) {
|
||||||
try {
|
try {
|
||||||
@@ -501,7 +502,8 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
background: var(--sidebar);
|
background: var(--sidebar);
|
||||||
border-top: 1px solid var(--border);
|
border-top: 1px solid var(--border);
|
||||||
font-size: 11px;
|
font-family: 'Consolas', 'Courier New', monospace;
|
||||||
|
font-size: 12px;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
@@ -578,7 +580,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.status-label-mono {
|
.status-label-mono {
|
||||||
font-family: 'JetBrains Mono', 'Consolas', 'Courier New', monospace;
|
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
color: hsl(var(--foreground));
|
color: hsl(var(--foreground));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,7 +83,11 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
|||||||
const maxTableSize = ref(DEFAULT_MAX_TABLE_SIZE);
|
const maxTableSize = ref(DEFAULT_MAX_TABLE_SIZE);
|
||||||
const searchLimit = ref(DEFAULT_SEARCH_LIMIT);
|
const searchLimit = ref(DEFAULT_SEARCH_LIMIT);
|
||||||
const proxyServer = ref('');
|
const proxyServer = ref('');
|
||||||
|
const appStartAt = Date.now();
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
async function init() {
|
async function init() {
|
||||||
if (LINUX) {
|
if (LINUX) {
|
||||||
window.electron.ipcRenderer.on('launch-command', (command) => {
|
window.electron.ipcRenderer.on('launch-command', (command) => {
|
||||||
@@ -176,6 +180,9 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
|||||||
|
|
||||||
init();
|
init();
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
async function updateDatabaseVersion() {
|
async function updateDatabaseVersion() {
|
||||||
// requires dbVars.userPrefix to be already set
|
// requires dbVars.userPrefix to be already set
|
||||||
const databaseVersion = 13;
|
const databaseVersion = 13;
|
||||||
@@ -226,6 +233,9 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
function clearVRCXCache() {
|
function clearVRCXCache() {
|
||||||
console.log('Clearing VRCX cache...');
|
console.log('Clearing VRCX cache...');
|
||||||
failedGetRequests.clear();
|
failedGetRequests.clear();
|
||||||
@@ -280,6 +290,10 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
|||||||
galleryStore.cachedEmoji.clear();
|
galleryStore.cachedEmoji.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param data
|
||||||
|
*/
|
||||||
function eventVrcxMessage(data) {
|
function eventVrcxMessage(data) {
|
||||||
let entry;
|
let entry;
|
||||||
switch (data.MsgType) {
|
switch (data.MsgType) {
|
||||||
@@ -337,6 +351,9 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
async function saveVRCXWindowOption() {
|
async function saveVRCXWindowOption() {
|
||||||
if (LINUX) {
|
if (LINUX) {
|
||||||
VRCXStorage.Set('VRCX_LocationX', state.locationX.toString());
|
VRCXStorage.Set('VRCX_LocationX', state.locationX.toString());
|
||||||
@@ -347,6 +364,10 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param path
|
||||||
|
*/
|
||||||
async function processScreenshot(path) {
|
async function processScreenshot(path) {
|
||||||
let newPath = path;
|
let newPath = path;
|
||||||
if (advancedSettingsStore.screenshotHelper) {
|
if (advancedSettingsStore.screenshotHelper) {
|
||||||
@@ -401,6 +422,10 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// use in C# side
|
// use in C# side
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param json
|
||||||
|
*/
|
||||||
function ipcEvent(json) {
|
function ipcEvent(json) {
|
||||||
if (!watchState.isLoggedIn) {
|
if (!watchState.isLoggedIn) {
|
||||||
return;
|
return;
|
||||||
@@ -537,6 +562,9 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
|||||||
{ flush: 'sync' }
|
{ flush: 'sync' }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
async function startupLaunchCommand() {
|
async function startupLaunchCommand() {
|
||||||
const command = await AppApi.GetLaunchCommand();
|
const command = await AppApi.GetLaunchCommand();
|
||||||
if (!command) {
|
if (!command) {
|
||||||
@@ -585,6 +613,10 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// called from C#
|
// called from C#
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param input
|
||||||
|
*/
|
||||||
function eventLaunchCommand(input) {
|
function eventLaunchCommand(input) {
|
||||||
if (!watchState.isLoggedIn) {
|
if (!watchState.isLoggedIn) {
|
||||||
return;
|
return;
|
||||||
@@ -689,6 +721,10 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param name
|
||||||
|
*/
|
||||||
async function backupVrcRegistry(name) {
|
async function backupVrcRegistry(name) {
|
||||||
let regJson;
|
let regJson;
|
||||||
try {
|
try {
|
||||||
@@ -722,6 +758,9 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
|||||||
// await this.updateRegistryBackupDialog();
|
// await this.updateRegistryBackupDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
async function checkAutoBackupRestoreVrcRegistry() {
|
async function checkAutoBackupRestoreVrcRegistry() {
|
||||||
if (
|
if (
|
||||||
!advancedSettingsStore.vrcRegistryAutoBackup ||
|
!advancedSettingsStore.vrcRegistryAutoBackup ||
|
||||||
@@ -764,10 +803,16 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
function showRegistryBackupDialog() {
|
function showRegistryBackupDialog() {
|
||||||
isRegistryBackupDialogVisible.value = true;
|
isRegistryBackupDialogVisible.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
async function tryAutoBackupVrcRegistry() {
|
async function tryAutoBackupVrcRegistry() {
|
||||||
if (!advancedSettingsStore.vrcRegistryAutoBackup) {
|
if (!advancedSettingsStore.vrcRegistryAutoBackup) {
|
||||||
return;
|
return;
|
||||||
@@ -815,6 +860,7 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
|||||||
return {
|
return {
|
||||||
state,
|
state,
|
||||||
|
|
||||||
|
appStartAt,
|
||||||
proxyServer,
|
proxyServer,
|
||||||
currentlyDroppingFile,
|
currentlyDroppingFile,
|
||||||
isRegistryBackupDialogVisible,
|
isRegistryBackupDialogVisible,
|
||||||
|
|||||||
Reference in New Issue
Block a user