mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-07 14:56:06 +02:00
refactor: Splitting API requests from app.js (#1175)
This commit is contained in:
+190
-1099
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@ import * as workerTimers from 'worker-timers';
|
|||||||
import configRepository from '../repository/config.js';
|
import configRepository from '../repository/config.js';
|
||||||
import database from '../repository/database.js';
|
import database from '../repository/database.js';
|
||||||
import { baseClass, $app, API, $t, $utils } from './baseClass.js';
|
import { baseClass, $app, API, $t, $utils } from './baseClass.js';
|
||||||
import { avatarRequest, worldRequest } from './request';
|
import { avatarRequest, favoriteRequest, worldRequest } from './request';
|
||||||
|
|
||||||
export default class extends baseClass {
|
export default class extends baseClass {
|
||||||
constructor(_app, _API, _t) {
|
constructor(_app, _API, _t) {
|
||||||
@@ -317,11 +317,13 @@ export default class extends baseClass {
|
|||||||
),
|
),
|
||||||
callback: (action, instance) => {
|
callback: (action, instance) => {
|
||||||
if (action === 'confirm') {
|
if (action === 'confirm') {
|
||||||
API.saveFavoriteGroup({
|
favoriteRequest
|
||||||
|
.saveFavoriteGroup({
|
||||||
type: ctx.type,
|
type: ctx.type,
|
||||||
group: ctx.name,
|
group: ctx.name,
|
||||||
displayName: instance.inputValue
|
displayName: instance.inputValue
|
||||||
}).then((args) => {
|
})
|
||||||
|
.then((args) => {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: $t(
|
message: $t(
|
||||||
'prompt.change_favorite_group_name.message.success'
|
'prompt.change_favorite_group_name.message.success'
|
||||||
|
|||||||
@@ -0,0 +1,60 @@
|
|||||||
|
// #region | API: AvatarModeration
|
||||||
|
|
||||||
|
const avatarModerationReq = {
|
||||||
|
getAvatarModerations() {
|
||||||
|
return window.API.call('auth/user/avatarmoderations', {
|
||||||
|
method: 'GET'
|
||||||
|
}).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json
|
||||||
|
};
|
||||||
|
window.API.$emit('AVATAR-MODERATION:LIST', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {{ avatarModerationType: string, targetAvatarId: string }} params
|
||||||
|
* @return { Promise<{json: any, params}> }
|
||||||
|
*/
|
||||||
|
sendAvatarModeration(params) {
|
||||||
|
return window.API.call('auth/user/avatarmoderations', {
|
||||||
|
method: 'POST',
|
||||||
|
params
|
||||||
|
}).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
window.API.$emit('AVATAR-MODERATION', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {{ avatarModerationType: string, targetAvatarId: string }} params
|
||||||
|
* @return { Promise<{json: any, params}> }
|
||||||
|
*/
|
||||||
|
deleteAvatarModeration(params) {
|
||||||
|
return window.API.call(
|
||||||
|
`auth/user/avatarmoderations?targetAvatarId=${encodeURIComponent(
|
||||||
|
params.targetAvatarId
|
||||||
|
)}&avatarModerationType=${encodeURIComponent(
|
||||||
|
params.avatarModerationType
|
||||||
|
)}`,
|
||||||
|
{
|
||||||
|
method: 'DELETE'
|
||||||
|
}
|
||||||
|
).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
window.API.$emit('AVATAR-MODERATION:DELETE', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// #endregion
|
||||||
|
export default avatarModerationReq;
|
||||||
@@ -0,0 +1,187 @@
|
|||||||
|
// #region | API: Favorite
|
||||||
|
|
||||||
|
const favoriteReq = {
|
||||||
|
getFavoriteLimits() {
|
||||||
|
return window.API.call('auth/user/favoritelimits', {
|
||||||
|
method: 'GET'
|
||||||
|
}).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json
|
||||||
|
};
|
||||||
|
window.API.$emit('FAVORITE:LIMITS', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {{
|
||||||
|
* n: number,
|
||||||
|
* offset: number,
|
||||||
|
* type: string,
|
||||||
|
* tag: string
|
||||||
|
* }} params
|
||||||
|
* @return { Promise<{json: any, params}> }
|
||||||
|
*/
|
||||||
|
getFavorites(params) {
|
||||||
|
return window.API.call('favorites', {
|
||||||
|
method: 'GET',
|
||||||
|
params
|
||||||
|
}).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
window.API.$emit('FAVORITE:LIST', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {{
|
||||||
|
* type: string,
|
||||||
|
* favoriteId: string (objectId),
|
||||||
|
* tags: string
|
||||||
|
* }} params
|
||||||
|
* @return { Promise<{json: any, params}> }
|
||||||
|
*/
|
||||||
|
addFavorite(params) {
|
||||||
|
return window.API.call('favorites', {
|
||||||
|
method: 'POST',
|
||||||
|
params
|
||||||
|
}).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
window.API.$emit('FAVORITE:ADD', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {{ objectId: string }} params
|
||||||
|
* @return { Promise<{json: any, params}> }
|
||||||
|
*/
|
||||||
|
deleteFavorite(params) {
|
||||||
|
return window.API.call(`favorites/${params.objectId}`, {
|
||||||
|
method: 'DELETE'
|
||||||
|
}).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
window.API.$emit('FAVORITE:DELETE', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {{ n: number, offset: number, type: string }} params
|
||||||
|
* @return { Promise<{json: any, params}> }
|
||||||
|
*/
|
||||||
|
getFavoriteGroups(params) {
|
||||||
|
return window.API.call('favorite/groups', {
|
||||||
|
method: 'GET',
|
||||||
|
params
|
||||||
|
}).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
window.API.$emit('FAVORITE:GROUP:LIST', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {{ type: string, group: string, displayName: string, visibility: string }} params group is a name
|
||||||
|
* @return { Promise<{json: any, params}> }
|
||||||
|
*/
|
||||||
|
saveFavoriteGroup(params) {
|
||||||
|
return window.API.call(
|
||||||
|
`favorite/group/${params.type}/${params.group}/${window.API.currentUser.id}`,
|
||||||
|
{
|
||||||
|
method: 'PUT',
|
||||||
|
params
|
||||||
|
}
|
||||||
|
).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
window.API.$emit('FAVORITE:GROUP:SAVE', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {{
|
||||||
|
* type: string,
|
||||||
|
* group: string (name)
|
||||||
|
* }} params
|
||||||
|
* @return { Promise<{json: any, params}> }
|
||||||
|
*/
|
||||||
|
clearFavoriteGroup(params) {
|
||||||
|
return window.API.call(
|
||||||
|
`favorite/group/${params.type}/${params.group}/${window.API.currentUser.id}`,
|
||||||
|
{
|
||||||
|
method: 'DELETE',
|
||||||
|
params
|
||||||
|
}
|
||||||
|
).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
window.API.$emit('FAVORITE:GROUP:CLEAR', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {{
|
||||||
|
* n: number,
|
||||||
|
* offset: number
|
||||||
|
* }} params
|
||||||
|
* @return { Promise<{json: any, params}> }
|
||||||
|
*/
|
||||||
|
getFavoriteWorlds(params) {
|
||||||
|
return window.API.call('worlds/favorites', {
|
||||||
|
method: 'GET',
|
||||||
|
params
|
||||||
|
}).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
window.API.$emit('FAVORITE:WORLD:LIST', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {{
|
||||||
|
* n: number,
|
||||||
|
* offset: number
|
||||||
|
* }} params
|
||||||
|
* @return { Promise<{json: any, params}> }
|
||||||
|
*/
|
||||||
|
getFavoriteAvatars(params) {
|
||||||
|
return window.API.call('avatars/favorites', {
|
||||||
|
method: 'GET',
|
||||||
|
params
|
||||||
|
}).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
window.API.$emit('FAVORITE:AVATAR:LIST', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// #endregion
|
||||||
|
|
||||||
|
export default favoriteReq;
|
||||||
@@ -0,0 +1,306 @@
|
|||||||
|
const imageReq = {
|
||||||
|
// use in uploadAvatarImage
|
||||||
|
// need to test
|
||||||
|
async uploadAvatarFailCleanup(id) {
|
||||||
|
const json = await window.API.call(`file/${id}`, {
|
||||||
|
method: 'GET'
|
||||||
|
});
|
||||||
|
const fileId = json.id;
|
||||||
|
const fileVersion = json.versions[json.versions.length - 1].version;
|
||||||
|
window.API.call(`file/${fileId}/${fileVersion}/signature/finish`, {
|
||||||
|
method: 'PUT'
|
||||||
|
});
|
||||||
|
window.API.call(`file/${fileId}/${fileVersion}/file/finish`, {
|
||||||
|
method: 'PUT'
|
||||||
|
});
|
||||||
|
window.$app.avatarDialog.loading = false;
|
||||||
|
window.$app.changeAvatarImageDialogLoading = false;
|
||||||
|
},
|
||||||
|
|
||||||
|
async uploadAvatarImage(params, fileId) {
|
||||||
|
try {
|
||||||
|
return await window.API.call(`file/${fileId}`, {
|
||||||
|
method: 'POST',
|
||||||
|
params
|
||||||
|
}).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
params,
|
||||||
|
fileId
|
||||||
|
};
|
||||||
|
window.API.$emit('AVATARIMAGE:INIT', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
window.API.uploadAvatarFailCleanup(fileId);
|
||||||
|
}
|
||||||
|
return void 0;
|
||||||
|
},
|
||||||
|
|
||||||
|
async uploadAvatarImageFileStart(params) {
|
||||||
|
try {
|
||||||
|
return await window.API.call(
|
||||||
|
`file/${params.fileId}/${params.fileVersion}/file/start`,
|
||||||
|
{
|
||||||
|
method: 'PUT'
|
||||||
|
}
|
||||||
|
).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
window.API.$emit('AVATARIMAGE:FILESTART', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
window.API.uploadAvatarFailCleanup(params.fileId);
|
||||||
|
}
|
||||||
|
return void 0;
|
||||||
|
},
|
||||||
|
|
||||||
|
uploadAvatarImageFileFinish(params) {
|
||||||
|
return window.API.call(
|
||||||
|
`file/${params.fileId}/${params.fileVersion}/file/finish`,
|
||||||
|
{
|
||||||
|
method: 'PUT',
|
||||||
|
params: {
|
||||||
|
maxParts: 0,
|
||||||
|
nextPartNumber: 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
window.API.$emit('AVATARIMAGE:FILEFINISH', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
async uploadAvatarImageSigStart(params) {
|
||||||
|
try {
|
||||||
|
return await window.API.call(
|
||||||
|
`file/${params.fileId}/${params.fileVersion}/signature/start`,
|
||||||
|
{
|
||||||
|
method: 'PUT'
|
||||||
|
}
|
||||||
|
).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
window.API.$emit('AVATARIMAGE:SIGSTART', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
window.API.uploadAvatarFailCleanup(params.fileId);
|
||||||
|
}
|
||||||
|
return void 0;
|
||||||
|
},
|
||||||
|
|
||||||
|
uploadAvatarImageSigFinish(params) {
|
||||||
|
return window.API.call(
|
||||||
|
`file/${params.fileId}/${params.fileVersion}/signature/finish`,
|
||||||
|
{
|
||||||
|
method: 'PUT',
|
||||||
|
params: {
|
||||||
|
maxParts: 0,
|
||||||
|
nextPartNumber: 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
window.API.$emit('AVATARIMAGE:SIGFINISH', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
setAvatarImage(params) {
|
||||||
|
return window.API.call(`avatars/${params.id}`, {
|
||||||
|
method: 'PUT',
|
||||||
|
params
|
||||||
|
}).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
window.API.$emit('AVATARIMAGE:SET', args);
|
||||||
|
window.API.$emit('AVATAR', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// use in uploadWorldImage
|
||||||
|
// need to test
|
||||||
|
async uploadWorldFailCleanup(id) {
|
||||||
|
const json = await window.API.call(`file/${id}`, {
|
||||||
|
method: 'GET'
|
||||||
|
});
|
||||||
|
const fileId = json.id;
|
||||||
|
const fileVersion = json.versions[json.versions.length - 1].version;
|
||||||
|
window.API.call(`file/${fileId}/${fileVersion}/signature/finish`, {
|
||||||
|
method: 'PUT'
|
||||||
|
});
|
||||||
|
window.API.call(`file/${fileId}/${fileVersion}/file/finish`, {
|
||||||
|
method: 'PUT'
|
||||||
|
});
|
||||||
|
window.$app.worldDialog.loading = false;
|
||||||
|
window.$app.changeWorldImageDialogLoading = false;
|
||||||
|
},
|
||||||
|
|
||||||
|
async uploadWorldImage(params, fileId) {
|
||||||
|
try {
|
||||||
|
return await window.API.call(`file/${fileId}`, {
|
||||||
|
method: 'POST',
|
||||||
|
params
|
||||||
|
}).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
params,
|
||||||
|
fileId
|
||||||
|
};
|
||||||
|
window.API.$emit('WORLDIMAGE:INIT', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
window.API.uploadWorldFailCleanup(fileId);
|
||||||
|
}
|
||||||
|
return void 0;
|
||||||
|
},
|
||||||
|
|
||||||
|
async uploadWorldImageFileStart(params) {
|
||||||
|
try {
|
||||||
|
return await window.API.call(
|
||||||
|
`file/${params.fileId}/${params.fileVersion}/file/start`,
|
||||||
|
{
|
||||||
|
method: 'PUT'
|
||||||
|
}
|
||||||
|
).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
window.API.$emit('WORLDIMAGE:FILESTART', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
window.API.uploadWorldFailCleanup(params.fileId);
|
||||||
|
}
|
||||||
|
return void 0;
|
||||||
|
},
|
||||||
|
|
||||||
|
uploadWorldImageFileFinish(params) {
|
||||||
|
return window.API.call(
|
||||||
|
`file/${params.fileId}/${params.fileVersion}/file/finish`,
|
||||||
|
{
|
||||||
|
method: 'PUT',
|
||||||
|
params: {
|
||||||
|
maxParts: 0,
|
||||||
|
nextPartNumber: 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
window.API.$emit('WORLDIMAGE:FILEFINISH', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
async uploadWorldImageSigStart(params) {
|
||||||
|
try {
|
||||||
|
return await window.API.call(
|
||||||
|
`file/${params.fileId}/${params.fileVersion}/signature/start`,
|
||||||
|
{
|
||||||
|
method: 'PUT'
|
||||||
|
}
|
||||||
|
).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
window.API.$emit('WORLDIMAGE:SIGSTART', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
window.API.uploadWorldFailCleanup(params.fileId);
|
||||||
|
}
|
||||||
|
return void 0;
|
||||||
|
},
|
||||||
|
|
||||||
|
uploadWorldImageSigFinish(params) {
|
||||||
|
return window.API.call(
|
||||||
|
`file/${params.fileId}/${params.fileVersion}/signature/finish`,
|
||||||
|
{
|
||||||
|
method: 'PUT',
|
||||||
|
params: {
|
||||||
|
maxParts: 0,
|
||||||
|
nextPartNumber: 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
window.API.$emit('WORLDIMAGE:SIGFINISH', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
setWorldImage(params) {
|
||||||
|
return window.API.call(`worlds/${params.id}`, {
|
||||||
|
method: 'PUT',
|
||||||
|
params
|
||||||
|
}).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
window.API.$emit('WORLDIMAGE:SET', args);
|
||||||
|
window.API.$emit('WORLD', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
getAvatarImages(params) {
|
||||||
|
return window.API.call(`file/${params.fileId}`, {
|
||||||
|
method: 'GET'
|
||||||
|
}).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
window.API.$emit('AVATARIMAGE:GET', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
getWorldImages(params) {
|
||||||
|
return window.API.call(`file/${params.fileId}`, {
|
||||||
|
method: 'GET',
|
||||||
|
params
|
||||||
|
}).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
window.API.$emit('WORLDIMAGE:GET', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export default imageReq;
|
||||||
@@ -12,6 +12,14 @@ import instanceRequest from './instance';
|
|||||||
import friendRequest from './friend';
|
import friendRequest from './friend';
|
||||||
import avatarRequest from './avatar';
|
import avatarRequest from './avatar';
|
||||||
import notificationRequest from './notification';
|
import notificationRequest from './notification';
|
||||||
|
import playerModerationRequest from './playerModeration';
|
||||||
|
import avatarModerationRequest from './avatarModeration';
|
||||||
|
import favoriteRequest from './favorite';
|
||||||
|
import vrcPlusIconRequest from './vrcPlusIcon';
|
||||||
|
import vrcPlusImageRequest from './vrcPlusImage';
|
||||||
|
import inviteMessagesRequest from './inviteMessages';
|
||||||
|
import imageRequest from './image';
|
||||||
|
import miscRequest from './misc';
|
||||||
|
|
||||||
export {
|
export {
|
||||||
userRequest,
|
userRequest,
|
||||||
@@ -19,5 +27,13 @@ export {
|
|||||||
instanceRequest,
|
instanceRequest,
|
||||||
friendRequest,
|
friendRequest,
|
||||||
avatarRequest,
|
avatarRequest,
|
||||||
notificationRequest
|
notificationRequest,
|
||||||
|
playerModerationRequest,
|
||||||
|
avatarModerationRequest,
|
||||||
|
favoriteRequest,
|
||||||
|
vrcPlusIconRequest,
|
||||||
|
vrcPlusImageRequest,
|
||||||
|
inviteMessagesRequest,
|
||||||
|
imageRequest,
|
||||||
|
miscRequest
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
// #region | App: Invite Messages
|
||||||
|
|
||||||
|
const inviteMessagesReq = {
|
||||||
|
refreshInviteMessageTableData(messageType) {
|
||||||
|
return window.API.call(
|
||||||
|
`message/${window.API.currentUser.id}/${messageType}`,
|
||||||
|
{
|
||||||
|
method: 'GET'
|
||||||
|
}
|
||||||
|
).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
messageType
|
||||||
|
};
|
||||||
|
window.API.$emit(`INVITE:${messageType.toUpperCase()}`, args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
editInviteMessage(params, messageType, slot) {
|
||||||
|
return window.API.call(
|
||||||
|
`message/${window.API.currentUser.id}/${messageType}/${slot}`,
|
||||||
|
{
|
||||||
|
method: 'PUT',
|
||||||
|
params
|
||||||
|
}
|
||||||
|
).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
params,
|
||||||
|
messageType,
|
||||||
|
slot
|
||||||
|
};
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// #endregion
|
||||||
|
|
||||||
|
export default inviteMessagesReq;
|
||||||
@@ -0,0 +1,179 @@
|
|||||||
|
const miscReq = {
|
||||||
|
getBundles(fileId) {
|
||||||
|
return window.API.call(`file/${fileId}`, {
|
||||||
|
method: 'GET'
|
||||||
|
}).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json
|
||||||
|
};
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
saveNote(params) {
|
||||||
|
return window.API.call('userNotes', {
|
||||||
|
method: 'POST',
|
||||||
|
params
|
||||||
|
}).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
window.API.$emit('NOTE', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {{
|
||||||
|
* userId: string,
|
||||||
|
* contentType: string,
|
||||||
|
* reason: string,
|
||||||
|
* type: string
|
||||||
|
* }} params
|
||||||
|
* @return { Promise<{json: any, params}> }
|
||||||
|
*/
|
||||||
|
reportUser(params) {
|
||||||
|
return window.API.call(`feedback/${params.userId}/user`, {
|
||||||
|
method: 'POST',
|
||||||
|
params: {
|
||||||
|
contentType: params.contentType,
|
||||||
|
reason: params.reason,
|
||||||
|
type: params.type
|
||||||
|
}
|
||||||
|
}).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
window.API.$emit('FEEDBACK:REPORT:USER', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {{
|
||||||
|
* fileId: string,
|
||||||
|
* version: number
|
||||||
|
* }} params
|
||||||
|
* @return { Promise<{json: any, params}> }
|
||||||
|
*/
|
||||||
|
getFileAnalysis(params) {
|
||||||
|
return window.API.call(
|
||||||
|
`analysis/${params.fileId}/${params.version}/${params.variant}`,
|
||||||
|
{
|
||||||
|
method: 'GET'
|
||||||
|
}
|
||||||
|
).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
window.API.$emit('FILE:ANALYSIS', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
getVRChatCredits() {
|
||||||
|
return window.API.call(`user/${window.API.currentUser.id}/balance`, {
|
||||||
|
method: 'GET'
|
||||||
|
}).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json
|
||||||
|
};
|
||||||
|
window.API.$emit('VRCCREDITS', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {{
|
||||||
|
* location: string,
|
||||||
|
* hardClose: boolean
|
||||||
|
* }} params
|
||||||
|
* @returns {Promise<{json: any, params}>}
|
||||||
|
*/
|
||||||
|
closeInstance(params) {
|
||||||
|
return window.API.call(`instances/${params.location}`, {
|
||||||
|
method: 'DELETE',
|
||||||
|
params: {
|
||||||
|
hardClose: params.hardClose ?? false
|
||||||
|
}
|
||||||
|
}).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
window.API.$emit('INSTANCE:CLOSE', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {{
|
||||||
|
* worldId: string
|
||||||
|
* }} params
|
||||||
|
* @returns {Promise<{json: any, params}>}
|
||||||
|
*/
|
||||||
|
deleteWorldPersistData(params) {
|
||||||
|
return window.API.call(
|
||||||
|
`users/${window.API.currentUser.id}/${params.worldId}/persist`,
|
||||||
|
{
|
||||||
|
method: 'DELETE'
|
||||||
|
}
|
||||||
|
).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
window.API.$emit('WORLD:PERSIST:DELETE', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {{
|
||||||
|
* worldId: string
|
||||||
|
* }} params
|
||||||
|
* @returns {Promise<{json: any, params}>}
|
||||||
|
*/
|
||||||
|
hasWorldPersistData(params) {
|
||||||
|
return window.API.call(
|
||||||
|
`users/${window.API.currentUser.id}/${params.worldId}/persist/exists`,
|
||||||
|
{
|
||||||
|
method: 'GET'
|
||||||
|
}
|
||||||
|
).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
window.API.$emit('WORLD:PERSIST:HAS', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
updateBadge(params) {
|
||||||
|
return window.API.call(
|
||||||
|
`users/${window.API.currentUser.id}/badges/${params.badgeId}`,
|
||||||
|
{
|
||||||
|
method: 'PUT',
|
||||||
|
params: {
|
||||||
|
userId: window.API.currentUser.id,
|
||||||
|
badgeId: params.badgeId,
|
||||||
|
hidden: params.hidden,
|
||||||
|
showcased: params.showcased
|
||||||
|
}
|
||||||
|
}
|
||||||
|
).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
window.API.$emit('BADGE:UPDATE', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export default miscReq;
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
// #region | API: PlayerModeration
|
||||||
|
|
||||||
|
const playerModerationReq = {
|
||||||
|
getPlayerModerations() {
|
||||||
|
return window.API.call('auth/user/playermoderations', {
|
||||||
|
method: 'GET'
|
||||||
|
}).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json
|
||||||
|
};
|
||||||
|
window.API.$emit('PLAYER-MODERATION:LIST', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {{ moderated: string, type: string }} params
|
||||||
|
* @return { Promise<{json: any, params}> }
|
||||||
|
*/
|
||||||
|
// old-way: POST auth/user/blocks {blocked:userId}
|
||||||
|
sendPlayerModeration(params) {
|
||||||
|
return window.API.call('auth/user/playermoderations', {
|
||||||
|
method: 'POST',
|
||||||
|
params
|
||||||
|
}).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
window.API.$emit('PLAYER-MODERATION:SEND', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {{ moderated: string, type: string }} params
|
||||||
|
* @return { Promise<{json: any, params}> }
|
||||||
|
*/
|
||||||
|
// old-way: PUT auth/user/unblocks {blocked:userId}
|
||||||
|
deletePlayerModeration(params) {
|
||||||
|
return window.API.call('auth/user/unplayermoderate', {
|
||||||
|
method: 'PUT',
|
||||||
|
params
|
||||||
|
}).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
window.API.$emit('PLAYER-MODERATION:DELETE', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// #endregion
|
||||||
|
export default playerModerationReq;
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
// #region | App: VRCPlus Icons
|
||||||
|
|
||||||
|
const VRCPlusIconsReq = {
|
||||||
|
getFileList(params) {
|
||||||
|
return window.API.call('files', {
|
||||||
|
method: 'GET',
|
||||||
|
params
|
||||||
|
}).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
window.API.$emit('FILES:LIST', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
deleteFile(fileId) {
|
||||||
|
return window.API.call(`file/${fileId}`, {
|
||||||
|
method: 'DELETE'
|
||||||
|
}).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
fileId
|
||||||
|
};
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
uploadVRCPlusIcon(imageData) {
|
||||||
|
const params = {
|
||||||
|
tag: 'icon'
|
||||||
|
};
|
||||||
|
return window.API.call('file/image', {
|
||||||
|
uploadImage: true,
|
||||||
|
matchingDimensions: true,
|
||||||
|
postData: JSON.stringify(params),
|
||||||
|
imageData
|
||||||
|
}).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
window.API.$emit('VRCPLUSICON:ADD', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// unused
|
||||||
|
// images.pug line 63
|
||||||
|
// deleteFileVersion(params) {
|
||||||
|
// return window.API.call(`file/${params.fileId}/${params.version}`, {
|
||||||
|
// method: 'DELETE'
|
||||||
|
// }).then((json) => {
|
||||||
|
// const args = {
|
||||||
|
// json,
|
||||||
|
// params
|
||||||
|
// };
|
||||||
|
// return args;
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
};
|
||||||
|
|
||||||
|
// #endregion
|
||||||
|
|
||||||
|
export default VRCPlusIconsReq;
|
||||||
@@ -0,0 +1,125 @@
|
|||||||
|
const vrcPlusImageReq = {
|
||||||
|
uploadGalleryImage(imageData) {
|
||||||
|
const params = {
|
||||||
|
tag: 'gallery'
|
||||||
|
};
|
||||||
|
return window.API.call('file/image', {
|
||||||
|
uploadImage: true,
|
||||||
|
matchingDimensions: false,
|
||||||
|
postData: JSON.stringify(params),
|
||||||
|
imageData
|
||||||
|
}).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
window.API.$emit('GALLERYIMAGE:ADD', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
uploadSticker(imageData, params) {
|
||||||
|
return window.API.call('file/image', {
|
||||||
|
uploadImage: true,
|
||||||
|
matchingDimensions: true,
|
||||||
|
postData: JSON.stringify(params),
|
||||||
|
imageData
|
||||||
|
}).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
window.API.$emit('STICKER:ADD', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
getPrints(params) {
|
||||||
|
return window.API.call(`prints/user/${window.API.currentUser.id}`, {
|
||||||
|
method: 'GET',
|
||||||
|
params
|
||||||
|
}).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
window.API.$emit('PRINT:LIST', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
deletePrint(printId) {
|
||||||
|
return window.API.call(`prints/${printId}`, {
|
||||||
|
method: 'DELETE'
|
||||||
|
}).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
printId
|
||||||
|
};
|
||||||
|
window.API.$emit('PRINT:DELETE', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
uploadPrint(imageData, params) {
|
||||||
|
return window.API.call('prints', {
|
||||||
|
uploadImagePrint: true,
|
||||||
|
postData: JSON.stringify(params),
|
||||||
|
imageData
|
||||||
|
}).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
window.API.$emit('PRINT:ADD', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
getPrint(params) {
|
||||||
|
return window.API.call(`prints/${params.printId}`, {
|
||||||
|
method: 'GET'
|
||||||
|
}).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
window.API.$emit('PRINT', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
uploadEmoji(imageData, params) {
|
||||||
|
return window.API.call('file/image', {
|
||||||
|
uploadImage: true,
|
||||||
|
matchingDimensions: true,
|
||||||
|
postData: JSON.stringify(params),
|
||||||
|
imageData
|
||||||
|
}).then((json) => {
|
||||||
|
const args = {
|
||||||
|
json,
|
||||||
|
params
|
||||||
|
};
|
||||||
|
window.API.$emit('EMOJI:ADD', args);
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------- no place uses this function ------------
|
||||||
|
|
||||||
|
// editPrint(params) {
|
||||||
|
// return window.API.call(`prints/${params.printId}`, {
|
||||||
|
// method: 'POST',
|
||||||
|
// params
|
||||||
|
// }).then((json) => {
|
||||||
|
// const args = {
|
||||||
|
// json,
|
||||||
|
// params
|
||||||
|
// };
|
||||||
|
// window.API.$emit('PRINT:EDIT', args);
|
||||||
|
// return args;
|
||||||
|
// });
|
||||||
|
// },
|
||||||
|
};
|
||||||
|
|
||||||
|
export default vrcPlusImageReq;
|
||||||
@@ -205,7 +205,7 @@ export default class extends baseClass {
|
|||||||
'<el-tooltip v-if="isValidInstance" placement="bottom">' +
|
'<el-tooltip v-if="isValidInstance" placement="bottom">' +
|
||||||
'<div slot="content">' +
|
'<div slot="content">' +
|
||||||
'<template v-if="isClosed"><span>Closed At: {{ closedAt | formatDate(\'long\') }}</span></br></template>' +
|
'<template v-if="isClosed"><span>Closed At: {{ closedAt | formatDate(\'long\') }}</span></br></template>' +
|
||||||
'<template v-if="canCloseInstance"><el-button :disabled="isClosed" size="mini" type="primary" @click="$app.closeInstance(location)">{{ $t("dialog.user.info.close_instance") }}</el-button></br></br></template>' +
|
'<template v-if="canCloseInstance"><el-button :disabled="isClosed" size="mini" type="primary" @click="$root.closeInstance(location)">{{ $t("dialog.user.info.close_instance") }}</el-button></br></br></template>' +
|
||||||
'<span><span style="color:#409eff">PC: </span>{{ platforms.standalonewindows }}</span></br>' +
|
'<span><span style="color:#409eff">PC: </span>{{ platforms.standalonewindows }}</span></br>' +
|
||||||
'<span><span style="color:#67c23a">Android: </span>{{ platforms.android }}</span></br>' +
|
'<span><span style="color:#67c23a">Android: </span>{{ platforms.android }}</span></br>' +
|
||||||
'<span>{{ $t("dialog.user.info.instance_game_version") }} {{ gameServerVersion }}</span></br>' +
|
'<span>{{ $t("dialog.user.info.instance_game_version") }} {{ gameServerVersion }}</span></br>' +
|
||||||
|
|||||||
@@ -129,6 +129,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { favoriteRequest } from '../../classes/request';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'FavoritesWorldItem',
|
name: 'FavoritesWorldItem',
|
||||||
inject: ['API'],
|
inject: ['API'],
|
||||||
@@ -170,10 +172,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
moveFavorite(ref, group, type) {
|
moveFavorite(ref, group, type) {
|
||||||
this.API.deleteFavorite({
|
favoriteRequest
|
||||||
|
.deleteFavorite({
|
||||||
objectId: ref.id
|
objectId: ref.id
|
||||||
}).then(() => {
|
})
|
||||||
this.API.addFavorite({
|
.then(() => {
|
||||||
|
favoriteRequest.addFavorite({
|
||||||
type,
|
type,
|
||||||
favoriteId: ref.id,
|
favoriteId: ref.id,
|
||||||
tags: group.name
|
tags: group.name
|
||||||
@@ -181,7 +185,7 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
deleteFavorite(objectId) {
|
deleteFavorite(objectId) {
|
||||||
this.API.deleteFavorite({
|
favoriteRequest.deleteFavorite({
|
||||||
objectId
|
objectId
|
||||||
});
|
});
|
||||||
// FIXME: 메시지 수정
|
// FIXME: 메시지 수정
|
||||||
@@ -200,11 +204,13 @@
|
|||||||
},
|
},
|
||||||
addFavoriteWorld(ref, group, message) {
|
addFavoriteWorld(ref, group, message) {
|
||||||
// wait API splitting PR Merged
|
// wait API splitting PR Merged
|
||||||
return this.API.addFavorite({
|
return favoriteRequest
|
||||||
|
.addFavorite({
|
||||||
type: 'world',
|
type: 'world',
|
||||||
favoriteId: ref.id,
|
favoriteId: ref.id,
|
||||||
tags: group.name
|
tags: group.name
|
||||||
}).then((args) => {
|
})
|
||||||
|
.then((args) => {
|
||||||
if (message) {
|
if (message) {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: 'World added to favorites',
|
message: 'World added to favorites',
|
||||||
|
|||||||
@@ -224,6 +224,8 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import FavoritesWorldItem from './FavoritesWorldItem.vue';
|
import FavoritesWorldItem from './FavoritesWorldItem.vue';
|
||||||
|
import { favoriteRequest } from '../../classes/request';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'FavoritesWorldTab',
|
name: 'FavoritesWorldTab',
|
||||||
components: {
|
components: {
|
||||||
@@ -296,7 +298,7 @@
|
|||||||
group: name,
|
group: name,
|
||||||
visibility
|
visibility
|
||||||
};
|
};
|
||||||
this.API.saveFavoriteGroup(params).then((args) => {
|
favoriteRequest.saveFavoriteGroup(params).then((args) => {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: 'Group visibility changed',
|
message: 'Group visibility changed',
|
||||||
type: 'success'
|
type: 'success'
|
||||||
|
|||||||
@@ -202,7 +202,6 @@
|
|||||||
@click="deleteVRChatCache(worldDialog.ref)" />
|
@click="deleteVRChatCache(worldDialog.ref)" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-tooltip
|
<el-tooltip
|
||||||
v-if="worldDialog.isFavorite"
|
|
||||||
placement="top"
|
placement="top"
|
||||||
:content="$t('dialog.world.actions.favorites_tooltip')"
|
:content="$t('dialog.world.actions.favorites_tooltip')"
|
||||||
:disabled="hideTooltips">
|
:disabled="hideTooltips">
|
||||||
|
|||||||
@@ -6,8 +6,7 @@
|
|||||||
:filters="filters"
|
:filters="filters"
|
||||||
:tableProps="tableProps"
|
:tableProps="tableProps"
|
||||||
:paginationProps="paginationProps"
|
:paginationProps="paginationProps"
|
||||||
v-loading="API.isPlayerModerationsLoading"
|
v-loading="API.isPlayerModerationsLoading">
|
||||||
>
|
|
||||||
<template slot="tool">
|
<template slot="tool">
|
||||||
<div class="tool-slot">
|
<div class="tool-slot">
|
||||||
<el-select
|
<el-select
|
||||||
@@ -16,32 +15,27 @@
|
|||||||
multiple
|
multiple
|
||||||
clearable
|
clearable
|
||||||
style="flex: 1"
|
style="flex: 1"
|
||||||
:placeholder="$t('view.moderation.filter_placeholder')"
|
:placeholder="$t('view.moderation.filter_placeholder')">
|
||||||
>
|
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in moderationTypes"
|
v-for="item in moderationTypes"
|
||||||
:key="item"
|
:key="item"
|
||||||
:label="$t('view.moderation.filters.' + item)"
|
:label="$t('view.moderation.filters.' + item)"
|
||||||
:value="item"
|
:value="item" />
|
||||||
/>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-input
|
<el-input
|
||||||
v-model="filters[1].value"
|
v-model="filters[1].value"
|
||||||
:placeholder="$t('view.moderation.search_placeholder')"
|
:placeholder="$t('view.moderation.search_placeholder')"
|
||||||
class="filter-input"
|
class="filter-input" />
|
||||||
/>
|
|
||||||
<el-tooltip
|
<el-tooltip
|
||||||
placement="bottom"
|
placement="bottom"
|
||||||
:content="$t('view.moderation.refresh_tooltip')"
|
:content="$t('view.moderation.refresh_tooltip')"
|
||||||
:disabled="hideTooltips"
|
:disabled="hideTooltips">
|
||||||
>
|
|
||||||
<el-button
|
<el-button
|
||||||
type="default"
|
type="default"
|
||||||
:loading="API.isPlayerModerationsLoading"
|
:loading="API.isPlayerModerationsLoading"
|
||||||
@click="API.refreshPlayerModerations()"
|
@click="API.refreshPlayerModerations()"
|
||||||
icon="el-icon-refresh"
|
icon="el-icon-refresh"
|
||||||
circle
|
circle />
|
||||||
/>
|
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -65,8 +59,7 @@
|
|||||||
<span
|
<span
|
||||||
class="x-link"
|
class="x-link"
|
||||||
v-text="scope.row.sourceDisplayName"
|
v-text="scope.row.sourceDisplayName"
|
||||||
@click="showUserDialog(scope.row.sourceUserId)"
|
@click="showUserDialog(scope.row.sourceUserId)"></span>
|
||||||
></span>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :label="$t('table.moderation.target')" prop="targetDisplayName">
|
<el-table-column :label="$t('table.moderation.target')" prop="targetDisplayName">
|
||||||
@@ -74,8 +67,7 @@
|
|||||||
<span
|
<span
|
||||||
class="x-link"
|
class="x-link"
|
||||||
v-text="scope.row.targetDisplayName"
|
v-text="scope.row.targetDisplayName"
|
||||||
@click="showUserDialog(scope.row.targetUserId)"
|
@click="showUserDialog(scope.row.targetUserId)"></span>
|
||||||
></span>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :label="$t('table.moderation.action')" width="80" align="right">
|
<el-table-column :label="$t('table.moderation.action')" width="80" align="right">
|
||||||
@@ -87,15 +79,13 @@
|
|||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-close"
|
icon="el-icon-close"
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="deletePlayerModeration(scope.row)"
|
@click="deletePlayerModeration(scope.row)"></el-button>
|
||||||
></el-button>
|
|
||||||
<el-button
|
<el-button
|
||||||
v-else
|
v-else
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-close"
|
icon="el-icon-close"
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="deletePlayerModerationPrompt(scope.row)"
|
@click="deletePlayerModerationPrompt(scope.row)"></el-button>
|
||||||
></el-button>
|
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -104,6 +94,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { playerModerationRequest } from '../../classes/request/index.js';
|
||||||
import configRepository from '../../repository/config.js';
|
import configRepository from '../../repository/config.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -163,7 +154,7 @@
|
|||||||
configRepository.setString('VRCX_playerModerationTableFilters', JSON.stringify(this.filters[0].value));
|
configRepository.setString('VRCX_playerModerationTableFilters', JSON.stringify(this.filters[0].value));
|
||||||
},
|
},
|
||||||
deletePlayerModeration(row) {
|
deletePlayerModeration(row) {
|
||||||
this.API.deletePlayerModeration({
|
playerModerationRequest.deletePlayerModeration({
|
||||||
moderated: row.targetUserId,
|
moderated: row.targetUserId,
|
||||||
type: row.type
|
type: row.type
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user