Fixes, option to delete gameLog entries

This commit is contained in:
Natsumi
2023-04-04 17:23:00 +12:00
parent 1417a5b952
commit 4112eafe68
4 changed files with 99 additions and 8 deletions
+40 -3
View File
@@ -1720,7 +1720,7 @@ speechSynthesis.getVoices();
} }
} }
if ($app.customUserTags.has(json.id)) { if ($app.customUserTags.has(json.id)) {
var tag = this.customUserTags.get(json.id); var tag = $app.customUserTags.get(json.id);
ref.$customTag = tag.tag; ref.$customTag = tag.tag;
ref.$customTagColour = tag.colour; ref.$customTagColour = tag.colour;
} }
@@ -9210,6 +9210,25 @@ speechSynthesis.getVoices();
this.addGameLogEntry(gameLog, this.lastLocation.location); this.addGameLogEntry(gameLog, this.lastLocation.location);
}; };
$app.methods.deleteGameLogEntry = function (row) {
this.$confirm('Continue? Delete Log', 'Confirm', {
confirmButtonText: 'Confirm',
cancelButtonText: 'Cancel',
type: 'info',
callback: (action) => {
if (action === 'confirm') {
removeFromArray(this.gameLogTable.data, row);
database.deleteGameLogEntry(row);
console.log(row);
database.getGamelogDatabase().then((data) => {
this.gameLogSessionTable = data;
this.updateSharedFeed(true);
});
}
}
});
};
$app.data.lastLocationDestination = ''; $app.data.lastLocationDestination = '';
$app.data.lastLocationDestinationTime = 0; $app.data.lastLocationDestinationTime = 0;
$app.data.lastVideoUrl = ''; $app.data.lastVideoUrl = '';
@@ -17546,6 +17565,20 @@ speechSynthesis.getVoices();
) )
}; };
API.$on('LOGIN', function () {
var D = $app.launchOptionsDialog;
if (
D.vrcLaunchPathOverride === null ||
D.vrcLaunchPathOverride === 'null'
) {
D.vrcLaunchPathOverride = '';
configRepository.setString(
'vrcLaunchPathOverride',
D.vrcLaunchPathOverride
);
}
});
API.$on('LOGOUT', function () { API.$on('LOGOUT', function () {
$app.launchOptionsDialog.visible = false; $app.launchOptionsDialog.visible = false;
}); });
@@ -20764,15 +20797,19 @@ speechSynthesis.getVoices();
} }
var lastLocation = this.lastLocation.location; var lastLocation = this.lastLocation.location;
AppApi.VrcClosedGracefully().then((result) => { AppApi.VrcClosedGracefully().then((result) => {
console.log(result, lastLocation);
if (result || !this.isRealInstance(lastLocation)) { if (result || !this.isRealInstance(lastLocation)) {
return; return;
} }
AppApi.FocusWindow(); AppApi.FocusWindow();
var message = 'VRChat crashed, attempting to rejoin last instance';
this.$message({
message,
type: 'info'
});
var entry = { var entry = {
created_at: new Date().toJSON(), created_at: new Date().toJSON(),
type: 'Event', type: 'Event',
data: 'VRChat crashed, attempting to rejoin last instance' data: message
}; };
database.addGamelogEventToDatabase(entry); database.addGamelogEventToDatabase(entry);
this.queueGameLogNoty(entry); this.queueGameLogNoty(entry);
+7 -3
View File
@@ -46,8 +46,8 @@ html
el-button(native-type="submit" type="primary" :loading="loginForm.loading" style="width:100%") {{ $t("view.login.login") }} el-button(native-type="submit" type="primary" :loading="loginForm.loading" style="width:100%") {{ $t("view.login.login") }}
el-button(type="primary" @click="openExternalLink('https://vrchat.com/register')" :loading="loginForm.loading" style="width:100%") {{ $t("view.login.register") }} el-button(type="primary" @click="openExternalLink('https://vrchat.com/register')" :loading="loginForm.loading" style="width:100%") {{ $t("view.login.register") }}
div(style="text-align:center;font-size:12px") div(style="text-align:center;font-size:12px")
p #[a(@click="openExternalLink('https://vrchat.com/home/password')") {{ $t("view.login.forgotPassword") }}] p #[a.x-link(@click="openExternalLink('https://vrchat.com/home/password')") {{ $t("view.login.forgotPassword") }}]
p © 2019-2022 #[a(@click="openExternalLink('https://github.com/pypy-vrc')") pypy] (mina#5656) & #[a(@click="openExternalLink('https://github.com/Natsumi-sama')") Natsumi] p © 2019-2022 #[a.x-link(@click="openExternalLink('https://github.com/pypy-vrc')") pypy] (mina#5656) & #[a.x-link(@click="openExternalLink('https://github.com/Natsumi-sama')") Natsumi]
p {{ $t("view.settings.general.legal_notice.info") }} p {{ $t("view.settings.general.legal_notice.info") }}
p {{ $t("view.settings.general.legal_notice.disclaimer1") }} p {{ $t("view.settings.general.legal_notice.disclaimer1") }}
p {{ $t("view.settings.general.legal_notice.disclaimer2") }} p {{ $t("view.settings.general.legal_notice.disclaimer2") }}
@@ -492,6 +492,9 @@ html
span.x-link(@click="openExternalLink(scope.row.resourceUrl)" v-text="scope.row.resourceUrl") span.x-link(@click="openExternalLink(scope.row.resourceUrl)" v-text="scope.row.resourceUrl")
template(v-else-if="scope.row.type === 'Notification' || scope.row.type === 'OnPlayerJoined' || scope.row.type === 'OnPlayerLeft'") template(v-else-if="scope.row.type === 'Notification' || scope.row.type === 'OnPlayerJoined' || scope.row.type === 'OnPlayerLeft'")
span.x-link(v-else v-text="scope.row.data") span.x-link(v-else v-text="scope.row.data")
el-table-column(:label="$t('table.gameLog.action')" width="80" align="right")
template(v-once #default="scope")
el-button(v-if="scope.row.type !== 'OnPlayerJoined' && scope.row.type !== 'OnPlayerLeft' && scope.row.type !== 'Location' && scope.row.type !== 'PortalSpawn'" type="text" icon="el-icon-close" size="mini" @click="deleteGameLogEntry(scope.row)")
//- search //- search
.x-container(v-show="$refs.menu && $refs.menu.activeIndex === 'search'") .x-container(v-show="$refs.menu && $refs.menu.activeIndex === 'search'")
@@ -1163,7 +1166,7 @@ html
div.options-container(style="margin-top:45px;border-top:1px solid #eee;padding-top:30px") div.options-container(style="margin-top:45px;border-top:1px solid #eee;padding-top:30px")
span.header {{ $t("view.settings.general.legal_notice.header" )}} span.header {{ $t("view.settings.general.legal_notice.header" )}}
div.options-container-item div.options-container-item
p © 2019-2022 #[a(@click="openExternalLink('https://github.com/pypy-vrc')") pypy] (mina#5656) & #[a(@click="openExternalLink('https://github.com/Natsumi-sama')") Natsumi] p © 2019-2022 #[a.x-link(@click="openExternalLink('https://github.com/pypy-vrc')") pypy] (mina#5656) & #[a.x-link(@click="openExternalLink('https://github.com/Natsumi-sama')") Natsumi]
p {{ $t("view.settings.general.legal_notice.info" )}} p {{ $t("view.settings.general.legal_notice.info" )}}
p {{ $t("view.settings.general.legal_notice.disclaimer1" )}} p {{ $t("view.settings.general.legal_notice.disclaimer1" )}}
p {{ $t("view.settings.general.legal_notice.disclaimer2" )}} p {{ $t("view.settings.general.legal_notice.disclaimer2" )}}
@@ -3856,6 +3859,7 @@ html
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="changeLogDialog" :visible.sync="changeLogDialog.visible" :title="$t('dialog.change_log.header')" width="800px") el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="changeLogDialog" :visible.sync="changeLogDialog.visible" :title="$t('dialog.change_log.header')" width="800px")
.changelog-dialog(v-if="changeLogDialog.visible") .changelog-dialog(v-if="changeLogDialog.visible")
h2(v-text="changeLogDialog.buildName") h2(v-text="changeLogDialog.buildName")
span {{ $t('dialog.change_log.description') }} #[a.x-link(@click="openExternalLink('https://www.patreon.com/Natsumi_VRCX')") Patreon], #[a.x-link(@click="openExternalLink('https://ko-fi.com/natsumi_sama')") Ko-fi].
vue-markdown(:source="changeLogDialog.changeLog" :linkify="false") vue-markdown(:source="changeLogDialog.changeLog" :linkify="false")
template(#footer) template(#footer)
el-button(type="small" @click="openExternalLink('https://github.com/vrcx-team/VRCX/releases')") {{ $t('dialog.change_log.github') }} el-button(type="small" @click="openExternalLink('https://github.com/vrcx-team/VRCX/releases')") {{ $t('dialog.change_log.github') }}
+4 -2
View File
@@ -808,7 +808,7 @@
"launch": "Launch" "launch": "Launch"
}, },
"launch_options": { "launch_options": {
"header": "Launch Options", "header": "VRChat Launch Options",
"description": "These options are for advanced users only.", "description": "These options are for advanced users only.",
"example": "to change max fps: --fps=<N> e.g.)", "example": "to change max fps: --fps=<N> e.g.)",
"path_override": "VRChat Path Override", "path_override": "VRChat Path Override",
@@ -1055,6 +1055,7 @@
}, },
"change_log": { "change_log": {
"header": "Change Log", "header": "Change Log",
"description": "Consider donating to support future development of VRCX",
"close": "Close", "close": "Close",
"donate": "Donate", "donate": "Donate",
"github": "GitHub" "github": "GitHub"
@@ -1305,7 +1306,8 @@
"type": "Type", "type": "Type",
"icon": "Icons", "icon": "Icons",
"user": "User", "user": "User",
"detail": "Detail" "detail": "Detail",
"action": "Action"
}, },
"playerList": { "playerList": {
"avatar": "Avatar", "avatar": "Avatar",
+48
View File
@@ -1503,6 +1503,54 @@ class Database {
); );
} }
deleteGameLogEntry(input) {
switch (input.type) {
case 'VideoPlay':
this.deleteGameLogVideoPlay(input);
break;
case 'Event':
this.deleteGameLogEvent(input);
break;
case 'StringLoad':
case 'ImageLoad':
this.deleteGameLogResourceLoad(input);
break;
}
}
deleteGameLogVideoPlay(input) {
sqliteService.executeNonQuery(
`DELETE FROM gamelog_video_play WHERE created_at = @created_at AND video_url = @video_url AND location = @location`,
{
'@created_at': input.created_at,
'@video_url': input.videoUrl,
'@location': input.location
}
);
}
deleteGameLogEvent(input) {
sqliteService.executeNonQuery(
`DELETE FROM gamelog_event WHERE created_at = @created_at AND data = @data`,
{
'@created_at': input.created_at,
'@data': input.data
}
);
}
deleteGameLogResourceLoad(input) {
sqliteService.executeNonQuery(
`DELETE FROM gamelog_resource_load WHERE created_at = @created_at AND resource_url = @resource_url AND location = @location`,
{
'@created_at': input.created_at,
'@resource_url': input.resourceUrl,
'@type': input.type,
'@location': input.location
}
);
}
async getpreviousInstancesByWorldId(input) { async getpreviousInstancesByWorldId(input) {
var data = new Map(); var data = new Map();
await sqliteService.execute( await sqliteService.execute(