mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-06 06:46:04 +02:00
wrap LogWatcher
This commit is contained in:
+23
-24
@@ -14,14 +14,15 @@ import locale from 'element-ui/lib/locale/lang/en';
|
|||||||
import sharedRepository from './repository/shared.js';
|
import sharedRepository from './repository/shared.js';
|
||||||
import configRepository from './repository/config.js';
|
import configRepository from './repository/config.js';
|
||||||
import webApiService from './service/webapi.js';
|
import webApiService from './service/webapi.js';
|
||||||
|
import logWatcherService from './service/logwatcher.js'
|
||||||
|
|
||||||
(async function () {
|
(async function () {
|
||||||
await CefSharp.BindObjectAsync(
|
await CefSharp.BindObjectAsync(
|
||||||
'WebApi',
|
'WebApi',
|
||||||
'VRCX',
|
'VRCX',
|
||||||
'SharedVariable', // DO NOT DIRECT ACCESS
|
'SharedVariable',
|
||||||
'VRCXStorage',
|
'VRCXStorage',
|
||||||
'SQLite', // DO NOT DIRECT ACCESS
|
'SQLite',
|
||||||
'LogWatcher',
|
'LogWatcher',
|
||||||
'Discord'
|
'Discord'
|
||||||
);
|
);
|
||||||
@@ -3294,27 +3295,26 @@ import webApiService from './service/webapi.js';
|
|||||||
methods: {},
|
methods: {},
|
||||||
watch: {},
|
watch: {},
|
||||||
el: '#x-app',
|
el: '#x-app',
|
||||||
mounted() {
|
async mounted() {
|
||||||
LogWatcher.Reset().then(() => {
|
this.checkAppVersion();
|
||||||
API.$on('SHOW_WORLD_DIALOG', (tag) => this.showWorldDialog(tag));
|
await logWatcherService.reset();
|
||||||
API.$on('SHOW_LAUNCH_DIALOG', (tag) => this.showLaunchDialog(tag));
|
API.$on('SHOW_WORLD_DIALOG', (tag) => this.showWorldDialog(tag));
|
||||||
this.updateLoop();
|
API.$on('SHOW_LAUNCH_DIALOG', (tag) => this.showLaunchDialog(tag));
|
||||||
this.updateGameLogLoop();
|
this.updateLoop();
|
||||||
this.$nextTick(function () {
|
this.updateGameLogLoop();
|
||||||
this.$el.style.display = '';
|
this.$nextTick(function () {
|
||||||
this.loginForm.loading = true;
|
this.$el.style.display = '';
|
||||||
API.getConfig().catch((err) => {
|
this.loginForm.loading = true;
|
||||||
|
API.getConfig().catch((err) => {
|
||||||
|
this.loginForm.loading = false;
|
||||||
|
throw err;
|
||||||
|
}).then((args) => {
|
||||||
|
API.getCurrentUser().finally(() => {
|
||||||
this.loginForm.loading = false;
|
this.loginForm.loading = false;
|
||||||
throw err;
|
|
||||||
}).then((args) => {
|
|
||||||
API.getCurrentUser().finally(() => {
|
|
||||||
this.loginForm.loading = false;
|
|
||||||
});
|
|
||||||
return args;
|
|
||||||
});
|
});
|
||||||
|
return args;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
this.checkAppVersion();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -4483,10 +4483,9 @@ import webApiService from './service/webapi.js';
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$app.methods.resetGameLog = function () {
|
$app.methods.resetGameLog = async function () {
|
||||||
LogWatcher.Reset().then(() => {
|
await logWatcherService.reset();
|
||||||
this.gameLogTable.data = [];
|
this.gameLogTable.data = [];
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$app.methods.updateGameLogLoop = async function () {
|
$app.methods.updateGameLogLoop = async function () {
|
||||||
@@ -4513,7 +4512,7 @@ import webApiService from './service/webapi.js';
|
|||||||
username: currentUserName
|
username: currentUserName
|
||||||
} = API.currentUser;
|
} = API.currentUser;
|
||||||
|
|
||||||
for (var [fileName, dt, type, ...args] of await LogWatcher.Get()) {
|
for (var [fileName, dt, type, ...args] of await logWatcherService.get()) {
|
||||||
var gameLogContext = gameLogContextMap.get(fileName);
|
var gameLogContext = gameLogContextMap.get(fileName);
|
||||||
if (gameLogContext === undefined) {
|
if (gameLogContext === undefined) {
|
||||||
gameLogContext = {
|
gameLogContext = {
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
// requires binding of LogWatcher
|
||||||
|
|
||||||
|
class LogWatcherService {
|
||||||
|
get() {
|
||||||
|
return LogWatcher.Get();
|
||||||
|
}
|
||||||
|
|
||||||
|
reset() {
|
||||||
|
return LogWatcher.Reset();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var self = new LogWatcherService();
|
||||||
|
window.logWatcherService = self;
|
||||||
|
|
||||||
|
export {
|
||||||
|
self as default,
|
||||||
|
LogWatcherService
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user