fix: dialog types error

This commit is contained in:
pa
2025-07-16 14:58:23 +09:00
committed by Natsumi
parent b23687430e
commit 6b84d7444b
17 changed files with 156 additions and 108 deletions
+4 -4
View File
@@ -18,7 +18,7 @@ const favoriteReq = {
}, },
/** /**
* @type {import('../types/favorite').getFavorites} * @type {import('../types/api/favorite').GetFavorites}
*/ */
getFavorites(params) { getFavorites(params) {
return request('favorites', { return request('favorites', {
@@ -34,7 +34,7 @@ const favoriteReq = {
}, },
/** /**
* @type {import('../types/favorite').addFavorite} * @type {import('../types/api/favorite').AddFavorite}
*/ */
addFavorite(params) { addFavorite(params) {
return request('favorites', { return request('favorites', {
@@ -130,7 +130,7 @@ const favoriteReq = {
}, },
/** /**
* @type {import('../types/favorite').getFavoriteWorlds} * @type {import('../types/api/favorite').GetFavoriteWorlds}
*/ */
getFavoriteWorlds(params) { getFavoriteWorlds(params) {
return request('worlds/favorites', { return request('worlds/favorites', {
@@ -146,7 +146,7 @@ const favoriteReq = {
}, },
/** /**
* @type {import('../types/favorite').getFavoriteAvatars} * @type {import('../types/api/favorite').GetFavoriteAvatars}
*/ */
getFavoriteAvatars(params) { getFavoriteAvatars(params) {
return request('avatars/favorites', { return request('avatars/favorites', {
+3 -3
View File
@@ -56,7 +56,7 @@ const groupReq = {
}); });
}, },
/** /**
* @type {import('../types/group').getGroup} * @type {import('../types/api/group').GetGroup}
*/ */
getGroup(params) { getGroup(params) {
return request(`groups/${params.groupId}`, { return request(`groups/${params.groupId}`, {
@@ -302,7 +302,7 @@ const groupReq = {
* groupId: string, * groupId: string,
* userId: string * userId: string
* }} params * }} params
* @return { Promise<{json: any, params}> } * @return { Promise<{json: any, params, ref?: any}> }
*/ */
getGroupMember(params) { getGroupMember(params) {
return request(`groups/${params.groupId}/members/${params.userId}`, { return request(`groups/${params.groupId}/members/${params.userId}`, {
@@ -557,7 +557,7 @@ const groupReq = {
}); });
}, },
/** /**
* @param {{ groupId: string, eventTypes: array }} params * @param {{ groupId: string, n: number, offset: number, eventTypes?: array }} params
* @return { Promise<{json: any, params}> } * @return { Promise<{json: any, params}> }
*/ */
getGroupLogs(params) { getGroupLogs(params) {
+9 -5
View File
@@ -84,11 +84,15 @@ const notificationReq = {
/** /**
* @param {{ * @param {{
* receiverUserId: string, * receiverUserId?: string,
* type: string, * type?: string,
* message: string, * message?: string,
* seen: boolean, * seen?: boolean,
* details: JsonString<any> * details?: JsonString<any>,
* instanceId?: string,
* worldId?: string,
* worldName?: string,
* messageSlot?: string,
* }} params * }} params
* @param receiverUserId * @param receiverUserId
* @return { Promise<{json: any, params}> } * @return { Promise<{json: any, params}> }
+4 -4
View File
@@ -77,8 +77,8 @@ const userReq = {
}, },
/** /**
* @param {string[]} params User tags to add * @param {{tags: string[]}} params User tags to add
* @returns {Promise<{json: any, params: string[]}>} * @returns {Promise<{json: any, params: {tags: string[]}}>}
*/ */
addUserTags(params) { addUserTags(params) {
const userStore = useUserStore(); const userStore = useUserStore();
@@ -96,8 +96,8 @@ const userReq = {
}, },
/** /**
* @param {string[]} params User tags to remove * @param {{tags: string[]}} params User tags to remove
* @returns {Promise<{json: any, params: string[]}>} * @returns {Promise<{json: any, params: {tags: string[]}}>}
*/ */
removeUserTags(params) { removeUserTags(params) {
const userStore = useUserStore(); const userStore = useUserStore();
@@ -403,21 +403,21 @@
icon="el-icon-back" icon="el-icon-back"
circle circle
class="x-link" class="x-link"
style="margin-left: 0px" style="margin-left: 0"
@click.stop="reorderAvatarGalleryImage(imageUrl, -1)"></el-button> @click.stop="reorderAvatarGalleryImage(imageUrl, -1)"></el-button>
<el-button <el-button
size="mini" size="mini"
icon="el-icon-right" icon="el-icon-right"
circle circle
class="x-link" class="x-link"
style="margin-left: 0px" style="margin-left: 0"
@click.stop="reorderAvatarGalleryImage(imageUrl, 1)"></el-button> @click.stop="reorderAvatarGalleryImage(imageUrl, 1)"></el-button>
<el-button <el-button
size="mini" size="mini"
icon="el-icon-delete" icon="el-icon-delete"
circle circle
class="x-link" class="x-link"
style="margin-left: 0px" style="margin-left: 0"
@click.stop="deleteAvatarGalleryImage(imageUrl)"></el-button> @click.stop="deleteAvatarGalleryImage(imageUrl)"></el-button>
</div> </div>
</el-carousel-item> </el-carousel-item>
@@ -24,12 +24,9 @@
</el-button> </el-button>
</el-button-group> </el-button-group>
<br /> <br />
<div <div v-for="image in previousImagesTable" :key="image.version" style="display: inline-block">
v-for="image in previousImagesTable"
v-if="image.file"
:key="image.version"
style="display: inline-block">
<div <div
v-if="image.file"
class="x-change-image-item" class="x-change-image-item"
style="cursor: pointer" style="cursor: pointer"
:class="{ 'current-image': compareCurrentImage(image) }" :class="{ 'current-image': compareCurrentImage(image) }"
@@ -34,16 +34,16 @@
<br /> <br />
<div <div
v-for="image in galleryTable" v-for="image in galleryTable"
v-if="image.versions && image.versions.length > 0"
:key="image.id" :key="image.id"
class="x-friend-item" class="x-friend-item"
style="display: inline-block; margin-top: 10px; width: unset; cursor: default"> style="display: inline-block; margin-top: 10px; width: unset; cursor: default">
<div <template v-if="image.versions && image.versions.length > 0">
v-if="image.versions[image.versions.length - 1].file.url" <div
class="vrcplus-icon" v-if="image.versions[image.versions.length - 1].file.url"
@click="selectImageGallerySelect(image.versions[image.versions.length - 1].file.url, image.id)"> class="vrcplus-icon"
<img v-lazy="image.versions[image.versions.length - 1].file.url" class="avatar" /> @click="selectImageGallerySelect(image.versions[image.versions.length - 1].file.url, image.id)">
</div> <img v-lazy="image.versions[image.versions.length - 1].file.url" class="avatar" /></div
></template>
</div> </div>
</div> </div>
</safe-dialog> </safe-dialog>
@@ -1253,7 +1253,13 @@
auditLogTypes: [] auditLogTypes: []
}); });
let loadMoreGroupMembersParams = {}; let loadMoreGroupMembersParams = ref({
n: 100,
offset: 0,
groupId: '',
sort: '',
roleId: ''
});
watch( watch(
() => groupDialog.value.loading, () => groupDialog.value.loading,
@@ -1632,16 +1638,17 @@
const D = groupDialog.value; const D = groupDialog.value;
D.members = []; D.members = [];
isGroupMembersDone.value = false; isGroupMembersDone.value = false;
loadMoreGroupMembersParams = { loadMoreGroupMembersParams.value = {
n: 100, n: 100,
offset: 0, offset: 0,
groupId: D.id groupId: D.id,
...loadMoreGroupMembersParams.value
}; };
if (D.memberSortOrder.value) { if (D.memberSortOrder.value) {
loadMoreGroupMembersParams.sort = D.memberSortOrder.value; loadMoreGroupMembersParams.value.sort = D.memberSortOrder.value;
} }
if (D.memberFilter.id !== null) { if (D.memberFilter.id !== null) {
loadMoreGroupMembersParams.roleId = D.memberFilter.id; loadMoreGroupMembersParams.value.roleId = D.memberFilter.id;
} }
if (D.inGroup) { if (D.inGroup) {
await groupRequest await groupRequest
@@ -1669,7 +1676,7 @@
return; return;
} }
const D = groupDialog.value; const D = groupDialog.value;
const params = loadMoreGroupMembersParams; const params = loadMoreGroupMembersParams.value;
D.memberSearch = ''; D.memberSearch = '';
isGroupMembersLoading.value = true; isGroupMembersLoading.value = true;
await groupRequest await groupRequest
@@ -1802,7 +1809,7 @@
async function setGroupMemberFilter(filter) { async function setGroupMemberFilter(filter) {
const D = groupDialog.value; const D = groupDialog.value;
if (D.memberFilter.value === filter) { if (D.memberFilter === filter) {
return; return;
} }
D.memberFilter = filter; D.memberFilter = filter;
@@ -80,10 +80,10 @@
v-text="t(item.name)"></el-dropdown-item> v-text="t(item.name)"></el-dropdown-item>
<el-dropdown-item <el-dropdown-item
v-for="item in groupDialog.ref.roles" v-for="item in groupDialog.ref.roles"
v-if="!item.defaultRole"
:key="item.name" :key="item.name"
@click.native="setGroupMemberFilter(item)" @click.native="setGroupMemberFilter(item)"
v-text="item.name"></el-dropdown-item> ><span v-if="!item.defaultRole">{{ t(item.name) }}</span></el-dropdown-item
>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</div> </div>
@@ -101,7 +101,7 @@
}}</el-button> }}</el-button>
<data-tables v-bind="groupMemberModerationTable" style="margin-top: 10px"> <data-tables v-bind="groupMemberModerationTable" style="margin-top: 10px">
<el-table-column width="55" prop="$selected"> <el-table-column width="55" prop="$selected">
<template slot-scope="scope"> <template #default="scope">
<el-button type="text" size="mini" @click.stop> <el-button type="text" size="mini" @click.stop>
<el-checkbox <el-checkbox
v-model="scope.row.$selected" v-model="scope.row.$selected"
@@ -115,7 +115,7 @@
:label="t('dialog.group_member_moderation.avatar')" :label="t('dialog.group_member_moderation.avatar')"
width="70" width="70"
prop="photo"> prop="photo">
<template slot-scope="scope"> <template #default="scope">
<el-popover placement="right" height="500px" trigger="hover"> <el-popover placement="right" height="500px" trigger="hover">
<img <img
slot="reference" slot="reference"
@@ -134,7 +134,7 @@
width="160" width="160"
prop="$displayName" prop="$displayName"
sortable> sortable>
<template slot-scope="scope"> <template #default="scope">
<span style="cursor: pointer" @click="showUserDialog(scope.row.userId)"> <span style="cursor: pointer" @click="showUserDialog(scope.row.userId)">
<span <span
v-if="randomUserColours" v-if="randomUserColours"
@@ -145,7 +145,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="t('dialog.group_member_moderation.roles')" prop="roleIds" sortable> <el-table-column :label="t('dialog.group_member_moderation.roles')" prop="roleIds" sortable>
<template slot-scope="scope"> <template #default="scope">
<template v-for="(roleId, index) in scope.row.roleIds"> <template v-for="(roleId, index) in scope.row.roleIds">
<template v-for="(role, rIndex) in groupMemberModeration.groupRef.roles"> <template v-for="(role, rIndex) in groupMemberModeration.groupRef.roles">
<span v-if="role?.id === roleId" :key="roleId + rIndex" <span v-if="role?.id === roleId" :key="roleId + rIndex"
@@ -160,7 +160,7 @@
:label="t('dialog.group_member_moderation.notes')" :label="t('dialog.group_member_moderation.notes')"
prop="managerNotes" prop="managerNotes"
sortable> sortable>
<template slot-scope="scope"> <template #default="scope">
<span @click.stop v-text="scope.row.managerNotes"></span> <span @click.stop v-text="scope.row.managerNotes"></span>
</template> </template>
</el-table-column> </el-table-column>
@@ -169,7 +169,7 @@
width="170" width="170"
prop="joinedAt" prop="joinedAt"
sortable> sortable>
<template slot-scope="scope"> <template #default="scope">
<span>{{ formatDateFilter(scope.row.joinedAt, 'long') }}</span> <span>{{ formatDateFilter(scope.row.joinedAt, 'long') }}</span>
</template> </template>
</el-table-column> </el-table-column>
@@ -178,7 +178,7 @@
width="120" width="120"
prop="visibility" prop="visibility"
sortable> sortable>
<template slot-scope="scope"> <template #default="scope">
<span v-text="scope.row.visibility"></span> <span v-text="scope.row.visibility"></span>
</template> </template>
</el-table-column> </el-table-column>
@@ -213,7 +213,7 @@
}}</el-button> }}</el-button>
<data-tables v-bind="groupBansModerationTable" style="margin-top: 10px"> <data-tables v-bind="groupBansModerationTable" style="margin-top: 10px">
<el-table-column width="55" prop="$selected"> <el-table-column width="55" prop="$selected">
<template slot-scope="scope"> <template #default="scope">
<el-button type="text" size="mini" @click.stop> <el-button type="text" size="mini" @click.stop>
<el-checkbox <el-checkbox
v-model="scope.row.$selected" v-model="scope.row.$selected"
@@ -227,7 +227,7 @@
:label="t('dialog.group_member_moderation.avatar')" :label="t('dialog.group_member_moderation.avatar')"
width="70" width="70"
prop="photo"> prop="photo">
<template slot-scope="scope"> <template #default="scope">
<el-popover placement="right" height="500px" trigger="hover"> <el-popover placement="right" height="500px" trigger="hover">
<img <img
slot="reference" slot="reference"
@@ -246,7 +246,7 @@
width="160" width="160"
prop="$displayName" prop="$displayName"
sortable> sortable>
<template slot-scope="scope"> <template #default="scope">
<span style="cursor: pointer" @click="showUserDialog(scope.row.userId)"> <span style="cursor: pointer" @click="showUserDialog(scope.row.userId)">
<span <span
v-if="randomUserColours" v-if="randomUserColours"
@@ -257,15 +257,17 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="t('dialog.group_member_moderation.roles')" prop="roleIds" sortable> <el-table-column :label="t('dialog.group_member_moderation.roles')" prop="roleIds" sortable>
<template slot-scope="scope"> <template #default="scope">
<template v-for="(roleId, index) in scope.row.roleIds"> <template v-for="(roleId, index) in scope.row.roleIds">
<span <span
v-for="(role, rIndex) in groupMemberModeration.groupRef.roles" v-for="(role, rIndex) in groupMemberModeration.groupRef.roles"
v-if="role.id === roleId" v-if="role.id === roleId"
:key="rIndex" :key="rIndex + roleId"
>{{ role.name }}</span >{{ role.name }}</span
> >
<span v-if="index < scope.row.roleIds.length - 1">, </span> <span v-if="index < scope.row.roleIds.length - 1" :key="index + roleId"
>,
</span>
</template> </template>
</template> </template>
</el-table-column> </el-table-column>
@@ -273,7 +275,7 @@
:label="t('dialog.group_member_moderation.notes')" :label="t('dialog.group_member_moderation.notes')"
prop="managerNotes" prop="managerNotes"
sortable> sortable>
<template slot-scope="scope"> <template #default="scope">
<span @click.stop v-text="scope.row.managerNotes"></span> <span @click.stop v-text="scope.row.managerNotes"></span>
</template> </template>
</el-table-column> </el-table-column>
@@ -282,7 +284,7 @@
width="170" width="170"
prop="joinedAt" prop="joinedAt"
sortable> sortable>
<template slot-scope="scope"> <template #default="scope">
<span>{{ formatDateFilter(scope.row.joinedAt, 'long') }}</span> <span>{{ formatDateFilter(scope.row.joinedAt, 'long') }}</span>
</template> </template>
</el-table-column> </el-table-column>
@@ -291,7 +293,7 @@
width="170" width="170"
prop="bannedAt" prop="bannedAt"
sortable> sortable>
<template slot-scope="scope"> <template #default="scope">
<span>{{ formatDateFilter(scope.row.bannedAt, 'long') }}</span> <span>{{ formatDateFilter(scope.row.bannedAt, 'long') }}</span>
</template> </template>
</el-table-column> </el-table-column>
@@ -326,7 +328,7 @@
}}</el-button> }}</el-button>
<data-tables v-bind="groupInvitesModerationTable" style="margin-top: 10px"> <data-tables v-bind="groupInvitesModerationTable" style="margin-top: 10px">
<el-table-column width="55" prop="$selected"> <el-table-column width="55" prop="$selected">
<template slot-scope="scope"> <template #default="scope">
<el-button type="text" size="mini" @click.stop> <el-button type="text" size="mini" @click.stop>
<el-checkbox <el-checkbox
v-model="scope.row.$selected" v-model="scope.row.$selected"
@@ -340,7 +342,7 @@
:label="t('dialog.group_member_moderation.avatar')" :label="t('dialog.group_member_moderation.avatar')"
width="70" width="70"
prop="photo"> prop="photo">
<template slot-scope="scope"> <template #default="scope">
<el-popover placement="right" height="500px" trigger="hover"> <el-popover placement="right" height="500px" trigger="hover">
<img <img
slot="reference" slot="reference"
@@ -359,7 +361,7 @@
width="160" width="160"
prop="$displayName" prop="$displayName"
sortable> sortable>
<template slot-scope="scope"> <template #default="scope">
<span style="cursor: pointer" @click="showUserDialog(scope.row.userId)"> <span style="cursor: pointer" @click="showUserDialog(scope.row.userId)">
<span <span
v-if="randomUserColours" v-if="randomUserColours"
@@ -373,7 +375,7 @@
:label="t('dialog.group_member_moderation.notes')" :label="t('dialog.group_member_moderation.notes')"
prop="managerNotes" prop="managerNotes"
sortable> sortable>
<template slot-scope="scope"> <template #default="scope">
<span @click.stop v-text="scope.row.managerNotes"></span> <span @click.stop v-text="scope.row.managerNotes"></span>
</template> </template>
</el-table-column> </el-table-column>
@@ -405,7 +407,7 @@
}}</el-button> }}</el-button>
<data-tables v-bind="groupJoinRequestsModerationTable" style="margin-top: 10px"> <data-tables v-bind="groupJoinRequestsModerationTable" style="margin-top: 10px">
<el-table-column width="55" prop="$selected"> <el-table-column width="55" prop="$selected">
<template slot-scope="scope"> <template #default="scope">
<el-button type="text" size="mini" @click.stop> <el-button type="text" size="mini" @click.stop>
<el-checkbox <el-checkbox
v-model="scope.row.$selected" v-model="scope.row.$selected"
@@ -419,7 +421,7 @@
:label="t('dialog.group_member_moderation.avatar')" :label="t('dialog.group_member_moderation.avatar')"
width="70" width="70"
prop="photo"> prop="photo">
<template slot-scope="scope"> <template #default="scope">
<el-popover placement="right" height="500px" trigger="hover"> <el-popover placement="right" height="500px" trigger="hover">
<img <img
slot="reference" slot="reference"
@@ -438,7 +440,7 @@
width="160" width="160"
prop="$displayName" prop="$displayName"
sortable> sortable>
<template slot-scope="scope"> <template #default="scope">
<span style="cursor: pointer" @click="showUserDialog(scope.row.userId)"> <span style="cursor: pointer" @click="showUserDialog(scope.row.userId)">
<span <span
v-if="randomUserColours" v-if="randomUserColours"
@@ -452,7 +454,7 @@
:label="t('dialog.group_member_moderation.notes')" :label="t('dialog.group_member_moderation.notes')"
prop="managerNotes" prop="managerNotes"
sortable> sortable>
<template slot-scope="scope"> <template #default="scope">
<span @click.stop v-text="scope.row.managerNotes"></span> <span @click.stop v-text="scope.row.managerNotes"></span>
</template> </template>
</el-table-column> </el-table-column>
@@ -504,7 +506,7 @@
}}</el-button> }}</el-button>
<data-tables v-bind="groupBlockedModerationTable" style="margin-top: 10px"> <data-tables v-bind="groupBlockedModerationTable" style="margin-top: 10px">
<el-table-column width="55" prop="$selected"> <el-table-column width="55" prop="$selected">
<template slot-scope="scope"> <template #default="scope">
<el-button type="text" size="mini" @click.stop> <el-button type="text" size="mini" @click.stop>
<el-checkbox <el-checkbox
v-model="scope.row.$selected" v-model="scope.row.$selected"
@@ -518,7 +520,7 @@
:label="t('dialog.group_member_moderation.avatar')" :label="t('dialog.group_member_moderation.avatar')"
width="70" width="70"
prop="photo"> prop="photo">
<template slot-scope="scope"> <template #default="scope">
<el-popover placement="right" height="500px" trigger="hover"> <el-popover placement="right" height="500px" trigger="hover">
<img <img
slot="reference" slot="reference"
@@ -537,7 +539,7 @@
width="160" width="160"
prop="$displayName" prop="$displayName"
sortable> sortable>
<template slot-scope="scope"> <template #default="scope">
<span style="cursor: pointer" @click="showUserDialog(scope.row.userId)"> <span style="cursor: pointer" @click="showUserDialog(scope.row.userId)">
<span <span
v-if="randomUserColours" v-if="randomUserColours"
@@ -551,7 +553,7 @@
:label="t('dialog.group_member_moderation.notes')" :label="t('dialog.group_member_moderation.notes')"
prop="managerNotes" prop="managerNotes"
sortable> sortable>
<template slot-scope="scope"> <template #default="scope">
<span @click.stop v-text="scope.row.managerNotes"></span> <span @click.stop v-text="scope.row.managerNotes"></span>
</template> </template>
</el-table-column> </el-table-column>
@@ -627,7 +629,7 @@
width="170" width="170"
prop="created_at" prop="created_at"
sortable> sortable>
<template slot-scope="scope"> <template #default="scope">
<span>{{ formatDateFilter(scope.row.created_at, 'long') }}</span> <span>{{ formatDateFilter(scope.row.created_at, 'long') }}</span>
</template> </template>
</el-table-column> </el-table-column>
@@ -636,7 +638,7 @@
width="190" width="190"
prop="eventType" prop="eventType"
sortable> sortable>
<template slot-scope="scope"> <template #default="scope">
<span v-text="scope.row.eventType"></span> <span v-text="scope.row.eventType"></span>
</template> </template>
</el-table-column> </el-table-column>
@@ -645,7 +647,7 @@
width="160" width="160"
prop="actorDisplayName" prop="actorDisplayName"
sortable> sortable>
<template slot-scope="scope"> <template #default="scope">
<span style="cursor: pointer" @click="showUserDialog(scope.row.actorId)"> <span style="cursor: pointer" @click="showUserDialog(scope.row.actorId)">
<span v-text="scope.row.actorDisplayName"></span> <span v-text="scope.row.actorDisplayName"></span>
</span> </span>
@@ -654,7 +656,7 @@
<el-table-column <el-table-column
:label="t('dialog.group_member_moderation.description')" :label="t('dialog.group_member_moderation.description')"
prop="description"> prop="description">
<template slot-scope="scope"> <template #default="scope">
<Location <Location
v-if="scope.row?.targetId.startsWith('wrld_')" v-if="scope.row?.targetId.startsWith('wrld_')"
:location="scope.row.targetId" /> :location="scope.row.targetId" />
@@ -662,7 +664,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="t('dialog.group_member_moderation.data')" prop="data"> <el-table-column :label="t('dialog.group_member_moderation.data')" prop="data">
<template slot-scope="scope"> <template #default="scope">
<span <span
v-if="Object.keys(scope.row.data).length" v-if="Object.keys(scope.row.data).length"
v-text="JSON.stringify(scope.row.data)"></span> v-text="JSON.stringify(scope.row.data)"></span>
@@ -230,7 +230,7 @@
function addFavoriteFriendsToInvite() { function addFavoriteFriendsToInvite() {
const D = props.inviteDialog; const D = props.inviteDialog;
for (const friend of props.vipFriends) { for (const friend of vipFriends.value) {
if (!D.userIds.includes(friend.id)) { if (!D.userIds.includes(friend.id)) {
D.userIds.push(friend.id); D.userIds.push(friend.id);
} }
@@ -17,9 +17,9 @@
</div> </div>
<data-tables v-loading="loading" v-bind="dataTable" style="margin-top: 10px"> <data-tables v-loading="loading" v-bind="dataTable" style="margin-top: 10px">
<el-table-column :label="$t('table.previous_instances.date')" prop="created_at" sortable width="110"> <el-table-column :label="$t('table.previous_instances.date')" prop="created_at" sortable width="110">
<template slot-scope="scope"> <template #default="scope">
<el-tooltip placement="left"> <el-tooltip placement="left">
<template slot="content"> <template #content>
<span>{{ formatDateFilter(scope.row.created_at, 'long') }}</span> <span>{{ formatDateFilter(scope.row.created_at, 'long') }}</span>
</template> </template>
<span>{{ formatDateFilter(scope.row.created_at, 'short') }}</span> <span>{{ formatDateFilter(scope.row.created_at, 'short') }}</span>
@@ -27,7 +27,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('table.gameLog.icon')" prop="isFriend" width="70" align="center"> <el-table-column :label="$t('table.gameLog.icon')" prop="isFriend" width="70" align="center">
<template slot-scope="scope"> <template #default="scope">
<template v-if="gameLogIsFriend(scope.row)"> <template v-if="gameLogIsFriend(scope.row)">
<el-tooltip v-if="gameLogIsFavorite(scope.row)" placement="top" content="Favorite"> <el-tooltip v-if="gameLogIsFavorite(scope.row)" placement="top" content="Favorite">
<span></span> <span></span>
@@ -39,17 +39,17 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('table.previous_instances.display_name')" prop="displayName" sortable> <el-table-column :label="$t('table.previous_instances.display_name')" prop="displayName" sortable>
<template slot-scope="scope"> <template #default="scope">
<span class="x-link" @click="lookupUser(scope.row)">{{ scope.row.displayName }}</span> <span class="x-link" @click="lookupUser(scope.row)">{{ scope.row.displayName }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('table.previous_instances.time')" prop="time" width="100" sortable> <el-table-column :label="$t('table.previous_instances.time')" prop="time" width="100" sortable>
<template slot-scope="scope"> <template #default="scope">
<span>{{ scope.row.timer }}</span> <span>{{ scope.row.timer }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('table.previous_instances.count')" prop="count" width="100" sortable> <el-table-column :label="$t('table.previous_instances.count')" prop="count" width="100" sortable>
<template slot-scope="scope"> <template #default="scope">
<span>{{ scope.row.count }}</span> <span>{{ scope.row.count }}</span>
</template> </template>
</el-table-column> </el-table-column>
@@ -78,7 +78,29 @@
const dialogRef = ref(null); const dialogRef = ref(null);
const loading = ref(false); const loading = ref(false);
const location = ref({}); const location = ref({
tag: '',
isOffline: false,
isPrivate: false,
isTraveling: false,
isRealInstance: false,
worldId: '',
instanceId: '',
instanceName: '',
accessType: '',
accessTypeName: '',
region: '',
shortName: '',
userId: null,
hiddenId: null,
privateId: null,
friendsId: null,
groupId: null,
groupAccessType: null,
canRequestInvite: false,
strict: false,
ageGate: false
});
const dataTable = ref({ const dataTable = ref({
data: [], data: [],
filters: [ filters: [
@@ -1,6 +1,6 @@
<template> <template>
<safe-dialog <safe-dialog
ref="previousInstancesWorldDialog" ref="previousInstancesWorldDialogRef"
:visible.sync="isVisible" :visible.sync="isVisible"
:title="t('dialog.previous_instances.header')" :title="t('dialog.previous_instances.header')"
width="1000px" width="1000px"
@@ -14,12 +14,12 @@
</div> </div>
<data-tables v-loading="loading" v-bind="previousInstancesWorldDialogTable" style="margin-top: 10px"> <data-tables v-loading="loading" v-bind="previousInstancesWorldDialogTable" style="margin-top: 10px">
<el-table-column :label="t('table.previous_instances.date')" prop="created_at" sortable width="170"> <el-table-column :label="t('table.previous_instances.date')" prop="created_at" sortable width="170">
<template slot-scope="scope"> <template #default="scope">
<span>{{ formatDateFilter(scope.row.created_at, 'long') }}</span> <span>{{ formatDateFilter(scope.row.created_at, 'long') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="t('table.previous_instances.instance_name')" prop="name"> <el-table-column :label="t('table.previous_instances.instance_name')" prop="name">
<template slot-scope="scope"> <template #default="scope">
<LocationWorld <LocationWorld
:locationobject="scope.row.$location" :locationobject="scope.row.$location"
:grouphint="scope.row.groupName" :grouphint="scope.row.groupName"
@@ -27,7 +27,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="t('table.previous_instances.instance_creator')" prop="location"> <el-table-column :label="t('table.previous_instances.instance_creator')" prop="location">
<template slot-scope="scope"> <template #default="scope">
<DisplayName <DisplayName
:userid="scope.row.$location.userId" :userid="scope.row.$location.userId"
:location="scope.row.$location.tag" :location="scope.row.$location.tag"
@@ -35,12 +35,12 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="t('table.previous_instances.time')" prop="time" width="100" sortable> <el-table-column :label="t('table.previous_instances.time')" prop="time" width="100" sortable>
<template slot-scope="scope"> <template #default="scope">
<span v-text="scope.row.timer"></span> <span v-text="scope.row.timer"></span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="t('table.previous_instances.action')" width="90" align="right"> <el-table-column :label="t('table.previous_instances.action')" width="90" align="right">
<template slot-scope="scope"> <template #default="scope">
<el-button <el-button
type="text" type="text"
icon="el-icon-s-data" icon="el-icon-s-data"
@@ -111,6 +111,7 @@
} }
}); });
const loading = ref(false); const loading = ref(false);
const previousInstancesWorldDialogRef = ref(null);
const isVisible = computed({ const isVisible = computed({
get: () => props.previousInstancesWorldDialog.visible, get: () => props.previousInstancesWorldDialog.visible,
@@ -161,7 +162,7 @@
() => { () => {
if (props.previousInstancesWorldDialog.visible) { if (props.previousInstancesWorldDialog.visible) {
nextTick(() => { nextTick(() => {
adjustDialogZ(proxy.$refs.previousInstancesWorldDialog.$el); adjustDialogZ(previousInstancesWorldDialogRef.value.$el);
}); });
refreshPreviousInstancesWorldTable(); refreshPreviousInstancesWorldTable();
} }
@@ -1,6 +1,6 @@
<template> <template>
<safe-dialog <safe-dialog
ref="previousInstancesUserDialog" ref="previousInstancesUserDialogRef"
:visible.sync="isVisible" :visible.sync="isVisible"
:title="$t('dialog.previous_instances.header')" :title="$t('dialog.previous_instances.header')"
width="1000px" width="1000px"
@@ -14,12 +14,12 @@
</div> </div>
<data-tables v-loading="loading" v-bind="previousInstancesUserDialogTable" style="margin-top: 10px"> <data-tables v-loading="loading" v-bind="previousInstancesUserDialogTable" style="margin-top: 10px">
<el-table-column :label="$t('table.previous_instances.date')" prop="created_at" sortable width="170"> <el-table-column :label="$t('table.previous_instances.date')" prop="created_at" sortable width="170">
<template slot-scope="scope"> <template #default="scope">
<span>{{ formatDateFilter(scope.row.created_at, 'long') }}</span> <span>{{ formatDateFilter(scope.row.created_at, 'long') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('table.previous_instances.world')" prop="name" sortable> <el-table-column :label="$t('table.previous_instances.world')" prop="name" sortable>
<template slot-scope="scope"> <template #default="scope">
<Location <Location
:location="scope.row.location" :location="scope.row.location"
:hint="scope.row.worldName" :hint="scope.row.worldName"
@@ -27,17 +27,17 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('table.previous_instances.instance_creator')" prop="location" width="170"> <el-table-column :label="$t('table.previous_instances.instance_creator')" prop="location" width="170">
<template slot-scope="scope"> <template #default="scope">
<DisplayName :userid="scope.row.$location.userId" :location="scope.row.$location.tag" /> <DisplayName :userid="scope.row.$location.userId" :location="scope.row.$location.tag" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('table.previous_instances.time')" prop="time" width="100" sortable> <el-table-column :label="$t('table.previous_instances.time')" prop="time" width="100" sortable>
<template slot-scope="scope"> <template #default="scope">
<span v-text="scope.row.timer"></span> <span v-text="scope.row.timer"></span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('table.previous_instances.action')" width="90" align="right"> <el-table-column :label="$t('table.previous_instances.action')" width="90" align="right">
<template slot-scope="scope"> <template #default="scope">
<el-button <el-button
type="text" type="text"
icon="el-icon-switch-button" icon="el-icon-switch-button"
@@ -123,6 +123,8 @@
const { showPreviousInstancesInfoDialog } = useInstanceStore(); const { showPreviousInstancesInfoDialog } = useInstanceStore();
const { shiftHeld } = storeToRefs(useUiStore()); const { shiftHeld } = storeToRefs(useUiStore());
const previousInstancesUserDialogRef = ref(null);
const isVisible = computed({ const isVisible = computed({
get: () => props.previousInstancesUserDialog.visible, get: () => props.previousInstancesUserDialog.visible,
set: (value) => { set: (value) => {
@@ -152,7 +154,7 @@
() => { () => {
if (props.previousInstancesUserDialog.visible) { if (props.previousInstancesUserDialog.visible) {
nextTick(() => { nextTick(() => {
adjustDialogZ(proxy.$refs.previousInstancesUserDialog.$el); adjustDialogZ(previousInstancesUserDialogRef.value.$el);
}); });
refreshPreviousInstancesUserTable(); refreshPreviousInstancesUserTable();
} }
@@ -901,7 +901,9 @@
<div class="x-friend-item" style="cursor: default"> <div class="x-friend-item" style="cursor: default">
<el-tooltip :placement="currentUser.id !== userDialog.id ? 'bottom' : 'top'"> <el-tooltip :placement="currentUser.id !== userDialog.id ? 'bottom' : 'top'">
<template #content> <template #content>
<span>{{ formatDateFilter(userOnlineForTimestamp(userDialog), 'short') }}</span> <span>{{
formatDateFilter(String(userOnlineForTimestamp(userDialog)), 'short')
}}</span>
</template> </template>
<div class="detail"> <div class="detail">
<span <span
@@ -1845,7 +1847,8 @@
useLocationStore, useLocationStore,
useModerationStore, useModerationStore,
useUserStore, useUserStore,
useWorldStore useWorldStore,
useUiStore
} from '../../../stores'; } from '../../../stores';
import SendInviteDialog from '../InviteDialog/SendInviteDialog.vue'; import SendInviteDialog from '../InviteDialog/SendInviteDialog.vue';
import InviteGroupDialog from '../InviteGroupDialog.vue'; import InviteGroupDialog from '../InviteGroupDialog.vue';
@@ -1895,6 +1898,7 @@
const { logout } = useAuthStore(); const { logout } = useAuthStore();
const { cachedConfig } = storeToRefs(useAuthStore()); const { cachedConfig } = storeToRefs(useAuthStore());
const { handlePlayerModerationAtSend, handlePlayerModeration, handlePlayerModerationDelete } = useModerationStore(); const { handlePlayerModerationAtSend, handlePlayerModeration, handlePlayerModerationDelete } = useModerationStore();
const { shiftHeld } = storeToRefs(useUiStore());
watch( watch(
() => userDialog.value.loading, () => userDialog.value.loading,
@@ -2066,7 +2070,7 @@
const data = await lookupAvatars('authorId', userId); const data = await lookupAvatars('authorId', userId);
const avatars = new Set(); const avatars = new Set();
userDialogAvatars.value.forEach((avatar) => { userDialogAvatars.value.forEach((avatar) => {
avatars.add(avatar.id, avatar); avatars.add(avatar.id);
}); });
if (data && typeof data === 'object') { if (data && typeof data === 'object') {
data.forEach((avatar) => { data.forEach((avatar) => {
@@ -2598,7 +2602,7 @@
async function sortCurrentUserGroups() { async function sortCurrentUserGroups() {
const D = userDialog.value; const D = userDialog.value;
let sortMethod = function () {}; let sortMethod = (a, b) => 0;
switch (D.groupSorting.value) { switch (D.groupSorting.value) {
case 'alphabetical': case 'alphabetical':
@@ -2621,7 +2625,7 @@
function setUserDialogAvatars(userId) { function setUserDialogAvatars(userId) {
const avatars = new Set(); const avatars = new Set();
userDialogAvatars.value.forEach((avatar) => { userDialogAvatars.value.forEach((avatar) => {
avatars.add(avatar.id, avatar); avatars.add(avatar.id);
}); });
for (const ref of cachedAvatars.value.values()) { for (const ref of cachedAvatars.value.values()) {
if (ref.authorId === userId && !avatars.has(ref.id)) { if (ref.authorId === userId && !avatars.has(ref.id)) {
@@ -2696,7 +2700,8 @@
const worldLists = []; const worldLists = [];
let params = { let params = {
ownerId: userId, ownerId: userId,
n: 100 n: 100,
offset: 0
}; };
const json = await request('favorite/groups', { const json = await request('favorite/groups', {
method: 'GET', method: 'GET',
@@ -2708,6 +2713,7 @@
continue; continue;
} }
params = { params = {
ownerId: userId,
n: 100, n: 100,
offset: 0, offset: 0,
userId, userId,
+1 -1
View File
@@ -27,7 +27,7 @@ function displayLocation(location, worldName, groupName) {
/** /**
* *
* @param {string} tag * @param {string} tag
* @returns {object} * @returns
*/ */
function parseLocation(tag) { function parseLocation(tag) {
let _tag = String(tag || ''); let _tag = String(tag || '');
+4 -4
View File
@@ -436,8 +436,8 @@ export const useUserStore = defineStore('User', () => {
const robotUrl = `${AppGlobal.endpointDomain}/file/file_0e8c4e32-7444-44ea-ade4-313c010d4bae/1/file`; const robotUrl = `${AppGlobal.endpointDomain}/file/file_0e8c4e32-7444-44ea-ade4-313c010d4bae/1/file`;
/** /**
* *
* @param {import('../types/user').getUserResponse} json * @param {import('../types/api/user').GetUserResponse} json
* @returns {import('../types/user').vrcxUser} * @returns {import('../types/api/user').VrcxUser}
*/ */
function applyUser(json) { function applyUser(json) {
let hasPropChanged = false; let hasPropChanged = false;
@@ -1735,8 +1735,8 @@ export const useUserStore = defineStore('User', () => {
} }
/** /**
* @param {import('../types/user').getCurrentUserResponse} json * @param {import('../types/api/user').GetCurrentUserResponse} json
* @returns {import('../types/user').getCurrentUserResponse} * @returns {import('../types/api/user').GetCurrentUserResponse}
*/ */
function applyCurrentUser(json) { function applyCurrentUser(json) {
authStore.attemptingAutoLogin = false; authStore.attemptingAutoLogin = false;
+9 -2
View File
@@ -18,9 +18,16 @@ export type GetFavoriteAvatars = (params: {
export type GetFavoriteWorlds = (params: { export type GetFavoriteWorlds = (params: {
n: number; n: number;
offset: number; offset: number;
userId?: string;
tag?: string;
}) => Promise<{ }) => Promise<{
json: GetFavoriteWorldsResponseList; json: GetFavoriteWorldsResponseList;
params: { n: number; offset: number }; params: {
n: number;
offset: number;
userId?: string;
tag?: string;
};
}>; }>;
export type AddFavorite = (params: { export type AddFavorite = (params: {
@@ -75,4 +82,4 @@ interface AddFavoriteResponse {
id: string; id: string;
type: 'world' | 'friend' | 'avatar'; type: 'world' | 'friend' | 'avatar';
tags: string[]; tags: string[];
} }