mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-18 22:33:50 +02:00
Refactor 1
This commit is contained in:
@@ -603,15 +603,15 @@ namespace VRCX
|
||||
var data = line.Substring(offset + 24);
|
||||
if (data == logContext.LastVideoError)
|
||||
return true;
|
||||
logContext.LastVideoError = data;
|
||||
logContext.LastVideoError = data;
|
||||
|
||||
AppendLog(new[]
|
||||
{
|
||||
fileInfo.Name,
|
||||
ConvertLogTimeToISO8601(line),
|
||||
"event",
|
||||
"VideoError: " + data
|
||||
});
|
||||
AppendLog(new[]
|
||||
{
|
||||
fileInfo.Name,
|
||||
ConvertLogTimeToISO8601(line),
|
||||
"event",
|
||||
"VideoError: " + data
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1015,6 +1015,19 @@ namespace VRCX
|
||||
{
|
||||
// 2022.11.29 04:27:33 Error - [UdonBehaviour] An exception occurred during Udon execution, this UdonBehaviour will be halted.
|
||||
// VRC.Udon.VM.UdonVMException: An exception occurred in an UdonVM, execution will be halted. --->VRC.Udon.VM.UdonVMException: An exception occurred during EXTERN to 'VRCSDKBaseVRCPlayerApi.__get_displayName__SystemString'. --->System.NullReferenceException: Object reference not set to an instance of an object.
|
||||
|
||||
if (line.Contains("[PyPyDance]"))
|
||||
{
|
||||
AppendLog(new[]
|
||||
{
|
||||
fileInfo.Name,
|
||||
ConvertLogTimeToISO8601(line),
|
||||
"udon-exception",
|
||||
line
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
var lineOffset = line.IndexOf(" ---> VRC.Udon.VM.UdonVMException: ");
|
||||
if (lineOffset < 0)
|
||||
return false;
|
||||
@@ -1193,7 +1206,7 @@ namespace VRCX
|
||||
fileInfo.Name,
|
||||
ConvertLogTimeToISO8601(line),
|
||||
"event",
|
||||
$"VRChat couldn't start OSC server, you may be affected by (https://vrchat.canny.io/bug-reports/p/installexe-breaks-osc-port-binding) \"{line.Substring(offset)}\""
|
||||
$"VRChat couldn't start OSC server, \"{line.Substring(offset)}\""
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
13771
html/src/app.js
13771
html/src/app.js
File diff suppressed because it is too large
Load Diff
37
html/src/classes/API/config.js
Normal file
37
html/src/classes/API/config.js
Normal file
@@ -0,0 +1,37 @@
|
||||
import { baseClass, $app, API, $t, $utils } from '../baseClass.js';
|
||||
|
||||
export default class extends baseClass {
|
||||
constructor(_app, _API, _t) {
|
||||
super(_app, _API, _t);
|
||||
}
|
||||
|
||||
init() {
|
||||
API.getConfig = function () {
|
||||
return this.call('config', {
|
||||
method: 'GET'
|
||||
}).then((json) => {
|
||||
var args = {
|
||||
json
|
||||
};
|
||||
this.$emit('CONFIG', args);
|
||||
return args;
|
||||
});
|
||||
};
|
||||
|
||||
API.$on('CONFIG', function (args) {
|
||||
args.ref = this.applyConfig(args.json);
|
||||
});
|
||||
|
||||
API.applyConfig = function (json) {
|
||||
var ref = {
|
||||
...json
|
||||
};
|
||||
this.cachedConfig = ref;
|
||||
return ref;
|
||||
};
|
||||
}
|
||||
|
||||
_data = {};
|
||||
|
||||
_methods = {};
|
||||
}
|
||||
16
html/src/classes/_classTemplate.js
Normal file
16
html/src/classes/_classTemplate.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import * as workerTimers from 'worker-timers';
|
||||
import configRepository from '../repository/config.js';
|
||||
import database from '../repository/database.js';
|
||||
import { baseClass, $app, API, $t, $utils } from './baseClass.js';
|
||||
|
||||
export default class extends baseClass {
|
||||
constructor(_app, _API, _t) {
|
||||
super(_app, _API, _t);
|
||||
}
|
||||
|
||||
init() {}
|
||||
|
||||
_data = {};
|
||||
|
||||
_methods = {};
|
||||
}
|
||||
53
html/src/classes/apiInit.js
Normal file
53
html/src/classes/apiInit.js
Normal file
@@ -0,0 +1,53 @@
|
||||
import { baseClass, $app, API, $t } from './baseClass.js';
|
||||
|
||||
export default class extends baseClass {
|
||||
constructor(_app) {
|
||||
super(_app);
|
||||
}
|
||||
|
||||
eventHandlers = new Map();
|
||||
|
||||
$emit = function (name, ...args) {
|
||||
if ($app.debug) {
|
||||
console.log(name, ...args);
|
||||
}
|
||||
var handlers = this.eventHandlers.get(name);
|
||||
if (typeof handlers === 'undefined') {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
for (var handler of handlers) {
|
||||
handler.apply(this, args);
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
};
|
||||
|
||||
$on = function (name, handler) {
|
||||
var handlers = this.eventHandlers.get(name);
|
||||
if (typeof handlers === 'undefined') {
|
||||
handlers = [];
|
||||
this.eventHandlers.set(name, handlers);
|
||||
}
|
||||
handlers.push(handler);
|
||||
};
|
||||
|
||||
$off = function (name, handler) {
|
||||
var handlers = this.eventHandlers.get(name);
|
||||
if (typeof handlers === 'undefined') {
|
||||
return;
|
||||
}
|
||||
var { length } = handlers;
|
||||
for (var i = 0; i < length; ++i) {
|
||||
if (handlers[i] === handler) {
|
||||
if (length > 1) {
|
||||
handlers.splice(i, 1);
|
||||
} else {
|
||||
this.eventHandlers.delete(name);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
438
html/src/classes/apiLogin.js
Normal file
438
html/src/classes/apiLogin.js
Normal file
@@ -0,0 +1,438 @@
|
||||
import Noty from 'noty';
|
||||
import security from '../security.js';
|
||||
import configRepository from '../repository/config.js';
|
||||
import { baseClass, $app, API, $t } from './baseClass.js';
|
||||
/* eslint-disable no-unused-vars */
|
||||
let webApiService = {};
|
||||
/* eslint-enable no-unused-vars */
|
||||
|
||||
export default class extends baseClass {
|
||||
constructor(_app, _API, _t, _webApiService) {
|
||||
super(_app, _API, _t);
|
||||
webApiService = _webApiService;
|
||||
}
|
||||
|
||||
async init() {
|
||||
$app.savedCredentials =
|
||||
(await configRepository.getString('savedCredentials')) !== null
|
||||
? JSON.parse(
|
||||
await configRepository.getString('savedCredentials')
|
||||
)
|
||||
: {};
|
||||
$app.lastUserLoggedIn =
|
||||
await configRepository.getString('lastUserLoggedIn');
|
||||
|
||||
API.isLoggedIn = false;
|
||||
API.attemptingAutoLogin = false;
|
||||
|
||||
/**
|
||||
* @param {{ username: string, password: string }} params credential to login
|
||||
* @returns {Promise<{origin: boolean, json: any, params}>}
|
||||
*/
|
||||
API.login = function (params) {
|
||||
var { username, password, saveCredentials, cipher } = params;
|
||||
username = encodeURIComponent(username);
|
||||
password = encodeURIComponent(password);
|
||||
var auth = btoa(`${username}:${password}`);
|
||||
if (saveCredentials) {
|
||||
delete params.saveCredentials;
|
||||
if (cipher) {
|
||||
params.password = cipher;
|
||||
delete params.cipher;
|
||||
}
|
||||
$app.saveCredentials = params;
|
||||
}
|
||||
return this.call('auth/user', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
Authorization: `Basic ${auth}`
|
||||
}
|
||||
}).then((json) => {
|
||||
var args = {
|
||||
json,
|
||||
params,
|
||||
origin: true
|
||||
};
|
||||
if (
|
||||
json.requiresTwoFactorAuth &&
|
||||
json.requiresTwoFactorAuth.includes('emailOtp')
|
||||
) {
|
||||
this.$emit('USER:EMAILOTP', args);
|
||||
} else if (json.requiresTwoFactorAuth) {
|
||||
this.$emit('USER:2FA', args);
|
||||
} else {
|
||||
this.$emit('USER:CURRENT', args);
|
||||
}
|
||||
return args;
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {{ code: string }} params One-time password
|
||||
* @returns {Promise<{json: any, params}>}
|
||||
*/
|
||||
API.verifyOTP = function (params) {
|
||||
return this.call('auth/twofactorauth/otp/verify', {
|
||||
method: 'POST',
|
||||
params
|
||||
}).then((json) => {
|
||||
var args = {
|
||||
json,
|
||||
params
|
||||
};
|
||||
this.$emit('OTP', args);
|
||||
return args;
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {{ code: string }} params One-time token
|
||||
* @returns {Promise<{json: any, params}>}
|
||||
*/
|
||||
API.verifyTOTP = function (params) {
|
||||
return this.call('auth/twofactorauth/totp/verify', {
|
||||
method: 'POST',
|
||||
params
|
||||
}).then((json) => {
|
||||
var args = {
|
||||
json,
|
||||
params
|
||||
};
|
||||
this.$emit('TOTP', args);
|
||||
return args;
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {{ code: string }} params One-time token
|
||||
* @returns {Promise<{json: any, params}>}
|
||||
*/
|
||||
API.verifyEmailOTP = function (params) {
|
||||
return this.call('auth/twofactorauth/emailotp/verify', {
|
||||
method: 'POST',
|
||||
params
|
||||
}).then((json) => {
|
||||
var args = {
|
||||
json,
|
||||
params
|
||||
};
|
||||
this.$emit('EMAILOTP', args);
|
||||
return args;
|
||||
});
|
||||
};
|
||||
|
||||
API.$on('AUTOLOGIN', function () {
|
||||
if (this.attemptingAutoLogin) {
|
||||
return;
|
||||
}
|
||||
this.attemptingAutoLogin = true;
|
||||
var user =
|
||||
$app.loginForm.savedCredentials[
|
||||
$app.loginForm.lastUserLoggedIn
|
||||
];
|
||||
if (typeof user === 'undefined') {
|
||||
this.attemptingAutoLogin = false;
|
||||
return;
|
||||
}
|
||||
if ($app.enablePrimaryPassword) {
|
||||
this.logout();
|
||||
return;
|
||||
}
|
||||
$app.relogin(user)
|
||||
.then(() => {
|
||||
if (this.errorNoty) {
|
||||
this.errorNoty.close();
|
||||
}
|
||||
this.errorNoty = new Noty({
|
||||
type: 'success',
|
||||
text: 'Automatically logged in.'
|
||||
}).show();
|
||||
console.log('Automatically logged in.');
|
||||
})
|
||||
.catch((err) => {
|
||||
if (this.errorNoty) {
|
||||
this.errorNoty.close();
|
||||
}
|
||||
this.errorNoty = new Noty({
|
||||
type: 'error',
|
||||
text: 'Failed to login automatically.'
|
||||
}).show();
|
||||
console.error('Failed to login automatically.', err);
|
||||
})
|
||||
.finally(() => {
|
||||
if (!navigator.onLine) {
|
||||
this.errorNoty = new Noty({
|
||||
type: 'error',
|
||||
text: `You're offline.`
|
||||
}).show();
|
||||
console.error(`You're offline.`);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
API.$on('USER:CURRENT', function () {
|
||||
this.attemptingAutoLogin = false;
|
||||
});
|
||||
|
||||
API.$on('LOGOUT', function () {
|
||||
this.attemptingAutoLogin = false;
|
||||
});
|
||||
|
||||
API.logout = function () {
|
||||
this.$emit('LOGOUT');
|
||||
// return this.call('logout', {
|
||||
// method: 'PUT'
|
||||
// }).finally(() => {
|
||||
// this.$emit('LOGOUT');
|
||||
// });
|
||||
};
|
||||
}
|
||||
|
||||
_data = {
|
||||
loginForm: {
|
||||
loading: true,
|
||||
username: '',
|
||||
password: '',
|
||||
endpoint: '',
|
||||
websocket: '',
|
||||
saveCredentials: false,
|
||||
savedCredentials: {},
|
||||
lastUserLoggedIn: '',
|
||||
rules: {
|
||||
username: [
|
||||
{
|
||||
required: true,
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
password: [
|
||||
{
|
||||
required: true,
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
_methods = {
|
||||
async relogin(user) {
|
||||
var { loginParmas } = user;
|
||||
if (user.cookies) {
|
||||
await webApiService.setCookies(user.cookies);
|
||||
}
|
||||
this.loginForm.lastUserLoggedIn = user.user.id; // for resend email 2fa
|
||||
if (loginParmas.endpoint) {
|
||||
API.endpointDomain = loginParmas.endpoint;
|
||||
API.websocketDomain = loginParmas.websocket;
|
||||
} else {
|
||||
API.endpointDomain = API.endpointDomainVrchat;
|
||||
API.websocketDomain = API.websocketDomainVrchat;
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
if (this.enablePrimaryPassword) {
|
||||
this.checkPrimaryPassword(loginParmas)
|
||||
.then((pwd) => {
|
||||
this.loginForm.loading = true;
|
||||
return API.getConfig()
|
||||
.catch((err) => {
|
||||
this.loginForm.loading = false;
|
||||
reject(err);
|
||||
})
|
||||
.then(() => {
|
||||
API.login({
|
||||
username: loginParmas.username,
|
||||
password: pwd,
|
||||
cipher: loginParmas.password,
|
||||
endpoint: loginParmas.endpoint,
|
||||
websocket: loginParmas.websocket
|
||||
})
|
||||
.catch((err2) => {
|
||||
this.loginForm.loading = false;
|
||||
// API.logout();
|
||||
reject(err2);
|
||||
})
|
||||
.then(() => {
|
||||
this.loginForm.loading = false;
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch((_) => {
|
||||
this.$message({
|
||||
message: 'Incorrect primary password',
|
||||
type: 'error'
|
||||
});
|
||||
reject(_);
|
||||
});
|
||||
} else {
|
||||
API.getConfig()
|
||||
.catch((err) => {
|
||||
this.loginForm.loading = false;
|
||||
reject(err);
|
||||
})
|
||||
.then(() => {
|
||||
API.login({
|
||||
username: loginParmas.username,
|
||||
password: loginParmas.password,
|
||||
endpoint: loginParmas.endpoint,
|
||||
websocket: loginParmas.websocket
|
||||
})
|
||||
.catch((err2) => {
|
||||
this.loginForm.loading = false;
|
||||
API.logout();
|
||||
reject(err2);
|
||||
})
|
||||
.then(() => {
|
||||
this.loginForm.loading = false;
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
async deleteSavedLogin(userId) {
|
||||
var savedCredentials = JSON.parse(
|
||||
await configRepository.getString('savedCredentials')
|
||||
);
|
||||
delete savedCredentials[userId];
|
||||
// Disable primary password when no account is available.
|
||||
if (Object.keys(savedCredentials).length === 0) {
|
||||
this.enablePrimaryPassword = false;
|
||||
await configRepository.setBool('enablePrimaryPassword', false);
|
||||
}
|
||||
this.loginForm.savedCredentials = savedCredentials;
|
||||
var jsonCredentials = JSON.stringify(savedCredentials);
|
||||
await configRepository.setString(
|
||||
'savedCredentials',
|
||||
jsonCredentials
|
||||
);
|
||||
new Noty({
|
||||
type: 'success',
|
||||
text: 'Account removed.'
|
||||
}).show();
|
||||
},
|
||||
|
||||
async login() {
|
||||
await webApiService.clearCookies();
|
||||
this.$refs.loginForm.validate((valid) => {
|
||||
if (valid && !this.loginForm.loading) {
|
||||
this.loginForm.loading = true;
|
||||
if (this.loginForm.endpoint) {
|
||||
API.endpointDomain = this.loginForm.endpoint;
|
||||
API.websocketDomain = this.loginForm.websocket;
|
||||
} else {
|
||||
API.endpointDomain = API.endpointDomainVrchat;
|
||||
API.websocketDomain = API.websocketDomainVrchat;
|
||||
}
|
||||
API.getConfig()
|
||||
.catch((err) => {
|
||||
this.loginForm.loading = false;
|
||||
throw err;
|
||||
})
|
||||
.then((args) => {
|
||||
if (
|
||||
this.loginForm.saveCredentials &&
|
||||
this.enablePrimaryPassword
|
||||
) {
|
||||
$app.$prompt(
|
||||
$t('prompt.primary_password.description'),
|
||||
$t('prompt.primary_password.header'),
|
||||
{
|
||||
inputType: 'password',
|
||||
inputPattern: /[\s\S]{1,32}/
|
||||
}
|
||||
)
|
||||
.then(({ value }) => {
|
||||
let saveCredential =
|
||||
this.loginForm.savedCredentials[
|
||||
Object.keys(
|
||||
this.loginForm
|
||||
.savedCredentials
|
||||
)[0]
|
||||
];
|
||||
security
|
||||
.decrypt(
|
||||
saveCredential.loginParmas
|
||||
.password,
|
||||
value
|
||||
)
|
||||
.then(() => {
|
||||
security
|
||||
.encrypt(
|
||||
this.loginForm.password,
|
||||
value
|
||||
)
|
||||
.then((pwd) => {
|
||||
API.login({
|
||||
username:
|
||||
this.loginForm
|
||||
.username,
|
||||
password:
|
||||
this.loginForm
|
||||
.password,
|
||||
endpoint:
|
||||
this.loginForm
|
||||
.endpoint,
|
||||
websocket:
|
||||
this.loginForm
|
||||
.websocket,
|
||||
saveCredentials:
|
||||
this.loginForm
|
||||
.saveCredentials,
|
||||
cipher: pwd
|
||||
}).then(() => {
|
||||
this.loginForm.username =
|
||||
'';
|
||||
this.loginForm.password =
|
||||
'';
|
||||
this.loginForm.endpoint =
|
||||
'';
|
||||
this.loginForm.websocket =
|
||||
'';
|
||||
});
|
||||
});
|
||||
});
|
||||
})
|
||||
.finally(() => {
|
||||
this.loginForm.loading = false;
|
||||
});
|
||||
return args;
|
||||
}
|
||||
API.login({
|
||||
username: this.loginForm.username,
|
||||
password: this.loginForm.password,
|
||||
endpoint: this.loginForm.endpoint,
|
||||
websocket: this.loginForm.websocket,
|
||||
saveCredentials: this.loginForm.saveCredentials
|
||||
})
|
||||
.then(() => {
|
||||
this.loginForm.username = '';
|
||||
this.loginForm.password = '';
|
||||
this.loginForm.endpoint = '';
|
||||
this.loginForm.websocket = '';
|
||||
})
|
||||
.finally(() => {
|
||||
this.loginForm.loading = false;
|
||||
});
|
||||
return args;
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
logout() {
|
||||
this.$confirm('Continue? Logout', 'Confirm', {
|
||||
confirmButtonText: 'Confirm',
|
||||
cancelButtonText: 'Cancel',
|
||||
type: 'info',
|
||||
callback: (action) => {
|
||||
if (action === 'confirm') {
|
||||
API.logout();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
372
html/src/classes/apiRequestHandler.js
Normal file
372
html/src/classes/apiRequestHandler.js
Normal file
@@ -0,0 +1,372 @@
|
||||
import Noty from 'noty';
|
||||
import { baseClass, $app, API, $t } from './baseClass.js';
|
||||
/* eslint-disable no-unused-vars */
|
||||
let webApiService = {};
|
||||
/* eslint-enable no-unused-vars */
|
||||
|
||||
export default class extends baseClass {
|
||||
constructor(_app, _API, _t, _webApiService) {
|
||||
super(_app, _API, _t);
|
||||
webApiService = _webApiService;
|
||||
}
|
||||
|
||||
init() {
|
||||
API.cachedConfig = {};
|
||||
API.pendingGetRequests = new Map();
|
||||
API.failedGetRequests = new Map();
|
||||
API.endpointDomainVrchat = 'https://api.vrchat.cloud/api/1';
|
||||
API.websocketDomainVrchat = 'wss://pipeline.vrchat.cloud';
|
||||
API.endpointDomain = 'https://api.vrchat.cloud/api/1';
|
||||
API.websocketDomain = 'wss://pipeline.vrchat.cloud';
|
||||
|
||||
API.call = function (endpoint, options) {
|
||||
var init = {
|
||||
url: `${API.endpointDomain}/${endpoint}`,
|
||||
method: 'GET',
|
||||
...options
|
||||
};
|
||||
var { params } = init;
|
||||
if (init.method === 'GET') {
|
||||
// don't retry recent 404/403
|
||||
if (this.failedGetRequests.has(endpoint)) {
|
||||
var lastRun = this.failedGetRequests.get(endpoint);
|
||||
if (lastRun >= Date.now() - 900000) {
|
||||
// 15mins
|
||||
throw new Error(
|
||||
`Bailing request due to recent 404/403, ${endpoint}`
|
||||
);
|
||||
}
|
||||
this.failedGetRequests.delete(endpoint);
|
||||
}
|
||||
// transform body to url
|
||||
if (params === Object(params)) {
|
||||
var url = new URL(init.url);
|
||||
var { searchParams } = url;
|
||||
for (var key in params) {
|
||||
searchParams.set(key, params[key]);
|
||||
}
|
||||
init.url = url.toString();
|
||||
}
|
||||
// merge requests
|
||||
var req = this.pendingGetRequests.get(init.url);
|
||||
if (typeof req !== 'undefined') {
|
||||
if (req.time >= Date.now() - 10000) {
|
||||
// 10s
|
||||
return req.req;
|
||||
}
|
||||
this.pendingGetRequests.delete(init.url);
|
||||
}
|
||||
} else if (
|
||||
init.uploadImage ||
|
||||
init.uploadFilePUT ||
|
||||
init.uploadImageLegacy
|
||||
) {
|
||||
// nothing
|
||||
} else {
|
||||
init.headers = {
|
||||
'Content-Type': 'application/json;charset=utf-8',
|
||||
...init.headers
|
||||
};
|
||||
init.body =
|
||||
params === Object(params) ? JSON.stringify(params) : '{}';
|
||||
}
|
||||
var req = webApiService
|
||||
.execute(init)
|
||||
.catch((err) => {
|
||||
this.$throw(0, err, endpoint);
|
||||
})
|
||||
.then((response) => {
|
||||
if (!response.data) {
|
||||
return response;
|
||||
}
|
||||
try {
|
||||
response.data = JSON.parse(response.data);
|
||||
if ($app.debugWebRequests) {
|
||||
console.log(init, response.data);
|
||||
}
|
||||
return response;
|
||||
} catch (e) {}
|
||||
if (response.status === 200) {
|
||||
this.$throw(0, 'Invalid JSON response', endpoint);
|
||||
}
|
||||
if (
|
||||
response.status === 429 &&
|
||||
init.url.endsWith('/instances/groups')
|
||||
) {
|
||||
$app.nextGroupInstanceRefresh = 120; // 1min
|
||||
throw new Error(
|
||||
`${response.status}: rate limited ${endpoint}`
|
||||
);
|
||||
}
|
||||
if (response.status === 504 || response.status === 502) {
|
||||
// ignore expected API errors
|
||||
throw new Error(
|
||||
`${response.status}: ${response.data} ${endpoint}`
|
||||
);
|
||||
}
|
||||
this.$throw(response.status, endpoint);
|
||||
return {};
|
||||
})
|
||||
.then(({ data, status }) => {
|
||||
if (status === 200) {
|
||||
if (!data) {
|
||||
return data;
|
||||
}
|
||||
var text = '';
|
||||
if (data.success === Object(data.success)) {
|
||||
text = data.success.message;
|
||||
} else if (data.OK === String(data.OK)) {
|
||||
text = data.OK;
|
||||
}
|
||||
if (text) {
|
||||
new Noty({
|
||||
type: 'success',
|
||||
text: $app.escapeTag(text)
|
||||
}).show();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
if (
|
||||
status === 401 &&
|
||||
data.error.message === '"Missing Credentials"'
|
||||
) {
|
||||
this.$emit('AUTOLOGIN');
|
||||
throw new Error('401: Missing Credentials');
|
||||
}
|
||||
if (
|
||||
status === 401 &&
|
||||
data.error.message === '"Unauthorized"' &&
|
||||
endpoint !== 'auth/user'
|
||||
) {
|
||||
// trigger 2FA dialog
|
||||
if (!$app.twoFactorAuthDialogVisible) {
|
||||
$app.API.getCurrentUser();
|
||||
}
|
||||
throw new Error('401: Unauthorized');
|
||||
}
|
||||
if (status === 403 && endpoint === 'config') {
|
||||
$app.$alert(
|
||||
'VRChat currently blocks most VPNs. Please disable any connected VPNs and try again.',
|
||||
'Login Error 403'
|
||||
);
|
||||
this.logout();
|
||||
throw new Error(`403: ${endpoint}`);
|
||||
}
|
||||
if (
|
||||
init.method === 'GET' &&
|
||||
status === 404 &&
|
||||
endpoint.startsWith('avatars/')
|
||||
) {
|
||||
$app.$message({
|
||||
message: 'Avatar private or deleted',
|
||||
type: 'error'
|
||||
});
|
||||
$app.avatarDialog.visible = false;
|
||||
throw new Error(
|
||||
`404: ${data.error.message} ${endpoint}`
|
||||
);
|
||||
}
|
||||
if (
|
||||
status === 404 &&
|
||||
endpoint.endsWith('/persist/exists')
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
if (
|
||||
init.method === 'GET' &&
|
||||
(status === 404 || status === 403) &&
|
||||
!endpoint.startsWith('auth/user')
|
||||
) {
|
||||
this.failedGetRequests.set(endpoint, Date.now());
|
||||
}
|
||||
if (
|
||||
init.method === 'GET' &&
|
||||
status === 404 &&
|
||||
endpoint.startsWith('users/') &&
|
||||
endpoint.split('/').length - 1 === 1
|
||||
) {
|
||||
throw new Error(
|
||||
`404: ${data.error.message} ${endpoint}`
|
||||
);
|
||||
}
|
||||
if (
|
||||
status === 404 &&
|
||||
endpoint.startsWith('invite/') &&
|
||||
init.inviteId
|
||||
) {
|
||||
this.expireNotification(init.inviteId);
|
||||
}
|
||||
if (
|
||||
status === 403 &&
|
||||
endpoint.startsWith('invite/myself/to/')
|
||||
) {
|
||||
throw new Error(
|
||||
`403: ${data.error.message} ${endpoint}`
|
||||
);
|
||||
}
|
||||
if (data && data.error === Object(data.error)) {
|
||||
this.$throw(
|
||||
data.error.status_code || status,
|
||||
data.error.message,
|
||||
endpoint
|
||||
);
|
||||
} else if (data && typeof data.error === 'string') {
|
||||
this.$throw(
|
||||
data.status_code || status,
|
||||
data.error,
|
||||
endpoint
|
||||
);
|
||||
}
|
||||
this.$throw(status, data, endpoint);
|
||||
return data;
|
||||
});
|
||||
if (init.method === 'GET') {
|
||||
req.finally(() => {
|
||||
this.pendingGetRequests.delete(init.url);
|
||||
});
|
||||
this.pendingGetRequests.set(init.url, {
|
||||
req,
|
||||
time: Date.now()
|
||||
});
|
||||
}
|
||||
return req;
|
||||
};
|
||||
|
||||
// FIXME : extra를 없애줘
|
||||
API.$throw = function (code, error, endpoint) {
|
||||
var text = [];
|
||||
if (code > 0) {
|
||||
var status = this.statusCodes[code];
|
||||
if (typeof status === 'undefined') {
|
||||
text.push(`${code}`);
|
||||
} else {
|
||||
text.push(`${code} ${status}`);
|
||||
}
|
||||
}
|
||||
if (typeof error !== 'undefined') {
|
||||
text.push(JSON.stringify(error));
|
||||
}
|
||||
if (typeof endpoint !== 'undefined') {
|
||||
text.push(JSON.stringify(endpoint));
|
||||
}
|
||||
text = text.map((s) => $app.escapeTag(s)).join('<br>');
|
||||
if (text.length) {
|
||||
if (this.errorNoty) {
|
||||
this.errorNoty.close();
|
||||
}
|
||||
this.errorNoty = new Noty({
|
||||
type: 'error',
|
||||
text
|
||||
}).show();
|
||||
}
|
||||
throw new Error(text);
|
||||
};
|
||||
|
||||
API.$bulk = function (options, args) {
|
||||
if ('handle' in options) {
|
||||
options.handle.call(this, args, options);
|
||||
}
|
||||
if (
|
||||
args.json.length > 0 &&
|
||||
((options.params.offset += args.json.length),
|
||||
// eslint-disable-next-line no-nested-ternary
|
||||
options.N > 0
|
||||
? options.N > options.params.offset
|
||||
: options.N < 0
|
||||
? args.json.length
|
||||
: options.params.n === args.json.length)
|
||||
) {
|
||||
this.bulk(options);
|
||||
} else if ('done' in options) {
|
||||
options.done.call(this, true, options);
|
||||
}
|
||||
return args;
|
||||
};
|
||||
|
||||
API.bulk = function (options) {
|
||||
this[options.fn](options.params)
|
||||
.catch((err) => {
|
||||
if ('done' in options) {
|
||||
options.done.call(this, false, options);
|
||||
}
|
||||
throw err;
|
||||
})
|
||||
.then((args) => this.$bulk(options, args));
|
||||
};
|
||||
|
||||
API.statusCodes = {
|
||||
100: 'Continue',
|
||||
101: 'Switching Protocols',
|
||||
102: 'Processing',
|
||||
103: 'Early Hints',
|
||||
200: 'OK',
|
||||
201: 'Created',
|
||||
202: 'Accepted',
|
||||
203: 'Non-Authoritative Information',
|
||||
204: 'No Content',
|
||||
205: 'Reset Content',
|
||||
206: 'Partial Content',
|
||||
207: 'Multi-Status',
|
||||
208: 'Already Reported',
|
||||
226: 'IM Used',
|
||||
300: 'Multiple Choices',
|
||||
301: 'Moved Permanently',
|
||||
302: 'Found',
|
||||
303: 'See Other',
|
||||
304: 'Not Modified',
|
||||
305: 'Use Proxy',
|
||||
306: 'Switch Proxy',
|
||||
307: 'Temporary Redirect',
|
||||
308: 'Permanent Redirect',
|
||||
400: 'Bad Request',
|
||||
401: 'Unauthorized',
|
||||
402: 'Payment Required',
|
||||
403: 'Forbidden',
|
||||
404: 'Not Found',
|
||||
405: 'Method Not Allowed',
|
||||
406: 'Not Acceptable',
|
||||
407: 'Proxy Authentication Required',
|
||||
408: 'Request Timeout',
|
||||
409: 'Conflict',
|
||||
410: 'Gone',
|
||||
411: 'Length Required',
|
||||
412: 'Precondition Failed',
|
||||
413: 'Payload Too Large',
|
||||
414: 'URI Too Long',
|
||||
415: 'Unsupported Media Type',
|
||||
416: 'Range Not Satisfiable',
|
||||
417: 'Expectation Failed',
|
||||
418: "I'm a teapot",
|
||||
421: 'Misdirected Request',
|
||||
422: 'Unprocessable Entity',
|
||||
423: 'Locked',
|
||||
424: 'Failed Dependency',
|
||||
425: 'Too Early',
|
||||
426: 'Upgrade Required',
|
||||
428: 'Precondition Required',
|
||||
429: 'Too Many Requests',
|
||||
431: 'Request Header Fields Too Large',
|
||||
451: 'Unavailable For Legal Reasons',
|
||||
500: 'Internal Server Error',
|
||||
501: 'Not Implemented',
|
||||
502: 'Bad Gateway',
|
||||
503: 'Service Unavailable',
|
||||
504: 'Gateway Timeout',
|
||||
505: 'HTTP Version Not Supported',
|
||||
506: 'Variant Also Negotiates',
|
||||
507: 'Insufficient Storage',
|
||||
508: 'Loop Detected',
|
||||
510: 'Not Extended',
|
||||
511: 'Network Authentication Required',
|
||||
// CloudFlare Error
|
||||
520: 'Web server returns an unknown error',
|
||||
521: 'Web server is down',
|
||||
522: 'Connection timed out',
|
||||
523: 'Origin is unreachable',
|
||||
524: 'A timeout occurred',
|
||||
525: 'SSL handshake failed',
|
||||
526: 'Invalid SSL certificate',
|
||||
527: 'Railgun Listener to origin error'
|
||||
};
|
||||
}
|
||||
}
|
||||
29
html/src/classes/baseClass.js
Normal file
29
html/src/classes/baseClass.js
Normal file
@@ -0,0 +1,29 @@
|
||||
import _utils from './utils';
|
||||
let $utils = new _utils().$utils;
|
||||
/* eslint-disable no-unused-vars */
|
||||
let $app = {};
|
||||
let API = {};
|
||||
let $t = {};
|
||||
/* eslint-enable no-unused-vars */
|
||||
|
||||
class baseClass {
|
||||
constructor(_app, _API, _t) {
|
||||
$app = _app;
|
||||
API = _API;
|
||||
$t = _t;
|
||||
|
||||
this.init();
|
||||
}
|
||||
|
||||
updateRef(_app) {
|
||||
$app = _app;
|
||||
}
|
||||
|
||||
init() {}
|
||||
|
||||
_data = {};
|
||||
|
||||
_methods = {};
|
||||
}
|
||||
|
||||
export { baseClass, $app, API, $t, $utils };
|
||||
103
html/src/classes/booping.js
Normal file
103
html/src/classes/booping.js
Normal file
@@ -0,0 +1,103 @@
|
||||
import { baseClass, $app, API, $t, $utils } from './baseClass.js';
|
||||
|
||||
export default class extends baseClass {
|
||||
constructor(_app, _API, _t) {
|
||||
super(_app, _API, _t);
|
||||
}
|
||||
|
||||
init() {
|
||||
/**
|
||||
* @params {{
|
||||
userId: string,
|
||||
emojiId: string
|
||||
}} params
|
||||
* @returns {Promise<{json: any, params}>}
|
||||
*/
|
||||
API.sendBoop = function (params) {
|
||||
return this.call(`users/${params.userId}/boop`, {
|
||||
method: 'POST',
|
||||
params
|
||||
}).then((json) => {
|
||||
var args = {
|
||||
json,
|
||||
params
|
||||
};
|
||||
this.$emit('BOOP:SEND', args);
|
||||
return args;
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
_data = {
|
||||
sendBoopDialog: {
|
||||
visible: false,
|
||||
userId: '',
|
||||
fileId: ''
|
||||
}
|
||||
};
|
||||
|
||||
_methods = {
|
||||
sendBoop() {
|
||||
var D = this.sendBoopDialog;
|
||||
this.dismissBoop(D.userId);
|
||||
var params = {
|
||||
userId: D.userId
|
||||
};
|
||||
if (D.fileId) {
|
||||
params.emojiId = D.fileId;
|
||||
}
|
||||
API.sendBoop(params);
|
||||
D.visible = false;
|
||||
},
|
||||
|
||||
dismissBoop(userId) {
|
||||
// JANK: This is a hack to remove boop notifications when responding
|
||||
var array = this.notificationTable.data;
|
||||
for (var i = array.length - 1; i >= 0; i--) {
|
||||
var ref = array[i];
|
||||
if (
|
||||
ref.type !== 'boop' ||
|
||||
ref.$isExpired ||
|
||||
ref.senderUserId !== userId
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
API.sendNotificationResponse({
|
||||
notificationId: ref.id,
|
||||
responseType: 'delete',
|
||||
responseData: ''
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
showSendBoopDialog(userId) {
|
||||
this.$nextTick(() =>
|
||||
$app.adjustDialogZ(this.$refs.sendBoopDialog.$el)
|
||||
);
|
||||
var D = this.sendBoopDialog;
|
||||
D.userId = userId;
|
||||
D.visible = true;
|
||||
if (this.emojiTable.length === 0 && API.currentUser.$isVRCPlus) {
|
||||
this.refreshEmojiTable();
|
||||
}
|
||||
},
|
||||
|
||||
getEmojiValue(emojiName) {
|
||||
if (!emojiName) {
|
||||
return '';
|
||||
}
|
||||
return `vrchat_${emojiName.replace(/ /g, '_').toLowerCase()}`;
|
||||
},
|
||||
|
||||
getEmojiName(emojiValue) {
|
||||
// uppercase first letter of each word
|
||||
if (!emojiValue) {
|
||||
return '';
|
||||
}
|
||||
return emojiValue
|
||||
.replace('vrchat_', '')
|
||||
.replace(/_/g, ' ')
|
||||
.replace(/\b\w/g, (l) => l.toUpperCase());
|
||||
}
|
||||
};
|
||||
}
|
||||
339
html/src/classes/currentUser.js
Normal file
339
html/src/classes/currentUser.js
Normal file
@@ -0,0 +1,339 @@
|
||||
import { baseClass, $app, API, $t, $utils } from './baseClass.js';
|
||||
|
||||
export default class extends baseClass {
|
||||
constructor(_app, _API, _t) {
|
||||
super(_app, _API, _t);
|
||||
}
|
||||
|
||||
init() {
|
||||
API.currentUser = {
|
||||
$userColour: ''
|
||||
};
|
||||
|
||||
API.getCurrentUser = function () {
|
||||
return this.call('auth/user', {
|
||||
method: 'GET'
|
||||
}).then((json) => {
|
||||
var args = {
|
||||
json,
|
||||
origin: true
|
||||
};
|
||||
if (
|
||||
json.requiresTwoFactorAuth &&
|
||||
json.requiresTwoFactorAuth.includes('emailOtp')
|
||||
) {
|
||||
this.$emit('USER:EMAILOTP', args);
|
||||
} else if (json.requiresTwoFactorAuth) {
|
||||
this.$emit('USER:2FA', args);
|
||||
} else {
|
||||
if ($app.debugCurrentUserDiff) {
|
||||
var ref = args.json;
|
||||
var $ref = this.currentUser;
|
||||
var props = {};
|
||||
for (var prop in $ref) {
|
||||
if ($ref[prop] !== Object($ref[prop])) {
|
||||
props[prop] = true;
|
||||
}
|
||||
}
|
||||
for (var prop in ref) {
|
||||
if (
|
||||
Array.isArray(ref[prop]) &&
|
||||
Array.isArray($ref[prop])
|
||||
) {
|
||||
if (!$app.arraysMatch(ref[prop], $ref[prop])) {
|
||||
props[prop] = true;
|
||||
}
|
||||
} else if (ref[prop] !== Object(ref[prop])) {
|
||||
props[prop] = true;
|
||||
}
|
||||
}
|
||||
var has = false;
|
||||
for (var prop in props) {
|
||||
var asis = $ref[prop];
|
||||
var tobe = ref[prop];
|
||||
if (asis === tobe) {
|
||||
delete props[prop];
|
||||
} else {
|
||||
if (
|
||||
prop.startsWith('$') ||
|
||||
prop === 'offlineFriends' ||
|
||||
prop === 'onlineFriends' ||
|
||||
prop === 'activeFriends'
|
||||
) {
|
||||
delete props[prop];
|
||||
continue;
|
||||
}
|
||||
props[prop] = [tobe, asis];
|
||||
has = true;
|
||||
}
|
||||
}
|
||||
if (has) {
|
||||
console.log('API.getCurrentUser diff', props);
|
||||
}
|
||||
}
|
||||
$app.nextCurrentUserRefresh = 420; // 7mins
|
||||
this.$emit('USER:CURRENT', args);
|
||||
}
|
||||
return args;
|
||||
});
|
||||
};
|
||||
|
||||
API.$on('USER:CURRENT', function (args) {
|
||||
var { json } = args;
|
||||
args.ref = this.applyCurrentUser(json);
|
||||
|
||||
// when isGameRunning use gameLog instead of API
|
||||
var $location = $app.parseLocation($app.lastLocation.location);
|
||||
var $travelingLocation = $app.parseLocation(
|
||||
$app.lastLocationDestination
|
||||
);
|
||||
var location = $app.lastLocation.location;
|
||||
var instanceId = $location.instanceId;
|
||||
var worldId = $location.worldId;
|
||||
var travelingToLocation = $app.lastLocationDestination;
|
||||
var travelingToWorld = $travelingLocation.worldId;
|
||||
var travelingToInstance = $travelingLocation.instanceId;
|
||||
if (!$app.isGameRunning && json.presence) {
|
||||
if ($app.isRealInstance(json.presence.world)) {
|
||||
location = `${json.presence.world}:${json.presence.instance}`;
|
||||
travelingToLocation = `${json.presence.travelingToWorld}:${json.presence.travelingToInstance}`;
|
||||
} else {
|
||||
location = json.presence.world;
|
||||
travelingToLocation = json.presence.travelingToWorld;
|
||||
}
|
||||
instanceId = json.presence.instance;
|
||||
worldId = json.presence.world;
|
||||
travelingToInstance = json.presence.travelingToInstance;
|
||||
travelingToWorld = json.presence.travelingToWorld;
|
||||
}
|
||||
|
||||
this.applyUser({
|
||||
allowAvatarCopying: json.allowAvatarCopying,
|
||||
badges: json.badges,
|
||||
bio: json.bio,
|
||||
bioLinks: json.bioLinks,
|
||||
currentAvatarImageUrl: json.currentAvatarImageUrl,
|
||||
currentAvatarTags: json.currentAvatarTags,
|
||||
currentAvatarThumbnailImageUrl:
|
||||
json.currentAvatarThumbnailImageUrl,
|
||||
date_joined: json.date_joined,
|
||||
developerType: json.developerType,
|
||||
displayName: json.displayName,
|
||||
friendKey: json.friendKey,
|
||||
// json.friendRequestStatus - missing from currentUser
|
||||
id: json.id,
|
||||
// instanceId - missing from currentUser
|
||||
isFriend: json.isFriend,
|
||||
last_activity: json.last_activity,
|
||||
last_login: json.last_login,
|
||||
last_mobile: json.last_mobile,
|
||||
last_platform: json.last_platform,
|
||||
// location - missing from currentUser
|
||||
// platform - missing from currentUser
|
||||
// note - missing from currentUser
|
||||
profilePicOverride: json.profilePicOverride,
|
||||
// profilePicOverrideThumbnail - missing from currentUser
|
||||
pronouns: json.pronouns,
|
||||
state: json.state,
|
||||
status: json.status,
|
||||
statusDescription: json.statusDescription,
|
||||
tags: json.tags,
|
||||
// travelingToInstance - missing from currentUser
|
||||
// travelingToLocation - missing from currentUser
|
||||
// travelingToWorld - missing from currentUser
|
||||
userIcon: json.userIcon,
|
||||
// worldId - missing from currentUser
|
||||
fallbackAvatar: json.fallbackAvatar,
|
||||
|
||||
// Location from gameLog/presence
|
||||
location,
|
||||
instanceId,
|
||||
worldId,
|
||||
travelingToLocation,
|
||||
travelingToInstance,
|
||||
travelingToWorld,
|
||||
|
||||
// set VRCX online/offline timers
|
||||
$online_for: this.currentUser.$online_for,
|
||||
$offline_for: this.currentUser.$offline_for,
|
||||
$location_at: this.currentUser.$location_at,
|
||||
$travelingToTime: this.currentUser.$travelingToTime
|
||||
});
|
||||
});
|
||||
|
||||
API.applyCurrentUser = function (json) {
|
||||
var ref = this.currentUser;
|
||||
if (this.isLoggedIn) {
|
||||
if (json.currentAvatar !== ref.currentAvatar) {
|
||||
$app.addAvatarToHistory(json.currentAvatar);
|
||||
}
|
||||
Object.assign(ref, json);
|
||||
if (ref.homeLocation !== ref.$homeLocation.tag) {
|
||||
ref.$homeLocation = $app.parseLocation(ref.homeLocation);
|
||||
// apply home location name to user dialog
|
||||
if (
|
||||
$app.userDialog.visible &&
|
||||
$app.userDialog.id === ref.id
|
||||
) {
|
||||
$app.getWorldName(API.currentUser.homeLocation).then(
|
||||
(worldName) => {
|
||||
$app.userDialog.$homeLocationName = worldName;
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
ref.$isVRCPlus = ref.tags.includes('system_supporter');
|
||||
this.applyUserTrustLevel(ref);
|
||||
this.applyUserLanguage(ref);
|
||||
this.applyPresenceLocation(ref);
|
||||
this.applyQueuedInstance(ref.queuedInstance);
|
||||
this.applyPresenceGroups(ref);
|
||||
} else {
|
||||
ref = {
|
||||
acceptedPrivacyVersion: 0,
|
||||
acceptedTOSVersion: 0,
|
||||
accountDeletionDate: null,
|
||||
accountDeletionLog: null,
|
||||
activeFriends: [],
|
||||
allowAvatarCopying: false,
|
||||
badges: [],
|
||||
bio: '',
|
||||
bioLinks: [],
|
||||
currentAvatar: '',
|
||||
currentAvatarAssetUrl: '',
|
||||
currentAvatarImageUrl: '',
|
||||
currentAvatarTags: [],
|
||||
currentAvatarThumbnailImageUrl: '',
|
||||
date_joined: '',
|
||||
developerType: '',
|
||||
displayName: '',
|
||||
emailVerified: false,
|
||||
fallbackAvatar: '',
|
||||
friendGroupNames: [],
|
||||
friendKey: '',
|
||||
friends: [],
|
||||
googleId: '',
|
||||
hasBirthday: false,
|
||||
hasEmail: false,
|
||||
hasLoggedInFromClient: false,
|
||||
hasPendingEmail: false,
|
||||
hideContentFilterSettings: false,
|
||||
homeLocation: '',
|
||||
id: '',
|
||||
isBoopingEnabled: false,
|
||||
isFriend: false,
|
||||
last_activity: '',
|
||||
last_login: '',
|
||||
last_mobile: null,
|
||||
last_platform: '',
|
||||
obfuscatedEmail: '',
|
||||
obfuscatedPendingEmail: '',
|
||||
oculusId: '',
|
||||
offlineFriends: [],
|
||||
onlineFriends: [],
|
||||
pastDisplayNames: [],
|
||||
picoId: '',
|
||||
presence: {
|
||||
avatarThumbnail: '',
|
||||
currentAvatarTags: '',
|
||||
displayName: '',
|
||||
groups: [],
|
||||
id: '',
|
||||
instance: '',
|
||||
instanceType: '',
|
||||
platform: '',
|
||||
profilePicOverride: '',
|
||||
status: '',
|
||||
travelingToInstance: '',
|
||||
travelingToWorld: '',
|
||||
userIcon: '',
|
||||
world: '',
|
||||
...json.presence
|
||||
},
|
||||
profilePicOverride: '',
|
||||
pronouns: '',
|
||||
queuedInstance: '',
|
||||
state: '',
|
||||
status: '',
|
||||
statusDescription: '',
|
||||
statusFirstTime: false,
|
||||
statusHistory: [],
|
||||
steamDetails: {},
|
||||
steamId: '',
|
||||
tags: [],
|
||||
twoFactorAuthEnabled: false,
|
||||
twoFactorAuthEnabledDate: null,
|
||||
unsubscribe: false,
|
||||
updated_at: '',
|
||||
userIcon: '',
|
||||
userLanguage: '',
|
||||
userLanguageCode: '',
|
||||
username: '',
|
||||
viveId: '',
|
||||
// VRCX
|
||||
$online_for: Date.now(),
|
||||
$offline_for: '',
|
||||
$location_at: Date.now(),
|
||||
$travelingToTime: Date.now(),
|
||||
$homeLocation: {},
|
||||
$isVRCPlus: false,
|
||||
$isModerator: false,
|
||||
$isTroll: false,
|
||||
$isProbableTroll: false,
|
||||
$trustLevel: 'Visitor',
|
||||
$trustClass: 'x-tag-untrusted',
|
||||
$userColour: '',
|
||||
$trustSortNum: 1,
|
||||
$languages: [],
|
||||
$locationTag: '',
|
||||
$travelingToLocation: '',
|
||||
$vbucks: null,
|
||||
...json
|
||||
};
|
||||
ref.$homeLocation = $app.parseLocation(ref.homeLocation);
|
||||
ref.$isVRCPlus = ref.tags.includes('system_supporter');
|
||||
this.applyUserTrustLevel(ref);
|
||||
this.applyUserLanguage(ref);
|
||||
this.applyPresenceLocation(ref);
|
||||
this.applyPresenceGroups(ref);
|
||||
this.currentUser = ref;
|
||||
this.isLoggedIn = true;
|
||||
this.$emit('LOGIN', {
|
||||
json,
|
||||
ref
|
||||
});
|
||||
}
|
||||
return ref;
|
||||
};
|
||||
|
||||
/**
|
||||
* @typedef {{
|
||||
* status: 'active' | 'offline' | 'busy' | 'ask me' | 'join me',
|
||||
* statusDescription: string
|
||||
* }} SaveCurrentUserParameters
|
||||
*/
|
||||
|
||||
/**
|
||||
* Updates current user's status.
|
||||
* @param params {SaveCurrentUserParameters} new status to be set
|
||||
* @returns {Promise<{json: any, params}>}
|
||||
*/
|
||||
API.saveCurrentUser = function (params) {
|
||||
return this.call(`users/${this.currentUser.id}`, {
|
||||
method: 'PUT',
|
||||
params
|
||||
}).then((json) => {
|
||||
var args = {
|
||||
json,
|
||||
params
|
||||
};
|
||||
this.$emit('USER:CURRENT:SAVE', args);
|
||||
return args;
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
_data = {};
|
||||
|
||||
_methods = {};
|
||||
}
|
||||
263
html/src/classes/discordRpc.js
Normal file
263
html/src/classes/discordRpc.js
Normal file
@@ -0,0 +1,263 @@
|
||||
import configRepository from '../repository/config.js';
|
||||
import { baseClass, $app, API, $t, $utils } from './baseClass.js';
|
||||
|
||||
export default class extends baseClass {
|
||||
constructor(_app, _API, _t) {
|
||||
super(_app, _API, _t);
|
||||
}
|
||||
|
||||
_data = {
|
||||
isDiscordActive: false,
|
||||
discordActive: false,
|
||||
discordInstance: true,
|
||||
discordJoinButton: false,
|
||||
discordHideInvite: true,
|
||||
discordHideImage: false
|
||||
};
|
||||
|
||||
_methods = {
|
||||
updateDiscord() {
|
||||
var currentLocation = this.lastLocation.location;
|
||||
var timeStamp = this.lastLocation.date;
|
||||
if (this.lastLocation.location === 'traveling') {
|
||||
currentLocation = this.lastLocationDestination;
|
||||
timeStamp = this.lastLocationDestinationTime;
|
||||
}
|
||||
if (
|
||||
!this.discordActive ||
|
||||
!this.isGameRunning ||
|
||||
(!currentLocation && !this.lastLocation$.tag)
|
||||
) {
|
||||
this.setDiscordActive(false);
|
||||
return;
|
||||
}
|
||||
this.setDiscordActive(true);
|
||||
var L = this.lastLocation$;
|
||||
if (currentLocation !== this.lastLocation$.tag) {
|
||||
Discord.SetTimestamps(timeStamp, 0);
|
||||
L = $app.parseLocation(currentLocation);
|
||||
L.worldName = '';
|
||||
L.thumbnailImageUrl = '';
|
||||
L.worldCapacity = 0;
|
||||
L.joinUrl = '';
|
||||
L.accessName = '';
|
||||
if (L.worldId) {
|
||||
var ref = API.cachedWorlds.get(L.worldId);
|
||||
if (ref) {
|
||||
L.worldName = ref.name;
|
||||
L.thumbnailImageUrl = ref.thumbnailImageUrl;
|
||||
L.worldCapacity = ref.capacity;
|
||||
} else {
|
||||
API.getWorld({
|
||||
worldId: L.worldId
|
||||
}).then((args) => {
|
||||
L.worldName = args.ref.name;
|
||||
L.thumbnailImageUrl = args.ref.thumbnailImageUrl;
|
||||
L.worldCapacity = args.ref.capacity;
|
||||
return args;
|
||||
});
|
||||
}
|
||||
if (this.isGameNoVR) {
|
||||
var platform = 'Desktop';
|
||||
} else {
|
||||
var platform = 'VR';
|
||||
}
|
||||
var groupAccessType = '';
|
||||
if (L.groupAccessType) {
|
||||
if (L.groupAccessType === 'public') {
|
||||
groupAccessType = 'Public';
|
||||
} else if (L.groupAccessType === 'plus') {
|
||||
groupAccessType = 'Plus';
|
||||
}
|
||||
}
|
||||
switch (L.accessType) {
|
||||
case 'public':
|
||||
L.joinUrl = this.getLaunchURL(L);
|
||||
L.accessName = `Public #${L.instanceName} (${platform})`;
|
||||
break;
|
||||
case 'invite+':
|
||||
L.accessName = `Invite+ #${L.instanceName} (${platform})`;
|
||||
break;
|
||||
case 'invite':
|
||||
L.accessName = `Invite #${L.instanceName} (${platform})`;
|
||||
break;
|
||||
case 'friends':
|
||||
L.accessName = `Friends #${L.instanceName} (${platform})`;
|
||||
break;
|
||||
case 'friends+':
|
||||
L.accessName = `Friends+ #${L.instanceName} (${platform})`;
|
||||
break;
|
||||
case 'group':
|
||||
L.accessName = `Group #${L.instanceName} (${platform})`;
|
||||
this.getGroupName(L.groupId).then((groupName) => {
|
||||
if (groupName) {
|
||||
L.accessName = `Group${groupAccessType}(${groupName}) #${L.instanceName} (${platform})`;
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.lastLocation$ = L;
|
||||
}
|
||||
var hidePrivate = false;
|
||||
if (
|
||||
this.discordHideInvite &&
|
||||
(L.accessType === 'invite' ||
|
||||
L.accessType === 'invite+' ||
|
||||
L.groupAccessType === 'members')
|
||||
) {
|
||||
hidePrivate = true;
|
||||
}
|
||||
switch (API.currentUser.status) {
|
||||
case 'active':
|
||||
L.statusName = 'Online';
|
||||
L.statusImage = 'active';
|
||||
break;
|
||||
case 'join me':
|
||||
L.statusName = 'Join Me';
|
||||
L.statusImage = 'joinme';
|
||||
break;
|
||||
case 'ask me':
|
||||
L.statusName = 'Ask Me';
|
||||
L.statusImage = 'askme';
|
||||
if (this.discordHideInvite) {
|
||||
hidePrivate = true;
|
||||
}
|
||||
break;
|
||||
case 'busy':
|
||||
L.statusName = 'Do Not Disturb';
|
||||
L.statusImage = 'busy';
|
||||
hidePrivate = true;
|
||||
break;
|
||||
}
|
||||
var appId = '883308884863901717';
|
||||
var bigIcon = 'vrchat';
|
||||
var partyId = `${L.worldId}:${L.instanceName}`;
|
||||
var partySize = this.lastLocation.playerList.size;
|
||||
var partyMaxSize = L.worldCapacity;
|
||||
if (partySize > partyMaxSize) {
|
||||
partyMaxSize = partySize;
|
||||
}
|
||||
var buttonText = 'Join';
|
||||
var buttonUrl = L.joinUrl;
|
||||
if (!this.discordJoinButton) {
|
||||
buttonText = '';
|
||||
buttonUrl = '';
|
||||
}
|
||||
if (!this.discordInstance) {
|
||||
partySize = 0;
|
||||
partyMaxSize = 0;
|
||||
}
|
||||
if (hidePrivate) {
|
||||
partyId = '';
|
||||
partySize = 0;
|
||||
partyMaxSize = 0;
|
||||
buttonText = '';
|
||||
buttonUrl = '';
|
||||
} else if (this.isRpcWorld(L.tag)) {
|
||||
// custom world rpc
|
||||
if (
|
||||
L.worldId === 'wrld_f20326da-f1ac-45fc-a062-609723b097b1' ||
|
||||
L.worldId === 'wrld_10e5e467-fc65-42ed-8957-f02cace1398c' ||
|
||||
L.worldId === 'wrld_04899f23-e182-4a8d-b2c7-2c74c7c15534'
|
||||
) {
|
||||
appId = '784094509008551956';
|
||||
bigIcon = 'pypy';
|
||||
} else if (
|
||||
L.worldId === 'wrld_42377cf1-c54f-45ed-8996-5875b0573a83' ||
|
||||
L.worldId === 'wrld_dd6d2888-dbdc-47c2-bc98-3d631b2acd7c'
|
||||
) {
|
||||
appId = '846232616054030376';
|
||||
bigIcon = 'vr_dancing';
|
||||
} else if (
|
||||
L.worldId === 'wrld_52bdcdab-11cd-4325-9655-0fb120846945' ||
|
||||
L.worldId === 'wrld_2d40da63-8f1f-4011-8a9e-414eb8530acd'
|
||||
) {
|
||||
appId = '939473404808007731';
|
||||
bigIcon = 'zuwa_zuwa_dance';
|
||||
} else if (
|
||||
L.worldId === 'wrld_74970324-58e8-4239-a17b-2c59dfdf00db' ||
|
||||
L.worldId === 'wrld_db9d878f-6e76-4776-8bf2-15bcdd7fc445' ||
|
||||
L.worldId === 'wrld_435bbf25-f34f-4b8b-82c6-cd809057eb8e' ||
|
||||
L.worldId === 'wrld_f767d1c8-b249-4ecc-a56f-614e433682c8'
|
||||
) {
|
||||
appId = '968292722391785512';
|
||||
bigIcon = 'ls_media';
|
||||
} else if (
|
||||
L.worldId === 'wrld_266523e8-9161-40da-acd0-6bd82e075833'
|
||||
) {
|
||||
appId = '1095440531821170820';
|
||||
bigIcon = 'movie_and_chill';
|
||||
}
|
||||
if (this.nowPlaying.name) {
|
||||
L.worldName = this.nowPlaying.name;
|
||||
}
|
||||
if (this.nowPlaying.playing) {
|
||||
Discord.SetTimestamps(
|
||||
Date.now(),
|
||||
(this.nowPlaying.startTime -
|
||||
this.nowPlaying.offset +
|
||||
this.nowPlaying.length) *
|
||||
1000
|
||||
);
|
||||
}
|
||||
} else if (!this.discordHideImage && L.thumbnailImageUrl) {
|
||||
bigIcon = L.thumbnailImageUrl;
|
||||
}
|
||||
Discord.SetAssets(
|
||||
bigIcon, // big icon
|
||||
'Powered by VRCX', // big icon hover text
|
||||
L.statusImage, // small icon
|
||||
L.statusName, // small icon hover text
|
||||
partyId, // party id
|
||||
partySize, // party size
|
||||
partyMaxSize, // party max size
|
||||
buttonText, // button text
|
||||
buttonUrl, // button url
|
||||
appId // app id
|
||||
);
|
||||
// NOTE
|
||||
// 글자 수가 짧으면 업데이트가 안된다..
|
||||
if (L.worldName.length < 2) {
|
||||
L.worldName += '\uFFA0'.repeat(2 - L.worldName.length);
|
||||
}
|
||||
if (hidePrivate) {
|
||||
Discord.SetText('Private', '');
|
||||
Discord.SetTimestamps(0, 0);
|
||||
} else if (this.discordInstance) {
|
||||
Discord.SetText(L.worldName, L.accessName);
|
||||
} else {
|
||||
Discord.SetText(L.worldName, '');
|
||||
}
|
||||
},
|
||||
|
||||
async setDiscordActive(active) {
|
||||
if (active !== this.isDiscordActive) {
|
||||
this.isDiscordActive = await Discord.SetActive(active);
|
||||
}
|
||||
},
|
||||
|
||||
async saveDiscordOption() {
|
||||
await configRepository.setBool('discordActive', this.discordActive);
|
||||
await configRepository.setBool(
|
||||
'discordInstance',
|
||||
this.discordInstance
|
||||
);
|
||||
await configRepository.setBool(
|
||||
'discordJoinButton',
|
||||
this.discordJoinButton
|
||||
);
|
||||
await configRepository.setBool(
|
||||
'discordHideInvite',
|
||||
this.discordHideInvite
|
||||
);
|
||||
await configRepository.setBool(
|
||||
'discordHideImage',
|
||||
this.discordHideImage
|
||||
);
|
||||
this.lastLocation$.tag = '';
|
||||
this.nextDiscordUpdate = 3;
|
||||
this.updateDiscord();
|
||||
}
|
||||
};
|
||||
}
|
||||
178
html/src/classes/feed.js
Normal file
178
html/src/classes/feed.js
Normal file
@@ -0,0 +1,178 @@
|
||||
import { baseClass, $app, API, $t, $utils } from './baseClass.js';
|
||||
import configRepository from '../repository/config.js';
|
||||
|
||||
export default class extends baseClass {
|
||||
constructor(_app, _API, _t) {
|
||||
super(_app, _API, _t);
|
||||
}
|
||||
|
||||
_data = {
|
||||
feedTable: {
|
||||
data: [],
|
||||
search: '',
|
||||
vip: false,
|
||||
loading: false,
|
||||
filter: [],
|
||||
tableProps: {
|
||||
stripe: true,
|
||||
size: 'mini',
|
||||
defaultSort: {
|
||||
prop: 'created_at',
|
||||
order: 'descending'
|
||||
}
|
||||
},
|
||||
pageSize: 15,
|
||||
paginationProps: {
|
||||
small: true,
|
||||
layout: 'sizes,prev,pager,next,total',
|
||||
pageSizes: [10, 15, 25, 50, 100]
|
||||
}
|
||||
},
|
||||
|
||||
feedSessionTable: []
|
||||
};
|
||||
|
||||
_methods = {
|
||||
feedSearch(row) {
|
||||
var value = this.feedTable.search.toUpperCase();
|
||||
if (!value) {
|
||||
return true;
|
||||
}
|
||||
if (
|
||||
value.startsWith('wrld_') &&
|
||||
String(row.location).toUpperCase().includes(value)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
switch (row.type) {
|
||||
case 'GPS':
|
||||
if (String(row.displayName).toUpperCase().includes(value)) {
|
||||
return true;
|
||||
}
|
||||
if (String(row.worldName).toUpperCase().includes(value)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
case 'Online':
|
||||
if (String(row.displayName).toUpperCase().includes(value)) {
|
||||
return true;
|
||||
}
|
||||
if (String(row.worldName).toUpperCase().includes(value)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
case 'Offline':
|
||||
if (String(row.displayName).toUpperCase().includes(value)) {
|
||||
return true;
|
||||
}
|
||||
if (String(row.worldName).toUpperCase().includes(value)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
case 'Status':
|
||||
if (String(row.displayName).toUpperCase().includes(value)) {
|
||||
return true;
|
||||
}
|
||||
if (String(row.status).toUpperCase().includes(value)) {
|
||||
return true;
|
||||
}
|
||||
if (
|
||||
String(row.statusDescription)
|
||||
.toUpperCase()
|
||||
.includes(value)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
case 'Avatar':
|
||||
if (String(row.displayName).toUpperCase().includes(value)) {
|
||||
return true;
|
||||
}
|
||||
if (String(row.avatarName).toUpperCase().includes(value)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
case 'Bio':
|
||||
if (String(row.displayName).toUpperCase().includes(value)) {
|
||||
return true;
|
||||
}
|
||||
if (String(row.bio).toUpperCase().includes(value)) {
|
||||
return true;
|
||||
}
|
||||
if (String(row.previousBio).toUpperCase().includes(value)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
|
||||
async feedTableLookup() {
|
||||
await configRepository.setString(
|
||||
'VRCX_feedTableFilters',
|
||||
JSON.stringify(this.feedTable.filter)
|
||||
);
|
||||
await configRepository.setBool(
|
||||
'VRCX_feedTableVIPFilter',
|
||||
this.feedTable.vip
|
||||
);
|
||||
this.feedTable.loading = true;
|
||||
var vipList = [];
|
||||
if (this.feedTable.vip) {
|
||||
vipList = Array.from(this.localFavoriteFriends.values());
|
||||
}
|
||||
this.feedTable.data = await database.lookupFeedDatabase(
|
||||
this.feedTable.search,
|
||||
this.feedTable.filter,
|
||||
vipList
|
||||
);
|
||||
this.feedTable.loading = false;
|
||||
},
|
||||
|
||||
addFeed(feed) {
|
||||
this.queueFeedNoty(feed);
|
||||
this.feedSessionTable.push(feed);
|
||||
this.updateSharedFeed(false);
|
||||
if (
|
||||
this.feedTable.filter.length > 0 &&
|
||||
!this.feedTable.filter.includes(feed.type)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
if (
|
||||
this.feedTable.vip &&
|
||||
!this.localFavoriteFriends.has(feed.userId)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
if (!this.feedSearch(feed)) {
|
||||
return;
|
||||
}
|
||||
this.feedTable.data.push(feed);
|
||||
this.sweepFeed();
|
||||
this.notifyMenu('feed');
|
||||
},
|
||||
|
||||
sweepFeed() {
|
||||
var { data } = this.feedTable;
|
||||
var j = data.length;
|
||||
if (j > this.maxTableSize) {
|
||||
data.splice(0, j - this.maxTableSize);
|
||||
}
|
||||
|
||||
var date = new Date();
|
||||
date.setDate(date.getDate() - 1); // 24 hour limit
|
||||
var limit = date.toJSON();
|
||||
var i = 0;
|
||||
var k = this.feedSessionTable.length;
|
||||
while (i < k && this.feedSessionTable[i].created_at < limit) {
|
||||
++i;
|
||||
}
|
||||
if (i === k) {
|
||||
this.feedSessionTable = [];
|
||||
} else if (i) {
|
||||
this.feedSessionTable.splice(0, i);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
1122
html/src/classes/gameLog.js
Normal file
1122
html/src/classes/gameLog.js
Normal file
File diff suppressed because it is too large
Load Diff
1544
html/src/classes/gameRealtimeLogging.js
Normal file
1544
html/src/classes/gameRealtimeLogging.js
Normal file
File diff suppressed because it is too large
Load Diff
3528
html/src/classes/groups.js
Normal file
3528
html/src/classes/groups.js
Normal file
File diff suppressed because it is too large
Load Diff
162
html/src/classes/languages.js
Normal file
162
html/src/classes/languages.js
Normal file
@@ -0,0 +1,162 @@
|
||||
import { baseClass, $app, API, $t, $utils } from './baseClass.js';
|
||||
|
||||
export default class extends baseClass {
|
||||
constructor(_app, _API, _t) {
|
||||
super(_app, _API, _t);
|
||||
}
|
||||
|
||||
init() {
|
||||
API.$on('CONFIG', function (args) {
|
||||
var languages =
|
||||
args.ref?.constants?.LANGUAGE?.SPOKEN_LANGUAGE_OPTIONS;
|
||||
if (!languages) {
|
||||
return;
|
||||
}
|
||||
$app.subsetOfLanguages = languages;
|
||||
var data = [];
|
||||
for (var key in languages) {
|
||||
var value = languages[key];
|
||||
data.push({
|
||||
key,
|
||||
value
|
||||
});
|
||||
}
|
||||
$app.languageDialog.languages = data;
|
||||
});
|
||||
|
||||
API.$on('LOGOUT', function () {
|
||||
$app.languageDialog.visible = false;
|
||||
});
|
||||
}
|
||||
|
||||
_data = {
|
||||
// vrchat to famfamfam language mappings
|
||||
languageMappings: {
|
||||
eng: 'us',
|
||||
kor: 'kr',
|
||||
rus: 'ru',
|
||||
spa: 'es',
|
||||
por: 'pt',
|
||||
zho: 'cn',
|
||||
deu: 'de',
|
||||
jpn: 'jp',
|
||||
fra: 'fr',
|
||||
swe: 'se',
|
||||
nld: 'nl',
|
||||
pol: 'pl',
|
||||
dan: 'dk',
|
||||
nor: 'no',
|
||||
ita: 'it',
|
||||
tha: 'th',
|
||||
fin: 'fi',
|
||||
hun: 'hu',
|
||||
ces: 'cz',
|
||||
tur: 'tr',
|
||||
ara: 'ae',
|
||||
ron: 'ro',
|
||||
vie: 'vn',
|
||||
ukr: 'ua',
|
||||
ase: 'us',
|
||||
bfi: 'gb',
|
||||
dse: 'nl',
|
||||
fsl: 'fr',
|
||||
jsl: 'jp',
|
||||
kvk: 'kr',
|
||||
|
||||
mlt: 'mt',
|
||||
ind: 'id',
|
||||
hrv: 'hr',
|
||||
heb: 'he',
|
||||
afr: 'af',
|
||||
ben: 'be',
|
||||
bul: 'bg',
|
||||
cmn: 'cn',
|
||||
cym: 'cy',
|
||||
ell: 'el',
|
||||
est: 'et',
|
||||
fil: 'ph',
|
||||
gla: 'gd',
|
||||
gle: 'ga',
|
||||
hin: 'hi',
|
||||
hmn: 'cn',
|
||||
hye: 'hy',
|
||||
isl: 'is',
|
||||
lav: 'lv',
|
||||
lit: 'lt',
|
||||
ltz: 'lb',
|
||||
mar: 'hi',
|
||||
mkd: 'mk',
|
||||
msa: 'my',
|
||||
sco: 'gd',
|
||||
slk: 'sk',
|
||||
slv: 'sl',
|
||||
tel: 'hi',
|
||||
mri: 'nz',
|
||||
wuu: 'cn',
|
||||
yue: 'cn',
|
||||
tws: 'cn',
|
||||
asf: 'au',
|
||||
nzs: 'nz',
|
||||
gsg: 'de',
|
||||
epo: 'eo',
|
||||
tok: 'tok'
|
||||
},
|
||||
|
||||
subsetOfLanguages: [],
|
||||
|
||||
languageDialog: {
|
||||
visible: false,
|
||||
loading: false,
|
||||
languageChoice: false,
|
||||
languageValue: '',
|
||||
languages: []
|
||||
}
|
||||
};
|
||||
|
||||
_methods = {
|
||||
languageClass(language) {
|
||||
var style = {};
|
||||
var mapping = this.languageMappings[language];
|
||||
if (typeof mapping !== 'undefined') {
|
||||
style[mapping] = true;
|
||||
} else {
|
||||
style.unknown = true;
|
||||
}
|
||||
return style;
|
||||
},
|
||||
|
||||
addUserLanguage(language) {
|
||||
if (language !== String(language)) {
|
||||
return;
|
||||
}
|
||||
var D = this.languageDialog;
|
||||
D.loading = true;
|
||||
API.addUserTags({
|
||||
tags: [`language_${language}`]
|
||||
}).finally(function () {
|
||||
D.loading = false;
|
||||
});
|
||||
},
|
||||
|
||||
removeUserLanguage(language) {
|
||||
if (language !== String(language)) {
|
||||
return;
|
||||
}
|
||||
var D = this.languageDialog;
|
||||
D.loading = true;
|
||||
API.removeUserTags({
|
||||
tags: [`language_${language}`]
|
||||
}).finally(function () {
|
||||
D.loading = false;
|
||||
});
|
||||
},
|
||||
|
||||
showLanguageDialog() {
|
||||
this.$nextTick(() =>
|
||||
$app.adjustDialogZ(this.$refs.languageDialog.$el)
|
||||
);
|
||||
var D = this.languageDialog;
|
||||
D.visible = true;
|
||||
}
|
||||
};
|
||||
}
|
||||
146
html/src/classes/memos.js
Normal file
146
html/src/classes/memos.js
Normal file
@@ -0,0 +1,146 @@
|
||||
import { baseClass, $app, API, $t, $utils } from './baseClass.js';
|
||||
|
||||
export default class extends baseClass {
|
||||
constructor(_app, _API, _t) {
|
||||
super(_app, _API, _t);
|
||||
}
|
||||
|
||||
init() {}
|
||||
|
||||
_data = {
|
||||
hideUserMemos: false
|
||||
};
|
||||
|
||||
_methods = {
|
||||
async migrateMemos() {
|
||||
var json = JSON.parse(await VRCXStorage.GetAll());
|
||||
database.begin();
|
||||
for (var line in json) {
|
||||
if (line.substring(0, 8) === 'memo_usr') {
|
||||
var userId = line.substring(5);
|
||||
var memo = json[line];
|
||||
if (memo) {
|
||||
await this.saveUserMemo(userId, memo);
|
||||
VRCXStorage.Remove(`memo_${userId}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
database.commit();
|
||||
},
|
||||
|
||||
onUserMemoChange() {
|
||||
var D = this.userDialog;
|
||||
this.saveUserMemo(D.id, D.memo);
|
||||
},
|
||||
|
||||
async getUserMemo(userId) {
|
||||
try {
|
||||
return await database.getUserMemo(userId);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
return {
|
||||
userId: '',
|
||||
editedAt: '',
|
||||
memo: ''
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
saveUserMemo(id, memo) {
|
||||
if (memo) {
|
||||
database.setUserMemo({
|
||||
userId: id,
|
||||
editedAt: new Date().toJSON(),
|
||||
memo
|
||||
});
|
||||
} else {
|
||||
database.deleteUserMemo(id);
|
||||
}
|
||||
var ref = this.friends.get(id);
|
||||
if (ref) {
|
||||
ref.memo = String(memo || '');
|
||||
if (memo) {
|
||||
var array = memo.split('\n');
|
||||
ref.$nickName = array[0];
|
||||
} else {
|
||||
ref.$nickName = '';
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
async getAllUserMemos() {
|
||||
var memos = await database.getAllUserMemos();
|
||||
memos.forEach((memo) => {
|
||||
var ref = $app.friends.get(memo.userId);
|
||||
if (typeof ref !== 'undefined') {
|
||||
ref.memo = memo.memo;
|
||||
ref.$nickName = '';
|
||||
if (memo.memo) {
|
||||
var array = memo.memo.split('\n');
|
||||
ref.$nickName = array[0];
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
onWorldMemoChange() {
|
||||
var D = this.worldDialog;
|
||||
this.saveWorldMemo(D.id, D.memo);
|
||||
},
|
||||
|
||||
async getWorldMemo(worldId) {
|
||||
try {
|
||||
return await database.getWorldMemo(worldId);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
return {
|
||||
worldId: '',
|
||||
editedAt: '',
|
||||
memo: ''
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
saveWorldMemo(worldId, memo) {
|
||||
if (memo) {
|
||||
database.setWorldMemo({
|
||||
worldId,
|
||||
editedAt: new Date().toJSON(),
|
||||
memo
|
||||
});
|
||||
} else {
|
||||
database.deleteWorldMemo(worldId);
|
||||
}
|
||||
},
|
||||
|
||||
onAvatarMemoChange() {
|
||||
var D = this.avatarDialog;
|
||||
this.saveAvatarMemo(D.id, D.memo);
|
||||
},
|
||||
|
||||
async getAvatarMemo(avatarId) {
|
||||
try {
|
||||
return await database.getAvatarMemoDB(avatarId);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
return {
|
||||
avatarId: '',
|
||||
editedAt: '',
|
||||
memo: ''
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
saveAvatarMemo(avatarId, memo) {
|
||||
if (memo) {
|
||||
database.setAvatarMemo({
|
||||
avatarId,
|
||||
editedAt: new Date().toJSON(),
|
||||
memo
|
||||
});
|
||||
} else {
|
||||
database.deleteAvatarMemo(avatarId);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
809
html/src/classes/prompts.js
Normal file
809
html/src/classes/prompts.js
Normal file
@@ -0,0 +1,809 @@
|
||||
import * as workerTimers from 'worker-timers';
|
||||
import configRepository from '../repository/config.js';
|
||||
import database from '../repository/database.js';
|
||||
import { baseClass, $app, API, $t, $utils } from './baseClass.js';
|
||||
|
||||
export default class extends baseClass {
|
||||
constructor(_app, _API, _t) {
|
||||
super(_app, _API, _t);
|
||||
}
|
||||
|
||||
_methods = {
|
||||
promptTOTP() {
|
||||
if (this.twoFactorAuthDialogVisible) {
|
||||
return;
|
||||
}
|
||||
AppApi.FlashWindow();
|
||||
this.twoFactorAuthDialogVisible = true;
|
||||
this.$prompt(
|
||||
$t('prompt.totp.description'),
|
||||
$t('prompt.totp.header'),
|
||||
{
|
||||
distinguishCancelAndClose: true,
|
||||
cancelButtonText: $t('prompt.totp.use_otp'),
|
||||
confirmButtonText: $t('prompt.totp.verify'),
|
||||
inputPlaceholder: $t('prompt.totp.input_placeholder'),
|
||||
inputPattern: /^[0-9]{6}$/,
|
||||
inputErrorMessage: $t('prompt.totp.input_error'),
|
||||
callback: (action, instance) => {
|
||||
if (action === 'confirm') {
|
||||
API.verifyTOTP({
|
||||
code: instance.inputValue.trim()
|
||||
})
|
||||
.catch((err) => {
|
||||
this.promptTOTP();
|
||||
throw err;
|
||||
})
|
||||
.then((args) => {
|
||||
API.getCurrentUser();
|
||||
return args;
|
||||
});
|
||||
} else if (action === 'cancel') {
|
||||
this.promptOTP();
|
||||
}
|
||||
},
|
||||
beforeClose: (action, instance, done) => {
|
||||
this.twoFactorAuthDialogVisible = false;
|
||||
done();
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
promptOTP() {
|
||||
if (this.twoFactorAuthDialogVisible) {
|
||||
return;
|
||||
}
|
||||
this.twoFactorAuthDialogVisible = true;
|
||||
this.$prompt(
|
||||
$t('prompt.otp.description'),
|
||||
$t('prompt.otp.header'),
|
||||
{
|
||||
distinguishCancelAndClose: true,
|
||||
cancelButtonText: $t('prompt.otp.use_totp'),
|
||||
confirmButtonText: $t('prompt.otp.verify'),
|
||||
inputPlaceholder: $t('prompt.otp.input_placeholder'),
|
||||
inputPattern: /^[a-z0-9]{4}-[a-z0-9]{4}$/,
|
||||
inputErrorMessage: $t('prompt.otp.input_error'),
|
||||
callback: (action, instance) => {
|
||||
if (action === 'confirm') {
|
||||
API.verifyOTP({
|
||||
code: instance.inputValue.trim()
|
||||
})
|
||||
.catch((err) => {
|
||||
this.promptOTP();
|
||||
throw err;
|
||||
})
|
||||
.then((args) => {
|
||||
API.getCurrentUser();
|
||||
return args;
|
||||
});
|
||||
} else if (action === 'cancel') {
|
||||
this.promptTOTP();
|
||||
}
|
||||
},
|
||||
beforeClose: (action, instance, done) => {
|
||||
this.twoFactorAuthDialogVisible = false;
|
||||
done();
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
promptEmailOTP() {
|
||||
if (this.twoFactorAuthDialogVisible) {
|
||||
return;
|
||||
}
|
||||
AppApi.FlashWindow();
|
||||
this.twoFactorAuthDialogVisible = true;
|
||||
this.$prompt(
|
||||
$t('prompt.email_otp.description'),
|
||||
$t('prompt.email_otp.header'),
|
||||
{
|
||||
distinguishCancelAndClose: true,
|
||||
cancelButtonText: $t('prompt.email_otp.resend'),
|
||||
confirmButtonText: $t('prompt.email_otp.verify'),
|
||||
inputPlaceholder: $t('prompt.email_otp.input_placeholder'),
|
||||
inputPattern: /^[0-9]{6}$/,
|
||||
inputErrorMessage: $t('prompt.email_otp.input_error'),
|
||||
callback: (action, instance) => {
|
||||
if (action === 'confirm') {
|
||||
API.verifyEmailOTP({
|
||||
code: instance.inputValue.trim()
|
||||
})
|
||||
.catch((err) => {
|
||||
this.promptEmailOTP();
|
||||
throw err;
|
||||
})
|
||||
.then((args) => {
|
||||
API.getCurrentUser();
|
||||
return args;
|
||||
});
|
||||
} else if (action === 'cancel') {
|
||||
this.resendEmail2fa();
|
||||
}
|
||||
},
|
||||
beforeClose: (action, instance, done) => {
|
||||
this.twoFactorAuthDialogVisible = false;
|
||||
done();
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
promptUserIdDialog() {
|
||||
this.$prompt(
|
||||
$t('prompt.direct_access_user_id.description'),
|
||||
$t('prompt.direct_access_user_id.header'),
|
||||
{
|
||||
distinguishCancelAndClose: true,
|
||||
confirmButtonText: $t('prompt.direct_access_user_id.ok'),
|
||||
cancelButtonText: $t('prompt.direct_access_user_id.cancel'),
|
||||
inputPattern: /\S+/,
|
||||
inputErrorMessage: $t(
|
||||
'prompt.direct_access_user_id.input_error'
|
||||
),
|
||||
callback: (action, instance) => {
|
||||
if (action === 'confirm' && instance.inputValue) {
|
||||
var testUrl = instance.inputValue.substring(0, 15);
|
||||
if (testUrl === 'https://vrchat.') {
|
||||
var userId = this.parseUserUrl(
|
||||
instance.inputValue
|
||||
);
|
||||
if (userId) {
|
||||
this.showUserDialog(userId);
|
||||
} else {
|
||||
this.$message({
|
||||
message: $t(
|
||||
'prompt.direct_access_user_id.message.error'
|
||||
),
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.showUserDialog(instance.inputValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
promptUsernameDialog() {
|
||||
this.$prompt(
|
||||
$t('prompt.direct_access_username.description'),
|
||||
$t('prompt.direct_access_username.header'),
|
||||
{
|
||||
distinguishCancelAndClose: true,
|
||||
confirmButtonText: $t('prompt.direct_access_username.ok'),
|
||||
cancelButtonText: $t(
|
||||
'prompt.direct_access_username.cancel'
|
||||
),
|
||||
inputPattern: /\S+/,
|
||||
inputErrorMessage: $t(
|
||||
'prompt.direct_access_username.input_error'
|
||||
),
|
||||
callback: (action, instance) => {
|
||||
if (action === 'confirm' && instance.inputValue) {
|
||||
this.lookupUser({
|
||||
displayName: instance.inputValue
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
promptWorldDialog() {
|
||||
this.$prompt(
|
||||
$t('prompt.direct_access_world_id.description'),
|
||||
$t('prompt.direct_access_world_id.header'),
|
||||
{
|
||||
distinguishCancelAndClose: true,
|
||||
confirmButtonText: $t('prompt.direct_access_world_id.ok'),
|
||||
cancelButtonText: $t(
|
||||
'prompt.direct_access_world_id.cancel'
|
||||
),
|
||||
inputPattern: /\S+/,
|
||||
inputErrorMessage: $t(
|
||||
'prompt.direct_access_world_id.input_error'
|
||||
),
|
||||
callback: (action, instance) => {
|
||||
if (action === 'confirm' && instance.inputValue) {
|
||||
if (!this.directAccessWorld(instance.inputValue)) {
|
||||
this.$message({
|
||||
message: $t(
|
||||
'prompt.direct_access_world_id.message.error'
|
||||
),
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
promptAvatarDialog() {
|
||||
this.$prompt(
|
||||
$t('prompt.direct_access_avatar_id.description'),
|
||||
$t('prompt.direct_access_avatar_id.header'),
|
||||
{
|
||||
distinguishCancelAndClose: true,
|
||||
confirmButtonText: $t('prompt.direct_access_avatar_id.ok'),
|
||||
cancelButtonText: $t(
|
||||
'prompt.direct_access_avatar_id.cancel'
|
||||
),
|
||||
inputPattern: /\S+/,
|
||||
inputErrorMessage: $t(
|
||||
'prompt.direct_access_avatar_id.input_error'
|
||||
),
|
||||
callback: (action, instance) => {
|
||||
if (action === 'confirm' && instance.inputValue) {
|
||||
var testUrl = instance.inputValue.substring(0, 15);
|
||||
if (testUrl === 'https://vrchat.') {
|
||||
var avatarId = this.parseAvatarUrl(
|
||||
instance.inputValue
|
||||
);
|
||||
if (avatarId) {
|
||||
this.showAvatarDialog(avatarId);
|
||||
} else {
|
||||
this.$message({
|
||||
message: $t(
|
||||
'prompt.direct_access_avatar_id.message.error'
|
||||
),
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.showAvatarDialog(instance.inputValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
promptOmniDirectDialog() {
|
||||
this.$prompt(
|
||||
$t('prompt.direct_access_omni.description'),
|
||||
$t('prompt.direct_access_omni.header'),
|
||||
{
|
||||
distinguishCancelAndClose: true,
|
||||
confirmButtonText: $t('prompt.direct_access_omni.ok'),
|
||||
cancelButtonText: $t('prompt.direct_access_omni.cancel'),
|
||||
inputPattern: /\S+/,
|
||||
inputErrorMessage: $t(
|
||||
'prompt.direct_access_omni.input_error'
|
||||
),
|
||||
callback: (action, instance) => {
|
||||
if (action === 'confirm' && instance.inputValue) {
|
||||
var input = instance.inputValue.trim();
|
||||
if (!this.directAccessParse(input)) {
|
||||
this.$message({
|
||||
message: $t(
|
||||
'prompt.direct_access_omni.message.error'
|
||||
),
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
changeFavoriteGroupName(ctx) {
|
||||
this.$prompt(
|
||||
$t('prompt.change_favorite_group_name.description'),
|
||||
$t('prompt.change_favorite_group_name.header'),
|
||||
{
|
||||
distinguishCancelAndClose: true,
|
||||
cancelButtonText: $t(
|
||||
'prompt.change_favorite_group_name.cancel'
|
||||
),
|
||||
confirmButtonText: $t(
|
||||
'prompt.change_favorite_group_name.change'
|
||||
),
|
||||
inputPlaceholder: $t(
|
||||
'prompt.change_favorite_group_name.input_placeholder'
|
||||
),
|
||||
inputValue: ctx.displayName,
|
||||
inputPattern: /\S+/,
|
||||
inputErrorMessage: $t(
|
||||
'prompt.change_favorite_group_name.input_error'
|
||||
),
|
||||
callback: (action, instance) => {
|
||||
if (action === 'confirm') {
|
||||
API.saveFavoriteGroup({
|
||||
type: ctx.type,
|
||||
group: ctx.name,
|
||||
displayName: instance.inputValue
|
||||
}).then((args) => {
|
||||
this.$message({
|
||||
message: $t(
|
||||
'prompt.change_favorite_group_name.message.success'
|
||||
),
|
||||
type: 'success'
|
||||
});
|
||||
return args;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
promptNotificationTimeout() {
|
||||
this.$prompt(
|
||||
$t('prompt.notification_timeout.description'),
|
||||
$t('prompt.notification_timeout.header'),
|
||||
{
|
||||
distinguishCancelAndClose: true,
|
||||
confirmButtonText: $t('prompt.notification_timeout.ok'),
|
||||
cancelButtonText: $t('prompt.notification_timeout.cancel'),
|
||||
inputValue: this.notificationTimeout / 1000,
|
||||
inputPattern: /\d+$/,
|
||||
inputErrorMessage: $t(
|
||||
'prompt.notification_timeout.input_error'
|
||||
),
|
||||
callback: async (action, instance) => {
|
||||
if (
|
||||
action === 'confirm' &&
|
||||
instance.inputValue &&
|
||||
!isNaN(instance.inputValue)
|
||||
) {
|
||||
this.notificationTimeout = Math.trunc(
|
||||
Number(instance.inputValue) * 1000
|
||||
);
|
||||
await configRepository.setString(
|
||||
'VRCX_notificationTimeout',
|
||||
this.notificationTimeout
|
||||
);
|
||||
this.updateVRConfigVars();
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
promptPhotonOverlayMessageTimeout() {
|
||||
this.$prompt(
|
||||
$t('prompt.overlay_message_timeout.description'),
|
||||
$t('prompt.overlay_message_timeout.header'),
|
||||
{
|
||||
distinguishCancelAndClose: true,
|
||||
confirmButtonText: $t('prompt.overlay_message_timeout.ok'),
|
||||
cancelButtonText: $t(
|
||||
'prompt.overlay_message_timeout.cancel'
|
||||
),
|
||||
inputValue: this.photonOverlayMessageTimeout / 1000,
|
||||
inputPattern: /\d+$/,
|
||||
inputErrorMessage: $t(
|
||||
'prompt.overlay_message_timeout.input_error'
|
||||
),
|
||||
callback: async (action, instance) => {
|
||||
if (
|
||||
action === 'confirm' &&
|
||||
instance.inputValue &&
|
||||
!isNaN(instance.inputValue)
|
||||
) {
|
||||
this.photonOverlayMessageTimeout = Math.trunc(
|
||||
Number(instance.inputValue) * 1000
|
||||
);
|
||||
await configRepository.setString(
|
||||
'VRCX_photonOverlayMessageTimeout',
|
||||
this.photonOverlayMessageTimeout
|
||||
);
|
||||
this.updateVRConfigVars();
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
promptRenameAvatar(avatar) {
|
||||
this.$prompt(
|
||||
$t('prompt.rename_avatar.description'),
|
||||
$t('prompt.rename_avatar.header'),
|
||||
{
|
||||
distinguishCancelAndClose: true,
|
||||
confirmButtonText: $t('prompt.rename_avatar.ok'),
|
||||
cancelButtonText: $t('prompt.rename_avatar.cancel'),
|
||||
inputValue: avatar.ref.name,
|
||||
inputErrorMessage: $t('prompt.rename_avatar.input_error'),
|
||||
callback: (action, instance) => {
|
||||
if (
|
||||
action === 'confirm' &&
|
||||
instance.inputValue !== avatar.ref.name
|
||||
) {
|
||||
API.saveAvatar({
|
||||
id: avatar.id,
|
||||
name: instance.inputValue
|
||||
}).then((args) => {
|
||||
this.$message({
|
||||
message: $t(
|
||||
'prompt.rename_avatar.message.success'
|
||||
),
|
||||
type: 'success'
|
||||
});
|
||||
return args;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
promptChangeAvatarDescription(avatar) {
|
||||
this.$prompt(
|
||||
$t('prompt.change_avatar_description.description'),
|
||||
$t('prompt.change_avatar_description.header'),
|
||||
{
|
||||
distinguishCancelAndClose: true,
|
||||
confirmButtonText: $t(
|
||||
'prompt.change_avatar_description.ok'
|
||||
),
|
||||
cancelButtonText: $t(
|
||||
'prompt.change_avatar_description.cancel'
|
||||
),
|
||||
inputValue: avatar.ref.description,
|
||||
inputErrorMessage: $t(
|
||||
'prompt.change_avatar_description.input_error'
|
||||
),
|
||||
callback: (action, instance) => {
|
||||
if (
|
||||
action === 'confirm' &&
|
||||
instance.inputValue !== avatar.ref.description
|
||||
) {
|
||||
API.saveAvatar({
|
||||
id: avatar.id,
|
||||
description: instance.inputValue
|
||||
}).then((args) => {
|
||||
this.$message({
|
||||
message: $t(
|
||||
'prompt.change_avatar_description.message.success'
|
||||
),
|
||||
type: 'success'
|
||||
});
|
||||
return args;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
promptRenameWorld(world) {
|
||||
this.$prompt(
|
||||
$t('prompt.rename_world.description'),
|
||||
$t('prompt.rename_world.header'),
|
||||
{
|
||||
distinguishCancelAndClose: true,
|
||||
confirmButtonText: $t('prompt.rename_world.ok'),
|
||||
cancelButtonText: $t('prompt.rename_world.cancel'),
|
||||
inputValue: world.ref.name,
|
||||
inputErrorMessage: $t('prompt.rename_world.input_error'),
|
||||
callback: (action, instance) => {
|
||||
if (
|
||||
action === 'confirm' &&
|
||||
instance.inputValue !== world.ref.name
|
||||
) {
|
||||
API.saveWorld({
|
||||
id: world.id,
|
||||
name: instance.inputValue
|
||||
}).then((args) => {
|
||||
this.$message({
|
||||
message: $t(
|
||||
'prompt.rename_world.message.success'
|
||||
),
|
||||
type: 'success'
|
||||
});
|
||||
return args;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
promptChangeWorldDescription(world) {
|
||||
this.$prompt(
|
||||
$t('prompt.change_world_description.description'),
|
||||
$t('prompt.change_world_description.header'),
|
||||
{
|
||||
distinguishCancelAndClose: true,
|
||||
confirmButtonText: $t('prompt.change_world_description.ok'),
|
||||
cancelButtonText: $t(
|
||||
'prompt.change_world_description.cancel'
|
||||
),
|
||||
inputValue: world.ref.description,
|
||||
inputErrorMessage: $t(
|
||||
'prompt.change_world_description.input_error'
|
||||
),
|
||||
callback: (action, instance) => {
|
||||
if (
|
||||
action === 'confirm' &&
|
||||
instance.inputValue !== world.ref.description
|
||||
) {
|
||||
API.saveWorld({
|
||||
id: world.id,
|
||||
description: instance.inputValue
|
||||
}).then((args) => {
|
||||
this.$message({
|
||||
message: $t(
|
||||
'prompt.change_world_description.message.success'
|
||||
),
|
||||
type: 'success'
|
||||
});
|
||||
return args;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
promptChangeWorldCapacity(world) {
|
||||
this.$prompt(
|
||||
$t('prompt.change_world_capacity.description'),
|
||||
$t('prompt.change_world_capacity.header'),
|
||||
{
|
||||
distinguishCancelAndClose: true,
|
||||
confirmButtonText: $t('prompt.change_world_capacity.ok'),
|
||||
cancelButtonText: $t('prompt.change_world_capacity.cancel'),
|
||||
inputValue: world.ref.capacity,
|
||||
inputPattern: /\d+$/,
|
||||
inputErrorMessage: $t(
|
||||
'prompt.change_world_capacity.input_error'
|
||||
),
|
||||
callback: (action, instance) => {
|
||||
if (
|
||||
action === 'confirm' &&
|
||||
instance.inputValue !== world.ref.capacity
|
||||
) {
|
||||
API.saveWorld({
|
||||
id: world.id,
|
||||
capacity: instance.inputValue
|
||||
}).then((args) => {
|
||||
this.$message({
|
||||
message: $t(
|
||||
'prompt.change_world_capacity.message.success'
|
||||
),
|
||||
type: 'success'
|
||||
});
|
||||
return args;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
promptChangeWorldRecommendedCapacity(world) {
|
||||
this.$prompt(
|
||||
$t('prompt.change_world_recommended_capacity.description'),
|
||||
$t('prompt.change_world_recommended_capacity.header'),
|
||||
{
|
||||
distinguishCancelAndClose: true,
|
||||
confirmButtonText: $t('prompt.change_world_capacity.ok'),
|
||||
cancelButtonText: $t('prompt.change_world_capacity.cancel'),
|
||||
inputValue: world.ref.recommendedCapacity,
|
||||
inputPattern: /\d+$/,
|
||||
inputErrorMessage: $t(
|
||||
'prompt.change_world_recommended_capacity.input_error'
|
||||
),
|
||||
callback: (action, instance) => {
|
||||
if (
|
||||
action === 'confirm' &&
|
||||
instance.inputValue !==
|
||||
world.ref.recommendedCapacity
|
||||
) {
|
||||
API.saveWorld({
|
||||
id: world.id,
|
||||
recommendedCapacity: instance.inputValue
|
||||
}).then((args) => {
|
||||
this.$message({
|
||||
message: $t(
|
||||
'prompt.change_world_recommended_capacity.message.success'
|
||||
),
|
||||
type: 'success'
|
||||
});
|
||||
return args;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
promptChangeWorldYouTubePreview(world) {
|
||||
this.$prompt(
|
||||
$t('prompt.change_world_preview.description'),
|
||||
$t('prompt.change_world_preview.header'),
|
||||
{
|
||||
distinguishCancelAndClose: true,
|
||||
confirmButtonText: $t('prompt.change_world_preview.ok'),
|
||||
cancelButtonText: $t('prompt.change_world_preview.cancel'),
|
||||
inputValue: world.ref.previewYoutubeId,
|
||||
inputErrorMessage: $t(
|
||||
'prompt.change_world_preview.input_error'
|
||||
),
|
||||
callback: (action, instance) => {
|
||||
if (
|
||||
action === 'confirm' &&
|
||||
instance.inputValue !== world.ref.previewYoutubeId
|
||||
) {
|
||||
if (instance.inputValue.length > 11) {
|
||||
try {
|
||||
var url = new URL(instance.inputValue);
|
||||
var id1 = url.pathname;
|
||||
var id2 = url.searchParams.get('v');
|
||||
if (id1 && id1.length === 12) {
|
||||
instance.inputValue = id1.substring(
|
||||
1,
|
||||
12
|
||||
);
|
||||
}
|
||||
if (id2 && id2.length === 11) {
|
||||
instance.inputValue = id2;
|
||||
}
|
||||
} catch {
|
||||
this.$message({
|
||||
message: $t(
|
||||
'prompt.change_world_preview.message.error'
|
||||
),
|
||||
type: 'error'
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (
|
||||
instance.inputValue !==
|
||||
world.ref.previewYoutubeId
|
||||
) {
|
||||
API.saveWorld({
|
||||
id: world.id,
|
||||
previewYoutubeId: instance.inputValue
|
||||
}).then((args) => {
|
||||
this.$message({
|
||||
message: $t(
|
||||
'prompt.change_world_preview.message.success'
|
||||
),
|
||||
type: 'success'
|
||||
});
|
||||
return args;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
promptMaxTableSizeDialog() {
|
||||
this.$prompt(
|
||||
$t('prompt.change_table_size.description'),
|
||||
$t('prompt.change_table_size.header'),
|
||||
{
|
||||
distinguishCancelAndClose: true,
|
||||
confirmButtonText: $t('prompt.change_table_size.save'),
|
||||
cancelButtonText: $t('prompt.change_table_size.cancel'),
|
||||
inputValue: this.maxTableSize,
|
||||
inputPattern: /\d+$/,
|
||||
inputErrorMessage: $t(
|
||||
'prompt.change_table_size.input_error'
|
||||
),
|
||||
callback: async (action, instance) => {
|
||||
if (action === 'confirm' && instance.inputValue) {
|
||||
if (instance.inputValue > 10000) {
|
||||
instance.inputValue = 10000;
|
||||
}
|
||||
this.maxTableSize = instance.inputValue;
|
||||
await configRepository.setString(
|
||||
'VRCX_maxTableSize',
|
||||
this.maxTableSize
|
||||
);
|
||||
database.setmaxTableSize(this.maxTableSize);
|
||||
this.feedTableLookup();
|
||||
this.gameLogTableLookup();
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
promptProxySettings() {
|
||||
this.$prompt(
|
||||
$t('prompt.proxy_settings.description'),
|
||||
$t('prompt.proxy_settings.header'),
|
||||
{
|
||||
distinguishCancelAndClose: true,
|
||||
confirmButtonText: $t('prompt.proxy_settings.restart'),
|
||||
cancelButtonText: $t('prompt.proxy_settings.close'),
|
||||
inputValue: this.proxyServer,
|
||||
inputPlaceholder: $t('prompt.proxy_settings.placeholder'),
|
||||
callback: async (action, instance) => {
|
||||
this.proxyServer = instance.inputValue;
|
||||
await VRCXStorage.Set(
|
||||
'VRCX_ProxyServer',
|
||||
this.proxyServer
|
||||
);
|
||||
await VRCXStorage.Flush();
|
||||
await new Promise((resolve) => {
|
||||
workerTimers.setTimeout(resolve, 100);
|
||||
});
|
||||
if (action === 'confirm') {
|
||||
var isUpgrade = false;
|
||||
this.restartVRCX(isUpgrade);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
promptPhotonLobbyTimeoutThreshold() {
|
||||
this.$prompt(
|
||||
$t('prompt.photon_lobby_timeout.description'),
|
||||
$t('prompt.photon_lobby_timeout.header'),
|
||||
{
|
||||
distinguishCancelAndClose: true,
|
||||
confirmButtonText: $t('prompt.photon_lobby_timeout.ok'),
|
||||
cancelButtonText: $t('prompt.photon_lobby_timeout.cancel'),
|
||||
inputValue: this.photonLobbyTimeoutThreshold / 1000,
|
||||
inputPattern: /\d+$/,
|
||||
inputErrorMessage: $t(
|
||||
'prompt.photon_lobby_timeout.input_error'
|
||||
),
|
||||
callback: async (action, instance) => {
|
||||
if (
|
||||
action === 'confirm' &&
|
||||
instance.inputValue &&
|
||||
!isNaN(instance.inputValue)
|
||||
) {
|
||||
this.photonLobbyTimeoutThreshold = Math.trunc(
|
||||
Number(instance.inputValue) * 1000
|
||||
);
|
||||
await configRepository.setString(
|
||||
'VRCX_photonLobbyTimeoutThreshold',
|
||||
this.photonLobbyTimeoutThreshold
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
promptAutoClearVRCXCacheFrequency() {
|
||||
this.$prompt(
|
||||
$t('prompt.auto_clear_cache.description'),
|
||||
$t('prompt.auto_clear_cache.header'),
|
||||
{
|
||||
distinguishCancelAndClose: true,
|
||||
confirmButtonText: $t('prompt.auto_clear_cache.ok'),
|
||||
cancelButtonText: $t('prompt.auto_clear_cache.cancel'),
|
||||
inputValue: this.clearVRCXCacheFrequency / 3600 / 2,
|
||||
inputPattern: /\d+$/,
|
||||
inputErrorMessage: $t(
|
||||
'prompt.auto_clear_cache.input_error'
|
||||
),
|
||||
callback: async (action, instance) => {
|
||||
if (
|
||||
action === 'confirm' &&
|
||||
instance.inputValue &&
|
||||
!isNaN(instance.inputValue)
|
||||
) {
|
||||
this.clearVRCXCacheFrequency = Math.trunc(
|
||||
Number(instance.inputValue) * 3600 * 2
|
||||
);
|
||||
await configRepository.setString(
|
||||
'VRCX_clearVRCXCacheFrequency',
|
||||
this.clearVRCXCacheFrequency
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
||||
}
|
||||
595
html/src/classes/sharedFeed.js
Normal file
595
html/src/classes/sharedFeed.js
Normal file
@@ -0,0 +1,595 @@
|
||||
import * as workerTimers from 'worker-timers';
|
||||
import configRepository from '../repository/config.js';
|
||||
import { baseClass, $app, API, $t, $utils } from './baseClass.js';
|
||||
|
||||
export default class extends baseClass {
|
||||
constructor(_app, _API, _t) {
|
||||
super(_app, _API, _t);
|
||||
}
|
||||
|
||||
_data = {
|
||||
sharedFeed: {
|
||||
gameLog: {
|
||||
wrist: [],
|
||||
lastEntryDate: ''
|
||||
},
|
||||
feedTable: {
|
||||
wrist: [],
|
||||
lastEntryDate: ''
|
||||
},
|
||||
notificationTable: {
|
||||
wrist: [],
|
||||
lastEntryDate: ''
|
||||
},
|
||||
friendLogTable: {
|
||||
wrist: [],
|
||||
lastEntryDate: ''
|
||||
},
|
||||
moderationAgainstTable: {
|
||||
wrist: [],
|
||||
lastEntryDate: ''
|
||||
},
|
||||
pendingUpdate: false
|
||||
},
|
||||
updateSharedFeedTimer: null,
|
||||
updateSharedFeedPending: false,
|
||||
updateSharedFeedPendingForceUpdate: false
|
||||
};
|
||||
|
||||
_methods = {
|
||||
updateSharedFeed(forceUpdate) {
|
||||
if (!this.friendLogInitStatus) {
|
||||
return;
|
||||
}
|
||||
if (this.updateSharedFeedTimer) {
|
||||
if (forceUpdate) {
|
||||
this.updateSharedFeedPendingForceUpdate = true;
|
||||
}
|
||||
this.updateSharedFeedPending = true;
|
||||
} else {
|
||||
this.updateSharedExecute(forceUpdate);
|
||||
this.updateSharedFeedTimer = setTimeout(() => {
|
||||
if (this.updateSharedFeedPending) {
|
||||
this.updateSharedExecute(
|
||||
this.updateSharedFeedPendingForceUpdate
|
||||
);
|
||||
}
|
||||
this.updateSharedFeedTimer = null;
|
||||
}, 150);
|
||||
}
|
||||
},
|
||||
|
||||
updateSharedExecute(forceUpdate) {
|
||||
try {
|
||||
this.updateSharedFeedDebounce(forceUpdate);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
this.updateSharedFeedTimer = null;
|
||||
this.updateSharedFeedPending = false;
|
||||
this.updateSharedFeedPendingForceUpdate = false;
|
||||
},
|
||||
|
||||
updateSharedFeedDebounce(forceUpdate) {
|
||||
this.updateSharedFeedGameLog(forceUpdate);
|
||||
this.updateSharedFeedFeedTable(forceUpdate);
|
||||
this.updateSharedFeedNotificationTable(forceUpdate);
|
||||
this.updateSharedFeedFriendLogTable(forceUpdate);
|
||||
this.updateSharedFeedModerationAgainstTable(forceUpdate);
|
||||
var feeds = this.sharedFeed;
|
||||
if (!feeds.pendingUpdate) {
|
||||
return;
|
||||
}
|
||||
var wristFeed = [];
|
||||
wristFeed = wristFeed.concat(
|
||||
feeds.gameLog.wrist,
|
||||
feeds.feedTable.wrist,
|
||||
feeds.notificationTable.wrist,
|
||||
feeds.friendLogTable.wrist,
|
||||
feeds.moderationAgainstTable.wrist
|
||||
);
|
||||
// OnPlayerJoining/Traveling
|
||||
API.currentTravelers.forEach((ref) => {
|
||||
var isFavorite = this.localFavoriteFriends.has(ref.id);
|
||||
if (
|
||||
(this.sharedFeedFilters.wrist.OnPlayerJoining ===
|
||||
'Friends' ||
|
||||
(this.sharedFeedFilters.wrist.OnPlayerJoining ===
|
||||
'VIP' &&
|
||||
isFavorite)) &&
|
||||
!$app.lastLocation.playerList.has(ref.displayName)
|
||||
) {
|
||||
if (ref.$location.tag === $app.lastLocation.location) {
|
||||
var feedEntry = {
|
||||
...ref,
|
||||
isFavorite,
|
||||
isFriend: true,
|
||||
type: 'OnPlayerJoining'
|
||||
};
|
||||
wristFeed.unshift(feedEntry);
|
||||
} else {
|
||||
var worldRef = API.cachedWorlds.get(
|
||||
ref.$location.worldId
|
||||
);
|
||||
var groupName = '';
|
||||
if (ref.$location.groupId) {
|
||||
var groupRef = API.cachedGroups.get(
|
||||
ref.$location.groupId
|
||||
);
|
||||
if (typeof groupRef !== 'undefined') {
|
||||
groupName = groupRef.name;
|
||||
} else {
|
||||
// no group cache, fetch group and try again
|
||||
API.getGroup({
|
||||
groupId: ref.$location.groupId
|
||||
})
|
||||
.then((args) => {
|
||||
workerTimers.setTimeout(() => {
|
||||
// delay to allow for group cache to update
|
||||
$app.sharedFeed.pendingUpdate = true;
|
||||
$app.updateSharedFeed(false);
|
||||
}, 100);
|
||||
return args;
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err);
|
||||
});
|
||||
}
|
||||
}
|
||||
if (typeof worldRef !== 'undefined') {
|
||||
var feedEntry = {
|
||||
created_at: ref.created_at,
|
||||
type: 'GPS',
|
||||
userId: ref.id,
|
||||
displayName: ref.displayName,
|
||||
location: ref.$location.tag,
|
||||
worldName: worldRef.name,
|
||||
groupName,
|
||||
previousLocation: '',
|
||||
isFavorite,
|
||||
time: 0,
|
||||
isFriend: true,
|
||||
isTraveling: true
|
||||
};
|
||||
wristFeed.unshift(feedEntry);
|
||||
} else {
|
||||
// no world cache, fetch world and try again
|
||||
API.getWorld({
|
||||
worldId: ref.$location.worldId
|
||||
})
|
||||
.then((args) => {
|
||||
workerTimers.setTimeout(() => {
|
||||
// delay to allow for world cache to update
|
||||
$app.sharedFeed.pendingUpdate = true;
|
||||
$app.updateSharedFeed(false);
|
||||
}, 100);
|
||||
return args;
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
wristFeed.sort(function (a, b) {
|
||||
if (a.created_at < b.created_at) {
|
||||
return 1;
|
||||
}
|
||||
if (a.created_at > b.created_at) {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
wristFeed.splice(16);
|
||||
AppApi.ExecuteVrFeedFunction(
|
||||
'wristFeedUpdate',
|
||||
JSON.stringify(wristFeed)
|
||||
);
|
||||
this.applyUserDialogLocation();
|
||||
this.applyWorldDialogInstances();
|
||||
this.applyGroupDialogInstances();
|
||||
feeds.pendingUpdate = false;
|
||||
},
|
||||
|
||||
updateSharedFeedGameLog(forceUpdate) {
|
||||
// Location, OnPlayerJoined, OnPlayerLeft
|
||||
var sessionTable = this.gameLogSessionTable;
|
||||
var i = sessionTable.length;
|
||||
if (i > 0) {
|
||||
if (
|
||||
sessionTable[i - 1].created_at ===
|
||||
this.sharedFeed.gameLog.lastEntryDate &&
|
||||
forceUpdate === false
|
||||
) {
|
||||
return;
|
||||
}
|
||||
this.sharedFeed.gameLog.lastEntryDate =
|
||||
sessionTable[i - 1].created_at;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
var bias = new Date(Date.now() - 86400000).toJSON(); // 24 hours
|
||||
var wristArr = [];
|
||||
var w = 0;
|
||||
var wristFilter = this.sharedFeedFilters.wrist;
|
||||
var currentUserLeaveTime = 0;
|
||||
var locationJoinTime = 0;
|
||||
for (var i = sessionTable.length - 1; i > -1; i--) {
|
||||
var ctx = sessionTable[i];
|
||||
if (ctx.created_at < bias) {
|
||||
break;
|
||||
}
|
||||
if (ctx.type === 'Notification') {
|
||||
continue;
|
||||
}
|
||||
// on Location change remove OnPlayerLeft
|
||||
if (ctx.type === 'LocationDestination') {
|
||||
currentUserLeaveTime = Date.parse(ctx.created_at);
|
||||
var currentUserLeaveTimeOffset =
|
||||
currentUserLeaveTime + 5 * 1000;
|
||||
for (var k = w - 1; k > -1; k--) {
|
||||
var feedItem = wristArr[k];
|
||||
if (
|
||||
(feedItem.type === 'OnPlayerLeft' ||
|
||||
feedItem.type === 'BlockedOnPlayerLeft' ||
|
||||
feedItem.type === 'MutedOnPlayerLeft') &&
|
||||
Date.parse(feedItem.created_at) >=
|
||||
currentUserLeaveTime &&
|
||||
Date.parse(feedItem.created_at) <=
|
||||
currentUserLeaveTimeOffset
|
||||
) {
|
||||
wristArr.splice(k, 1);
|
||||
w--;
|
||||
}
|
||||
}
|
||||
}
|
||||
// on Location change remove OnPlayerJoined
|
||||
if (ctx.type === 'Location') {
|
||||
locationJoinTime = Date.parse(ctx.created_at);
|
||||
var locationJoinTimeOffset = locationJoinTime + 20 * 1000;
|
||||
for (var k = w - 1; k > -1; k--) {
|
||||
var feedItem = wristArr[k];
|
||||
if (
|
||||
(feedItem.type === 'OnPlayerJoined' ||
|
||||
feedItem.type === 'BlockedOnPlayerJoined' ||
|
||||
feedItem.type === 'MutedOnPlayerJoined') &&
|
||||
Date.parse(feedItem.created_at) >=
|
||||
locationJoinTime &&
|
||||
Date.parse(feedItem.created_at) <=
|
||||
locationJoinTimeOffset
|
||||
) {
|
||||
wristArr.splice(k, 1);
|
||||
w--;
|
||||
}
|
||||
}
|
||||
}
|
||||
// remove current user
|
||||
if (
|
||||
(ctx.type === 'OnPlayerJoined' ||
|
||||
ctx.type === 'OnPlayerLeft' ||
|
||||
ctx.type === 'PortalSpawn') &&
|
||||
ctx.displayName === API.currentUser.displayName
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
var isFriend = false;
|
||||
var isFavorite = false;
|
||||
if (ctx.userId) {
|
||||
isFriend = this.friends.has(ctx.userId);
|
||||
isFavorite = this.localFavoriteFriends.has(ctx.userId);
|
||||
} else if (ctx.displayName) {
|
||||
for (var ref of API.cachedUsers.values()) {
|
||||
if (ref.displayName === ctx.displayName) {
|
||||
isFriend = this.friends.has(ref.id);
|
||||
isFavorite = this.localFavoriteFriends.has(ref.id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// add tag colour
|
||||
var tagColour = '';
|
||||
if (ctx.userId) {
|
||||
var tagRef = this.customUserTags.get(ctx.userId);
|
||||
if (typeof tagRef !== 'undefined') {
|
||||
tagColour = tagRef.colour;
|
||||
}
|
||||
}
|
||||
// BlockedOnPlayerJoined, BlockedOnPlayerLeft, MutedOnPlayerJoined, MutedOnPlayerLeft
|
||||
if (
|
||||
ctx.type === 'OnPlayerJoined' ||
|
||||
ctx.type === 'OnPlayerLeft'
|
||||
) {
|
||||
for (var ref of API.cachedPlayerModerations.values()) {
|
||||
if (
|
||||
ref.targetDisplayName !== ctx.displayName &&
|
||||
ref.sourceUserId !== ctx.userId
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ref.type === 'block') {
|
||||
var type = `Blocked${ctx.type}`;
|
||||
} else if (ref.type === 'mute') {
|
||||
var type = `Muted${ctx.type}`;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
|
||||
var entry = {
|
||||
created_at: ctx.created_at,
|
||||
type,
|
||||
displayName: ref.targetDisplayName,
|
||||
userId: ref.targetUserId,
|
||||
isFriend,
|
||||
isFavorite
|
||||
};
|
||||
if (
|
||||
wristFilter[type] &&
|
||||
(wristFilter[type] === 'Everyone' ||
|
||||
(wristFilter[type] === 'Friends' && isFriend) ||
|
||||
(wristFilter[type] === 'VIP' && isFavorite))
|
||||
) {
|
||||
wristArr.unshift(entry);
|
||||
}
|
||||
this.queueGameLogNoty(entry);
|
||||
}
|
||||
}
|
||||
// when too many user joins happen at once when switching instances
|
||||
// the "w" counter maxes out and wont add any more entries
|
||||
// until the onJoins are cleared by "Location"
|
||||
// e.g. if a "VideoPlay" occurs between "OnPlayerJoined" and "Location" it wont be added
|
||||
if (
|
||||
w < 50 &&
|
||||
wristFilter[ctx.type] &&
|
||||
(wristFilter[ctx.type] === 'On' ||
|
||||
wristFilter[ctx.type] === 'Everyone' ||
|
||||
(wristFilter[ctx.type] === 'Friends' && isFriend) ||
|
||||
(wristFilter[ctx.type] === 'VIP' && isFavorite))
|
||||
) {
|
||||
wristArr.push({
|
||||
...ctx,
|
||||
tagColour,
|
||||
isFriend,
|
||||
isFavorite
|
||||
});
|
||||
++w;
|
||||
}
|
||||
}
|
||||
this.sharedFeed.gameLog.wrist = wristArr;
|
||||
this.sharedFeed.pendingUpdate = true;
|
||||
},
|
||||
|
||||
updateSharedFeedFeedTable(forceUpdate) {
|
||||
// GPS, Online, Offline, Status, Avatar
|
||||
var feedSession = this.feedSessionTable;
|
||||
var i = feedSession.length;
|
||||
if (i > 0) {
|
||||
if (
|
||||
feedSession[i - 1].created_at ===
|
||||
this.sharedFeed.feedTable.lastEntryDate &&
|
||||
forceUpdate === false
|
||||
) {
|
||||
return;
|
||||
}
|
||||
this.sharedFeed.feedTable.lastEntryDate =
|
||||
feedSession[i - 1].created_at;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
var bias = new Date(Date.now() - 86400000).toJSON(); // 24 hours
|
||||
var wristArr = [];
|
||||
var w = 0;
|
||||
var wristFilter = this.sharedFeedFilters.wrist;
|
||||
for (var i = feedSession.length - 1; i > -1; i--) {
|
||||
var ctx = feedSession[i];
|
||||
if (ctx.created_at < bias) {
|
||||
break;
|
||||
}
|
||||
if (ctx.type === 'Avatar') {
|
||||
continue;
|
||||
}
|
||||
// hide private worlds from feed
|
||||
if (
|
||||
this.hidePrivateFromFeed &&
|
||||
ctx.type === 'GPS' &&
|
||||
ctx.location === 'private'
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
var isFriend = this.friends.has(ctx.userId);
|
||||
var isFavorite = this.localFavoriteFriends.has(ctx.userId);
|
||||
if (
|
||||
w < 20 &&
|
||||
wristFilter[ctx.type] &&
|
||||
(wristFilter[ctx.type] === 'Friends' ||
|
||||
(wristFilter[ctx.type] === 'VIP' && isFavorite))
|
||||
) {
|
||||
wristArr.push({
|
||||
...ctx,
|
||||
isFriend,
|
||||
isFavorite
|
||||
});
|
||||
++w;
|
||||
}
|
||||
}
|
||||
this.sharedFeed.feedTable.wrist = wristArr;
|
||||
this.sharedFeed.pendingUpdate = true;
|
||||
},
|
||||
|
||||
updateSharedFeedNotificationTable(forceUpdate) {
|
||||
// invite, requestInvite, requestInviteResponse, inviteResponse, friendRequest
|
||||
var notificationTable = this.notificationTable;
|
||||
var i = notificationTable.length;
|
||||
if (i > 0) {
|
||||
if (
|
||||
notificationTable[i - 1].created_at ===
|
||||
this.sharedFeed.notificationTable.lastEntryDate &&
|
||||
forceUpdate === false
|
||||
) {
|
||||
return;
|
||||
}
|
||||
this.sharedFeed.notificationTable.lastEntryDate =
|
||||
notificationTable[i - 1].created_at;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
var bias = new Date(Date.now() - 86400000).toJSON(); // 24 hours
|
||||
var wristArr = [];
|
||||
var w = 0;
|
||||
var wristFilter = this.sharedFeedFilters.wrist;
|
||||
for (var i = notificationTable.length - 1; i > -1; i--) {
|
||||
var ctx = notificationTable[i];
|
||||
if (ctx.created_at < bias) {
|
||||
break;
|
||||
}
|
||||
if (ctx.senderUserId === API.currentUser.id) {
|
||||
continue;
|
||||
}
|
||||
var isFriend = this.friends.has(ctx.senderUserId);
|
||||
var isFavorite = this.localFavoriteFriends.has(
|
||||
ctx.senderUserId
|
||||
);
|
||||
if (
|
||||
w < 20 &&
|
||||
wristFilter[ctx.type] &&
|
||||
(wristFilter[ctx.type] === 'On' ||
|
||||
wristFilter[ctx.type] === 'Friends' ||
|
||||
(wristFilter[ctx.type] === 'VIP' && isFavorite))
|
||||
) {
|
||||
wristArr.push({
|
||||
...ctx,
|
||||
isFriend,
|
||||
isFavorite
|
||||
});
|
||||
++w;
|
||||
}
|
||||
}
|
||||
this.sharedFeed.notificationTable.wrist = wristArr;
|
||||
this.sharedFeed.pendingUpdate = true;
|
||||
},
|
||||
|
||||
updateSharedFeedFriendLogTable(forceUpdate) {
|
||||
// TrustLevel, Friend, FriendRequest, Unfriend, DisplayName
|
||||
var friendLog = this.friendLogTable;
|
||||
var i = friendLog.length;
|
||||
if (i > 0) {
|
||||
if (
|
||||
friendLog[i - 1].created_at ===
|
||||
this.sharedFeed.friendLogTable.lastEntryDate &&
|
||||
forceUpdate === false
|
||||
) {
|
||||
return;
|
||||
}
|
||||
this.sharedFeed.friendLogTable.lastEntryDate =
|
||||
friendLog[i - 1].created_at;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
var bias = new Date(Date.now() - 86400000).toJSON(); // 24 hours
|
||||
var wristArr = [];
|
||||
var w = 0;
|
||||
var wristFilter = this.sharedFeedFilters.wrist;
|
||||
for (var i = friendLog.length - 1; i > -1; i--) {
|
||||
var ctx = friendLog[i];
|
||||
if (ctx.created_at < bias) {
|
||||
break;
|
||||
}
|
||||
if (ctx.type === 'FriendRequest') {
|
||||
continue;
|
||||
}
|
||||
var isFriend = this.friends.has(ctx.userId);
|
||||
var isFavorite = this.localFavoriteFriends.has(ctx.userId);
|
||||
if (
|
||||
w < 20 &&
|
||||
wristFilter[ctx.type] &&
|
||||
(wristFilter[ctx.type] === 'On' ||
|
||||
wristFilter[ctx.type] === 'Friends' ||
|
||||
(wristFilter[ctx.type] === 'VIP' && isFavorite))
|
||||
) {
|
||||
wristArr.push({
|
||||
...ctx,
|
||||
isFriend,
|
||||
isFavorite
|
||||
});
|
||||
++w;
|
||||
}
|
||||
}
|
||||
this.sharedFeed.friendLogTable.wrist = wristArr;
|
||||
this.sharedFeed.pendingUpdate = true;
|
||||
},
|
||||
|
||||
updateSharedFeedModerationAgainstTable(forceUpdate) {
|
||||
// Unblocked, Blocked, Muted, Unmuted
|
||||
var moderationAgainst = this.moderationAgainstTable;
|
||||
var i = moderationAgainst.length;
|
||||
if (i > 0) {
|
||||
if (
|
||||
moderationAgainst[i - 1].created_at ===
|
||||
this.sharedFeed.moderationAgainstTable.lastEntryDate &&
|
||||
forceUpdate === false
|
||||
) {
|
||||
return;
|
||||
}
|
||||
this.sharedFeed.moderationAgainstTable.lastEntryDate =
|
||||
moderationAgainst[i - 1].created_at;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
var bias = new Date(Date.now() - 86400000).toJSON(); // 24 hours
|
||||
var wristArr = [];
|
||||
var w = 0;
|
||||
var wristFilter = this.sharedFeedFilters.wrist;
|
||||
for (var i = moderationAgainst.length - 1; i > -1; i--) {
|
||||
var ctx = moderationAgainst[i];
|
||||
if (ctx.created_at < bias) {
|
||||
break;
|
||||
}
|
||||
var isFriend = this.friends.has(ctx.userId);
|
||||
var isFavorite = this.localFavoriteFriends.has(ctx.userId);
|
||||
// add tag colour
|
||||
var tagColour = '';
|
||||
var tagRef = this.customUserTags.get(ctx.userId);
|
||||
if (typeof tagRef !== 'undefined') {
|
||||
tagColour = tagRef.colour;
|
||||
}
|
||||
if (
|
||||
w < 20 &&
|
||||
wristFilter[ctx.type] &&
|
||||
wristFilter[ctx.type] === 'On'
|
||||
) {
|
||||
wristArr.push({
|
||||
...ctx,
|
||||
isFriend,
|
||||
isFavorite,
|
||||
tagColour
|
||||
});
|
||||
++w;
|
||||
}
|
||||
}
|
||||
this.sharedFeed.moderationAgainstTable.wrist = wristArr;
|
||||
this.sharedFeed.pendingUpdate = true;
|
||||
},
|
||||
|
||||
saveSharedFeedFilters() {
|
||||
configRepository.setString(
|
||||
'sharedFeedFilters',
|
||||
JSON.stringify(this.sharedFeedFilters)
|
||||
);
|
||||
this.updateSharedFeed(true);
|
||||
},
|
||||
|
||||
async resetSharedFeedFilters() {
|
||||
if (await configRepository.getString('sharedFeedFilters')) {
|
||||
this.sharedFeedFilters = JSON.parse(
|
||||
await configRepository.getString(
|
||||
'sharedFeedFilters',
|
||||
JSON.stringify(this.sharedFeedFiltersDefaults)
|
||||
)
|
||||
);
|
||||
} else {
|
||||
this.sharedFeedFilters = this.sharedFeedFiltersDefaults;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
602
html/src/classes/uiComponents.js
Normal file
602
html/src/classes/uiComponents.js
Normal file
@@ -0,0 +1,602 @@
|
||||
import Vue from 'vue';
|
||||
import VueMarkdown from 'vue-markdown';
|
||||
import { baseClass, $app, API, $t, $utils } from './baseClass.js';
|
||||
|
||||
export default class extends baseClass {
|
||||
constructor(_app, _API, _t) {
|
||||
super(_app, _API, _t);
|
||||
}
|
||||
|
||||
init() {
|
||||
Vue.component('vue-markdown', VueMarkdown);
|
||||
|
||||
Vue.component('launch', {
|
||||
template:
|
||||
'<el-button @click="confirm" size="mini" icon="el-icon-info" circle></el-button>',
|
||||
props: {
|
||||
location: String
|
||||
},
|
||||
methods: {
|
||||
parse() {
|
||||
this.$el.style.display = $app.checkCanInviteSelf(
|
||||
this.location
|
||||
)
|
||||
? ''
|
||||
: 'none';
|
||||
},
|
||||
confirm() {
|
||||
API.$emit('SHOW_LAUNCH_DIALOG', this.location);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
location() {
|
||||
this.parse();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.parse();
|
||||
}
|
||||
});
|
||||
|
||||
Vue.component('invite-yourself', {
|
||||
template:
|
||||
'<el-button @click="confirm" size="mini" icon="el-icon-message" circle></el-button>',
|
||||
props: {
|
||||
location: String,
|
||||
shortname: String
|
||||
},
|
||||
methods: {
|
||||
parse() {
|
||||
this.$el.style.display = $app.checkCanInviteSelf(
|
||||
this.location
|
||||
)
|
||||
? ''
|
||||
: 'none';
|
||||
},
|
||||
confirm() {
|
||||
$app.selfInvite(this.location, this.shortname);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
location() {
|
||||
this.parse();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.parse();
|
||||
}
|
||||
});
|
||||
|
||||
Vue.component('location', {
|
||||
template:
|
||||
"<span><span @click=\"showWorldDialog\" :class=\"{ 'x-link': link && this.location !== 'private' && this.location !== 'offline'}\">" +
|
||||
'<i v-if="isTraveling" class="el-icon el-icon-loading" style="display:inline-block;margin-right:5px"></i>' +
|
||||
'<span>{{ text }}</span></span>' +
|
||||
'<span v-if="groupName" @click="showGroupDialog" :class="{ \'x-link\': link}">({{ groupName }})</span>' +
|
||||
'<span class="flags" :class="region" style="display:inline-block;margin-left:5px"></span>' +
|
||||
'<i v-if="strict" class="el-icon el-icon-lock" style="display:inline-block;margin-left:5px"></i></span>',
|
||||
props: {
|
||||
location: String,
|
||||
traveling: String,
|
||||
hint: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
grouphint: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
link: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
text: this.location,
|
||||
region: this.region,
|
||||
strict: this.strict,
|
||||
isTraveling: this.isTraveling,
|
||||
groupName: this.groupName
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
parse() {
|
||||
this.isTraveling = false;
|
||||
this.groupName = '';
|
||||
var instanceId = this.location;
|
||||
if (
|
||||
typeof this.traveling !== 'undefined' &&
|
||||
this.location === 'traveling'
|
||||
) {
|
||||
instanceId = this.traveling;
|
||||
this.isTraveling = true;
|
||||
}
|
||||
this.text = instanceId;
|
||||
var L = $utils.parseLocation(instanceId);
|
||||
if (L.isOffline) {
|
||||
this.text = 'Offline';
|
||||
} else if (L.isPrivate) {
|
||||
this.text = 'Private';
|
||||
} else if (L.isTraveling) {
|
||||
this.text = 'Traveling';
|
||||
} else if (
|
||||
typeof this.hint === 'string' &&
|
||||
this.hint !== ''
|
||||
) {
|
||||
if (L.instanceId) {
|
||||
this.text = `${this.hint} #${L.instanceName} ${L.accessTypeName}`;
|
||||
} else {
|
||||
this.text = this.hint;
|
||||
}
|
||||
} else if (L.worldId) {
|
||||
var ref = API.cachedWorlds.get(L.worldId);
|
||||
if (typeof ref === 'undefined') {
|
||||
$app.getWorldName(L.worldId).then((worldName) => {
|
||||
if (L.tag === instanceId) {
|
||||
if (L.instanceId) {
|
||||
this.text = `${worldName} #${L.instanceName} ${L.accessTypeName}`;
|
||||
} else {
|
||||
this.text = worldName;
|
||||
}
|
||||
}
|
||||
});
|
||||
} else if (L.instanceId) {
|
||||
this.text = `${ref.name} #${L.instanceName} ${L.accessTypeName}`;
|
||||
} else {
|
||||
this.text = ref.name;
|
||||
}
|
||||
}
|
||||
if (this.grouphint) {
|
||||
this.groupName = this.grouphint;
|
||||
} else if (L.groupId) {
|
||||
this.groupName = L.groupId;
|
||||
$app.getGroupName(instanceId).then((groupName) => {
|
||||
if (L.tag === instanceId) {
|
||||
this.groupName = groupName;
|
||||
}
|
||||
});
|
||||
}
|
||||
this.region = '';
|
||||
if (!L.isOffline && !L.isPrivate && !L.isTraveling) {
|
||||
this.region = L.region;
|
||||
if (!L.region && L.instanceId) {
|
||||
this.region = 'us';
|
||||
}
|
||||
}
|
||||
this.strict = L.strict;
|
||||
},
|
||||
showWorldDialog() {
|
||||
if (this.link) {
|
||||
var instanceId = this.location;
|
||||
if (this.traveling && this.location === 'traveling') {
|
||||
instanceId = this.traveling;
|
||||
}
|
||||
if (!instanceId && this.hint.length === 8) {
|
||||
// shortName
|
||||
API.$emit('SHOW_WORLD_DIALOG_SHORTNAME', this.hint);
|
||||
return;
|
||||
}
|
||||
API.$emit('SHOW_WORLD_DIALOG', instanceId);
|
||||
}
|
||||
},
|
||||
showGroupDialog() {
|
||||
var location = this.location;
|
||||
if (this.isTraveling) {
|
||||
location = this.traveling;
|
||||
}
|
||||
if (!location || !this.link) {
|
||||
return;
|
||||
}
|
||||
var L = $utils.parseLocation(location);
|
||||
if (!L.groupId) {
|
||||
return;
|
||||
}
|
||||
API.$emit('SHOW_GROUP_DIALOG', L.groupId);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
location() {
|
||||
this.parse();
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.parse();
|
||||
}
|
||||
});
|
||||
|
||||
Vue.component('location-world', {
|
||||
template:
|
||||
'<span><span @click="showLaunchDialog" class="x-link">' +
|
||||
'<i v-if="isUnlocked" class="el-icon el-icon-unlock" style="display:inline-block;margin-right:5px"></i>' +
|
||||
'<span>#{{ instanceName }} {{ accessTypeName }}</span></span>' +
|
||||
'<span v-if="groupName" @click="showGroupDialog" class="x-link">({{ groupName }})</span>' +
|
||||
'<span class="flags" :class="region" style="display:inline-block;margin-left:5px"></span>' +
|
||||
'<i v-if="strict" class="el-icon el-icon-lock" style="display:inline-block;margin-left:5px"></i></span>',
|
||||
props: {
|
||||
locationobject: Object,
|
||||
currentuserid: String,
|
||||
worlddialogshortname: String,
|
||||
grouphint: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
location: this.location,
|
||||
instanceName: this.instanceName,
|
||||
accessTypeName: this.accessTypeName,
|
||||
region: this.region,
|
||||
shortName: this.shortName,
|
||||
isUnlocked: this.isUnlocked,
|
||||
strict: this.strict,
|
||||
groupName: this.groupName
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
parse() {
|
||||
this.location = this.locationobject.tag;
|
||||
this.instanceName = this.locationobject.instanceName;
|
||||
this.accessTypeName = this.locationobject.accessTypeName;
|
||||
this.strict = this.locationobject.strict;
|
||||
this.shortName = this.locationobject.shortName;
|
||||
|
||||
this.isUnlocked = false;
|
||||
if (
|
||||
(this.worlddialogshortname &&
|
||||
this.locationobject.shortName &&
|
||||
this.worlddialogshortname ===
|
||||
this.locationobject.shortName) ||
|
||||
this.currentuserid === this.locationobject.userId
|
||||
) {
|
||||
this.isUnlocked = true;
|
||||
}
|
||||
|
||||
this.region = this.locationobject.region;
|
||||
if (!this.region) {
|
||||
this.region = 'us';
|
||||
}
|
||||
|
||||
this.groupName = '';
|
||||
if (this.grouphint) {
|
||||
this.groupName = this.grouphint;
|
||||
} else if (this.locationobject.groupId) {
|
||||
this.groupName = this.locationobject.groupId;
|
||||
$app.getGroupName(this.locationobject.groupId).then(
|
||||
(groupName) => {
|
||||
this.groupName = groupName;
|
||||
}
|
||||
);
|
||||
}
|
||||
},
|
||||
showLaunchDialog() {
|
||||
API.$emit(
|
||||
'SHOW_LAUNCH_DIALOG',
|
||||
this.location,
|
||||
this.shortName
|
||||
);
|
||||
},
|
||||
showGroupDialog() {
|
||||
if (!this.location) {
|
||||
return;
|
||||
}
|
||||
var L = $utils.parseLocation(this.location);
|
||||
if (!L.groupId) {
|
||||
return;
|
||||
}
|
||||
API.$emit('SHOW_GROUP_DIALOG', L.groupId);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
locationobject() {
|
||||
this.parse();
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.parse();
|
||||
}
|
||||
});
|
||||
|
||||
Vue.component('last-join', {
|
||||
template:
|
||||
'<span>' +
|
||||
'<el-tooltip placement="top" style="margin-left:5px" v-if="lastJoin">' +
|
||||
'<div slot="content">' +
|
||||
'<span>{{ $t("dialog.user.info.last_join") }} <timer :epoch="lastJoin"></timer></span>' +
|
||||
'</div>' +
|
||||
'<i v-if="lastJoin" class="el-icon el-icon-location-outline" style="display:inline-block"></i>' +
|
||||
'</el-tooltip>' +
|
||||
'</span>',
|
||||
props: {
|
||||
location: String,
|
||||
currentlocation: String
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
lastJoin: this.lastJoin
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
parse() {
|
||||
this.lastJoin = $app.instanceJoinHistory.get(this.location);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
location() {
|
||||
this.parse();
|
||||
},
|
||||
currentlocation() {
|
||||
this.parse();
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.parse();
|
||||
}
|
||||
});
|
||||
|
||||
Vue.component('instance-info', {
|
||||
template:
|
||||
'<div style="display:inline-block;margin-left:5px">' +
|
||||
'<el-tooltip v-if="isValidInstance" placement="bottom">' +
|
||||
'<div slot="content">' +
|
||||
'<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>' +
|
||||
'<span><span style="color:#409eff">PC: </span>{{ platforms.standalonewindows }}</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 v-if="queueEnabled">{{ $t("dialog.user.info.instance_queuing_enabled") }}</br></span>' +
|
||||
'<span v-if="userList.length">{{ $t("dialog.user.info.instance_users") }}</br></span>' +
|
||||
'<template v-for="user in userList"><span style="cursor:pointer;margin-right:5px" @click="showUserDialog(user.id)" v-text="user.displayName"></span></template>' +
|
||||
'</div>' +
|
||||
'<i class="el-icon-caret-bottom"></i>' +
|
||||
'</el-tooltip>' +
|
||||
'<span v-if="occupants" style="margin-left:5px">{{ occupants }}/{{ capacity }}</span>' +
|
||||
'<span v-if="friendcount" style="margin-left:5px">({{ friendcount }})</span>' +
|
||||
'<span v-if="isFull" style="margin-left:5px;color:lightcoral">{{ $t("dialog.user.info.instance_full") }}</span>' +
|
||||
'<span v-if="isHardClosed" style="margin-left:5px;color:lightcoral">{{ $t("dialog.user.info.instance_hard_closed") }}</span>' +
|
||||
'<span v-else-if="isClosed" style="margin-left:5px;color:lightcoral">{{ $t("dialog.user.info.instance_closed") }}</span>' +
|
||||
'<span v-if="queueSize" style="margin-left:5px">{{ $t("dialog.user.info.instance_queue") }} {{ queueSize }}</span>' +
|
||||
'</div>',
|
||||
props: {
|
||||
location: String,
|
||||
instance: Object,
|
||||
friendcount: Number,
|
||||
updateelement: Number
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isValidInstance: this.isValidInstance,
|
||||
isFull: this.isFull,
|
||||
isClosed: this.isClosed,
|
||||
isHardClosed: this.isHardClosed,
|
||||
closedAt: this.closedAt,
|
||||
occupants: this.occupants,
|
||||
capacity: this.capacity,
|
||||
queueSize: this.queueSize,
|
||||
queueEnabled: this.queueEnabled,
|
||||
platforms: this.platforms,
|
||||
userList: this.userList,
|
||||
gameServerVersion: this.gameServerVersion,
|
||||
canCloseInstance: this.canCloseInstance
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
parse() {
|
||||
this.isValidInstance = false;
|
||||
this.isFull = false;
|
||||
this.isClosed = false;
|
||||
this.isHardClosed = false;
|
||||
this.closedAt = '';
|
||||
this.occupants = 0;
|
||||
this.capacity = 0;
|
||||
this.queueSize = 0;
|
||||
this.queueEnabled = false;
|
||||
this.platforms = [];
|
||||
this.userList = [];
|
||||
this.gameServerVersion = '';
|
||||
this.canCloseInstance = false;
|
||||
if (
|
||||
!this.location ||
|
||||
!this.instance ||
|
||||
Object.keys(this.instance).length === 0
|
||||
) {
|
||||
return;
|
||||
}
|
||||
this.isValidInstance = true;
|
||||
this.isFull =
|
||||
typeof this.instance.hasCapacityForYou !==
|
||||
'undefined' && !this.instance.hasCapacityForYou;
|
||||
if (this.instance.closedAt) {
|
||||
this.isClosed = true;
|
||||
this.closedAt = this.instance.closedAt;
|
||||
}
|
||||
this.isHardClosed = this.instance.hardClose === true;
|
||||
this.occupants = this.instance.userCount;
|
||||
if (this.location === $app.lastLocation.location) {
|
||||
// use gameLog for occupants when in same location
|
||||
this.occupants = $app.lastLocation.playerList.size;
|
||||
}
|
||||
this.capacity = this.instance.capacity;
|
||||
this.gameServerVersion = this.instance.gameServerVersion;
|
||||
this.queueSize = this.instance.queueSize;
|
||||
if (this.instance.platforms) {
|
||||
this.platforms = this.instance.platforms;
|
||||
}
|
||||
if (this.instance.users) {
|
||||
this.userList = this.instance.users;
|
||||
}
|
||||
if (this.instance.ownerId === API.currentUser.id) {
|
||||
this.canCloseInstance = true;
|
||||
} else if (this.instance?.ownerId?.startsWith('grp_')) {
|
||||
// check group perms
|
||||
var groupId = this.instance.ownerId;
|
||||
var group = API.cachedGroups.get(groupId);
|
||||
this.canCloseInstance = $app.hasGroupPermission(
|
||||
group,
|
||||
'group-instance-moderate'
|
||||
);
|
||||
}
|
||||
},
|
||||
showUserDialog(userId) {
|
||||
API.$emit('SHOW_USER_DIALOG', userId);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
updateelement() {
|
||||
this.parse();
|
||||
},
|
||||
location() {
|
||||
this.parse();
|
||||
},
|
||||
friendcount() {
|
||||
this.parse();
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.parse();
|
||||
}
|
||||
});
|
||||
|
||||
Vue.component('avatar-info', {
|
||||
template:
|
||||
'<div @click="confirm" class="avatar-info">' +
|
||||
'<span style="margin-right:5px">{{ avatarName }}</span>' +
|
||||
'<span style="margin-right:5px" :class="color">{{ avatarType }}</span>' +
|
||||
'<span style="color:#909399;font-family:monospace;font-size:12px;">{{ avatarTags }}</span>' +
|
||||
'</div>',
|
||||
props: {
|
||||
imageurl: String,
|
||||
userid: String,
|
||||
hintownerid: String,
|
||||
hintavatarname: String,
|
||||
avatartags: Array
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
avatarName: this.avatarName,
|
||||
avatarType: this.avatarType,
|
||||
avatarTags: this.avatarTags,
|
||||
color: this.color
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
async parse() {
|
||||
this.ownerId = '';
|
||||
this.avatarName = '';
|
||||
this.avatarType = '';
|
||||
this.color = '';
|
||||
this.avatarTags = '';
|
||||
if (!this.imageurl) {
|
||||
this.avatarName = '-';
|
||||
} else if (this.hintownerid) {
|
||||
this.avatarName = this.hintavatarname;
|
||||
this.ownerId = this.hintownerid;
|
||||
} else {
|
||||
try {
|
||||
var avatarInfo = await $app.getAvatarName(
|
||||
this.imageurl
|
||||
);
|
||||
this.avatarName = avatarInfo.avatarName;
|
||||
this.ownerId = avatarInfo.ownerId;
|
||||
} catch (err) {}
|
||||
}
|
||||
if (typeof this.userid === 'undefined' || !this.ownerId) {
|
||||
this.color = '';
|
||||
this.avatarType = '';
|
||||
} else if (this.ownerId === this.userid) {
|
||||
this.color = 'avatar-info-own';
|
||||
this.avatarType = '(own)';
|
||||
} else {
|
||||
this.color = 'avatar-info-public';
|
||||
this.avatarType = '(public)';
|
||||
}
|
||||
if (typeof this.avatartags === 'object') {
|
||||
var tagString = '';
|
||||
for (var i = 0; i < this.avatartags.length; i++) {
|
||||
var tagName = this.avatartags[i].replace(
|
||||
'content_',
|
||||
''
|
||||
);
|
||||
tagString += tagName;
|
||||
if (i < this.avatartags.length - 1) {
|
||||
tagString += ', ';
|
||||
}
|
||||
}
|
||||
this.avatarTags = tagString;
|
||||
}
|
||||
},
|
||||
confirm() {
|
||||
if (!this.imageurl) {
|
||||
return;
|
||||
}
|
||||
$app.showAvatarAuthorDialog(
|
||||
this.userid,
|
||||
this.ownerId,
|
||||
this.imageurl
|
||||
);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
imageurl() {
|
||||
this.parse();
|
||||
},
|
||||
userid() {
|
||||
this.parse();
|
||||
},
|
||||
avatartags() {
|
||||
this.parse();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.parse();
|
||||
}
|
||||
});
|
||||
|
||||
Vue.component('display-name', {
|
||||
template:
|
||||
'<span @click="showUserDialog" class="x-link">{{ username }}</span>',
|
||||
props: {
|
||||
userid: String,
|
||||
location: String,
|
||||
key: Number
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
username: this.username
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
async parse() {
|
||||
this.username = this.userid;
|
||||
if (this.userid) {
|
||||
var args = await API.getCachedUser({
|
||||
userId: this.userid
|
||||
});
|
||||
}
|
||||
if (
|
||||
typeof args !== 'undefined' &&
|
||||
typeof args.json !== 'undefined' &&
|
||||
typeof args.json.displayName !== 'undefined'
|
||||
) {
|
||||
this.username = args.json.displayName;
|
||||
}
|
||||
},
|
||||
showUserDialog() {
|
||||
$app.showUserDialog(this.userid);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
location() {
|
||||
this.parse();
|
||||
},
|
||||
key() {
|
||||
this.parse();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.parse();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
78
html/src/classes/updateLoop.js
Normal file
78
html/src/classes/updateLoop.js
Normal file
@@ -0,0 +1,78 @@
|
||||
import * as workerTimers from 'worker-timers';
|
||||
import { baseClass, $app, API, $t, $utils } from './baseClass.js';
|
||||
|
||||
export default class extends baseClass {
|
||||
constructor(_app, _API, _t) {
|
||||
super(_app, _API, _t);
|
||||
}
|
||||
|
||||
_data = {
|
||||
nextCurrentUserRefresh: 0,
|
||||
nextFriendsRefresh: 0,
|
||||
nextGroupInstanceRefresh: 0,
|
||||
nextAppUpdateCheck: 3600,
|
||||
ipcTimeout: 0,
|
||||
nextClearVRCXCacheCheck: 0,
|
||||
nextDiscordUpdate: 0,
|
||||
nextAutoStateChange: 0
|
||||
};
|
||||
|
||||
_methods = {
|
||||
updateLoop() {
|
||||
try {
|
||||
if (API.isLoggedIn === true) {
|
||||
if (--this.nextCurrentUserRefresh <= 0) {
|
||||
this.nextCurrentUserRefresh = 300; // 5min
|
||||
API.getCurrentUser();
|
||||
}
|
||||
if (--this.nextFriendsRefresh <= 0) {
|
||||
this.nextFriendsRefresh = 3600; // 1hour
|
||||
this.refreshFriendsList();
|
||||
this.updateStoredUser(API.currentUser);
|
||||
if (this.isGameRunning) {
|
||||
API.refreshPlayerModerations();
|
||||
}
|
||||
}
|
||||
if (--this.nextGroupInstanceRefresh <= 0) {
|
||||
if (this.friendLogInitStatus) {
|
||||
this.nextGroupInstanceRefresh = 300; // 5min
|
||||
API.getUsersGroupInstances();
|
||||
}
|
||||
AppApi.CheckGameRunning();
|
||||
}
|
||||
if (--this.nextAppUpdateCheck <= 0) {
|
||||
this.nextAppUpdateCheck = 3600; // 1hour
|
||||
if (this.autoUpdateVRCX !== 'Off') {
|
||||
this.checkForVRCXUpdate();
|
||||
}
|
||||
}
|
||||
if (--this.ipcTimeout <= 0) {
|
||||
this.ipcEnabled = false;
|
||||
}
|
||||
if (
|
||||
--this.nextClearVRCXCacheCheck <= 0 &&
|
||||
this.clearVRCXCacheFrequency > 0
|
||||
) {
|
||||
this.nextClearVRCXCacheCheck =
|
||||
this.clearVRCXCacheFrequency / 2;
|
||||
this.clearVRCXCache();
|
||||
}
|
||||
if (--this.nextDiscordUpdate <= 0) {
|
||||
this.nextDiscordUpdate = 3;
|
||||
if (this.discordActive) {
|
||||
this.updateDiscord();
|
||||
}
|
||||
}
|
||||
if (--this.nextAutoStateChange <= 0) {
|
||||
this.nextAutoStateChange = 3;
|
||||
this.updateAutoStateChange();
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
API.isRefreshFriendsLoading = false;
|
||||
console.error(err);
|
||||
}
|
||||
workerTimers.setTimeout(() => this.updateLoop(), 1000);
|
||||
}
|
||||
};
|
||||
}
|
||||
302
html/src/classes/utils.js
Normal file
302
html/src/classes/utils.js
Normal file
@@ -0,0 +1,302 @@
|
||||
export default class {
|
||||
$utils = {
|
||||
removeFromArray(array, item) {
|
||||
var { length } = array;
|
||||
for (var i = 0; i < length; ++i) {
|
||||
if (array[i] === item) {
|
||||
array.splice(i, 1);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
arraysMatch(a, b) {
|
||||
if (!Array.isArray(a) || !Array.isArray(b)) {
|
||||
return false;
|
||||
}
|
||||
return (
|
||||
a.length === b.length &&
|
||||
a.every(
|
||||
(element, index) =>
|
||||
JSON.stringify(element) === JSON.stringify(b[index])
|
||||
)
|
||||
);
|
||||
},
|
||||
|
||||
escapeTag(tag) {
|
||||
var s = String(tag);
|
||||
return s.replace(/["&'<>]/g, (c) => `&#${c.charCodeAt(0)};`);
|
||||
},
|
||||
|
||||
escapeTagRecursive(obj) {
|
||||
if (typeof obj === 'string') {
|
||||
return this.escapeTag(obj);
|
||||
}
|
||||
if (typeof obj === 'object') {
|
||||
for (var key in obj) {
|
||||
obj[key] = this.escapeTagRecursive(obj[key]);
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
timeToText(sec) {
|
||||
var n = Number(sec);
|
||||
if (isNaN(n)) {
|
||||
return this.escapeTag(sec);
|
||||
}
|
||||
n = Math.floor(n / 1000);
|
||||
var arr = [];
|
||||
if (n < 0) {
|
||||
n = -n;
|
||||
}
|
||||
if (n >= 86400) {
|
||||
arr.push(`${Math.floor(n / 86400)}d`);
|
||||
n %= 86400;
|
||||
}
|
||||
if (n >= 3600) {
|
||||
arr.push(`${Math.floor(n / 3600)}h`);
|
||||
n %= 3600;
|
||||
}
|
||||
if (n >= 60) {
|
||||
arr.push(`${Math.floor(n / 60)}m`);
|
||||
n %= 60;
|
||||
}
|
||||
if (arr.length === 0 && n < 60) {
|
||||
arr.push(`${n}s`);
|
||||
}
|
||||
return arr.join(' ');
|
||||
},
|
||||
|
||||
textToHex(text) {
|
||||
var s = String(text);
|
||||
return s
|
||||
.split('')
|
||||
.map((c) => c.charCodeAt(0).toString(16))
|
||||
.join(' ');
|
||||
},
|
||||
|
||||
commaNumber(num) {
|
||||
if (!num) {
|
||||
return '0';
|
||||
}
|
||||
var s = String(Number(num));
|
||||
return s.replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1,');
|
||||
},
|
||||
|
||||
parseLocation(tag) {
|
||||
var _tag = String(tag || '');
|
||||
var ctx = {
|
||||
tag: _tag,
|
||||
isOffline: false,
|
||||
isPrivate: false,
|
||||
isTraveling: false,
|
||||
worldId: '',
|
||||
instanceId: '',
|
||||
instanceName: '',
|
||||
accessType: '',
|
||||
accessTypeName: '',
|
||||
region: '',
|
||||
shortName: '',
|
||||
userId: null,
|
||||
hiddenId: null,
|
||||
privateId: null,
|
||||
friendsId: null,
|
||||
groupId: null,
|
||||
groupAccessType: null,
|
||||
canRequestInvite: false,
|
||||
strict: false
|
||||
};
|
||||
if (_tag === 'offline' || _tag === 'offline:offline') {
|
||||
ctx.isOffline = true;
|
||||
} else if (_tag === 'private' || _tag === 'private:private') {
|
||||
ctx.isPrivate = true;
|
||||
} else if (_tag === 'traveling' || _tag === 'traveling:traveling') {
|
||||
ctx.isTraveling = true;
|
||||
} else if (_tag.startsWith('local') === false) {
|
||||
var sep = _tag.indexOf(':');
|
||||
// technically not part of instance id, but might be there when coping id from url so why not support it
|
||||
var shortNameQualifier = '&shortName=';
|
||||
var shortNameIndex = _tag.indexOf(shortNameQualifier);
|
||||
if (shortNameIndex >= 0) {
|
||||
ctx.shortName = _tag.substr(
|
||||
shortNameIndex + shortNameQualifier.length
|
||||
);
|
||||
_tag = _tag.substr(0, shortNameIndex);
|
||||
}
|
||||
if (sep >= 0) {
|
||||
ctx.worldId = _tag.substr(0, sep);
|
||||
ctx.instanceId = _tag.substr(sep + 1);
|
||||
ctx.instanceId.split('~').forEach((s, i) => {
|
||||
if (i) {
|
||||
var A = s.indexOf('(');
|
||||
var Z = A >= 0 ? s.lastIndexOf(')') : -1;
|
||||
var key = Z >= 0 ? s.substr(0, A) : s;
|
||||
var value = A < Z ? s.substr(A + 1, Z - A - 1) : '';
|
||||
if (key === 'hidden') {
|
||||
ctx.hiddenId = value;
|
||||
} else if (key === 'private') {
|
||||
ctx.privateId = value;
|
||||
} else if (key === 'friends') {
|
||||
ctx.friendsId = value;
|
||||
} else if (key === 'canRequestInvite') {
|
||||
ctx.canRequestInvite = true;
|
||||
} else if (key === 'region') {
|
||||
ctx.region = value;
|
||||
} else if (key === 'group') {
|
||||
ctx.groupId = value;
|
||||
} else if (key === 'groupAccessType') {
|
||||
ctx.groupAccessType = value;
|
||||
} else if (key === 'strict') {
|
||||
ctx.strict = true;
|
||||
}
|
||||
} else {
|
||||
ctx.instanceName = s;
|
||||
}
|
||||
});
|
||||
ctx.accessType = 'public';
|
||||
if (ctx.privateId !== null) {
|
||||
if (ctx.canRequestInvite) {
|
||||
// InvitePlus
|
||||
ctx.accessType = 'invite+';
|
||||
} else {
|
||||
// InviteOnly
|
||||
ctx.accessType = 'invite';
|
||||
}
|
||||
ctx.userId = ctx.privateId;
|
||||
} else if (ctx.friendsId !== null) {
|
||||
// FriendsOnly
|
||||
ctx.accessType = 'friends';
|
||||
ctx.userId = ctx.friendsId;
|
||||
} else if (ctx.hiddenId !== null) {
|
||||
// FriendsOfGuests
|
||||
ctx.accessType = 'friends+';
|
||||
ctx.userId = ctx.hiddenId;
|
||||
} else if (ctx.groupId !== null) {
|
||||
// Group
|
||||
ctx.accessType = 'group';
|
||||
}
|
||||
ctx.accessTypeName = ctx.accessType;
|
||||
if (ctx.groupAccessType !== null) {
|
||||
if (ctx.groupAccessType === 'public') {
|
||||
ctx.accessTypeName = 'groupPublic';
|
||||
} else if (ctx.groupAccessType === 'plus') {
|
||||
ctx.accessTypeName = 'groupPlus';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ctx.worldId = _tag;
|
||||
}
|
||||
}
|
||||
return ctx;
|
||||
},
|
||||
|
||||
displayLocation(location, worldName, groupName) {
|
||||
var text = worldName;
|
||||
var L = this.parseLocation(location);
|
||||
if (L.isOffline) {
|
||||
text = 'Offline';
|
||||
} else if (L.isPrivate) {
|
||||
text = 'Private';
|
||||
} else if (L.isTraveling) {
|
||||
text = 'Traveling';
|
||||
} else if (L.worldId) {
|
||||
if (groupName) {
|
||||
text = `${worldName} ${L.accessTypeName}(${groupName})`;
|
||||
} else if (L.instanceId) {
|
||||
text = `${worldName} ${L.accessTypeName}`;
|
||||
}
|
||||
}
|
||||
return text;
|
||||
},
|
||||
|
||||
extractFileId(s) {
|
||||
var match = String(s).match(/file_[0-9A-Za-z-]+/);
|
||||
return match ? match[0] : '';
|
||||
},
|
||||
|
||||
extractFileVersion(s) {
|
||||
var match = /(?:\/file_[0-9A-Za-z-]+\/)([0-9]+)/gi.exec(s);
|
||||
return match ? match[1] : '';
|
||||
},
|
||||
|
||||
extractVariantVersion(url) {
|
||||
if (!url) {
|
||||
return '0';
|
||||
}
|
||||
try {
|
||||
const params = new URLSearchParams(new URL(url).search);
|
||||
const version = params.get('v');
|
||||
if (version) {
|
||||
return version;
|
||||
}
|
||||
return '0';
|
||||
} catch {
|
||||
return '0';
|
||||
}
|
||||
},
|
||||
|
||||
buildTreeData(json) {
|
||||
var node = [];
|
||||
for (var key in json) {
|
||||
if (key[0] === '$') {
|
||||
continue;
|
||||
}
|
||||
var value = json[key];
|
||||
if (Array.isArray(value) && value.length === 0) {
|
||||
node.push({
|
||||
key,
|
||||
value: '[]'
|
||||
});
|
||||
} else if (
|
||||
value === Object(value) &&
|
||||
Object.keys(value).length === 0
|
||||
) {
|
||||
node.push({
|
||||
key,
|
||||
value: '{}'
|
||||
});
|
||||
} else if (Array.isArray(value)) {
|
||||
node.push({
|
||||
children: value.map((val, idx) => {
|
||||
if (val === Object(val)) {
|
||||
return {
|
||||
children: this.buildTreeData(val),
|
||||
key: idx
|
||||
};
|
||||
}
|
||||
return {
|
||||
key: idx,
|
||||
value: val
|
||||
};
|
||||
}),
|
||||
key
|
||||
});
|
||||
} else if (value === Object(value)) {
|
||||
node.push({
|
||||
children: this.buildTreeData(value),
|
||||
key
|
||||
});
|
||||
} else {
|
||||
node.push({
|
||||
key,
|
||||
value: String(value)
|
||||
});
|
||||
}
|
||||
}
|
||||
node.sort(function (a, b) {
|
||||
var A = String(a.key).toUpperCase();
|
||||
var B = String(b.key).toUpperCase();
|
||||
if (A < B) {
|
||||
return -1;
|
||||
}
|
||||
if (A > B) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
return node;
|
||||
}
|
||||
};
|
||||
}
|
||||
275
html/src/classes/vrcRegistry.js
Normal file
275
html/src/classes/vrcRegistry.js
Normal file
@@ -0,0 +1,275 @@
|
||||
import configRepository from '../repository/config.js';
|
||||
import { baseClass, $app, API, $t, $utils } from './baseClass.js';
|
||||
|
||||
export default class extends baseClass {
|
||||
constructor(_app, _API, _t) {
|
||||
super(_app, _API, _t);
|
||||
}
|
||||
|
||||
init() {}
|
||||
|
||||
_data = {
|
||||
registryBackupDialog: {
|
||||
visible: false
|
||||
},
|
||||
|
||||
registryBackupTable: {
|
||||
data: [],
|
||||
tableProps: {
|
||||
stripe: true,
|
||||
size: 'mini',
|
||||
defaultSort: {
|
||||
prop: 'date',
|
||||
order: 'descending'
|
||||
}
|
||||
},
|
||||
layout: 'table'
|
||||
}
|
||||
};
|
||||
|
||||
_methods = {
|
||||
showRegistryBackupDialog() {
|
||||
this.$nextTick(() =>
|
||||
$app.adjustDialogZ(this.$refs.registryBackupDialog.$el)
|
||||
);
|
||||
var D = this.registryBackupDialog;
|
||||
D.visible = true;
|
||||
this.updateRegistryBackupDialog();
|
||||
},
|
||||
|
||||
async updateRegistryBackupDialog() {
|
||||
var D = this.registryBackupDialog;
|
||||
this.registryBackupTable.data = [];
|
||||
if (!D.visible) {
|
||||
return;
|
||||
}
|
||||
var backupsJson = await configRepository.getString(
|
||||
'VRCX_VRChatRegistryBackups'
|
||||
);
|
||||
if (!backupsJson) {
|
||||
backupsJson = JSON.stringify([]);
|
||||
}
|
||||
this.registryBackupTable.data = JSON.parse(backupsJson);
|
||||
},
|
||||
|
||||
async promptVrcRegistryBackupName() {
|
||||
var name = await this.$prompt(
|
||||
'Enter a name for the backup',
|
||||
'Backup Name',
|
||||
{
|
||||
confirmButtonText: 'Confirm',
|
||||
cancelButtonText: 'Cancel',
|
||||
inputPattern: /\S+/,
|
||||
inputErrorMessage: 'Name is required',
|
||||
inputValue: 'Backup'
|
||||
}
|
||||
);
|
||||
if (name.action === 'confirm') {
|
||||
this.backupVrcRegistry(name.value);
|
||||
}
|
||||
},
|
||||
|
||||
async backupVrcRegistry(name) {
|
||||
var regJson = await AppApi.GetVRChatRegistry();
|
||||
var newBackup = {
|
||||
name,
|
||||
date: new Date().toJSON(),
|
||||
data: regJson
|
||||
};
|
||||
var backupsJson = await configRepository.getString(
|
||||
'VRCX_VRChatRegistryBackups'
|
||||
);
|
||||
if (!backupsJson) {
|
||||
backupsJson = JSON.stringify([]);
|
||||
}
|
||||
var backups = JSON.parse(backupsJson);
|
||||
backups.push(newBackup);
|
||||
await configRepository.setString(
|
||||
'VRCX_VRChatRegistryBackups',
|
||||
JSON.stringify(backups)
|
||||
);
|
||||
await this.updateRegistryBackupDialog();
|
||||
},
|
||||
|
||||
async deleteVrcRegistryBackup(row) {
|
||||
var backups = this.registryBackupTable.data;
|
||||
$app.removeFromArray(backups, row);
|
||||
await configRepository.setString(
|
||||
'VRCX_VRChatRegistryBackups',
|
||||
JSON.stringify(backups)
|
||||
);
|
||||
await this.updateRegistryBackupDialog();
|
||||
},
|
||||
|
||||
restoreVrcRegistryBackup(row) {
|
||||
this.$confirm('Continue? Restore Backup', 'Confirm', {
|
||||
confirmButtonText: 'Confirm',
|
||||
cancelButtonText: 'Cancel',
|
||||
type: 'warning',
|
||||
callback: (action) => {
|
||||
if (action !== 'confirm') {
|
||||
return;
|
||||
}
|
||||
var data = JSON.stringify(row.data);
|
||||
AppApi.SetVRChatRegistry(data)
|
||||
.then(() => {
|
||||
this.$message({
|
||||
message: 'VRC registry settings restored',
|
||||
type: 'success'
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
console.error(e);
|
||||
this.$message({
|
||||
message: `Failed to restore VRC registry settings, check console for full error: ${e}`,
|
||||
type: 'error'
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
saveVrcRegistryBackupToFile(row) {
|
||||
this.downloadAndSaveJson(row.name, row.data);
|
||||
},
|
||||
|
||||
restoreVrcRegistryFromFile(json) {
|
||||
try {
|
||||
var data = JSON.parse(json);
|
||||
if (!data || typeof data !== 'object') {
|
||||
throw new Error('Invalid JSON');
|
||||
}
|
||||
// quick check to make sure it's a valid registry backup
|
||||
for (var key in data) {
|
||||
var value = data[key];
|
||||
if (
|
||||
typeof value !== 'object' ||
|
||||
typeof value.type !== 'number' ||
|
||||
typeof value.data === 'undefined'
|
||||
) {
|
||||
throw new Error('Invalid JSON');
|
||||
}
|
||||
}
|
||||
AppApi.SetVRChatRegistry(json)
|
||||
.then(() => {
|
||||
this.$message({
|
||||
message: 'VRC registry settings restored',
|
||||
type: 'success'
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
console.error(e);
|
||||
this.$message({
|
||||
message: `Failed to restore VRC registry settings, check console for full error: ${e}`,
|
||||
type: 'error'
|
||||
});
|
||||
});
|
||||
} catch {
|
||||
this.$message({
|
||||
message: 'Invalid JSON',
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
deleteVrcRegistry() {
|
||||
this.$confirm('Continue? Delete VRC Registry Settings', 'Confirm', {
|
||||
confirmButtonText: 'Confirm',
|
||||
cancelButtonText: 'Cancel',
|
||||
type: 'warning',
|
||||
callback: (action) => {
|
||||
if (action !== 'confirm') {
|
||||
return;
|
||||
}
|
||||
AppApi.DeleteVRChatRegistryFolder().then(() => {
|
||||
this.$message({
|
||||
message: 'VRC registry settings deleted',
|
||||
type: 'success'
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
clearVrcRegistryDialog() {
|
||||
this.registryBackupTable.data = [];
|
||||
},
|
||||
|
||||
async checkAutoBackupRestoreVrcRegistry() {
|
||||
if (!this.vrcRegistryAutoBackup) {
|
||||
return;
|
||||
}
|
||||
|
||||
// check for auto restore
|
||||
var hasVRChatRegistryFolder =
|
||||
await AppApi.HasVRChatRegistryFolder();
|
||||
if (!hasVRChatRegistryFolder) {
|
||||
var lastBackupDate = await configRepository.getString(
|
||||
'VRCX_VRChatRegistryLastBackupDate'
|
||||
);
|
||||
var lastRestoreCheck = await configRepository.getString(
|
||||
'VRCX_VRChatRegistryLastRestoreCheck'
|
||||
);
|
||||
if (
|
||||
!lastBackupDate ||
|
||||
(lastRestoreCheck &&
|
||||
lastBackupDate &&
|
||||
lastRestoreCheck === lastBackupDate)
|
||||
) {
|
||||
// only ask to restore once and when backup is present
|
||||
return;
|
||||
}
|
||||
// popup message about auto restore
|
||||
this.$alert(
|
||||
$t('dialog.registry_backup.restore_prompt'),
|
||||
$t('dialog.registry_backup.header')
|
||||
);
|
||||
this.showRegistryBackupDialog();
|
||||
await AppApi.FocusWindow();
|
||||
await configRepository.setString(
|
||||
'VRCX_VRChatRegistryLastRestoreCheck',
|
||||
lastBackupDate
|
||||
);
|
||||
} else {
|
||||
await this.autoBackupVrcRegistry();
|
||||
}
|
||||
},
|
||||
|
||||
async autoBackupVrcRegistry() {
|
||||
var date = new Date();
|
||||
var lastBackupDate = await configRepository.getString(
|
||||
'VRCX_VRChatRegistryLastBackupDate'
|
||||
);
|
||||
if (lastBackupDate) {
|
||||
var lastBackup = new Date(lastBackupDate);
|
||||
var diff = date.getTime() - lastBackup.getTime();
|
||||
var diffDays = Math.floor(diff / (1000 * 60 * 60 * 24));
|
||||
if (diffDays < 7) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
var backupsJson = await configRepository.getString(
|
||||
'VRCX_VRChatRegistryBackups'
|
||||
);
|
||||
if (!backupsJson) {
|
||||
backupsJson = JSON.stringify([]);
|
||||
}
|
||||
var backups = JSON.parse(backupsJson);
|
||||
backups.forEach((backup) => {
|
||||
if (backup.name === 'Auto Backup') {
|
||||
// remove old auto backup
|
||||
$app.removeFromArray(backups, backup);
|
||||
}
|
||||
});
|
||||
await configRepository.setString(
|
||||
'VRCX_VRChatRegistryBackups',
|
||||
JSON.stringify(backups)
|
||||
);
|
||||
this.backupVrcRegistry('Auto Backup');
|
||||
await configRepository.setString(
|
||||
'VRCX_VRChatRegistryLastBackupDate',
|
||||
date.toJSON()
|
||||
);
|
||||
}
|
||||
};
|
||||
}
|
||||
52
html/src/classes/vrcxJsonStorage.js
Normal file
52
html/src/classes/vrcxJsonStorage.js
Normal file
@@ -0,0 +1,52 @@
|
||||
import * as workerTimers from 'worker-timers';
|
||||
/* eslint-disable no-unused-vars */
|
||||
let VRCXStorage = {};
|
||||
/* eslint-enable no-unused-vars */
|
||||
|
||||
export default class {
|
||||
constructor(_VRCXStorage) {
|
||||
VRCXStorage = _VRCXStorage;
|
||||
this.init();
|
||||
}
|
||||
|
||||
init() {
|
||||
VRCXStorage.GetArray = async function (key) {
|
||||
try {
|
||||
var array = JSON.parse(await this.Get(key));
|
||||
if (Array.isArray(array)) {
|
||||
return array;
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
return [];
|
||||
};
|
||||
|
||||
VRCXStorage.SetArray = function (key, value) {
|
||||
this.Set(key, JSON.stringify(value));
|
||||
};
|
||||
|
||||
VRCXStorage.GetObject = async function (key) {
|
||||
try {
|
||||
var object = JSON.parse(await this.Get(key));
|
||||
if (object === Object(object)) {
|
||||
return object;
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
return {};
|
||||
};
|
||||
|
||||
VRCXStorage.SetObject = function (key, value) {
|
||||
this.Set(key, JSON.stringify(value));
|
||||
};
|
||||
|
||||
workerTimers.setInterval(
|
||||
() => {
|
||||
VRCXStorage.Flush();
|
||||
},
|
||||
5 * 60 * 1000
|
||||
);
|
||||
}
|
||||
}
|
||||
1611
html/src/classes/vrcxNotifications.js
Normal file
1611
html/src/classes/vrcxNotifications.js
Normal file
File diff suppressed because it is too large
Load Diff
264
html/src/classes/vrcxUpdater.js
Normal file
264
html/src/classes/vrcxUpdater.js
Normal file
@@ -0,0 +1,264 @@
|
||||
import { baseClass, $app, API, $t, $utils } from './baseClass.js';
|
||||
|
||||
export default class extends baseClass {
|
||||
constructor(_app, _API, _t) {
|
||||
super(_app, _API, _t);
|
||||
}
|
||||
|
||||
_data = {
|
||||
VRCXUpdateDialog: {
|
||||
visible: false,
|
||||
updatePending: false,
|
||||
updatePendingIsLatest: false,
|
||||
release: '',
|
||||
releases: [],
|
||||
json: {}
|
||||
},
|
||||
branch: 'Stable',
|
||||
autoUpdateVRCX: 'Auto Download',
|
||||
checkingForVRCXUpdate: false,
|
||||
pendingVRCXInstall: '',
|
||||
pendingVRCXUpdate: false,
|
||||
branches: {
|
||||
Stable: {
|
||||
name: 'Stable',
|
||||
urlReleases: 'https://api0.vrcx.app/releases/stable',
|
||||
urlLatest: 'https://api0.vrcx.app/releases/stable/latest'
|
||||
},
|
||||
Nightly: {
|
||||
name: 'Nightly',
|
||||
urlReleases: 'https://api0.vrcx.app/releases/nightly',
|
||||
urlLatest: 'https://api0.vrcx.app/releases/nightly/latest'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
_methods = {
|
||||
async showVRCXUpdateDialog() {
|
||||
this.$nextTick(() =>
|
||||
$app.adjustDialogZ(this.$refs.VRCXUpdateDialog.$el)
|
||||
);
|
||||
var D = this.VRCXUpdateDialog;
|
||||
D.visible = true;
|
||||
D.updatePendingIsLatest = false;
|
||||
D.updatePending = await AppApi.CheckForUpdateExe();
|
||||
this.loadBranchVersions();
|
||||
},
|
||||
|
||||
downloadVRCXUpdate(updateSetupUrl, updateHashUrl, size, name, type) {
|
||||
var ref = {
|
||||
id: 'VRCXUpdate',
|
||||
name
|
||||
};
|
||||
this.downloadQueue.set('VRCXUpdate', {
|
||||
ref,
|
||||
type,
|
||||
updateSetupUrl,
|
||||
updateHashUrl,
|
||||
size
|
||||
});
|
||||
this.downloadQueueTable.data = Array.from(
|
||||
this.downloadQueue.values()
|
||||
);
|
||||
if (!this.downloadInProgress) {
|
||||
this.downloadFileQueueUpdate();
|
||||
}
|
||||
},
|
||||
|
||||
installVRCXUpdate() {
|
||||
for (var release of this.VRCXUpdateDialog.releases) {
|
||||
if (release.name === this.VRCXUpdateDialog.release) {
|
||||
var downloadUrl = '';
|
||||
var hashUrl = '';
|
||||
var size = 0;
|
||||
for (var asset of release.assets) {
|
||||
if (asset.state !== 'uploaded') {
|
||||
continue;
|
||||
}
|
||||
if (
|
||||
asset.content_type === 'application/x-msdownload' ||
|
||||
asset.content_type === 'application/x-msdos-program'
|
||||
) {
|
||||
downloadUrl = asset.browser_download_url;
|
||||
size = asset.size;
|
||||
continue;
|
||||
}
|
||||
if (
|
||||
asset.name === 'SHA256SUMS.txt' &&
|
||||
asset.content_type === 'text/plain'
|
||||
) {
|
||||
hashUrl = asset.browser_download_url;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (!downloadUrl) {
|
||||
return;
|
||||
}
|
||||
var name = release.name;
|
||||
var type = 'Manual';
|
||||
this.downloadVRCXUpdate(
|
||||
downloadUrl,
|
||||
hashUrl,
|
||||
size,
|
||||
name,
|
||||
type
|
||||
);
|
||||
this.VRCXUpdateDialog.visible = false;
|
||||
this.showDownloadDialog();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
async loadBranchVersions() {
|
||||
var D = this.VRCXUpdateDialog;
|
||||
var url = this.branches[this.branch].urlReleases;
|
||||
this.checkingForVRCXUpdate = true;
|
||||
try {
|
||||
var response = await webApiService.execute({
|
||||
url,
|
||||
method: 'GET'
|
||||
});
|
||||
} finally {
|
||||
this.checkingForVRCXUpdate = false;
|
||||
}
|
||||
var json = JSON.parse(response.data);
|
||||
if (this.debugWebRequests) {
|
||||
console.log(json, response);
|
||||
}
|
||||
var releases = [];
|
||||
if (typeof json !== 'object' || json.message) {
|
||||
$app.$message({
|
||||
message: `Failed to check for update, "${json.message}"`,
|
||||
type: 'error'
|
||||
});
|
||||
return;
|
||||
}
|
||||
for (var release of json) {
|
||||
for (var asset of release.assets) {
|
||||
if (
|
||||
(asset.content_type === 'application/x-msdownload' ||
|
||||
asset.content_type ===
|
||||
'application/x-msdos-program') &&
|
||||
asset.state === 'uploaded'
|
||||
) {
|
||||
releases.push(release);
|
||||
}
|
||||
}
|
||||
}
|
||||
D.releases = releases;
|
||||
D.release = json[0].name;
|
||||
this.VRCXUpdateDialog.updatePendingIsLatest = false;
|
||||
if (D.release === this.pendingVRCXInstall) {
|
||||
// update already downloaded and latest version
|
||||
this.VRCXUpdateDialog.updatePendingIsLatest = true;
|
||||
}
|
||||
if (
|
||||
(await configRepository.getString('VRCX_branch')) !==
|
||||
this.branch
|
||||
) {
|
||||
await configRepository.setString('VRCX_branch', this.branch);
|
||||
}
|
||||
},
|
||||
|
||||
async checkForVRCXUpdate() {
|
||||
if (
|
||||
!this.appVersion ||
|
||||
this.appVersion === 'VRCX Nightly Build' ||
|
||||
this.appVersion === 'VRCX Build'
|
||||
) {
|
||||
return;
|
||||
}
|
||||
if (this.branch === 'Beta') {
|
||||
// move Beta users to stable
|
||||
this.branch = 'Stable';
|
||||
await configRepository.setString('VRCX_branch', this.branch);
|
||||
}
|
||||
var url = this.branches[this.branch].urlLatest;
|
||||
this.checkingForVRCXUpdate = true;
|
||||
try {
|
||||
var response = await webApiService.execute({
|
||||
url,
|
||||
method: 'GET'
|
||||
});
|
||||
} finally {
|
||||
this.checkingForVRCXUpdate = false;
|
||||
}
|
||||
this.pendingVRCXUpdate = false;
|
||||
var json = JSON.parse(response.data);
|
||||
if (this.debugWebRequests) {
|
||||
console.log(json, response);
|
||||
}
|
||||
if (json === Object(json) && json.name && json.published_at) {
|
||||
this.VRCXUpdateDialog.updateJson = json;
|
||||
this.changeLogDialog.buildName = json.name;
|
||||
this.changeLogDialog.changeLog = this.changeLogRemoveLinks(
|
||||
json.body
|
||||
);
|
||||
this.latestAppVersion = json.name;
|
||||
var name = json.name;
|
||||
this.VRCXUpdateDialog.updatePendingIsLatest = false;
|
||||
if (name === this.pendingVRCXInstall) {
|
||||
// update already downloaded
|
||||
this.VRCXUpdateDialog.updatePendingIsLatest = true;
|
||||
} else if (name > this.appVersion) {
|
||||
var downloadUrl = '';
|
||||
var hashUrl = '';
|
||||
var size = 0;
|
||||
for (var asset of json.assets) {
|
||||
if (asset.state !== 'uploaded') {
|
||||
continue;
|
||||
}
|
||||
if (
|
||||
asset.content_type === 'application/x-msdownload' ||
|
||||
asset.content_type === 'application/x-msdos-program'
|
||||
) {
|
||||
downloadUrl = asset.browser_download_url;
|
||||
size = asset.size;
|
||||
continue;
|
||||
}
|
||||
if (
|
||||
asset.name === 'SHA256SUMS.txt' &&
|
||||
asset.content_type === 'text/plain'
|
||||
) {
|
||||
hashUrl = asset.browser_download_url;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (!downloadUrl) {
|
||||
return;
|
||||
}
|
||||
this.pendingVRCXUpdate = true;
|
||||
this.notifyMenu('settings');
|
||||
var type = 'Auto';
|
||||
if (!API.isLoggedIn) {
|
||||
this.showVRCXUpdateDialog();
|
||||
} else if (this.autoUpdateVRCX === 'Notify') {
|
||||
// this.showVRCXUpdateDialog();
|
||||
} else if (this.autoUpdateVRCX === 'Auto Download') {
|
||||
this.downloadVRCXUpdate(
|
||||
downloadUrl,
|
||||
hashUrl,
|
||||
size,
|
||||
name,
|
||||
type
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
restartVRCX(isUpgrade) {
|
||||
AppApi.RestartApplication(isUpgrade);
|
||||
},
|
||||
|
||||
async saveAutoUpdateVRCX() {
|
||||
if (this.autoUpdateVRCX === 'Off') {
|
||||
this.pendingVRCXUpdate = false;
|
||||
}
|
||||
await configRepository.setString(
|
||||
'VRCX_autoUpdateVRCX',
|
||||
this.autoUpdateVRCX
|
||||
);
|
||||
}
|
||||
};
|
||||
}
|
||||
519
html/src/classes/websocket.js
Normal file
519
html/src/classes/websocket.js
Normal file
@@ -0,0 +1,519 @@
|
||||
import * as workerTimers from 'worker-timers';
|
||||
import Noty from 'noty';
|
||||
import { baseClass, $app, API, $t } from './baseClass.js';
|
||||
|
||||
export default class extends baseClass {
|
||||
constructor(_app, _API, _t) {
|
||||
super(_app, _API, _t);
|
||||
}
|
||||
|
||||
init() {
|
||||
API.webSocket = null;
|
||||
API.lastWebSocketMessage = '';
|
||||
|
||||
API.$on('USER:CURRENT', function () {
|
||||
if ($app.friendLogInitStatus && this.webSocket === null) {
|
||||
this.getAuth();
|
||||
}
|
||||
});
|
||||
|
||||
API.getAuth = function () {
|
||||
return this.call('auth', {
|
||||
method: 'GET'
|
||||
}).then((json) => {
|
||||
var args = {
|
||||
json
|
||||
};
|
||||
this.$emit('AUTH', args);
|
||||
return args;
|
||||
});
|
||||
};
|
||||
|
||||
API.$on('AUTH', function (args) {
|
||||
if (args.json.ok) {
|
||||
this.connectWebSocket(args.json.token);
|
||||
}
|
||||
});
|
||||
|
||||
API.connectWebSocket = function (token) {
|
||||
if (this.webSocket !== null) {
|
||||
return;
|
||||
}
|
||||
var socket = new WebSocket(`${API.websocketDomain}/?auth=${token}`);
|
||||
socket.onopen = () => {
|
||||
if ($app.debugWebSocket) {
|
||||
console.log('WebSocket connected');
|
||||
}
|
||||
};
|
||||
socket.onclose = () => {
|
||||
if (this.webSocket === socket) {
|
||||
this.webSocket = null;
|
||||
}
|
||||
try {
|
||||
socket.close();
|
||||
} catch (err) {}
|
||||
if ($app.debugWebSocket) {
|
||||
console.log('WebSocket closed');
|
||||
}
|
||||
workerTimers.setTimeout(() => {
|
||||
if (
|
||||
this.isLoggedIn &&
|
||||
$app.friendLogInitStatus &&
|
||||
this.webSocket === null
|
||||
) {
|
||||
this.getAuth();
|
||||
}
|
||||
}, 5000);
|
||||
};
|
||||
socket.onerror = () => {
|
||||
if (this.errorNoty) {
|
||||
this.errorNoty.close();
|
||||
}
|
||||
this.errorNoty = new Noty({
|
||||
type: 'error',
|
||||
text: 'WebSocket Error'
|
||||
}).show();
|
||||
socket.onclose();
|
||||
};
|
||||
socket.onmessage = ({ data }) => {
|
||||
try {
|
||||
if (this.lastWebSocketMessage === data) {
|
||||
// pls no spam
|
||||
return;
|
||||
}
|
||||
this.lastWebSocketMessage = data;
|
||||
var json = JSON.parse(data);
|
||||
try {
|
||||
json.content = JSON.parse(json.content);
|
||||
} catch (err) {}
|
||||
this.$emit('PIPELINE', {
|
||||
json
|
||||
});
|
||||
if ($app.debugWebSocket && json.content) {
|
||||
var displayName = '';
|
||||
var user = this.cachedUsers.get(json.content.userId);
|
||||
if (user) {
|
||||
displayName = user.displayName;
|
||||
}
|
||||
console.log(
|
||||
'WebSocket',
|
||||
json.type,
|
||||
displayName,
|
||||
json.content
|
||||
);
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
};
|
||||
this.webSocket = socket;
|
||||
};
|
||||
|
||||
API.$on('LOGOUT', function () {
|
||||
this.closeWebSocket();
|
||||
});
|
||||
|
||||
API.closeWebSocket = function () {
|
||||
var socket = this.webSocket;
|
||||
if (socket === null) {
|
||||
return;
|
||||
}
|
||||
this.webSocket = null;
|
||||
try {
|
||||
socket.close();
|
||||
} catch (err) {}
|
||||
};
|
||||
|
||||
API.reconnectWebSocket = function () {
|
||||
if (!this.isLoggedIn || !$app.friendLogInitStatus) {
|
||||
return;
|
||||
}
|
||||
this.closeWebSocket();
|
||||
this.getAuth();
|
||||
};
|
||||
|
||||
API.$on('PIPELINE', function (args) {
|
||||
var { type, content, err } = args.json;
|
||||
if (typeof err !== 'undefined') {
|
||||
console.error('PIPELINE: error', args);
|
||||
if (this.errorNoty) {
|
||||
this.errorNoty.close();
|
||||
}
|
||||
this.errorNoty = new Noty({
|
||||
type: 'error',
|
||||
text: $app.escapeTag(`WebSocket Error: ${err}`)
|
||||
}).show();
|
||||
return;
|
||||
}
|
||||
if (typeof content === 'undefined') {
|
||||
console.error('PIPELINE: missing content', args);
|
||||
return;
|
||||
}
|
||||
if (typeof content.user !== 'undefined') {
|
||||
// I forgot about this...
|
||||
delete content.user.state;
|
||||
}
|
||||
switch (type) {
|
||||
case 'notification':
|
||||
this.$emit('NOTIFICATION', {
|
||||
json: content,
|
||||
params: {
|
||||
notificationId: content.id
|
||||
}
|
||||
});
|
||||
this.$emit('PIPELINE:NOTIFICATION', {
|
||||
json: content,
|
||||
params: {
|
||||
notificationId: content.id
|
||||
}
|
||||
});
|
||||
break;
|
||||
|
||||
case 'notification-v2':
|
||||
console.log('notification-v2', content);
|
||||
this.$emit('NOTIFICATION:V2', {
|
||||
json: content,
|
||||
params: {
|
||||
notificationId: content.id
|
||||
}
|
||||
});
|
||||
break;
|
||||
|
||||
case 'notification-v2-delete':
|
||||
console.log('notification-v2-delete', content);
|
||||
for (var id of content.ids) {
|
||||
this.$emit('NOTIFICATION:HIDE', {
|
||||
params: {
|
||||
notificationId: id
|
||||
}
|
||||
});
|
||||
this.$emit('NOTIFICATION:SEE', {
|
||||
params: {
|
||||
notificationId: id
|
||||
}
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
||||
case 'notification-v2-update':
|
||||
console.log('notification-v2-update', content);
|
||||
this.$emit('NOTIFICATION:V2:UPDATE', {
|
||||
json: content.updates,
|
||||
params: {
|
||||
notificationId: content.id
|
||||
}
|
||||
});
|
||||
break;
|
||||
|
||||
case 'see-notification':
|
||||
this.$emit('NOTIFICATION:SEE', {
|
||||
params: {
|
||||
notificationId: content
|
||||
}
|
||||
});
|
||||
break;
|
||||
|
||||
case 'hide-notification':
|
||||
this.$emit('NOTIFICATION:HIDE', {
|
||||
params: {
|
||||
notificationId: content
|
||||
}
|
||||
});
|
||||
this.$emit('NOTIFICATION:SEE', {
|
||||
params: {
|
||||
notificationId: content
|
||||
}
|
||||
});
|
||||
break;
|
||||
|
||||
case 'response-notification':
|
||||
this.$emit('NOTIFICATION:HIDE', {
|
||||
params: {
|
||||
notificationId: content.notificationId
|
||||
}
|
||||
});
|
||||
this.$emit('NOTIFICATION:SEE', {
|
||||
params: {
|
||||
notificationId: content.notificationId
|
||||
}
|
||||
});
|
||||
break;
|
||||
|
||||
case 'friend-add':
|
||||
this.$emit('USER', {
|
||||
json: content.user,
|
||||
params: {
|
||||
userId: content.userId
|
||||
}
|
||||
});
|
||||
this.$emit('FRIEND:ADD', {
|
||||
params: {
|
||||
userId: content.userId
|
||||
}
|
||||
});
|
||||
break;
|
||||
|
||||
case 'friend-delete':
|
||||
this.$emit('FRIEND:DELETE', {
|
||||
params: {
|
||||
userId: content.userId
|
||||
}
|
||||
});
|
||||
break;
|
||||
|
||||
case 'friend-online':
|
||||
if (content?.user?.id) {
|
||||
this.$emit('USER', {
|
||||
json: {
|
||||
location: content.location,
|
||||
travelingToLocation:
|
||||
content.travelingToLocation,
|
||||
...content.user
|
||||
},
|
||||
params: {
|
||||
userId: content.userId
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$emit('FRIEND:STATE', {
|
||||
json: {
|
||||
state: 'online'
|
||||
},
|
||||
params: {
|
||||
userId: content.userId
|
||||
}
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
||||
case 'friend-active':
|
||||
if (content?.user?.id) {
|
||||
this.$emit('USER', {
|
||||
json: content.user,
|
||||
params: {
|
||||
userId: content.userId
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$emit('FRIEND:STATE', {
|
||||
json: {
|
||||
state: 'active'
|
||||
},
|
||||
params: {
|
||||
userId: content.userId
|
||||
}
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
||||
case 'friend-offline':
|
||||
this.$emit('FRIEND:STATE', {
|
||||
json: {
|
||||
state: 'offline'
|
||||
},
|
||||
params: {
|
||||
userId: content.userId
|
||||
}
|
||||
});
|
||||
break;
|
||||
|
||||
case 'friend-update':
|
||||
this.$emit('USER', {
|
||||
json: content.user,
|
||||
params: {
|
||||
userId: content.userId
|
||||
}
|
||||
});
|
||||
break;
|
||||
|
||||
case 'friend-location':
|
||||
if (!content?.user?.id) {
|
||||
var ref = this.cachedUsers.get(content.userId);
|
||||
if (typeof ref !== 'undefined') {
|
||||
this.$emit('USER', {
|
||||
json: {
|
||||
...ref,
|
||||
location: content.location,
|
||||
travelingToLocation:
|
||||
content.travelingToLocation
|
||||
},
|
||||
params: {
|
||||
userId: content.userId
|
||||
}
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
this.$emit('USER', {
|
||||
json: {
|
||||
location: content.location,
|
||||
travelingToLocation: content.travelingToLocation,
|
||||
...content.user
|
||||
// state: 'online'
|
||||
},
|
||||
params: {
|
||||
userId: content.userId
|
||||
}
|
||||
});
|
||||
break;
|
||||
|
||||
case 'user-update':
|
||||
this.$emit('USER:CURRENT', {
|
||||
json: content.user,
|
||||
params: {
|
||||
userId: content.userId
|
||||
}
|
||||
});
|
||||
break;
|
||||
|
||||
case 'user-location':
|
||||
// update current user location
|
||||
if (content.userId !== this.currentUser.id) {
|
||||
console.error('user-location wrong userId', content);
|
||||
break;
|
||||
}
|
||||
|
||||
// content.user: {}
|
||||
// content.world: {}
|
||||
|
||||
this.currentUser.presence.instance = content.instance;
|
||||
this.currentUser.presence.world = content.worldId;
|
||||
$app.setCurrentUserLocation(content.location);
|
||||
break;
|
||||
|
||||
case 'group-joined':
|
||||
// var groupId = content.groupId;
|
||||
// $app.onGroupJoined(groupId);
|
||||
break;
|
||||
|
||||
case 'group-left':
|
||||
// var groupId = content.groupId;
|
||||
// $app.onGroupLeft(groupId);
|
||||
break;
|
||||
|
||||
case 'group-role-updated':
|
||||
var groupId = content.role.groupId;
|
||||
API.getGroup({ groupId, includeRoles: true });
|
||||
console.log('group-role-updated', content);
|
||||
|
||||
// content {
|
||||
// role: {
|
||||
// createdAt: string,
|
||||
// description: string,
|
||||
// groupId: string,
|
||||
// id: string,
|
||||
// isManagementRole: boolean,
|
||||
// isSelfAssignable: boolean,
|
||||
// name: string,
|
||||
// order: number,
|
||||
// permissions: string[],
|
||||
// requiresPurchase: boolean,
|
||||
// requiresTwoFactor: boolean
|
||||
break;
|
||||
|
||||
case 'group-member-updated':
|
||||
var groupId = content.member.groupId;
|
||||
if (
|
||||
$app.groupDialog.visible &&
|
||||
$app.groupDialog.id === groupId
|
||||
) {
|
||||
$app.getGroupDialogGroup(groupId);
|
||||
}
|
||||
this.$emit('GROUP:MEMBER', {
|
||||
json: content.member,
|
||||
params: {
|
||||
groupId
|
||||
}
|
||||
});
|
||||
console.log('group-member-updated', content);
|
||||
|
||||
// content {
|
||||
// groupId: string,
|
||||
// id: string,
|
||||
// isRepresenting: boolean,
|
||||
// isSubscribedToAnnouncements: boolean,
|
||||
// joinedAt: string,
|
||||
// membershipStatus: string,
|
||||
// roleIds: string[],
|
||||
// userId: string,
|
||||
// visibility: string
|
||||
// }
|
||||
break;
|
||||
|
||||
case 'instance-queue-joined':
|
||||
case 'instance-queue-position':
|
||||
var instanceId = content.instanceLocation;
|
||||
var position = content.position ?? 0;
|
||||
var queueSize = content.queueSize ?? 0;
|
||||
$app.instanceQueueUpdate(instanceId, position, queueSize);
|
||||
break;
|
||||
|
||||
case 'instance-queue-ready':
|
||||
var instanceId = content.instanceLocation;
|
||||
// var expiry = Date.parse(content.expiry);
|
||||
$app.instanceQueueReady(instanceId);
|
||||
break;
|
||||
|
||||
case 'instance-queue-left':
|
||||
var instanceId = content.instanceLocation;
|
||||
$app.removeQueuedInstance(instanceId);
|
||||
// $app.instanceQueueClear();
|
||||
break;
|
||||
|
||||
case 'content-refresh':
|
||||
var contentType = content.contentType;
|
||||
console.log('content-refresh', content);
|
||||
if (contentType === 'icon') {
|
||||
if ($app.galleryDialogVisible) {
|
||||
$app.refreshVRCPlusIconsTable();
|
||||
}
|
||||
} else if (contentType === 'gallery') {
|
||||
if ($app.galleryDialogVisible) {
|
||||
$app.refreshGalleryTable();
|
||||
}
|
||||
} else if (contentType === 'emoji') {
|
||||
if ($app.galleryDialogVisible) {
|
||||
$app.refreshEmojiTable();
|
||||
}
|
||||
} else if (contentType === 'avatar') {
|
||||
// hmm, utilizing this might be too spamy and cause UI to move around
|
||||
} else if (contentType === 'world') {
|
||||
// hmm
|
||||
} else if (contentType === 'created') {
|
||||
// on avatar upload
|
||||
} else {
|
||||
console.log('Unknown content-refresh', content);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'instance-closed':
|
||||
// TODO: get worldName, groupName, hardClose
|
||||
var noty = {
|
||||
type: 'instance.closed',
|
||||
location: content.instanceLocation,
|
||||
message: 'Instance Closed',
|
||||
created_at: new Date().toJSON()
|
||||
};
|
||||
if (
|
||||
$app.notificationTable.filters[0].value.length === 0 ||
|
||||
$app.notificationTable.filters[0].value.includes(
|
||||
noty.type
|
||||
)
|
||||
) {
|
||||
$app.notifyMenu('notification');
|
||||
}
|
||||
$app.queueNotificationNoty(noty);
|
||||
$app.notificationTable.data.push(noty);
|
||||
$app.updateSharedFeed(true);
|
||||
break;
|
||||
|
||||
default:
|
||||
console.log('Unknown pipeline type', args.json);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
_data = {};
|
||||
|
||||
_methods = {};
|
||||
}
|
||||
3765
html/src/index.pug
3765
html/src/index.pug
File diff suppressed because it is too large
Load Diff
122
html/src/mixins/dialogs/avatarDialog.pug
Normal file
122
html/src/mixins/dialogs/avatarDialog.pug
Normal file
@@ -0,0 +1,122 @@
|
||||
|
||||
mixin avatarDialog()
|
||||
el-dialog.x-dialog.x-avatar-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="avatarDialog" :visible.sync="avatarDialog.visible" :show-close="false" width="600px")
|
||||
div(v-loading="avatarDialog.loading")
|
||||
div(style="display:flex")
|
||||
el-popover(placement="right" width="500px" trigger="click")
|
||||
img.x-link(slot="reference" v-lazy="avatarDialog.ref.thumbnailImageUrl" style="flex:none;width:160px;height:120px;border-radius:12px")
|
||||
img.x-link(v-lazy="avatarDialog.ref.imageUrl" style="width:500px;height:375px" @click="showFullscreenImageDialog(avatarDialog.ref.imageUrl)")
|
||||
div(style="flex:1;display:flex;align-items:center;margin-left:15px")
|
||||
div(style="flex:1")
|
||||
div
|
||||
span.dialog-title(v-text="avatarDialog.ref.name")
|
||||
div(style="margin-top:5px")
|
||||
span.x-link.x-grey(v-text="avatarDialog.ref.authorName" @click="showUserDialog(avatarDialog.ref.authorId)" style="font-family:monospace")
|
||||
div
|
||||
el-tag(v-if="avatarDialog.ref.releaseStatus === 'public'" type="success" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") {{ $t('dialog.avatar.tags.public') }}
|
||||
el-tag(v-else type="danger" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") {{ $t('dialog.avatar.tags.private') }}
|
||||
el-tag.x-tag-platform-pc(v-if="avatarDialog.isPC" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") PC
|
||||
span.x-grey(v-if="avatarDialog.platformInfo.pc" style=";margin-left:5px;border-left:inherit;padding-left:5px") {{ avatarDialog.platformInfo.pc.performanceRating }}
|
||||
span.x-grey(v-if="avatarDialog.bundleSizes['standalonewindows']" style=";margin-left:5px;border-left:inherit;padding-left:5px") {{ avatarDialog.bundleSizes['standalonewindows'].fileSize }}
|
||||
el-tag.x-tag-platform-quest(v-if="avatarDialog.isQuest" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") Android
|
||||
span.x-grey(v-if="avatarDialog.platformInfo.android" style=";margin-left:5px;border-left:inherit;padding-left:5px") {{ avatarDialog.platformInfo.android.performanceRating }}
|
||||
span.x-grey(v-if="avatarDialog.bundleSizes['android']" style="margin-left:5px;border-left:inherit;padding-left:5px") {{ avatarDialog.bundleSizes['android'].fileSize }}
|
||||
el-tag.x-tag-platform-ios(v-if="avatarDialog.isIos" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") iOS
|
||||
span.x-grey(v-if="avatarDialog.platformInfo.ios" style=";margin-left:5px;border-left:inherit;padding-left:5px") {{ avatarDialog.platformInfo.ios.performanceRating }}
|
||||
span.x-grey(v-if="avatarDialog.bundleSizes['ios']" style="margin-left:5px;border-left:inherit;padding-left:5px") {{ avatarDialog.bundleSizes['ios'].fileSize }}
|
||||
el-tag.x-link(v-if="avatarDialog.inCache" type="info" effect="plain" size="mini" @click="openFolderGeneric(avatarDialog.cachePath)" style="margin-right:5px;margin-top:5px")
|
||||
span(v-text="avatarDialog.cacheSize")
|
||||
| {{ $t('dialog.avatar.tags.cache') }}
|
||||
el-tag(v-if="avatarDialog.isQuestFallback" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") {{ $t('dialog.avatar.tags.fallback') }}
|
||||
el-tag(v-if="avatarDialog.hasImposter" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") {{ $t('dialog.avatar.tags.impostor') }}
|
||||
span.x-grey(v-if="avatarDialog.imposterVersion" style="margin-left:5px;border-left:inherit;padding-left:5px") v{{ avatarDialog.imposterVersion }}
|
||||
el-tag(v-if="avatarDialog.ref.unityPackageUrl" type="success" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") {{ $t('dialog.avatar.tags.future_proofing') }}
|
||||
div
|
||||
template(v-for="tag in avatarDialog.ref.tags")
|
||||
el-tag(v-if="tag.startsWith('content_')" :key="tag" effect="plain" size="mini" style="margin-right:5px;margin-top:5px")
|
||||
template(v-if="tag === 'content_horror'") {{ $t('dialog.avatar.tags.content_horror') }}
|
||||
template(v-else-if="tag === 'content_gore'") {{ $t('dialog.avatar.tags.content_gore') }}
|
||||
template(v-else-if="tag === 'content_violence'") {{ $t('dialog.avatar.tags.content_violence') }}
|
||||
template(v-else-if="tag === 'content_adult'") {{ $t('dialog.avatar.tags.content_adult') }}
|
||||
template(v-else-if="tag === 'content_sex'") {{ $t('dialog.avatar.tags.content_sex') }}
|
||||
template(v-else) {{ tag.replace('content_', '') }}
|
||||
div(style="margin-top:5px")
|
||||
span(v-show="avatarDialog.ref.name !== avatarDialog.ref.description" v-text="avatarDialog.ref.description" style="font-size:12px")
|
||||
div(style="flex:none;margin-left:10px")
|
||||
el-tooltip(v-if="avatarDialog.inCache" placement="top" :content="$t('dialog.avatar.actions.delete_cache_tooltip')" :disabled="hideTooltips")
|
||||
el-button(icon="el-icon-delete" circle @click="deleteVRChatCache(avatarDialog.ref)" :disabled="isGameRunning && avatarDialog.cacheLocked")
|
||||
el-tooltip(v-if="avatarDialog.isFavorite" placement="top" :content="$t('dialog.avatar.actions.favorite_tooltip')" :disabled="hideTooltips")
|
||||
el-button(type="warning" icon="el-icon-star-on" circle @click="avatarDialogCommand('Add Favorite')" style="margin-left:5px")
|
||||
el-tooltip(v-else placement="top" :content="$t('dialog.avatar.actions.favorite_tooltip')" :disabled="hideTooltips")
|
||||
el-button(type="default" icon="el-icon-star-off" circle @click="avatarDialogCommand('Add Favorite')" style="margin-left:5px")
|
||||
el-dropdown(trigger="click" @command="avatarDialogCommand" size="small" style="margin-left:5px")
|
||||
el-button(:type="avatarDialog.isBlocked ? 'danger' : 'default'" icon="el-icon-more" circle)
|
||||
el-dropdown-menu(#default="dropdown")
|
||||
el-dropdown-item(icon="el-icon-refresh" command="Refresh") {{ $t('dialog.avatar.actions.refresh') }}
|
||||
el-dropdown-item(icon="el-icon-check" :disabled="API.currentUser.currentAvatar === avatarDialog.id" command="Select Avatar") {{ $t('dialog.avatar.actions.select') }}
|
||||
el-dropdown-item(v-if="/quest/.test(avatarDialog.ref.tags)" icon="el-icon-check" command="Select Fallback Avatar") {{ $t('dialog.avatar.actions.select_fallback') }}
|
||||
el-dropdown-item(v-if="avatarDialog.isBlocked" icon="el-icon-circle-check" command="Unblock Avatar" style="color:#F56C6C") {{ $t('dialog.avatar.actions.unblock') }}
|
||||
el-dropdown-item(v-else icon="el-icon-circle-close" command="Block Avatar") {{ $t('dialog.avatar.actions.block') }}
|
||||
el-dropdown-item(v-if="avatarDialog.ref.authorId !== API.currentUser.id" icon="el-icon-picture-outline" command="Previous Images") {{ $t('dialog.avatar.actions.show_previous_images') }}
|
||||
template(v-if="avatarDialog.ref.authorId === API.currentUser.id")
|
||||
el-dropdown-item(v-if="avatarDialog.ref.releaseStatus === 'public'" icon="el-icon-user-solid" command="Make Private" divided) {{ $t('dialog.avatar.actions.make_private') }}
|
||||
el-dropdown-item(v-else icon="el-icon-user" command="Make Public" divided) {{ $t('dialog.avatar.actions.make_public') }}
|
||||
el-dropdown-item(icon="el-icon-edit" command="Rename") {{ $t('dialog.avatar.actions.rename') }}
|
||||
el-dropdown-item(icon="el-icon-edit" command="Change Description") {{ $t('dialog.avatar.actions.change_description') }}
|
||||
el-dropdown-item(icon="el-icon-edit" command="Change Content Tags") {{ $t('dialog.avatar.actions.change_content_tags') }}
|
||||
el-dropdown-item(icon="el-icon-picture-outline" command="Change Image") {{ $t('dialog.avatar.actions.change_image') }}
|
||||
el-dropdown-item(v-if="avatarDialog.ref.unityPackageUrl" icon="el-icon-download" command="Download Unity Package") {{ $t('dialog.avatar.actions.download_package') }}
|
||||
el-dropdown-item(v-if="avatarDialog.hasImposter" icon="el-icon-delete" command="Delete Imposter" style="color:#F56C6C") {{ $t('dialog.avatar.actions.delete_impostor') }}
|
||||
el-dropdown-item(v-else icon="el-icon-user" command="Create Imposter") {{ $t('dialog.avatar.actions.create_impostor') }}
|
||||
el-dropdown-item(icon="el-icon-delete" command="Delete" style="color:#F56C6C" divided) {{ $t('dialog.avatar.actions.delete') }}
|
||||
el-tabs
|
||||
el-tab-pane(:label="$t('dialog.avatar.info.header')")
|
||||
.x-friend-list
|
||||
.x-friend-item(style="width:100%;cursor:default")
|
||||
.detail
|
||||
span.name {{ $t('dialog.avatar.info.memo') }}
|
||||
el-input.extra(v-model="avatarDialog.memo" @change="onAvatarMemoChange" size="mini" type="textarea" :rows="2" :autosize="{minRows: 1, maxRows: 20}" :placeholder="$t('dialog.avatar.info.memo_placeholder')" resize="none")
|
||||
.x-friend-item(style="width:100%;cursor:default")
|
||||
.detail
|
||||
span.name {{ $t('dialog.avatar.info.id') }}
|
||||
span.extra {{ avatarDialog.id }}
|
||||
el-tooltip(placement="top" :content="$t('dialog.avatar.info.id_tooltip')" :disabled="hideTooltips")
|
||||
el-dropdown(trigger="click" @click.native.stop size="mini" style="margin-left:5px")
|
||||
el-button(type="default" icon="el-icon-s-order" size="mini" circle)
|
||||
el-dropdown-menu(#default="dropdown")
|
||||
el-dropdown-item(@click.native="copyAvatarId(avatarDialog.id)") {{ $t('dialog.avatar.info.copy_id') }}
|
||||
el-dropdown-item(@click.native="copyAvatarUrl(avatarDialog.id)") {{ $t('dialog.avatar.info.copy_url') }}
|
||||
.x-friend-item(style="cursor:default")
|
||||
.detail
|
||||
span.name {{ $t('dialog.avatar.info.created_at') }}
|
||||
span.extra {{ avatarDialog.ref.created_at | formatDate('long') }}
|
||||
.x-friend-item(style="cursor:default")
|
||||
.detail
|
||||
span.name {{ $t('dialog.avatar.info.last_updated') }}
|
||||
span.extra(v-if="avatarDialog.lastUpdated") {{ avatarDialog.lastUpdated | formatDate('long') }}
|
||||
span.extra(v-else) {{ avatarDialog.ref.updated_at | formatDate('long') }}
|
||||
.x-friend-item(style="cursor:default")
|
||||
.detail
|
||||
span.name {{ $t('dialog.avatar.info.version') }}
|
||||
span.extra(v-if="avatarDialog.ref.version !== 0" v-text="avatarDialog.ref.version")
|
||||
span.extra(v-else) -
|
||||
.x-friend-item(style="width:100%;cursor:default")
|
||||
.detail
|
||||
span.name {{ $t('dialog.avatar.info.platform') }}
|
||||
span.extra(v-if="avatarDialogPlatform" v-text="avatarDialogPlatform")
|
||||
span.extra(v-else) -
|
||||
el-tab-pane(:label="$t('dialog.avatar.json.header')")
|
||||
el-button(type="default" @click="refreshAvatarDialogTreeData()" size="mini" icon="el-icon-refresh" circle)
|
||||
el-tooltip(placement="top" :content="$t('dialog.avatar.json.file_analysis')" :disabled="hideTooltips")
|
||||
el-button(type="default" @click="getAvatarFileAnalysis" size="mini" icon="el-icon-s-data" circle style="margin-left:5px")
|
||||
el-button(type="default" @click="downloadAndSaveJson(avatarDialog.id, avatarDialog.ref)" size="mini" icon="el-icon-download" circle style="margin-left:5px")
|
||||
el-tree(v-if="Object.keys(avatarDialog.fileAnalysis).length > 0" :data="avatarDialog.fileAnalysis" style="margin-top:5px;font-size:12px")
|
||||
template(#default="scope")
|
||||
span
|
||||
span(v-text="scope.data.key" style="font-weight:bold;margin-right:5px")
|
||||
span(v-if="!scope.data.children" v-text="scope.data.value")
|
||||
el-tree(:data="avatarDialog.treeData" style="margin-top:5px;font-size:12px")
|
||||
template(#default="scope")
|
||||
span
|
||||
span(v-text="scope.data.key" style="font-weight:bold;margin-right:5px")
|
||||
span(v-if="!scope.data.children" v-text="scope.data.value")
|
||||
53
html/src/mixins/dialogs/boops.pug
Normal file
53
html/src/mixins/dialogs/boops.pug
Normal file
@@ -0,0 +1,53 @@
|
||||
mixin boops()
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="sendBoopDialog" :visible.sync="sendBoopDialog.visible" :title="$t('dialog.boop_dialog.header')" width="450px")
|
||||
div(v-if="sendBoopDialog.visible")
|
||||
el-select(v-model="sendBoopDialog.userId" :placeholder="$t('dialog.new_instance.instance_creator_placeholder')" filterable style="width:100%")
|
||||
el-option-group(v-if="vipFriends.length" :label="$t('side_panel.favorite')")
|
||||
el-option.x-friend-item(v-for="friend in vipFriends" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto")
|
||||
template(v-if="friend.ref")
|
||||
.avatar(:class="userStatusClass(friend.ref)")
|
||||
img(v-lazy="userImage(friend.ref)")
|
||||
.detail
|
||||
span.name(v-text="friend.ref.displayName" :style="{'color':friend.ref.$userColour}")
|
||||
span(v-else v-text="friend.id")
|
||||
el-option-group(v-if="onlineFriends.length" :label="$t('side_panel.online')")
|
||||
el-option.x-friend-item(v-for="friend in onlineFriends" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto")
|
||||
template(v-if="friend.ref")
|
||||
.avatar(:class="userStatusClass(friend.ref)")
|
||||
img(v-lazy="userImage(friend.ref)")
|
||||
.detail
|
||||
span.name(v-text="friend.ref.displayName" :style="{'color':friend.ref.$userColour}")
|
||||
span(v-else v-text="friend.id")
|
||||
el-option-group(v-if="activeFriends.length" :label="$t('side_panel.active')")
|
||||
el-option.x-friend-item(v-for="friend in activeFriends" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto")
|
||||
template(v-if="friend.ref")
|
||||
.avatar
|
||||
img(v-lazy="userImage(friend.ref)")
|
||||
.detail
|
||||
span.name(v-text="friend.ref.displayName" :style="{'color':friend.ref.$userColour}")
|
||||
span(v-else v-text="friend.id")
|
||||
el-option-group(v-if="offlineFriends.length" :label="$t('side_panel.offline')")
|
||||
el-option.x-friend-item(v-for="friend in offlineFriends" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto")
|
||||
template(v-if="friend.ref")
|
||||
.avatar
|
||||
img(v-lazy="userImage(friend.ref)")
|
||||
.detail
|
||||
span.name(v-text="friend.ref.displayName" :style="{'color':friend.ref.$userColour}")
|
||||
span(v-else v-text="friend.id")
|
||||
br
|
||||
br
|
||||
el-select(v-model="sendBoopDialog.fileId" clearable :placeholder="$t('dialog.boop_dialog.select_emoji')" size="small" style="width:100%" popper-class="max-height-el-select")
|
||||
el-option-group(:label="$t('dialog.boop_dialog.my_emojis')")
|
||||
el-option(v-if="image.versions && image.versions.length > 0" v-for="image in emojiTable" :key="image.id" :value="image.id" style="width:100%;height:100%")
|
||||
.vrcplus-icon(v-if="image.versions[image.versions.length - 1].file.url" style="overflow:hidden;width:200px;height:200px;padding:10px")
|
||||
template(v-if="image.frames")
|
||||
.avatar(:style="generateEmojiStyle(image.versions[image.versions.length - 1].file.url, image.framesOverTime, image.frames, image.loopStyle)")
|
||||
template(v-else)
|
||||
img.avatar(v-lazy="image.versions[image.versions.length - 1].file.url" style="width:200px;height:200px")
|
||||
el-option-group(:label="$t('dialog.boop_dialog.default_emojis')")
|
||||
el-option(v-for="emojiName in photonEmojis" :key="emojiName" :value="getEmojiValue(emojiName)" style="width:100%;height:100%")
|
||||
span(v-text="emojiName")
|
||||
template(#footer)
|
||||
el-button(size="small" @click="showGalleryDialog(2)") {{ $t('dialog.boop_dialog.emoji_manager') }}
|
||||
el-button(size="small" @click="sendBoopDialog.visible = false") {{ $t('dialog.boop_dialog.cancel') }}
|
||||
el-button(size="small" @click="sendBoop" :disabled="!sendBoopDialog.userId") {{ $t('dialog.boop_dialog.send') }}
|
||||
152
html/src/mixins/dialogs/currentUser.pug
Normal file
152
html/src/mixins/dialogs/currentUser.pug
Normal file
@@ -0,0 +1,152 @@
|
||||
mixin currentUser()
|
||||
//- dialog: social status
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="socialStatusDialog" :visible.sync="socialStatusDialog.visible" :title="$t('dialog.social_status.header')" width="400px")
|
||||
div(v-loading="socialStatusDialog.loading")
|
||||
el-collapse(style="border:0")
|
||||
el-collapse-item
|
||||
template(slot="title")
|
||||
span(style="font-size:16px") {{ $t('dialog.social_status.history') }}
|
||||
data-tables(v-bind="socialStatusHistoryTable" @row-click="setSocialStatusFromHistory" style="cursor:pointer")
|
||||
el-table-column(:label="$t('table.social_status.no')" prop="no" width="50")
|
||||
el-table-column(:label="$t('table.social_status.status')" prop="status")
|
||||
el-select(v-model="socialStatusDialog.status" style="display:block;margin-top:10px")
|
||||
el-option(:label="$t('dialog.user.status.join_me')" value="join me").
|
||||
#[i.x-user-status.joinme] {{ $t('dialog.user.status.join_me') }}
|
||||
el-option(:label="$t('dialog.user.status.online')" value="active").
|
||||
#[i.x-user-status.online] {{ $t('dialog.user.status.online') }}
|
||||
el-option(:label="$t('dialog.user.status.ask_me')" value="ask me").
|
||||
#[i.x-user-status.askme] {{ $t('dialog.user.status.ask_me') }}
|
||||
el-option(:label="$t('dialog.user.status.busy')" value="busy").
|
||||
#[i.x-user-status.busy] {{ $t('dialog.user.status.busy') }}
|
||||
el-option(v-if="API.currentUser.$isModerator" :label="$t('dialog.user.status.offline')" value="offline").
|
||||
#[i.x-user-status.offline] {{ $t('dialog.user.status.offline') }}
|
||||
el-input(v-model="socialStatusDialog.statusDescription" :placeholder="$t('dialog.social_status.status_placeholder')" maxlength="32" show-word-limit style="display:block;margin-top:10px")
|
||||
template(#footer)
|
||||
el-button(type="primary" size="small" :disabled="socialStatusDialog.loading" @click="saveSocialStatus") {{ $t('dialog.social_status.update') }}
|
||||
|
||||
//- dialog: language
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="languageDialog" :visible.sync="languageDialog.visible" :title="$t('dialog.language.header')" width="400px")
|
||||
div(v-loading="languageDialog.loading")
|
||||
div(style="margin:5px 0")
|
||||
el-tag(v-for="item in API.currentUser.$languages" :key="item.key" size="small" type="info" effect="plain" closable @close="removeUserLanguage(item.key)" style="margin-right:5px")
|
||||
span.flags(:class="languageClass(item.key)" style="display:inline-block;margin-right:5px")
|
||||
| {{ item.value }} ({{ item.key }})
|
||||
div(v-if="languageDialog.languageChoice === true")
|
||||
el-select(v-model="languageDialog.languageValue" :placeholder="$t('dialog.language.select_language')" size="mini")
|
||||
el-option(v-for="item in languageDialog.languages" :key="item.key" :value="item.key" :label="item.value")
|
||||
span.flags(:class="languageClass(item.key)" style="display:inline-block;margin-right:5px")
|
||||
| {{ item.value }} ({{ item.key }})
|
||||
el-button(@click="languageDialog.languageChoice=false; addUserLanguage(languageDialog.languageValue)" size="mini") {{ $t('dialog.language.ok') }}
|
||||
el-button(@click="languageDialog.languageChoice=false" size="mini" style="margin-left:0") {{ $t('dialog.language.cancel') }}
|
||||
div(v-else)
|
||||
el-button(@click="languageDialog.languageValue='';languageDialog.languageChoice=true" size="mini") {{ $t('dialog.language.add_language') }}
|
||||
|
||||
//- dialog: bio
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="bioDialog" :visible.sync="bioDialog.visible" :title="$t('dialog.bio.header')" width="600px")
|
||||
div(v-loading="bioDialog.loading")
|
||||
el-input(type="textarea" v-model="bioDialog.bio" size="mini" maxlength="512" show-word-limit :autosize="{ minRows:2, maxRows:5 }" :placeholder="$t('dialog.bio.bio_placeholder')")
|
||||
el-input(v-for="(link, index) in bioDialog.bioLinks" :key="index" :value="link" v-model="bioDialog.bioLinks[index]" size="small" style="margin-top:5px")
|
||||
img(slot="prepend" :src="getFaviconUrl(link)" style="width:16px;height:16px")
|
||||
el-button(slot="append" icon="el-icon-delete" @click="bioDialog.bioLinks.splice(index, 1)")
|
||||
el-button(@click="bioDialog.bioLinks.push('')" :disabled="bioDialog.bioLinks.length >= 3" size="mini" style="margin-top:5px") {{ $t('dialog.bio.add_link') }}
|
||||
template(#footer)
|
||||
el-button(type="primary" size="small" :disabled="bioDialog.loading" @click="saveBio") {{ $t('dialog.bio.update') }}
|
||||
|
||||
//- dialog: pronouns
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="pronounsDialog" :visible.sync="pronounsDialog.visible" :title="$t('dialog.pronouns.header')" width="600px")
|
||||
div(v-loading="pronounsDialog.loading")
|
||||
el-input(type="textarea" v-model="pronounsDialog.pronouns" size="mini" maxlength="32" show-word-limit :autosize="{ minRows:2, maxRows:5 }" :placeholder="$t('dialog.pronouns.pronouns_placeholder')")
|
||||
template(#footer)
|
||||
el-button(type="primary" size="small" :disabled="pronounsDialog.loading" @click="savePronouns") {{ $t('dialog.pronouns.update') }}
|
||||
|
||||
//- dialog: Gallery/VRCPlusIcons
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="galleryDialog" :visible.sync="galleryDialogVisible" :title="$t('dialog.gallery_icons.header')" width="100%")
|
||||
span(style="padding-bottom:10px") {{ $t('dialog.gallery_icons.description') }}
|
||||
br
|
||||
br
|
||||
el-tabs(type="card" ref="galleryTabs")
|
||||
el-tab-pane(v-if="galleryDialogVisible" v-loading="galleryDialogGalleryLoading")
|
||||
span(slot="label") {{ $t('dialog.gallery_icons.gallery') }}
|
||||
span(style="color:#909399;font-size:12px;margin-left:5px") {{ galleryTable.length }}/64
|
||||
input(type="file" accept="image/png,image/jpg,image/jpeg,image/webp,image/bmp,image/gif" @change="onFileChangeGallery" id="GalleryUploadButton" style="display:none")
|
||||
el-button-group
|
||||
el-button(type="default" size="small" @click="refreshGalleryTable" icon="el-icon-refresh") {{ $t('dialog.gallery_icons.refresh') }}
|
||||
el-button(type="default" size="small" @click="displayGalleryUpload" icon="el-icon-upload2" :disabled="!API.currentUser.$isVRCPlus") {{ $t('dialog.gallery_icons.upload') }}
|
||||
el-button(type="default" size="small" @click="setProfilePicOverride('')" icon="el-icon-close" :disabled="!API.currentUser.profilePicOverride") {{ $t('dialog.gallery_icons.clear') }}
|
||||
br
|
||||
.x-friend-item(v-if="image.versions && image.versions.length > 0" v-for="image in galleryTable" :key="image.id" style="display:inline-block;margin-top:10px;width:unset;cursor:default")
|
||||
.vrcplus-icon(v-if="image.versions[image.versions.length - 1].file.url" @click="setProfilePicOverride(image.id)" :class="{ 'current-vrcplus-icon': compareCurrentProfilePic(image.id) }")
|
||||
img.avatar(v-lazy="image.versions[image.versions.length - 1].file.url")
|
||||
div(style="float:right;margin-top:5px")
|
||||
el-button(type="default" @click="showFullscreenImageDialog(image.versions[image.versions.length - 1].file.url)" size="mini" icon="el-icon-download" circle)
|
||||
el-button(type="default" @click="deleteGalleryImage(image.id)" size="mini" icon="el-icon-delete" circle style="margin-left:5px")
|
||||
el-tab-pane(v-if="galleryDialogVisible" v-loading="galleryDialogIconsLoading")
|
||||
span(slot="label") {{ $t('dialog.gallery_icons.icons') }}
|
||||
span(style="color:#909399;font-size:12px;margin-left:5px") {{ VRCPlusIconsTable.length }}/64
|
||||
input(type="file" accept="image/png,image/jpg,image/jpeg,image/webp,image/bmp,image/gif" @change="onFileChangeVRCPlusIcon" id="VRCPlusIconUploadButton" style="display:none")
|
||||
el-button-group
|
||||
el-button(type="default" size="small" @click="refreshVRCPlusIconsTable" icon="el-icon-refresh") {{ $t('dialog.gallery_icons.refresh') }}
|
||||
el-button(type="default" size="small" @click="displayVRCPlusIconUpload" icon="el-icon-upload2" :disabled="!API.currentUser.$isVRCPlus") {{ $t('dialog.gallery_icons.upload') }}
|
||||
el-button(type="default" size="small" @click="setVRCPlusIcon('')" icon="el-icon-close" :disabled="!API.currentUser.userIcon") {{ $t('dialog.gallery_icons.clear') }}
|
||||
br
|
||||
.x-friend-item(v-if="image.versions && image.versions.length > 0" v-for="image in VRCPlusIconsTable" :key="image.id" style="display:inline-block;margin-top:10px;width:unset;cursor:default")
|
||||
.vrcplus-icon(v-if="image.versions[image.versions.length - 1].file.url" @click="setVRCPlusIcon(image.id)" :class="{ 'current-vrcplus-icon': compareCurrentVRCPlusIcon(image.id) }")
|
||||
img.avatar(v-lazy="image.versions[image.versions.length - 1].file.url")
|
||||
div(style="float:right;margin-top:5px")
|
||||
el-button(type="default" @click="showFullscreenImageDialog(image.versions[image.versions.length - 1].file.url)" size="mini" icon="el-icon-download" circle)
|
||||
el-button(type="default" @click="deleteVRCPlusIcon(image.id)" size="mini" icon="el-icon-delete" circle style="margin-left:5px")
|
||||
el-tab-pane(v-if="galleryDialogVisible" v-loading="galleryDialogEmojisLoading")
|
||||
span(slot="label") {{ $t('dialog.gallery_icons.emojis') }}
|
||||
span(style="color:#909399;font-size:12px;margin-left:5px") {{ emojiTable.length }}/9
|
||||
input(type="file" accept="image/png,image/jpg,image/jpeg,image/webp,image/bmp,image/gif" @change="onFileChangeEmoji" id="EmojiUploadButton" style="display:none")
|
||||
el-button-group(style="margin-right:10px")
|
||||
el-button(type="default" size="small" @click="refreshEmojiTable" icon="el-icon-refresh") {{ $t('dialog.gallery_icons.refresh') }}
|
||||
el-button(type="default" size="small" @click="displayEmojiUpload" icon="el-icon-upload2" :disabled="!API.currentUser.$isVRCPlus") {{ $t('dialog.gallery_icons.upload') }}
|
||||
el-select(v-model="emojiAnimationStyle" popper-class="max-height-el-select")
|
||||
el-option-group {{ $t('dialog.gallery_icons.emoji_animation_styles') }}
|
||||
el-option.x-friend-item(v-for="(fileName, styleName) in emojiAnimationStyleList" :key="fileName" :label="styleName" :value="styleName" style="height:auto")
|
||||
.avatar(style="width:200px;height:200px")
|
||||
img(v-lazy="`${emojiAnimationStyleUrl}${fileName}`")
|
||||
.detail
|
||||
span.name(v-text="styleName" style="margin-right:100px")
|
||||
el-checkbox(v-model="emojiAnimType" style="margin-left:10px;margin-right:10px")
|
||||
span {{ $t('dialog.gallery_icons.emoji_animation_type') }}
|
||||
template(v-if="emojiAnimType")
|
||||
span(style="margin-right:10px") {{ $t('dialog.gallery_icons.emoji_animation_fps') }}
|
||||
el-input-number(size="small" v-model="emojiAnimFps" :min="1" :max="64" style="margin-right:10px;width:112px")
|
||||
span(style="margin-right:10px") {{ $t('dialog.gallery_icons.emoji_animation_frame_count') }}
|
||||
el-input-number(size="small" v-model="emojiAnimFrameCount" :min="2" :max="64" style="margin-right:10px;width:112px")
|
||||
el-checkbox(v-model="emojiAnimLoopPingPong" style="margin-left:10px;margin-right:10px")
|
||||
span {{ $t('dialog.gallery_icons.emoji_loop_pingpong') }}
|
||||
br
|
||||
span {{ $t('dialog.gallery_icons.flipbook_info') }}
|
||||
br
|
||||
.x-friend-item(v-if="image.versions && image.versions.length > 0" v-for="image in emojiTable" :key="image.id" style="display:inline-block;margin-top:10px;width:unset;cursor:default")
|
||||
.vrcplus-icon(v-if="image.versions[image.versions.length - 1].file.url" style="overflow:hidden" @click="showFullscreenImageDialog(image.versions[image.versions.length - 1].file.url)")
|
||||
template(v-if="image.frames")
|
||||
.avatar(:style="generateEmojiStyle(image.versions[image.versions.length - 1].file.url, image.framesOverTime, image.frames, image.loopStyle)")
|
||||
template(v-else)
|
||||
img.avatar(v-lazy="image.versions[image.versions.length - 1].file.url")
|
||||
div(style="display:inline-block;margin:5px")
|
||||
span(v-if="image.loopStyle === 'pingpong'") #[i.el-icon-refresh.el-icon--left]
|
||||
span(style="margin-right:5px") {{ image.animationStyle }}
|
||||
span(v-if="image.framesOverTime" style="margin-right:5px") {{ image.framesOverTime }}fps
|
||||
span(v-if="image.frames" style="margin-right:5px") {{ image.frames }}frames
|
||||
br
|
||||
div(style="float:right;margin-top:5px")
|
||||
el-button(type="default" @click="showFullscreenImageDialog(image.versions[image.versions.length - 1].file.url)" size="mini" icon="el-icon-download" circle)
|
||||
el-button(type="default" @click="deleteEmoji(image.id)" size="mini" icon="el-icon-delete" circle style="margin-left:5px")
|
||||
el-tab-pane(v-if="galleryDialogVisible" v-loading="galleryDialogStickersLoading")
|
||||
span(slot="label") {{ $t('dialog.gallery_icons.stickers') }}
|
||||
span(style="color:#909399;font-size:12px;margin-left:5px") {{ stickerTable.length }}/9
|
||||
input(type="file" accept="image/png,image/jpg,image/jpeg,image/webp,image/bmp,image/gif" @change="onFileChangeSticker" id="StickerUploadButton" style="display:none")
|
||||
el-button-group
|
||||
el-button(type="default" size="small" @click="refreshStickerTable" icon="el-icon-refresh") {{ $t('dialog.gallery_icons.refresh') }}
|
||||
el-button(type="default" size="small" @click="displayStickerUpload" icon="el-icon-upload2" :disabled="!API.currentUser.$isVRCPlus") {{ $t('dialog.gallery_icons.upload') }}
|
||||
br
|
||||
.x-friend-item(v-if="image.versions && image.versions.length > 0" v-for="image in stickerTable" :key="image.id" style="display:inline-block;margin-top:10px;width:unset;cursor:default")
|
||||
.vrcplus-icon(v-if="image.versions[image.versions.length - 1].file.url" style="overflow:hidden" @click="showFullscreenImageDialog(image.versions[image.versions.length - 1].file.url)")
|
||||
img.avatar(v-lazy="image.versions[image.versions.length - 1].file.url")
|
||||
div(style="float:right;margin-top:5px")
|
||||
el-button(type="default" @click="showFullscreenImageDialog(image.versions[image.versions.length - 1].file.url)" size="mini" icon="el-icon-download" circle)
|
||||
el-button(type="default" @click="deleteSticker(image.id)" size="mini" icon="el-icon-delete" circle style="margin-left:5px")
|
||||
230
html/src/mixins/dialogs/favorites.pug
Normal file
230
html/src/mixins/dialogs/favorites.pug
Normal file
@@ -0,0 +1,230 @@
|
||||
mixin favorites()
|
||||
//- dialog: favorite
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="favoriteDialog" :visible.sync="favoriteDialog.visible" :title="$t('dialog.favorite.header')" width="300px")
|
||||
div(v-if="favoriteDialog.visible" v-loading="favoriteDialog.loading")
|
||||
span(style="display:block;text-align:center") {{ $t('dialog.favorite.vrchat_favorites') }}
|
||||
template(v-if="favoriteDialog.currentGroup && favoriteDialog.currentGroup.key")
|
||||
el-button(style="display:block;width:100%;margin:10px 0" @click="deleteFavoriteNoConfirm(favoriteDialog.objectId)") #[i.el-icon-check] {{ favoriteDialog.currentGroup.displayName }} ({{ favoriteDialog.currentGroup.count }} / {{ favoriteDialog.currentGroup.capacity }})
|
||||
template(v-else)
|
||||
el-button(v-for="group in favoriteDialog.groups" :key="group" style="display:block;width:100%;margin:10px 0" @click="addFavorite(group)") {{ group.displayName }} ({{ group.count }} / {{ group.capacity }})
|
||||
div(v-if="favoriteDialog.visible && favoriteDialog.type === 'world'" style="margin-top:20px")
|
||||
span(style="display:block;text-align:center") {{ $t('dialog.favorite.local_favorites') }}
|
||||
template(v-for="group in localWorldFavoriteGroups" :key="group")
|
||||
el-button(v-if="hasLocalWorldFavorite(favoriteDialog.objectId, group)" style="display:block;width:100%;margin:10px 0" @click="removeLocalWorldFavorite(favoriteDialog.objectId, group)") #[i.el-icon-check] {{ group }} ({{ getLocalWorldFavoriteGroupLength(group) }})
|
||||
el-button(v-else style="display:block;width:100%;margin:10px 0" @click="addLocalWorldFavorite(favoriteDialog.objectId, group)") {{ group }} ({{ getLocalWorldFavoriteGroupLength(group) }})
|
||||
div(v-if="favoriteDialog.visible && favoriteDialog.type === 'avatar'" style="margin-top:20px")
|
||||
span(style="display:block;text-align:center") {{ $t('dialog.favorite.local_avatar_favorites') }}
|
||||
template(v-for="group in localAvatarFavoriteGroups" :key="group")
|
||||
el-button(v-if="hasLocalAvatarFavorite(favoriteDialog.objectId, group)" style="display:block;width:100%;margin:10px 0" @click="removeLocalAvatarFavorite(favoriteDialog.objectId, group)") #[i.el-icon-check] {{ group }} ({{ getLocalAvatarFavoriteGroupLength(group) }})
|
||||
el-button(v-else style="display:block;width:100%;margin:10px 0" :disabled="!isLocalUserVrcplusSupporter()" @click="addLocalAvatarFavorite(favoriteDialog.objectId, group)") {{ group }} ({{ getLocalAvatarFavoriteGroupLength(group) }})
|
||||
|
||||
//- dialog: export friends list
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" :visible.sync="exportFriendsListDialog" :title="$t('dialog.export_friends_list.header')" width="650px")
|
||||
el-tabs(type="card")
|
||||
el-tab-pane(:label="$t('dialog.export_friends_list.csv')")
|
||||
el-input(type="textarea" v-if="exportFriendsListDialog" v-model="exportFriendsListCsv" size="mini" rows="15" resize="none" readonly style="margin-top:15px" @click.native="$event.target.tagName === 'TEXTAREA' && $event.target.select()")
|
||||
el-tab-pane(:label="$t('dialog.export_friends_list.json')")
|
||||
el-input(type="textarea" v-if="exportFriendsListDialog" v-model="exportFriendsListJson" size="mini" rows="15" resize="none" readonly style="margin-top:15px" @click.native="$event.target.tagName === 'TEXTAREA' && $event.target.select()")
|
||||
|
||||
//- dialog: export avatars list
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" :visible.sync="exportAvatarsListDialog" :title="$t('dialog.export_own_avatars.header')" width="650px")
|
||||
el-input(type="textarea" v-if="exportAvatarsListDialog" v-model="exportAvatarsListCsv" size="mini" rows="15" resize="none" readonly style="margin-top:15px" @click.native="$event.target.tagName === 'TEXTAREA' && $event.target.select()")
|
||||
|
||||
//- dialog: export world list
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="worldExportDialogRef" :visible.sync="worldExportDialogVisible" :title="$t('dialog.world_export.header')" width="650px")
|
||||
el-dropdown(@click.native.stop trigger="click" size="small")
|
||||
el-button(size="mini")
|
||||
span(v-if="worldExportFavoriteGroup") {{ worldExportFavoriteGroup.displayName }} ({{ worldExportFavoriteGroup.count }}/{{ worldExportFavoriteGroup.capacity }}) #[i.el-icon-arrow-down.el-icon--right]
|
||||
span(v-else) All Favorites #[i.el-icon-arrow-down.el-icon--right]
|
||||
el-dropdown-menu(#default="dropdown")
|
||||
el-dropdown-item(style="display:block;margin:10px 0" @click.native="selectWorldExportGroup(null)") None
|
||||
template(v-for="groupAPI in API.favoriteWorldGroups" :key="groupAPI.name")
|
||||
el-dropdown-item(style="display:block;margin:10px 0" @click.native="selectWorldExportGroup(groupAPI)") {{ groupAPI.displayName }} ({{ groupAPI.count }}/{{ groupAPI.capacity }})
|
||||
el-dropdown(@click.native.stop trigger="click" size="small" style="margin-left:10px")
|
||||
el-button(size="mini")
|
||||
span(v-if="worldExportLocalFavoriteGroup") {{ worldExportLocalFavoriteGroup }} ({{ getLocalWorldFavoriteGroupLength(worldExportLocalFavoriteGroup) }}) #[i.el-icon-arrow-down.el-icon--right]
|
||||
span(v-else) Select Group #[i.el-icon-arrow-down.el-icon--right]
|
||||
el-dropdown-menu(#default="dropdown")
|
||||
el-dropdown-item(style="display:block;margin:10px 0" @click.native="selectWorldExportLocalGroup(null)") None
|
||||
template(v-for="group in localWorldFavoriteGroups" :key="group")
|
||||
el-dropdown-item(style="display:block;margin:10px 0" @click.native="selectWorldExportLocalGroup(group)") {{ group }} ({{ localWorldFavorites[group].length }})
|
||||
br
|
||||
el-input(type="textarea" v-if="worldExportDialogVisible" v-model="worldExportContent" size="mini" rows="15" resize="none" readonly style="margin-top:15px" @click.native="$event.target.tagName === 'TEXTAREA' && $event.target.select()")
|
||||
|
||||
//- dialog: World import dialog
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="worldImportDialog" :visible.sync="worldImportDialog.visible" :title="$t('dialog.world_import.header')" width="650px")
|
||||
div(style="font-size:12px")
|
||||
| {{ $t('dialog.world_import.description') }}
|
||||
el-input(type="textarea" v-model="worldImportDialog.input" size="mini" rows="10" resize="none" style="margin-top:15px")
|
||||
el-button(size="small" @click="processWorldImportList" :disabled="!worldImportDialog.input") {{ $t('dialog.world_import.process_list') }}
|
||||
span(v-if="worldImportDialog.progress" style="margin-top:10px") #[i.el-icon-loading(style="margin-right:5px")] {{ $t('dialog.world_import.process_progress') }} {{ worldImportDialog.progress }}/{{ worldImportDialog.progressTotal }}
|
||||
br
|
||||
el-dropdown(@click.native.stop trigger="click" size="small" style="margin-right:5px")
|
||||
el-button(size="mini")
|
||||
span(v-if="worldImportDialog.worldImportFavoriteGroup") {{ worldImportDialog.worldImportFavoriteGroup.displayName }} ({{ worldImportDialog.worldImportFavoriteGroup.count }}/{{ worldImportDialog.worldImportFavoriteGroup.capacity }}) #[i.el-icon-arrow-down.el-icon--right]
|
||||
span(v-else) {{ $t('dialog.world_import.select_vrchat_group_placeholder') }} #[i.el-icon-arrow-down.el-icon--right]
|
||||
el-dropdown-menu(#default="dropdown")
|
||||
template(v-for="groupAPI in API.favoriteWorldGroups" :key="groupAPI.name")
|
||||
el-dropdown-item(style="display:block;margin:10px 0" @click.native="selectWorldImportGroup(groupAPI)" :disabled="groupAPI.count >= groupAPI.capacity") {{ groupAPI.displayName }} ({{ groupAPI.count }}/{{ groupAPI.capacity }})
|
||||
el-dropdown(@click.native.stop trigger="click" size="small" style="margin:5px")
|
||||
el-button(size="mini")
|
||||
span(v-if="worldImportDialog.worldImportLocalFavoriteGroup") {{ worldImportDialog.worldImportLocalFavoriteGroup }} ({{ getLocalWorldFavoriteGroupLength(worldImportDialog.worldImportLocalFavoriteGroup) }}) #[i.el-icon-arrow-down.el-icon--right]
|
||||
span(v-else) {{ $t('dialog.world_import.select_local_group_placeholder') }} #[i.el-icon-arrow-down.el-icon--right]
|
||||
el-dropdown-menu(#default="dropdown")
|
||||
template(v-for="group in localWorldFavoriteGroups" :key="group")
|
||||
el-dropdown-item(style="display:block;margin:10px 0" @click.native="selectWorldImportLocalGroup(group)" ) {{ group }} ({{ getLocalWorldFavoriteGroupLength(group) }})
|
||||
el-button(size="small" @click="importWorldImportTable" style="margin:5px" :disabled="worldImportTable.data.length === 0 || (!worldImportDialog.worldImportFavoriteGroup && !worldImportDialog.worldImportLocalFavoriteGroup)") {{ $t('dialog.world_import.import') }}
|
||||
el-button(v-if="worldImportDialog.loading" size="small" @click="cancelWorldImport" style="margin-top:10px") {{ $t('dialog.world_import.cancel') }}
|
||||
span(v-if="worldImportDialog.worldImportFavoriteGroup") {{ worldImportTable.data.length }} / {{ worldImportDialog.worldImportFavoriteGroup.capacity - worldImportDialog.worldImportFavoriteGroup.count }}
|
||||
span(v-if="worldImportDialog.importProgress" style="margin:10px") #[i.el-icon-loading(style="margin-right:5px")] {{ $t('dialog.world_import.import_progress') }} {{ worldImportDialog.importProgress }}/{{ worldImportDialog.importProgressTotal }}
|
||||
br
|
||||
el-button(size="small" @click="clearWorldImportTable") {{ $t('dialog.world_import.clear_table') }}
|
||||
template(v-if="worldImportDialog.errors")
|
||||
el-button(size="small" @click="worldImportDialog.errors = ''" style="margin-left:5px") {{ $t('dialog.world_import.clear_errors') }}
|
||||
h2(style="font-weight:bold;margin:0") {{ $t('dialog.world_import.errors') }}
|
||||
pre(v-text="worldImportDialog.errors" style="white-space:pre-wrap;font-size:12px")
|
||||
data-tables(v-if="worldImportDialog.visible" v-bind="worldImportTable" v-loading="worldImportDialog.loading" style="margin-top:10px")
|
||||
el-table-column(:label="$t('table.import.image')" width="70" prop="thumbnailImageUrl")
|
||||
template(v-once #default="scope")
|
||||
el-popover(placement="right" height="500px" trigger="hover")
|
||||
img.friends-list-avatar(slot="reference" v-lazy="scope.row.thumbnailImageUrl")
|
||||
img.friends-list-avatar(v-lazy="scope.row.imageUrl" style="height:500px;cursor:pointer" @click="showFullscreenImageDialog(scope.row.imageUrl)")
|
||||
el-table-column(:label="$t('table.import.name')" prop="name")
|
||||
template(v-once #default="scope")
|
||||
span.x-link(v-text="scope.row.name" @click="showWorldDialog(scope.row.id)")
|
||||
el-table-column(:label="$t('table.import.author')" width="120" prop="authorName")
|
||||
template(v-once #default="scope")
|
||||
span.x-link(v-text="scope.row.authorName" @click="showUserDialog(scope.row.authorId)")
|
||||
el-table-column(:label="$t('table.import.status')" width="70" prop="releaseStatus")
|
||||
template(v-once #default="scope")
|
||||
span(v-text="scope.row.releaseStatus" v-if="scope.row.releaseStatus === 'public'" style="color:#67c23a")
|
||||
span(v-text="scope.row.releaseStatus" v-else-if="scope.row.releaseStatus === 'private'" style="color:#f56c6c")
|
||||
span(v-text="scope.row.releaseStatus" v-else)
|
||||
el-table-column(:label="$t('table.import.action')" width="90" align="right")
|
||||
template(v-once #default="scope")
|
||||
el-button(type="text" icon="el-icon-close" size="mini" @click="deleteItemWorldImport(scope.row)")
|
||||
|
||||
//- dialog: export avatar list
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="avatarExportDialogRef" :visible.sync="avatarExportDialogVisible" :title="$t('dialog.avatar_export.header')" width="650px")
|
||||
el-dropdown(@click.native.stop trigger="click" size="small")
|
||||
el-button(size="mini")
|
||||
span(v-if="avatarExportFavoriteGroup") {{ avatarExportFavoriteGroup.displayName }} ({{ avatarExportFavoriteGroup.count }}/{{ avatarExportFavoriteGroup.capacity }}) #[i.el-icon-arrow-down.el-icon--right]
|
||||
span(v-else) All Favorites #[i.el-icon-arrow-down.el-icon--right]
|
||||
el-dropdown-menu(#default="dropdown")
|
||||
el-dropdown-item(style="display:block;margin:10px 0" @click.native="selectAvatarExportGroup(null)") All Favorites
|
||||
template(v-for="groupAPI in API.favoriteAvatarGroups" :key="groupAPI.name")
|
||||
el-dropdown-item(style="display:block;margin:10px 0" @click.native="selectAvatarExportGroup(groupAPI)") {{ groupAPI.displayName }} ({{ groupAPI.count }}/{{ groupAPI.capacity }})
|
||||
el-dropdown(@click.native.stop trigger="click" size="small" style="margin-left:10px")
|
||||
el-button(size="mini")
|
||||
span(v-if="avatarExportLocalFavoriteGroup") {{ avatarExportLocalFavoriteGroup }} ({{ getLocalAvatarFavoriteGroupLength(avatarExportLocalFavoriteGroup) }}) #[i.el-icon-arrow-down.el-icon--right]
|
||||
span(v-else) Select Group #[i.el-icon-arrow-down.el-icon--right]
|
||||
el-dropdown-menu(#default="dropdown")
|
||||
el-dropdown-item(style="display:block;margin:10px 0" @click.native="selectAvatarExportLocalGroup(null)") None
|
||||
template(v-for="group in localAvatarFavoriteGroups" :key="group")
|
||||
el-dropdown-item(style="display:block;margin:10px 0" @click.native="selectAvatarExportLocalGroup(group)" ) {{ group }} ({{ getLocalAvatarFavoriteGroupLength(group) }})
|
||||
br
|
||||
el-input(type="textarea" v-if="avatarExportDialogVisible" v-model="avatarExportContent" size="mini" rows="15" resize="none" readonly style="margin-top:15px" @click.native="$event.target.tagName === 'TEXTAREA' && $event.target.select()")
|
||||
|
||||
//- dialog: Avatar import dialog
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="avatarImportDialog" :visible.sync="avatarImportDialog.visible" :title="$t('dialog.avatar_import.header')" width="650px")
|
||||
div(style="font-size:12px")
|
||||
| {{ $t('dialog.avatar_import.description') }}
|
||||
el-input(type="textarea" v-model="avatarImportDialog.input" size="mini" rows="10" resize="none" style="margin-top:15px")
|
||||
el-button(size="small" @click="processAvatarImportList" :disabled="!avatarImportDialog.input") {{ $t('dialog.avatar_import.process_list') }}
|
||||
span(v-if="avatarImportDialog.progress" style="margin-top:10px") #[i.el-icon-loading(style="margin-right:5px")] {{ $t('dialog.avatar_import.process_progress') }} {{ avatarImportDialog.progress }}/{{ avatarImportDialog.progressTotal }}
|
||||
br
|
||||
el-dropdown(@click.native.stop trigger="click" size="small")
|
||||
el-button(size="mini")
|
||||
span(v-if="avatarImportDialog.avatarImportFavoriteGroup") {{ avatarImportDialog.avatarImportFavoriteGroup.displayName }} ({{ avatarImportDialog.avatarImportFavoriteGroup.count }}/{{ avatarImportDialog.avatarImportFavoriteGroup.capacity }}) #[i.el-icon-arrow-down.el-icon--right]
|
||||
span(v-else) {{ $t('dialog.avatar_import.select_group_placeholder') }} #[i.el-icon-arrow-down.el-icon--right]
|
||||
el-dropdown-menu(#default="dropdown")
|
||||
template(v-for="groupAPI in API.favoriteAvatarGroups" :key="groupAPI.name")
|
||||
el-dropdown-item(style="display:block;margin:10px 0" @click.native="selectAvatarImportGroup(groupAPI)" :disabled="groupAPI.count >= groupAPI.capacity") {{ groupAPI.displayName }} ({{ groupAPI.count }}/{{ groupAPI.capacity }})
|
||||
el-dropdown(@click.native.stop trigger="click" size="small" style="margin:5px")
|
||||
el-button(size="mini")
|
||||
span(v-if="avatarImportDialog.avatarImportLocalFavoriteGroup") {{ avatarImportDialog.avatarImportLocalFavoriteGroup }} ({{ getLocalAvatarFavoriteGroupLength(avatarImportDialog.avatarImportLocalFavoriteGroup) }}) #[i.el-icon-arrow-down.el-icon--right]
|
||||
span(v-else) {{ $t('dialog.avatar_import.select_group_placeholder') }} #[i.el-icon-arrow-down.el-icon--right]
|
||||
el-dropdown-menu(#default="dropdown")
|
||||
template(v-for="group in localAvatarFavoriteGroups" :key="group")
|
||||
el-dropdown-item(style="display:block;margin:10px 0" @click.native="selectAvatarImportLocalGroup(group)" ) {{ group }} ({{ getLocalAvatarFavoriteGroupLength(group) }})
|
||||
el-button(size="small" @click="importAvatarImportTable" style="margin:5px" :disabled="avatarImportTable.data.length === 0 || (!avatarImportDialog.avatarImportFavoriteGroup && !avatarImportDialog.avatarImportLocalFavoriteGroup)") {{ $t('dialog.avatar_import.import') }}
|
||||
el-button(v-if="avatarImportDialog.loading" size="small" @click="cancelAvatarImport" style="margin-top:10px") {{ $t('dialog.avatar_import.cancel') }}
|
||||
span(v-if="avatarImportDialog.avatarImportFavoriteGroup") {{ avatarImportTable.data.length }} / {{ avatarImportDialog.avatarImportFavoriteGroup.capacity - avatarImportDialog.avatarImportFavoriteGroup.count }}
|
||||
span(v-if="avatarImportDialog.importProgress" style="margin:10px") #[i.el-icon-loading(style="margin-right:5px")] {{ $t('dialog.avatar_import.import_progress') }} {{ avatarImportDialog.importProgress }}/{{ avatarImportDialog.importProgressTotal }}
|
||||
br
|
||||
el-button(size="small" @click="clearAvatarImportTable") {{ $t('dialog.avatar_import.clear_table') }}
|
||||
template(v-if="avatarImportDialog.errors")
|
||||
el-button(size="small" @click="avatarImportDialog.errors = ''" style="margin-left:5px") {{ $t('dialog.avatar_import.clear_errors') }}
|
||||
h2(style="font-weight:bold;margin:0") {{ $t('dialog.avatar_import.errors') }}
|
||||
pre(v-text="avatarImportDialog.errors" style="white-space:pre-wrap;font-size:12px")
|
||||
data-tables(v-if="avatarImportDialog.visible" v-bind="avatarImportTable" v-loading="avatarImportDialog.loading" style="margin-top:10px")
|
||||
el-table-column(:label="$t('table.import.image')" width="70" prop="thumbnailImageUrl")
|
||||
template(v-once #default="scope")
|
||||
el-popover(placement="right" height="500px" trigger="hover")
|
||||
img.friends-list-avatar(slot="reference" v-lazy="scope.row.thumbnailImageUrl")
|
||||
img.friends-list-avatar(v-lazy="scope.row.imageUrl" style="height:500px;cursor:pointer" @click="showFullscreenImageDialog(scope.row.imageUrl)")
|
||||
el-table-column(:label="$t('table.import.name')" prop="name")
|
||||
template(v-once #default="scope")
|
||||
span.x-link(v-text="scope.row.name" @click="showAvatarDialog(scope.row.id)")
|
||||
el-table-column(:label="$t('table.import.author')" width="120" prop="authorName")
|
||||
template(v-once #default="scope")
|
||||
span.x-link(v-text="scope.row.authorName" @click="showUserDialog(scope.row.authorId)")
|
||||
el-table-column(:label="$t('table.import.status')" width="70" prop="releaseStatus")
|
||||
template(v-once #default="scope")
|
||||
span(v-text="scope.row.releaseStatus" v-if="scope.row.releaseStatus === 'public'" style="color:#67c23a")
|
||||
span(v-text="scope.row.releaseStatus" v-else-if="scope.row.releaseStatus === 'private'" style="color:#f56c6c")
|
||||
span(v-text="scope.row.releaseStatus" v-else)
|
||||
el-table-column(:label="$t('table.import.action')" width="90" align="right")
|
||||
template(v-once #default="scope")
|
||||
el-button(type="text" icon="el-icon-close" size="mini" @click="deleteItemAvatarImport(scope.row)")
|
||||
|
||||
//- dialog: export friend list
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="friendExportDialogRef" :visible.sync="friendExportDialogVisible" :title="$t('dialog.friend_export.header')" width="650px")
|
||||
el-dropdown(@click.native.stop trigger="click" size="small")
|
||||
el-button(size="mini")
|
||||
span(v-if="friendExportFavoriteGroup") {{ friendExportFavoriteGroup.displayName }} ({{ friendExportFavoriteGroup.count }}/{{ friendExportFavoriteGroup.capacity }}) #[i.el-icon-arrow-down.el-icon--right]
|
||||
span(v-else) All Favorites #[i.el-icon-arrow-down.el-icon--right]
|
||||
el-dropdown-menu(#default="dropdown")
|
||||
el-dropdown-item(style="display:block;margin:10px 0" @click.native="selectFriendExportGroup(null)") All Favorites
|
||||
template(v-for="groupAPI in API.favoriteFriendGroups" :key="groupAPI.name")
|
||||
el-dropdown-item(style="display:block;margin:10px 0" @click.native="selectFriendExportGroup(groupAPI)") {{ groupAPI.displayName }} ({{ groupAPI.count }}/{{ groupAPI.capacity }})
|
||||
br
|
||||
el-input(type="textarea" v-if="friendExportDialogVisible" v-model="friendExportContent" size="mini" rows="15" resize="none" readonly style="margin-top:15px" @click.native="$event.target.tagName === 'TEXTAREA' && $event.target.select()")
|
||||
|
||||
//- dialog: Friend import dialog
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="friendImportDialog" :visible.sync="friendImportDialog.visible" :title="$t('dialog.friend_import.header')" width="650px")
|
||||
div(style="font-size:12px")
|
||||
| {{ $t('dialog.friend_import.description') }}
|
||||
el-input(type="textarea" v-model="friendImportDialog.input" size="mini" rows="10" resize="none" style="margin-top:15px")
|
||||
el-button(size="small" @click="processFriendImportList" :disabled="!friendImportDialog.input") {{ $t('dialog.friend_import.process_list') }}
|
||||
span(v-if="friendImportDialog.progress" style="margin-top:10px") #[i.el-icon-loading(style="margin-right:5px")] {{ $t('dialog.friend_import.process_progress') }} {{ friendImportDialog.progress }}/{{ friendImportDialog.progressTotal }}
|
||||
br
|
||||
el-dropdown(@click.native.stop trigger="click" size="small")
|
||||
el-button(size="mini")
|
||||
span(v-if="friendImportDialog.friendImportFavoriteGroup") {{ friendImportDialog.friendImportFavoriteGroup.displayName }} ({{ friendImportDialog.friendImportFavoriteGroup.count }}/{{ friendImportDialog.friendImportFavoriteGroup.capacity }}) #[i.el-icon-arrow-down.el-icon--right]
|
||||
span(v-else) {{ $t('dialog.friend_import.select_group_placeholder') }} #[i.el-icon-arrow-down.el-icon--right]
|
||||
el-dropdown-menu(#default="dropdown")
|
||||
template(v-for="groupAPI in API.favoriteFriendGroups" :key="groupAPI.name")
|
||||
el-dropdown-item(style="display:block;margin:10px 0" @click.native="selectFriendImportGroup(groupAPI)" :disabled="groupAPI.count >= groupAPI.capacity") {{ groupAPI.displayName }} ({{ groupAPI.count }}/{{ groupAPI.capacity }})
|
||||
el-button(size="small" @click="importFriendImportTable" style="margin:5px" :disabled="friendImportTable.data.length === 0 || !friendImportDialog.friendImportFavoriteGroup") {{ $t('dialog.friend_import.import') }}
|
||||
el-button(v-if="friendImportDialog.loading" size="small" @click="cancelFriendImport" style="margin-top:10px") {{ $t('dialog.friend_import.cancel') }}
|
||||
span(v-if="friendImportDialog.friendImportFavoriteGroup") {{ friendImportTable.data.length }} / {{ friendImportDialog.friendImportFavoriteGroup.capacity - friendImportDialog.friendImportFavoriteGroup.count }}
|
||||
span(v-if="friendImportDialog.importProgress" style="margin:10px") #[i.el-icon-loading(style="margin-right:5px")] {{ $t('dialog.friend_import.import_progress') }} {{ friendImportDialog.importProgress }}/{{ friendImportDialog.importProgressTotal }}
|
||||
br
|
||||
el-button(size="small" @click="clearFriendImportTable") {{ $t('dialog.friend_import.clear_table') }}
|
||||
template(v-if="friendImportDialog.errors")
|
||||
el-button(size="small" @click="friendImportDialog.errors = ''" style="margin-left:5px") {{ $t('dialog.friend_import.clear_errors') }}
|
||||
h2(style="font-weight:bold;margin:0") {{ $t('dialog.friend_import.errors') }}
|
||||
pre(v-text="friendImportDialog.errors" style="white-space:pre-wrap;font-size:12px")
|
||||
data-tables(v-if="friendImportDialog.visible" v-bind="friendImportTable" v-loading="friendImportDialog.loading" style="margin-top:10px")
|
||||
el-table-column(:label="$t('table.import.image')" width="70" prop="currentAvatarThumbnailImageUrl")
|
||||
template(v-once #default="scope")
|
||||
el-popover(placement="right" height="500px" trigger="hover")
|
||||
img.friends-list-avatar(slot="reference" v-lazy="userImage(scope.row)")
|
||||
img.friends-list-avatar(v-lazy="userImageFull(scope.row)" style="height:500px;cursor:pointer" @click="showFullscreenImageDialog(userImageFull(scope.row))")
|
||||
el-table-column(:label="$t('table.import.name')" prop="displayName")
|
||||
template(v-once #default="scope")
|
||||
span.x-link(v-text="scope.row.displayName" @click="showUserDialog(scope.row.id)")
|
||||
el-table-column(:label="$t('table.import.action')" width="90" align="right")
|
||||
template(v-once #default="scope")
|
||||
el-button(type="text" icon="el-icon-close" size="mini" @click="deleteItemFriendImport(scope.row)")
|
||||
503
html/src/mixins/dialogs/feedFilters.pug
Normal file
503
html/src/mixins/dialogs/feedFilters.pug
Normal file
@@ -0,0 +1,503 @@
|
||||
mixin feedFilters()
|
||||
//- dialog: Noty feed filters
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="notyFeedFiltersDialog" :visible.sync="notyFeedFiltersDialog.visible" :title="$t('dialog.shared_feed_filters.notification')" width="550px")
|
||||
.toggle-list
|
||||
.toggle-item
|
||||
span.toggle-name OnPlayerJoining
|
||||
el-radio-group(v-model="sharedFeedFilters.noty.OnPlayerJoining" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
|
||||
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
|
||||
.toggle-item
|
||||
span.toggle-name OnPlayerJoined
|
||||
el-radio-group(v-model="sharedFeedFilters.noty.OnPlayerJoined" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
|
||||
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
|
||||
el-radio-button(label="Everyone") {{ $t('dialog.shared_feed_filters.everyone') }}
|
||||
.toggle-item
|
||||
span.toggle-name OnPlayerLeft
|
||||
el-radio-group(v-model="sharedFeedFilters.noty.OnPlayerLeft" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
|
||||
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
|
||||
el-radio-button(label="Everyone") {{ $t('dialog.shared_feed_filters.everyone') }}
|
||||
.toggle-item
|
||||
span.toggle-name Online
|
||||
el-radio-group(v-model="sharedFeedFilters.noty.Online" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
|
||||
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
|
||||
.toggle-item
|
||||
span.toggle-name Offline
|
||||
el-radio-group(v-model="sharedFeedFilters.noty.Offline" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
|
||||
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
|
||||
.toggle-item
|
||||
span.toggle-name GPS
|
||||
el-radio-group(v-model="sharedFeedFilters.noty.GPS" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
|
||||
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
|
||||
.toggle-item
|
||||
span.toggle-name Status
|
||||
el-radio-group(v-model="sharedFeedFilters.noty.Status" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
|
||||
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
|
||||
.toggle-item
|
||||
span.toggle-name Invite
|
||||
el-radio-group(v-model="sharedFeedFilters.noty.invite" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
|
||||
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
|
||||
.toggle-item
|
||||
span.toggle-name Request Invite
|
||||
el-radio-group(v-model="sharedFeedFilters.noty.requestInvite" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
|
||||
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
|
||||
.toggle-item
|
||||
span.toggle-name Invite Response
|
||||
el-radio-group(v-model="sharedFeedFilters.noty.inviteResponse" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
|
||||
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
|
||||
.toggle-item
|
||||
span.toggle-name Request Invite Response
|
||||
el-radio-group(v-model="sharedFeedFilters.noty.requestInviteResponse" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
|
||||
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
|
||||
.toggle-item
|
||||
span.toggle-name Friend Request
|
||||
el-radio-group(v-model="sharedFeedFilters.noty.friendRequest" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="On") {{ $t('dialog.shared_feed_filters.on') }}
|
||||
.toggle-item
|
||||
span.toggle-name New Friend
|
||||
el-radio-group(v-model="sharedFeedFilters.noty.Friend" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="On") {{ $t('dialog.shared_feed_filters.on') }}
|
||||
.toggle-item
|
||||
span.toggle-name Unfriend
|
||||
el-radio-group(v-model="sharedFeedFilters.noty.Unfriend" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="On") {{ $t('dialog.shared_feed_filters.on') }}
|
||||
.toggle-item
|
||||
span.toggle-name Display Name Change
|
||||
el-radio-group(v-model="sharedFeedFilters.noty.DisplayName" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
|
||||
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
|
||||
.toggle-item
|
||||
span.toggle-name Trust Level Change
|
||||
el-radio-group(v-model="sharedFeedFilters.noty.TrustLevel" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
|
||||
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
|
||||
//- .toggle-item
|
||||
//- span.toggle-name Boop
|
||||
//- el-radio-group(v-model="sharedFeedFilters.noty.boop" size="mini" @change="saveSharedFeedFilters")
|
||||
//- el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
//- el-radio-button(label="On") {{ $t('dialog.shared_feed_filters.on') }}
|
||||
.toggle-item
|
||||
span.toggle-name Group Change
|
||||
el-tooltip(placement="top" style="margin-left:5px" content="When you've left or been kicked from a group, group name changed, group owner changed, role added/removed")
|
||||
i.el-icon-info
|
||||
el-radio-group(v-model="sharedFeedFilters.noty.groupChange" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="On") {{ $t('dialog.shared_feed_filters.on') }}
|
||||
.toggle-item
|
||||
span.toggle-name Group Announcement
|
||||
el-radio-group(v-model="sharedFeedFilters.noty['group.announcement']" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="On") {{ $t('dialog.shared_feed_filters.on') }}
|
||||
.toggle-item
|
||||
span.toggle-name Group Join
|
||||
el-tooltip(placement="top" style="margin-left:5px" content="When your request to join a group has been approved")
|
||||
i.el-icon-info
|
||||
el-radio-group(v-model="sharedFeedFilters.noty['group.informative']" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="On") {{ $t('dialog.shared_feed_filters.on') }}
|
||||
.toggle-item
|
||||
span.toggle-name Group Invite
|
||||
el-tooltip(placement="top" style="margin-left:5px" content="When someone invites you to join a group")
|
||||
i.el-icon-info
|
||||
el-radio-group(v-model="sharedFeedFilters.noty['group.invite']" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="On") {{ $t('dialog.shared_feed_filters.on') }}
|
||||
.toggle-item
|
||||
span.toggle-name Group Join Request
|
||||
el-tooltip(placement="top" style="margin-left:5px" content="When someone requests to join a group you're a moderator for")
|
||||
i.el-icon-info
|
||||
el-radio-group(v-model="sharedFeedFilters.noty['group.joinRequest']" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="On") {{ $t('dialog.shared_feed_filters.on') }}
|
||||
.toggle-item
|
||||
span.toggle-name Group Transfer Request
|
||||
el-radio-group(v-model="sharedFeedFilters.noty['group.transfer']" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="On") {{ $t('dialog.shared_feed_filters.on') }}
|
||||
.toggle-item
|
||||
span.toggle-name Instance Queue Ready
|
||||
el-radio-group(v-model="sharedFeedFilters.noty['group.queueReady']" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="On") {{ $t('dialog.shared_feed_filters.on') }}
|
||||
.toggle-item
|
||||
span.toggle-name Instance Closed
|
||||
el-tooltip(placement="top" style="margin-left:5px" content="When the instance you're in has been closed preventing anyone from joining")
|
||||
i.el-icon-info
|
||||
el-radio-group(v-model="sharedFeedFilters.noty['instance.closed']" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="On") {{ $t('dialog.shared_feed_filters.on') }}
|
||||
.toggle-item
|
||||
span.toggle-name Video Play
|
||||
el-tooltip(placement="top" style="margin-left:5px" content="Requires VRCX YouTube API option enabled")
|
||||
i.el-icon-warning
|
||||
el-radio-group(v-model="sharedFeedFilters.noty.VideoPlay" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="On") {{ $t('dialog.shared_feed_filters.on') }}
|
||||
.toggle-item
|
||||
span.toggle-name Miscellaneous Events
|
||||
el-tooltip(placement="top" style="margin-left:5px" content="Misc event from VRC game log: VRC crash auto rejoin, shader keyword limit, joining instance blocked by master, error loading video, audio device changed, error joining instance, kicked from instance, VRChat failing to start OSC server, etc...")
|
||||
i.el-icon-info
|
||||
el-radio-group(v-model="sharedFeedFilters.noty.Event" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="On") {{ $t('dialog.shared_feed_filters.on') }}
|
||||
.toggle-item
|
||||
span.toggle-name External App
|
||||
el-radio-group(v-model="sharedFeedFilters.noty.External" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="On") {{ $t('dialog.shared_feed_filters.on') }}
|
||||
.toggle-item
|
||||
span.toggle-name Blocked Player Joins
|
||||
el-radio-group(v-model="sharedFeedFilters.noty.BlockedOnPlayerJoined" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
|
||||
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
|
||||
el-radio-button(label="Everyone") {{ $t('dialog.shared_feed_filters.everyone') }}
|
||||
.toggle-item
|
||||
span.toggle-name Blocked Player Leaves
|
||||
el-radio-group(v-model="sharedFeedFilters.noty.BlockedOnPlayerLeft" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
|
||||
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
|
||||
el-radio-button(label="Everyone") {{ $t('dialog.shared_feed_filters.everyone') }}
|
||||
.toggle-item
|
||||
span.toggle-name Muted Player Joins
|
||||
el-radio-group(v-model="sharedFeedFilters.noty.MutedOnPlayerJoined" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
|
||||
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
|
||||
el-radio-button(label="Everyone") {{ $t('dialog.shared_feed_filters.everyone') }}
|
||||
.toggle-item
|
||||
span.toggle-name Muted Player Leaves
|
||||
el-radio-group(v-model="sharedFeedFilters.noty.MutedOnPlayerLeft" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
|
||||
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
|
||||
el-radio-button(label="Everyone") {{ $t('dialog.shared_feed_filters.everyone') }}
|
||||
.toggle-item
|
||||
span.toggle-name Lobby Avatar Change
|
||||
el-radio-group(v-model="sharedFeedFilters.noty.AvatarChange" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
|
||||
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
|
||||
el-radio-button(label="Everyone") {{ $t('dialog.shared_feed_filters.everyone') }}
|
||||
template(v-if="photonLoggingEnabled")
|
||||
br
|
||||
.toggle-item
|
||||
span.toggle-name Photon Event Logging
|
||||
.toggle-item
|
||||
span.toggle-name Portal Spawn
|
||||
el-radio-group(v-model="sharedFeedFilters.noty.PortalSpawn" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
|
||||
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
|
||||
el-radio-button(label="Everyone") {{ $t('dialog.shared_feed_filters.everyone') }}
|
||||
.toggle-item
|
||||
span.toggle-name Lobby ChatBox Message
|
||||
el-radio-group(v-model="sharedFeedFilters.noty.ChatBoxMessage" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
|
||||
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
|
||||
el-radio-button(label="Everyone") {{ $t('dialog.shared_feed_filters.everyone') }}
|
||||
.toggle-item
|
||||
span.toggle-name Blocked
|
||||
el-radio-group(v-model="sharedFeedFilters.noty.Blocked" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="On") {{ $t('dialog.shared_feed_filters.on') }}
|
||||
.toggle-item
|
||||
span.toggle-name Unblocked
|
||||
el-radio-group(v-model="sharedFeedFilters.noty.Unblocked" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="On") {{ $t('dialog.shared_feed_filters.on') }}
|
||||
.toggle-item
|
||||
span.toggle-name Muted
|
||||
el-radio-group(v-model="sharedFeedFilters.noty.Muted" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="On") {{ $t('dialog.shared_feed_filters.on') }}
|
||||
.toggle-item
|
||||
span.toggle-name Unmuted
|
||||
el-radio-group(v-model="sharedFeedFilters.noty.Unmuted" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="On") {{ $t('dialog.shared_feed_filters.on') }}
|
||||
template(#footer)
|
||||
el-button(type="small" @click="resetSharedFeedFilters") {{ $t('dialog.shared_feed_filters.reset') }}
|
||||
el-button(size="small" style="margin-left:10px" @click="notyFeedFiltersDialog.visible = false") {{ $t('dialog.shared_feed_filters.close') }}
|
||||
|
||||
//- dialog: wrist feed filters
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="wristFeedFiltersDialog" :visible.sync="wristFeedFiltersDialog.visible" :title="$t('dialog.shared_feed_filters.wrist')" width="550px")
|
||||
.toggle-list
|
||||
.toggle-item
|
||||
span.toggle-name Self Location
|
||||
el-radio-group(v-model="sharedFeedFilters.wrist.Location" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="On") {{ $t('dialog.shared_feed_filters.on') }}
|
||||
.toggle-item
|
||||
span.toggle-name OnPlayerJoining
|
||||
el-radio-group(v-model="sharedFeedFilters.wrist.OnPlayerJoining" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
|
||||
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
|
||||
.toggle-item
|
||||
span.toggle-name OnPlayerJoined
|
||||
el-radio-group(v-model="sharedFeedFilters.wrist.OnPlayerJoined" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
|
||||
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
|
||||
el-radio-button(label="Everyone") {{ $t('dialog.shared_feed_filters.everyone') }}
|
||||
.toggle-item
|
||||
span.toggle-name OnPlayerLeft
|
||||
el-radio-group(v-model="sharedFeedFilters.wrist.OnPlayerLeft" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
|
||||
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
|
||||
el-radio-button(label="Everyone") {{ $t('dialog.shared_feed_filters.everyone') }}
|
||||
.toggle-item
|
||||
span.toggle-name Online
|
||||
el-radio-group(v-model="sharedFeedFilters.wrist.Online" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
|
||||
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
|
||||
.toggle-item
|
||||
span.toggle-name Offline
|
||||
el-radio-group(v-model="sharedFeedFilters.wrist.Offline" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
|
||||
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
|
||||
.toggle-item
|
||||
span.toggle-name GPS
|
||||
el-radio-group(v-model="sharedFeedFilters.wrist.GPS" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
|
||||
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
|
||||
.toggle-item
|
||||
span.toggle-name Status
|
||||
el-radio-group(v-model="sharedFeedFilters.wrist.Status" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
|
||||
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
|
||||
.toggle-item
|
||||
span.toggle-name Invite
|
||||
el-radio-group(v-model="sharedFeedFilters.wrist.invite" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
|
||||
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
|
||||
.toggle-item
|
||||
span.toggle-name Request Invite
|
||||
el-radio-group(v-model="sharedFeedFilters.wrist.requestInvite" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
|
||||
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
|
||||
.toggle-item
|
||||
span.toggle-name Invite Response
|
||||
el-radio-group(v-model="sharedFeedFilters.wrist.inviteResponse" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
|
||||
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
|
||||
.toggle-item
|
||||
span.toggle-name Request Invite Response
|
||||
el-radio-group(v-model="sharedFeedFilters.wrist.requestInviteResponse" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
|
||||
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
|
||||
.toggle-item
|
||||
span.toggle-name Friend Request
|
||||
el-radio-group(v-model="sharedFeedFilters.wrist.friendRequest" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="On") {{ $t('dialog.shared_feed_filters.on') }}
|
||||
.toggle-item
|
||||
span.toggle-name New Friend
|
||||
el-radio-group(v-model="sharedFeedFilters.wrist.Friend" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="On") {{ $t('dialog.shared_feed_filters.on') }}
|
||||
.toggle-item
|
||||
span.toggle-name Unfriend
|
||||
el-radio-group(v-model="sharedFeedFilters.wrist.Unfriend" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="On") {{ $t('dialog.shared_feed_filters.on') }}
|
||||
.toggle-item
|
||||
span.toggle-name Display Name Change
|
||||
el-radio-group(v-model="sharedFeedFilters.wrist.DisplayName" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
|
||||
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
|
||||
.toggle-item
|
||||
span.toggle-name Trust Level Change
|
||||
el-radio-group(v-model="sharedFeedFilters.wrist.TrustLevel" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
|
||||
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
|
||||
//- .toggle-item
|
||||
//- span.toggle-name Boop
|
||||
//- el-radio-group(v-model="sharedFeedFilters.wrist.boop" size="mini" @change="saveSharedFeedFilters")
|
||||
//- el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
//- el-radio-button(label="On") {{ $t('dialog.shared_feed_filters.on') }}
|
||||
.toggle-item
|
||||
span.toggle-name Group Change
|
||||
el-tooltip(placement="top" style="margin-left:5px" content="When you've left or been kicked from a group, group name changed, group owner changed, role added/removed")
|
||||
i.el-icon-info
|
||||
el-radio-group(v-model="sharedFeedFilters.wrist.groupChange" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="On") {{ $t('dialog.shared_feed_filters.on') }}
|
||||
.toggle-item
|
||||
span.toggle-name Group Announcement
|
||||
el-radio-group(v-model="sharedFeedFilters.wrist['group.announcement']" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="On") {{ $t('dialog.shared_feed_filters.on') }}
|
||||
.toggle-item
|
||||
span.toggle-name Group Join
|
||||
el-tooltip(placement="top" style="margin-left:5px" content="When your request to join a group has been approved")
|
||||
i.el-icon-info
|
||||
el-radio-group(v-model="sharedFeedFilters.wrist['group.informative']" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="On") {{ $t('dialog.shared_feed_filters.on') }}
|
||||
.toggle-item
|
||||
span.toggle-name Group Invite
|
||||
el-tooltip(placement="top" style="margin-left:5px" content="When someone invites you to join a group")
|
||||
i.el-icon-info
|
||||
el-radio-group(v-model="sharedFeedFilters.wrist['group.invite']" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="On") {{ $t('dialog.shared_feed_filters.on') }}
|
||||
.toggle-item
|
||||
span.toggle-name Group Join Request
|
||||
el-tooltip(placement="top" style="margin-left:5px" content="When someone requests to join a group you're a moderator for")
|
||||
i.el-icon-info
|
||||
el-radio-group(v-model="sharedFeedFilters.wrist['group.joinRequest']" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="On") {{ $t('dialog.shared_feed_filters.on') }}
|
||||
.toggle-item
|
||||
span.toggle-name Group Transfer Request
|
||||
el-radio-group(v-model="sharedFeedFilters.wrist['group.transfer']" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="On") {{ $t('dialog.shared_feed_filters.on') }}
|
||||
.toggle-item
|
||||
span.toggle-name Instance Queue Ready
|
||||
el-radio-group(v-model="sharedFeedFilters.wrist['group.queueReady']" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="On") {{ $t('dialog.shared_feed_filters.on') }}
|
||||
.toggle-item
|
||||
span.toggle-name Instance Closed
|
||||
el-tooltip(placement="top" style="margin-left:5px" content="When the instance you're in has been closed preventing anyone from joining")
|
||||
i.el-icon-info
|
||||
el-radio-group(v-model="sharedFeedFilters.wrist['instance.closed']" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="On") {{ $t('dialog.shared_feed_filters.on') }}
|
||||
.toggle-item
|
||||
span.toggle-name Video Play
|
||||
el-tooltip(placement="top" style="margin-left:5px" content="Requires VRCX YouTube API option enabled")
|
||||
i.el-icon-warning
|
||||
el-radio-group(v-model="sharedFeedFilters.wrist.VideoPlay" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="On") {{ $t('dialog.shared_feed_filters.on') }}
|
||||
.toggle-item
|
||||
span.toggle-name Miscellaneous Events
|
||||
el-tooltip(placement="top" style="margin-left:5px" content="Misc event from VRC game log: VRC crash auto rejoin, shader keyword limit, joining instance blocked by master, error loading video, audio device changed, error joining instance, kicked from instance, VRChat failing to start OSC server, etc...")
|
||||
i.el-icon-info
|
||||
el-radio-group(v-model="sharedFeedFilters.wrist.Event" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="On") {{ $t('dialog.shared_feed_filters.on') }}
|
||||
.toggle-item
|
||||
span.toggle-name External App
|
||||
el-radio-group(v-model="sharedFeedFilters.wrist.External" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="On") {{ $t('dialog.shared_feed_filters.on') }}
|
||||
.toggle-item
|
||||
span.toggle-name Blocked Player Joins
|
||||
el-radio-group(v-model="sharedFeedFilters.wrist.BlockedOnPlayerJoined" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
|
||||
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
|
||||
el-radio-button(label="Everyone") {{ $t('dialog.shared_feed_filters.everyone') }}
|
||||
.toggle-item
|
||||
span.toggle-name Blocked Player Leaves
|
||||
el-radio-group(v-model="sharedFeedFilters.wrist.BlockedOnPlayerLeft" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
|
||||
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
|
||||
el-radio-button(label="Everyone") {{ $t('dialog.shared_feed_filters.everyone') }}
|
||||
.toggle-item
|
||||
span.toggle-name Muted Player Joins
|
||||
el-radio-group(v-model="sharedFeedFilters.wrist.MutedOnPlayerJoined" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
|
||||
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
|
||||
el-radio-button(label="Everyone") {{ $t('dialog.shared_feed_filters.everyone') }}
|
||||
.toggle-item
|
||||
span.toggle-name Muted Player Leaves
|
||||
el-radio-group(v-model="sharedFeedFilters.wrist.MutedOnPlayerLeft" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
|
||||
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
|
||||
el-radio-button(label="Everyone") {{ $t('dialog.shared_feed_filters.everyone') }}
|
||||
.toggle-item
|
||||
span.toggle-name Lobby Avatar Change
|
||||
el-radio-group(v-model="sharedFeedFilters.wrist.AvatarChange" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
|
||||
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
|
||||
el-radio-button(label="Everyone") {{ $t('dialog.shared_feed_filters.everyone') }}
|
||||
template(v-if="photonLoggingEnabled")
|
||||
br
|
||||
.toggle-item
|
||||
span.toggle-name Photon Event Logging
|
||||
.toggle-item
|
||||
span.toggle-name Portal Spawn
|
||||
el-radio-group(v-model="sharedFeedFilters.wrist.PortalSpawn" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
|
||||
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
|
||||
el-radio-button(label="Everyone") {{ $t('dialog.shared_feed_filters.everyone') }}
|
||||
.toggle-item
|
||||
span.toggle-name Lobby ChatBox Message
|
||||
el-radio-group(v-model="sharedFeedFilters.wrist.ChatBoxMessage" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }}
|
||||
el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }}
|
||||
el-radio-button(label="Everyone") {{ $t('dialog.shared_feed_filters.everyone') }}
|
||||
.toggle-item
|
||||
span.toggle-name Blocked
|
||||
el-radio-group(v-model="sharedFeedFilters.wrist.Blocked" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="On") {{ $t('dialog.shared_feed_filters.on') }}
|
||||
.toggle-item
|
||||
span.toggle-name Unblocked
|
||||
el-radio-group(v-model="sharedFeedFilters.wrist.Unblocked" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="On") {{ $t('dialog.shared_feed_filters.on') }}
|
||||
.toggle-item
|
||||
span.toggle-name Muted
|
||||
el-radio-group(v-model="sharedFeedFilters.wrist.Muted" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="On") {{ $t('dialog.shared_feed_filters.on') }}
|
||||
.toggle-item
|
||||
span.toggle-name Unmuted
|
||||
el-radio-group(v-model="sharedFeedFilters.wrist.Unmuted" size="mini" @change="saveSharedFeedFilters")
|
||||
el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }}
|
||||
el-radio-button(label="On") {{ $t('dialog.shared_feed_filters.on') }}
|
||||
template(#footer)
|
||||
el-button(type="small" @click="resetSharedFeedFilters") {{ $t('dialog.shared_feed_filters.reset') }}
|
||||
el-button(size="small" @click="wristFeedFiltersDialog.visible = false") {{ $t('dialog.shared_feed_filters.close') }}
|
||||
347
html/src/mixins/dialogs/groupDialog.pug
Normal file
347
html/src/mixins/dialogs/groupDialog.pug
Normal file
@@ -0,0 +1,347 @@
|
||||
|
||||
mixin groupDialog()
|
||||
el-dialog.x-dialog.x-group-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="groupDialog" :visible.sync="groupDialog.visible" :show-close="false" width="770px")
|
||||
.group-banner-image
|
||||
el-popover(placement="right" width="500px" trigger="click")
|
||||
img.x-link(slot="reference" v-lazy="groupDialog.ref.bannerUrl" style="flex:none;width:100%;aspect-ratio:6/1;object-fit:cover;border-radius:4px")
|
||||
img.x-link(v-lazy="groupDialog.ref.bannerUrl" style="width:854px;height:480px" @click="showFullscreenImageDialog(groupDialog.ref.bannerUrl)")
|
||||
.group-body(v-loading="groupDialog.loading")
|
||||
div(style="display:flex")
|
||||
el-popover(placement="right" width="500px" trigger="click")
|
||||
img.x-link(slot="reference" v-lazy="groupDialog.ref.iconUrl" style="flex:none;width:120px;height:120px;border-radius:12px")
|
||||
img.x-link(v-lazy="groupDialog.ref.iconUrl" style="width:500px;height:500px" @click="showFullscreenImageDialog(groupDialog.ref.iconUrl)")
|
||||
div(style="flex:1;display:flex;align-items:center;margin-left:15px")
|
||||
.group-header(style="flex:1")
|
||||
span(v-if="groupDialog.ref.ownerId === API.currentUser.id" style="margin-right:5px") 👑
|
||||
span.dialog-title(v-text="groupDialog.ref.name" style="margin-right:5px")
|
||||
span.group-discriminator.x-grey(style="font-family:monospace;font-size:12px;margin-right:5px") {{ groupDialog.ref.shortCode }}.{{ groupDialog.ref.discriminator }}
|
||||
el-tooltip(v-for="item in groupDialog.ref.$languages" :key="item.key" placement="top")
|
||||
template(#content)
|
||||
span {{ item.value }} ({{ item.key }})
|
||||
span.flags(:class="languageClass(item.key)" style="display:inline-block;margin-right:5px")
|
||||
div(style="margin-top:5px")
|
||||
span.x-link.x-grey(v-text="groupDialog.ownerDisplayName" @click="showUserDialog(groupDialog.ref.ownerId)" style="font-family:monospace")
|
||||
.group-tags
|
||||
el-tag(v-if="groupDialog.ref.isVerified" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") {{ $t('dialog.group.tags.verified') }}
|
||||
|
||||
el-tag(v-if="groupDialog.ref.privacy === 'private'" type="danger" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") {{ $t('dialog.group.tags.private') }}
|
||||
el-tag(v-if="groupDialog.ref.privacy === 'default'" type="success" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") {{ $t('dialog.group.tags.public') }}
|
||||
|
||||
el-tag(v-if="groupDialog.ref.joinState === 'open'" type="success" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") {{ $t('dialog.group.tags.open') }}
|
||||
el-tag(v-else-if="groupDialog.ref.joinState === 'request'" type="warning" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") {{ $t('dialog.group.tags.request') }}
|
||||
el-tag(v-else-if="groupDialog.ref.joinState === 'invite'" type="danger" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") {{ $t('dialog.group.tags.invite') }}
|
||||
el-tag(v-else-if="groupDialog.ref.joinState === 'closed'" type="danger" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") {{ $t('dialog.group.tags.closed') }}
|
||||
|
||||
el-tag(v-if="groupDialog.inGroup" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") {{ $t('dialog.group.tags.joined') }}
|
||||
el-tag(v-if="groupDialog.ref.myMember && groupDialog.ref.myMember.bannedAt" type="danger" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") {{ $t('dialog.group.tags.banned') }}
|
||||
|
||||
template(v-if="groupDialog.inGroup && groupDialog.ref.myMember")
|
||||
el-tag(v-if="groupDialog.ref.myMember.visibility === 'visible'" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") {{ $t('dialog.group.tags.visible') }}
|
||||
el-tag(v-else-if="groupDialog.ref.myMember.visibility === 'friends'" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") {{ $t('dialog.group.tags.friends') }}
|
||||
el-tag(v-else-if="groupDialog.ref.myMember.visibility === 'hidden'" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") {{ $t('dialog.group.tags.hidden') }}
|
||||
el-tag(v-if="groupDialog.ref.myMember.isSubscribedToAnnouncements" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") {{ $t('dialog.group.tags.subscribed') }}
|
||||
|
||||
.group-description(style="margin-top:5px")
|
||||
span(v-show="groupDialog.ref.name !== groupDialog.ref.description" v-text="groupDialog.ref.description" style="font-size:12px")
|
||||
div(style="flex:none;margin-left:10px")
|
||||
template(v-if="groupDialog.inGroup && groupDialog.ref?.myMember")
|
||||
el-tooltip(v-if="groupDialog.ref.myMember?.isRepresenting" placement="top" :content="$t('dialog.group.actions.unrepresent_tooltip')" :disabled="hideTooltips")
|
||||
el-button(type="warning" icon="el-icon-star-on" circle @click="clearGroupRepresentation(groupDialog.id)" style="margin-left:5px")
|
||||
el-tooltip(v-else placement="top" :content="$t('dialog.group.actions.represent_tooltip')" :disabled="hideTooltips")
|
||||
span
|
||||
el-button(type="default" icon="el-icon-star-off" circle @click="setGroupRepresentation(groupDialog.id)" style="margin-left:5px" :disabled="groupDialog.ref.privacy === 'private'")
|
||||
template(v-else-if="groupDialog.ref.myMember?.membershipStatus === 'requested'")
|
||||
el-tooltip(placement="top" :content="$t('dialog.group.actions.cancel_join_request_tooltip')" :disabled="hideTooltips")
|
||||
span
|
||||
el-button(type="default" icon="el-icon-close" circle @click="cancelGroupRequest(groupDialog.id)" style="margin-left:5px")
|
||||
template(v-else-if="groupDialog.ref.myMember?.membershipStatus === 'invited'")
|
||||
el-tooltip(placement="top" :content="$t('dialog.group.actions.pending_request_tooltip')" :disabled="hideTooltips")
|
||||
span
|
||||
el-button(type="default" icon="el-icon-check" circle @click="joinGroup(groupDialog.id)" style="margin-left:5px")
|
||||
template(v-else)
|
||||
el-tooltip(v-if="groupDialog.ref.joinState === 'request'" placement="top" :content="$t('dialog.group.actions.request_join_tooltip')" :disabled="hideTooltips")
|
||||
el-button(type="default" icon="el-icon-message" circle @click="joinGroup(groupDialog.id)" style="margin-left:5px")
|
||||
el-tooltip(v-if="groupDialog.ref.joinState === 'invite'" placement="top" :content="$t('dialog.group.actions.invite_required_tooltip')" :disabled="hideTooltips")
|
||||
span
|
||||
el-button(type="default" icon="el-icon-message" disabled circle style="margin-left:5px")
|
||||
el-tooltip(v-if="groupDialog.ref.joinState === 'open'" placement="top" :content="$t('dialog.group.actions.join_group_tooltip')" :disabled="hideTooltips")
|
||||
el-button(type="default" icon="el-icon-check" circle @click="joinGroup(groupDialog.id)" style="margin-left:5px")
|
||||
el-dropdown(trigger="click" @command="groupDialogCommand" size="small" style="margin-left:5px")
|
||||
el-button(:type="groupDialog.ref.membershipStatus === 'userblocked' ? 'danger' : 'default'" icon="el-icon-more" circle)
|
||||
el-dropdown-menu(#default="dropdown")
|
||||
el-dropdown-item(icon="el-icon-refresh" command="Refresh") {{ $t('dialog.group.actions.refresh') }}
|
||||
template(v-if="groupDialog.inGroup")
|
||||
template(v-if="groupDialog.ref.myMember")
|
||||
el-dropdown-item(v-if="groupDialog.ref.myMember.isSubscribedToAnnouncements" icon="el-icon-close" command="Unsubscribe To Announcements" divided) {{ $t('dialog.group.actions.unsubscribe') }}
|
||||
el-dropdown-item(v-else icon="el-icon-check" command="Subscribe To Announcements" divided) {{ $t('dialog.group.actions.subscribe') }}
|
||||
el-dropdown-item(v-if="hasGroupPermission(groupDialog.ref, 'group-invites-manage')" icon="el-icon-message" command="Invite To Group") {{ $t('dialog.group.actions.invite_to_group') }}
|
||||
template(v-if="hasGroupPermission(groupDialog.ref, 'group-announcement-manage')")
|
||||
el-dropdown-item(icon="el-icon-tickets" command="Create Post") {{ $t('dialog.group.actions.create_post') }}
|
||||
//- template(v-if="hasGroupPermission(groupDialog.ref, 'group-members-manage')")
|
||||
el-dropdown-item(icon="el-icon-s-operation" command="Moderation Tools") {{ $t('dialog.group.actions.moderation_tools') }}
|
||||
template(v-if="groupDialog.ref.myMember && groupDialog.ref.privacy === 'default'")
|
||||
el-dropdown-item(icon="el-icon-view" command="Visibility Everyone" divided) #[i.el-icon-check(v-if="groupDialog.ref.myMember.visibility === 'visible'")] {{ $t('dialog.group.actions.visibility_everyone') }}
|
||||
el-dropdown-item(icon="el-icon-view" command="Visibility Friends") #[i.el-icon-check(v-if="groupDialog.ref.myMember.visibility === 'friends'")] {{ $t('dialog.group.actions.visibility_friends') }}
|
||||
el-dropdown-item(icon="el-icon-view" command="Visibility Hidden") #[i.el-icon-check(v-if="groupDialog.ref.myMember.visibility === 'hidden'")] {{ $t('dialog.group.actions.visibility_hidden') }}
|
||||
el-dropdown-item(icon="el-icon-delete" command="Leave Group" style="color:#F56C6C" divided) {{ $t('dialog.group.actions.leave') }}
|
||||
template(v-else)
|
||||
el-dropdown-item(v-if="groupDialog.ref.membershipStatus === 'userblocked'" icon="el-icon-circle-check" command="Unblock Group" style="color:#F56C6C" divided) {{ $t('dialog.group.actions.unblock') }}
|
||||
el-dropdown-item(v-else icon="el-icon-circle-close" command="Block Group" divided) {{ $t('dialog.group.actions.block') }}
|
||||
el-tabs(ref="groupDialogTabs" @tab-click="groupDialogTabClick")
|
||||
el-tab-pane(:label="$t('dialog.group.info.header')")
|
||||
.group-banner-image-info
|
||||
el-popover(placement="right" width="500px" trigger="click")
|
||||
img.x-link(slot="reference" v-lazy="groupDialog.ref.bannerUrl" style="flex:none;width:100%;aspect-ratio:6/1;object-fit:cover;border-radius:4px")
|
||||
img.x-link(v-lazy="groupDialog.ref.bannerUrl" style="width:854px;height:480px" @click="showFullscreenImageDialog(groupDialog.ref.bannerUrl)")
|
||||
.x-friend-list(style="max-height:none")
|
||||
span(v-if="groupDialog.instances.length" style="font-size:12px;font-weight:bold;margin:5px") {{ $t('dialog.group.info.instances') }}
|
||||
div(v-for="room in groupDialog.instances" :key="room.tag" style="width:100%")
|
||||
div(style="margin:5px 0")
|
||||
location(:location="room.tag")
|
||||
el-tooltip(placement="top" content="Invite yourself" :disabled="hideTooltips")
|
||||
invite-yourself(:location="room.tag" style="margin-left:5px")
|
||||
el-tooltip(placement="top" content="Refresh player count" :disabled="hideTooltips")
|
||||
el-button(@click="refreshInstancePlayerCount(room.tag)" size="mini" icon="el-icon-refresh" style="margin-left:5px" circle)
|
||||
last-join(:location="room.tag" :currentlocation="lastLocation.location")
|
||||
instance-info(:location="room.tag" :instance="room.ref" :friendcount="room.friendCount" :updateelement="updateInstanceInfo")
|
||||
.x-friend-list(style="margin:10px 0;padding:0;max-height:unset" v-if="room.users.length")
|
||||
.x-friend-item(v-for="user in room.users" :key="user.id" @click="showUserDialog(user.id)" class="x-friend-item-border")
|
||||
.avatar(:class="userStatusClass(user)")
|
||||
img(v-lazy="userImage(user)")
|
||||
.detail
|
||||
span.name(v-text="user.displayName" :style="{'color':user.$userColour}")
|
||||
span.extra(v-if="user.location === 'traveling'")
|
||||
i.el-icon-loading(style="margin-right:5px")
|
||||
timer(:epoch="user.$travelingToTime")
|
||||
span.extra(v-else)
|
||||
timer(:epoch="user.$location_at")
|
||||
.x-friend-item(style="width:100%;cursor:default")
|
||||
.detail
|
||||
span.name {{ $t('dialog.group.info.announcement') }}
|
||||
span(style="display:block" v-text="groupDialog.announcement.title")
|
||||
div(v-if="groupDialog.announcement.imageUrl" style="display:inline-block;margin-right:5px")
|
||||
el-popover(placement="right" width="500px" trigger="click")
|
||||
img.x-link(slot="reference" v-lazy="groupDialog.announcement.imageUrl" style="flex:none;width:60px;height:60px;border-radius:4px;object-fit:cover")
|
||||
img.x-link(v-lazy="groupDialog.announcement.imageUrl" style="height:500px" @click="showFullscreenImageDialog(groupDialog.announcement.imageUrl)")
|
||||
pre.extra(style="display:inline-block;vertical-align:top;font-family:inherit;font-size:12px;white-space:pre-wrap;margin:0") {{ groupDialog.announcement.text || '-' }}
|
||||
br
|
||||
.extra(v-if="groupDialog.announcement.id" style="float:right;margin-left:5px")
|
||||
el-tooltip(v-if="groupDialog.announcement.roleIds.length" placement="top")
|
||||
template(#content)
|
||||
span {{ $t('dialog.group.posts.visibility') }}
|
||||
br
|
||||
template(v-for="roleId in groupDialog.announcement.roleIds" :key="roleId")
|
||||
span(v-for="(role, rIndex) in groupDialog.ref.roles" :key="rIndex" v-if="role.id === roleId" v-text="role.name")
|
||||
span(v-if="groupDialog.announcement.roleIds.indexOf(roleId) < groupDialog.announcement.roleIds.length - 1") ,
|
||||
i.el-icon-view(style="margin-right:5px")
|
||||
display-name(:userid="groupDialog.announcement.authorId" style="margin-right:5px")
|
||||
span(v-if="groupDialog.announcement.editorId" style="margin-right:5px") ({{ $t('dialog.group.posts.edited_by') }} #[display-name(:userid="groupDialog.announcement.editorId")])
|
||||
el-tooltip(placement="bottom")
|
||||
template(#content)
|
||||
span {{ $t('dialog.group.posts.created_at') }} {{ groupDialog.announcement.createdAt | formatDate('long') }}
|
||||
template(v-if="groupDialog.announcement.updatedAt !== groupDialog.announcement.createdAt")
|
||||
br
|
||||
span {{ $t('dialog.group.posts.edited_at') }} {{ groupDialog.announcement.updatedAt | formatDate('long') }}
|
||||
timer(:epoch="Date.parse(groupDialog.announcement.updatedAt)")
|
||||
template(v-if="hasGroupPermission(groupDialog.ref, 'group-announcement-manage')")
|
||||
el-tooltip(placement="top" :content="$t('dialog.group.posts.edit_tooltip')" :disabled="hideTooltips")
|
||||
el-button(type="text" icon="el-icon-edit" size="mini" style="margin-left:5px" @click="showGroupPostEditDialog(groupDialog.id, groupDialog.announcement)")
|
||||
el-tooltip(placement="top" :content="$t('dialog.group.posts.delete_tooltip')" :disabled="hideTooltips")
|
||||
el-button(type="text" icon="el-icon-delete" size="mini" style="margin-left:5px" @click="confirmDeleteGroupPost(groupDialog.announcement)")
|
||||
.x-friend-item(style="width:100%;cursor:default")
|
||||
.detail
|
||||
span.name {{ $t('dialog.group.info.rules') }}
|
||||
pre.extra(style="font-family:inherit;font-size:12px;white-space:pre-wrap;margin:0 0.5em 0 0") {{ groupDialog.ref.rules || '-' }}
|
||||
.x-friend-item(style="cursor:default")
|
||||
.detail
|
||||
span.name {{ $t('dialog.group.info.members') }}
|
||||
.extra {{ groupDialog.ref.memberCount }} ({{ groupDialog.ref.onlineMemberCount }})
|
||||
.x-friend-item(style="cursor:default")
|
||||
.detail
|
||||
span.name {{ $t('dialog.group.info.created_at') }}
|
||||
span.extra {{ groupDialog.ref.createdAt | formatDate('long') }}
|
||||
.x-friend-item(style="cursor:default")
|
||||
.detail
|
||||
span.name {{ $t('dialog.group.info.links') }}
|
||||
div(v-if="groupDialog.ref.links && groupDialog.ref.links.length > 0" style="margin-top:5px")
|
||||
el-tooltip(v-if="link" v-for="(link, index) in groupDialog.ref.links" :key="index")
|
||||
template(#content)
|
||||
span(v-text="link")
|
||||
img(:src="getFaviconUrl(link)" style="width:16px;height:16px;vertical-align:middle;margin-right:5px;cursor:pointer" @click.stop="openExternalLink(link)")
|
||||
.extra(v-else) -
|
||||
.x-friend-item(style="width:350px;cursor:default")
|
||||
.detail
|
||||
span.name {{ $t('dialog.group.info.url') }}
|
||||
span.extra {{ groupDialog.ref.$url }}
|
||||
el-tooltip(placement="top" :content="$t('dialog.group.info.url_tooltip')" :disabled="hideTooltips")
|
||||
el-button(type="default" @click="copyGroupUrl(groupDialog.ref.$url)" size="mini" icon="el-icon-s-order" circle style="margin-left:5px")
|
||||
.x-friend-item(style="width:350px;cursor:default")
|
||||
.detail
|
||||
span.name {{ $t('dialog.group.info.id') }}
|
||||
span.extra {{ groupDialog.id }}
|
||||
el-tooltip(placement="top" :content="$t('dialog.group.info.id_tooltip')" :disabled="hideTooltips")
|
||||
el-button(type="default" @click="copyGroupId(groupDialog.id)" size="mini" icon="el-icon-s-order" circle style="margin-left:5px")
|
||||
div(v-if="groupDialog.ref.membershipStatus === 'member'" style="width:100%;margin-top:10px;border-top:1px solid #e4e7ed14")
|
||||
div(style="width:100%;display:flex;margin-top:10px")
|
||||
.x-friend-item(style="cursor:default")
|
||||
.detail
|
||||
span.name {{ $t('dialog.group.info.joined_at') }}
|
||||
span.extra {{ groupDialog.ref.myMember.joinedAt | formatDate('long') }}
|
||||
.x-friend-item(style="cursor:default")
|
||||
.detail
|
||||
span.name {{ $t('dialog.group.info.roles') }}
|
||||
span.extra(v-if="groupDialog.memberRoles.length === 0") -
|
||||
span.extra(v-else)
|
||||
template(v-for="(role, rIndex) in groupDialog.memberRoles" :key="rIndex")
|
||||
el-tooltip(placement="top")
|
||||
template(#content)
|
||||
span {{ $t('dialog.group.info.role') }} {{ role.name }}
|
||||
br
|
||||
span {{ $t('dialog.group.info.role_description') }} {{ role.description }}
|
||||
br
|
||||
span(v-if="role.updatedAt") {{ $t('dialog.group.info.role_updated_at') }} {{ role.updatedAt | formatDate('long') }}
|
||||
span(v-else) {{ $t('dialog.group.info.role_created_at') }} {{ role.createdAt | formatDate('long') }}
|
||||
br
|
||||
span {{ $t('dialog.group.info.role_permissions') }}
|
||||
br
|
||||
template(v-for="(permission, pIndex) in role.permissions" :key="pIndex")
|
||||
span {{ permission }}
|
||||
br
|
||||
span {{ role.name }}{{ rIndex < groupDialog.memberRoles.length - 1 ? ', ' : '' }}
|
||||
el-tab-pane(:label="$t('dialog.group.posts.header')")
|
||||
template(v-if="groupDialog.visible")
|
||||
span(style="margin-right:10px") {{ $t('dialog.group.posts.posts_count') }} {{ groupDialog.posts.length }}
|
||||
el-input(v-model="groupDialog.postsSearch" @input="updateGroupPostSearch" clearable size="mini" :placeholder="$t('dialog.group.posts.search_placeholder')" style="width:89%;margin-bottom:10px")
|
||||
.x-friend-list
|
||||
.x-friend-item(v-for="post in groupDialog.postsFiltered" :key="post.id" style="width:100%;cursor:default")
|
||||
.detail
|
||||
span(style="display:block" v-text="post.title")
|
||||
div(v-if="post.imageUrl" style="display:inline-block;margin-right:5px")
|
||||
el-popover(placement="right" width="500px" trigger="click")
|
||||
img.x-link(slot="reference" v-lazy="post.imageUrl" style="flex:none;width:60px;height:60px;border-radius:4px;object-fit:cover")
|
||||
img.x-link(v-lazy="post.imageUrl" style="height:500px" @click="showFullscreenImageDialog(post.imageUrl)")
|
||||
pre.extra(style="display:inline-block;vertical-align:top;font-family:inherit;font-size:12px;white-space:pre-wrap;margin:0") {{ post.text || '-' }}
|
||||
br
|
||||
.extra(v-if="post.authorId" style="float:right;margin-left:5px")
|
||||
el-tooltip(v-if="post.roleIds.length" placement="top")
|
||||
template(#content)
|
||||
span {{ $t('dialog.group.posts.visibility') }}
|
||||
br
|
||||
template(v-for="roleId in post.roleIds" :key="roleId")
|
||||
span(v-for="(role, rIndex) in groupDialog.ref.roles" :key="rIndex" v-if="role.id === roleId" v-text="role.name")
|
||||
span(v-if="post.roleIds.indexOf(roleId) < post.roleIds.length - 1") ,
|
||||
i.el-icon-view(style="margin-right:5px")
|
||||
display-name(:userid="post.authorId" style="margin-right:5px")
|
||||
span(v-if="post.editorId" style="margin-right:5px") ({{ $t('dialog.group.posts.edited_by') }} #[display-name(:userid="post.editorId")])
|
||||
el-tooltip(placement="bottom")
|
||||
template(#content)
|
||||
span {{ $t('dialog.group.posts.created_at') }} {{ post.createdAt | formatDate('long') }}
|
||||
template(v-if="post.updatedAt !== post.createdAt")
|
||||
br
|
||||
span {{ $t('dialog.group.posts.edited_at') }} {{ post.updatedAt | formatDate('long') }}
|
||||
timer(:epoch="Date.parse(post.updatedAt)")
|
||||
template(v-if="hasGroupPermission(groupDialog.ref, 'group-announcement-manage')")
|
||||
el-tooltip(placement="top" :content="$t('dialog.group.posts.edit_tooltip')" :disabled="hideTooltips")
|
||||
el-button(type="text" icon="el-icon-edit" size="mini" style="margin-left:5px" @click="showGroupPostEditDialog(groupDialog.id, post)")
|
||||
el-tooltip(placement="top" :content="$t('dialog.group.posts.delete_tooltip')" :disabled="hideTooltips")
|
||||
el-button(type="text" icon="el-icon-delete" size="mini" style="margin-left:5px" @click="confirmDeleteGroupPost(post)")
|
||||
el-tab-pane(:label="$t('dialog.group.members.header')")
|
||||
template(v-if="groupDialog.visible")
|
||||
span(v-if="hasGroupPermission(groupDialog.ref, 'group-members-viewall')" style="font-weight:bold;font-size:16px") {{ $t('dialog.group.members.all_members') }}
|
||||
span(v-else style="font-weight:bold;font-size:16px") {{ $t('dialog.group.members.friends_only') }}
|
||||
div(style="margin-top:10px")
|
||||
el-button(type="default" @click="loadAllGroupMembers" size="mini" icon="el-icon-refresh" :loading="isGroupMembersLoading" circle)
|
||||
el-button(type="default" @click="downloadAndSaveJson(`${groupDialog.id}_members`, groupDialog.members)" size="mini" icon="el-icon-download" circle style="margin-left:5px")
|
||||
span(v-if="groupDialog.memberSearch.length" style="font-size:14px;margin-left:5px;margin-right:5px") {{ groupDialog.memberSearchResults.length }}/{{ groupDialog.ref.memberCount }}
|
||||
span(v-else style="font-size:14px;margin-left:5px;margin-right:5px") {{ groupDialog.members.length }}/{{ groupDialog.ref.memberCount }}
|
||||
div(v-if="hasGroupPermission(groupDialog.ref, 'group-members-manage')" style="float:right")
|
||||
span(style="margin-right:5px") {{ $t('dialog.group.members.sort_by') }}
|
||||
el-dropdown(@click.native.stop trigger="click" size="small" style="margin-right:5px" :disabled="isGroupMembersLoading || groupDialog.memberSearch.length")
|
||||
el-button(size="mini")
|
||||
span {{ groupDialog.memberSortOrder.name }} #[i.el-icon-arrow-down.el-icon--right]
|
||||
el-dropdown-menu(#default="dropdown")
|
||||
el-dropdown-item(v-for="(item) in groupDialogSortingOptions" v-text="item.name" @click.native="setGroupMemberSortOrder(item)")
|
||||
span(style="margin-right:5px") {{ $t('dialog.group.members.filter') }}
|
||||
el-dropdown(@click.native.stop trigger="click" size="small" style="margin-right:5px" :disabled="isGroupMembersLoading || groupDialog.memberSearch.length")
|
||||
el-button(size="mini")
|
||||
span {{ groupDialog.memberFilter.name }} #[i.el-icon-arrow-down.el-icon--right]
|
||||
el-dropdown-menu(#default="dropdown")
|
||||
el-dropdown-item(v-for="(item) in groupDialogFilterOptions" v-text="item.name" @click.native="setGroupMemberFilter(item)")
|
||||
el-dropdown-item(v-for="(item) in groupDialog.ref.roles" v-if="!item.defaultRole" v-text="item.name" @click.native="setGroupMemberFilter(item)")
|
||||
el-input(v-model="groupDialog.memberSearch" @input="groupMembersSearch" clearable size="mini" :placeholder="$t('dialog.group.members.search')" style="margin-top:10px;margin-bottom:10px")
|
||||
.x-friend-list(v-if="groupDialog.memberSearch.length" v-loading="isGroupMembersLoading" style="margin-top:10px;overflow:auto;max-height:250px;min-width:130px")
|
||||
.x-friend-item(v-for="user in groupDialog.memberSearchResults" :key="user.id" @click="showUserDialog(user.userId)" class="x-friend-item-border")
|
||||
.avatar
|
||||
img(v-lazy="userImage(user.user)")
|
||||
.detail
|
||||
span.name(v-text="user.user.displayName" :style="{'color':user.user.$userColour}")
|
||||
span.extra
|
||||
template(v-if="hasGroupPermission(groupDialog.ref, 'group-members-manage')")
|
||||
el-tooltip(v-if="user.isRepresenting" placement="top" :content="$t('dialog.group.members.representing')")
|
||||
i.el-icon-collection-tag(style="margin-right:5px")
|
||||
el-tooltip(v-if="user.visibility !== 'visible'" placement="top")
|
||||
template(#content)
|
||||
span {{ $t('dialog.group.members.visibility') }} {{ user.visibility }}
|
||||
i.el-icon-view(style="margin-right:5px")
|
||||
el-tooltip(v-if="!user.isSubscribedToAnnouncements" placement="top" :content="$t('dialog.group.members.unsubscribed_announcements')")
|
||||
i.el-icon-chat-line-square(style="margin-right:5px")
|
||||
el-tooltip(v-if="user.managerNotes" placement="top")
|
||||
template(#content)
|
||||
span {{ $t('dialog.group.members.manager_notes') }}
|
||||
br
|
||||
span {{ user.managerNotes }}
|
||||
i.el-icon-edit-outline(style="margin-right:5px")
|
||||
template(v-for="roleId in user.roleIds" :key="roleId")
|
||||
span(v-for="(role, rIndex) in groupDialog.ref.roles" :key="rIndex" v-if="role.id === roleId" v-text="role.name")
|
||||
span(v-if="user.roleIds.indexOf(roleId) < user.roleIds.length - 1") ,
|
||||
ul.infinite-list.x-friend-list(v-else-if="groupDialog.members.length > 0" v-infinite-scroll="loadMoreGroupMembers" style="margin-top:10px;overflow:auto;max-height:250px;min-width:130px")
|
||||
li.infinite-list-item.x-friend-item(v-for="user in groupDialog.members" :key="user.id" @click="showUserDialog(user.userId)" class="x-friend-item-border")
|
||||
.avatar
|
||||
img(v-lazy="userImage(user.user)")
|
||||
.detail
|
||||
span.name(v-text="user.user.displayName" :style="{'color':user.user.$userColour}")
|
||||
span.extra
|
||||
template(v-if="hasGroupPermission(groupDialog.ref, 'group-members-manage')")
|
||||
el-tooltip(v-if="user.isRepresenting" placement="top" :content="$t('dialog.group.members.representing')")
|
||||
i.el-icon-collection-tag(style="margin-right:5px")
|
||||
el-tooltip(v-if="user.visibility !== 'visible'" placement="top")
|
||||
template(#content)
|
||||
span {{ $t('dialog.group.members.visibility') }} {{ user.visibility }}
|
||||
i.el-icon-view(style="margin-right:5px")
|
||||
el-tooltip(v-if="!user.isSubscribedToAnnouncements" placement="top" :content="$t('dialog.group.members.unsubscribed_announcements')")
|
||||
i.el-icon-chat-line-square(style="margin-right:5px")
|
||||
el-tooltip(v-if="user.managerNotes" placement="top")
|
||||
template(#content)
|
||||
span {{ $t('dialog.group.members.manager_notes') }}
|
||||
br
|
||||
span {{ user.managerNotes }}
|
||||
i.el-icon-edit-outline(style="margin-right:5px")
|
||||
template(v-for="roleId in user.roleIds" :key="roleId")
|
||||
span(v-for="(role, rIndex) in groupDialog.ref.roles" :key="rIndex" v-if="role.id === roleId" v-text="role.name")
|
||||
span(v-if="user.roleIds.indexOf(roleId) < user.roleIds.length - 1") ,
|
||||
.x-friend-item(v-if="!isGroupMembersDone" v-loading="isGroupMembersLoading" style="width:100%;height:45px;text-align:center" @click="loadMoreGroupMembers")
|
||||
.detail(v-if="!isGroupMembersLoading")
|
||||
span.name {{ $t('dialog.group.members.load_more') }}
|
||||
el-tab-pane(:label="$t('dialog.group.gallery.header')")
|
||||
el-button(type="default" size="mini" icon="el-icon-refresh" @click="getGroupGalleries" :loading="isGroupGalleryLoading" circle)
|
||||
el-tabs(type="card" v-loading="isGroupGalleryLoading" ref="groupDialogGallery" style="margin-top:10px")
|
||||
template(v-for="(gallery, index) in groupDialog.ref.galleries")
|
||||
el-tab-pane
|
||||
span(slot="label")
|
||||
span(v-text="gallery.name" style="font-weight:bold;font-size:16px")
|
||||
i.x-user-status(style="margin-left:5px" :class="groupGalleryStatus(gallery)")
|
||||
span(style="color:#909399;font-size:12px;margin-left:5px") {{ groupDialog.galleries[gallery.id] ? groupDialog.galleries[gallery.id].length : 0 }}
|
||||
span(v-text="gallery.description" style="color:#c7c7c7;padding:10px")
|
||||
el-carousel(:interval="0" height="600px" style="margin-top:10px")
|
||||
el-carousel-item(v-for="image in groupDialog.galleries[gallery.id]" :key="image.id")
|
||||
el-popover(placement="top" width="700px" trigger="click")
|
||||
img.x-link(slot="reference" v-lazy="image.imageUrl" style="width:100%;height:100%;object-fit:contain")
|
||||
img.x-link(v-lazy="image.imageUrl" style="height:700px" @click="showFullscreenImageDialog(image.imageUrl)")
|
||||
el-tab-pane(:label="$t('dialog.group.json.header')")
|
||||
el-button(type="default" @click="refreshGroupDialogTreeData()" size="mini" icon="el-icon-refresh" circle)
|
||||
el-button(type="default" @click="downloadAndSaveJson(groupDialog.id, groupDialog.ref)" size="mini" icon="el-icon-download" circle style="margin-left:5px")
|
||||
el-tree(:data="groupDialog.treeData" style="margin-top:5px;font-size:12px")
|
||||
template(#default="scope")
|
||||
span
|
||||
span(v-text="scope.data.key" style="font-weight:bold;margin-right:5px")
|
||||
span(v-if="!scope.data.children" v-text="scope.data.value")
|
||||
334
html/src/mixins/dialogs/groups.pug
Normal file
334
html/src/mixins/dialogs/groups.pug
Normal file
@@ -0,0 +1,334 @@
|
||||
mixin groups()
|
||||
//- dialog: invite group
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="inviteGroupDialog" :visible.sync="inviteGroupDialog.visible" :title="$t('dialog.invite_to_group.header')" width="450px")
|
||||
div(v-if="inviteGroupDialog.visible" v-loading="inviteGroupDialog.loading")
|
||||
span {{ $t('dialog.invite_to_group.description') }}
|
||||
br
|
||||
el-select(v-model="inviteGroupDialog.groupId" clearable :placeholder="$t('dialog.invite_to_group.choose_group_placeholder')" filterable :disabled="inviteGroupDialog.loading" @change="isAllowedToInviteToGroup" style="margin-top:15px")
|
||||
el-option-group(v-if="API.currentUserGroups.size" :label="$t('dialog.invite_to_group.groups')" style="width:410px")
|
||||
el-option.x-friend-item(v-for="group in API.currentUserGroups.values()" :key="group.id" :label="group.name" :value="group.id" style="height:auto")
|
||||
.avatar
|
||||
img(v-lazy="group.iconUrl")
|
||||
.detail
|
||||
span.name(v-text="group.name")
|
||||
el-select(v-model="inviteGroupDialog.userIds" multiple clearable :placeholder="$t('dialog.invite_to_group.choose_friends_placeholder')" filterable :disabled="inviteGroupDialog.loading" style="width:100%;margin-top:15px")
|
||||
el-option-group(v-if="inviteGroupDialog.userId" :label="$t('dialog.invite_to_group.selected_users')")
|
||||
el-option.x-friend-item(:key="inviteGroupDialog.userObject.id" :label="inviteGroupDialog.userObject.displayName" :value="inviteGroupDialog.userObject.id" style="height:auto")
|
||||
template(v-if="inviteGroupDialog.userObject.id")
|
||||
.avatar(:class="userStatusClass(inviteGroupDialog.userObject)")
|
||||
img(v-lazy="userImage(inviteGroupDialog.userObject)")
|
||||
.detail
|
||||
span.name(v-text="inviteGroupDialog.userObject.displayName" :style="{'color':inviteGroupDialog.userObject.$userColour}")
|
||||
span(v-else v-text="inviteGroupDialog.userId")
|
||||
el-option-group(v-if="vipFriends.length" :label="$t('side_panel.favorite')")
|
||||
el-option.x-friend-item(v-for="friend in vipFriends" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto")
|
||||
template(v-if="friend.ref")
|
||||
.avatar(:class="userStatusClass(friend.ref)")
|
||||
img(v-lazy="userImage(friend.ref)")
|
||||
.detail
|
||||
span.name(v-text="friend.ref.displayName" :style="{'color':friend.ref.$userColour}")
|
||||
span(v-else v-text="friend.id")
|
||||
el-option-group(v-if="onlineFriends.length" :label="$t('side_panel.online')")
|
||||
el-option.x-friend-item(v-for="friend in onlineFriends" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto")
|
||||
template(v-if="friend.ref")
|
||||
.avatar(:class="userStatusClass(friend.ref)")
|
||||
img(v-lazy="userImage(friend.ref)")
|
||||
.detail
|
||||
span.name(v-text="friend.ref.displayName" :style="{'color':friend.ref.$userColour}")
|
||||
span(v-else v-text="friend.id")
|
||||
el-option-group(v-if="activeFriends.length" :label="$t('side_panel.active')")
|
||||
el-option.x-friend-item(v-for="friend in activeFriends" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto")
|
||||
template(v-if="friend.ref")
|
||||
.avatar
|
||||
img(v-lazy="userImage(friend.ref)")
|
||||
.detail
|
||||
span.name(v-text="friend.ref.displayName" :style="{'color':friend.ref.$userColour}")
|
||||
span(v-else v-text="friend.id")
|
||||
el-option-group(v-if="offlineFriends.length" :label="$t('side_panel.offline')")
|
||||
el-option.x-friend-item(v-for="friend in offlineFriends" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto")
|
||||
template(v-if="friend.ref")
|
||||
.avatar
|
||||
img(v-lazy="userImage(friend.ref)")
|
||||
.detail
|
||||
span.name(v-text="friend.ref.displayName" :style="{'color':friend.ref.$userColour}")
|
||||
span(v-else v-text="friend.id")
|
||||
template(#footer)
|
||||
el-button(type="primary" size="small" :disabled="inviteGroupDialog.loading || !inviteGroupDialog.userIds.length" @click="sendGroupInvite()") Invite
|
||||
|
||||
//- dialog: group moderation
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="groupMemberModeration" :visible.sync="groupMemberModeration.visible" :title="$t('dialog.group_member_moderation.header')" width="90vw")
|
||||
div(v-if="groupMemberModeration.visible")
|
||||
h3(v-text="groupMemberModeration.groupRef.name")
|
||||
el-tabs(type="card" style="height:100%")
|
||||
el-tab-pane(:label="$t('dialog.group_member_moderation.members')")
|
||||
div(style="margin-top:10px")
|
||||
el-button(type="default" @click="loadAllGroupMembers" size="mini" icon="el-icon-refresh" :loading="isGroupMembersLoading" circle)
|
||||
span(style="font-size:14px;margin-left:5px;margin-right:5px") {{ groupMemberModerationTable.data.length }}/{{ groupMemberModeration.groupRef.memberCount }}
|
||||
div(style="float:right;margin-top:5px")
|
||||
span(style="margin-right:5px") {{ $t('dialog.group.members.sort_by') }}
|
||||
el-dropdown(@click.native.stop trigger="click" size="small" style="margin-right:5px" :disabled="isGroupMembersLoading || groupDialog.memberSearch.length || !hasGroupPermission(groupDialog.ref, 'group-bans-manage')")
|
||||
el-button(size="mini")
|
||||
span {{ groupDialog.memberSortOrder.name }} #[i.el-icon-arrow-down.el-icon--right]
|
||||
el-dropdown-menu(#default="dropdown")
|
||||
el-dropdown-item(v-for="(item) in groupDialogSortingOptions" v-text="item.name" @click.native="setGroupMemberSortOrder(item)")
|
||||
span(style="margin-right:5px") {{ $t('dialog.group.members.filter') }}
|
||||
el-dropdown(@click.native.stop trigger="click" size="small" style="margin-right:5px" :disabled="isGroupMembersLoading || groupDialog.memberSearch.length || !hasGroupPermission(groupDialog.ref, 'group-bans-manage')")
|
||||
el-button(size="mini")
|
||||
span {{ groupDialog.memberFilter.name }} #[i.el-icon-arrow-down.el-icon--right]
|
||||
el-dropdown-menu(#default="dropdown")
|
||||
el-dropdown-item(v-for="(item) in groupDialogFilterOptions" v-text="item.name" @click.native="setGroupMemberFilter(item)")
|
||||
el-dropdown-item(v-for="(item) in groupDialog.ref.roles" v-if="!item.defaultRole" v-text="item.name" @click.native="setGroupMemberFilter(item)")
|
||||
el-input(v-model="groupDialog.memberSearch" :disabled="!hasGroupPermission(groupDialog.ref, 'group-bans-manage')" @input="groupMembersSearch" clearable size="mini" :placeholder="$t('dialog.group.members.search')" style="margin-top:10px;margin-bottom:10px")
|
||||
br
|
||||
el-button(size="small" @click="selectAllGroupMembers") {{ $t('dialog.group_member_moderation.select_all') }}
|
||||
data-tables(v-bind="groupMemberModerationTable" style="margin-top:10px")
|
||||
el-table-column(width="55" prop="$selected" :key="groupMemberModerationTableForceUpdate")
|
||||
template(v-once #default="scope")
|
||||
el-button(type="text" size="mini" @click.stop)
|
||||
el-checkbox(v-model="scope.row.$selected" @change="groupMemberModerationTableSelectionChange(scope.row)")
|
||||
el-table-column(:label="$t('dialog.group_member_moderation.avatar')" width="70" prop="photo")
|
||||
template(v-once #default="scope")
|
||||
el-popover(placement="right" height="500px" trigger="hover")
|
||||
img.friends-list-avatar(slot="reference" v-lazy="userImage(scope.row.user)")
|
||||
img.friends-list-avatar(v-lazy="userImageFull(scope.row.user)" style="height:500px;cursor:pointer" @click="showFullscreenImageDialog(userImageFull(scope.row.user))")
|
||||
el-table-column(:label="$t('dialog.group_member_moderation.display_name')" width="160" prop="$displayName" sortable)
|
||||
template(v-once #default="scope")
|
||||
span(style="cursor:pointer" @click="showUserDialog(scope.row.userId)")
|
||||
span(v-if="randomUserColours" v-text="scope.row.user.displayName" :style="{'color':scope.row.user.$userColour}")
|
||||
span(v-else v-text="scope.row.user.displayName")
|
||||
el-table-column(:label="$t('dialog.group_member_moderation.roles')" prop="roleIds" sortable)
|
||||
template(v-once #default="scope")
|
||||
template(v-for="roleId in scope.row.roleIds" :key="roleId")
|
||||
span(v-for="(role, rIndex) in groupMemberModeration.groupRef.roles" :key="rIndex" v-if="role.id === roleId" v-text="role.name")
|
||||
span(v-if="scope.row.roleIds.indexOf(roleId) < scope.row.roleIds.length - 1") ,
|
||||
el-table-column(:label="$t('dialog.group_member_moderation.notes')" prop="managerNotes" sortable)
|
||||
template(v-once #default="scope")
|
||||
span(v-text="scope.row.managerNotes" @click.stop)
|
||||
el-table-column(:label="$t('dialog.group_member_moderation.joined_at')" width="170" prop="joinedAt" sortable)
|
||||
template(v-once #default="scope")
|
||||
span {{ scope.row.joinedAt | formatDate('long') }}
|
||||
el-table-column(:label="$t('dialog.group_member_moderation.visibility')" width="120" prop="visibility" sortable)
|
||||
template(v-once #default="scope")
|
||||
span(v-text="scope.row.visibility")
|
||||
el-tab-pane(:label="$t('dialog.group_member_moderation.bans')" :disabled="!hasGroupPermission(groupDialog.ref, 'group-bans-manage')")
|
||||
div(style="margin-top:10px")
|
||||
el-button(type="default" @click="getAllGroupBans(groupMemberModeration.id)" size="mini" icon="el-icon-refresh" :loading="isGroupMembersLoading" circle)
|
||||
span(style="font-size:14px;margin-left:5px;margin-right:5px") {{ groupBansModerationTable.data.length }}
|
||||
br
|
||||
el-input(v-model="groupBansModerationTable.filters[0].value" clearable size="mini" :placeholder="$t('dialog.group.members.search')" style="margin-top:10px;margin-bottom:10px")
|
||||
br
|
||||
el-button(size="small" @click="selectAllGroupBans") {{ $t('dialog.group_member_moderation.select_all') }}
|
||||
data-tables(v-bind="groupBansModerationTable" style="margin-top:10px")
|
||||
el-table-column(width="55" prop="$selected" :key="groupMemberModerationTableForceUpdate")
|
||||
template(v-once #default="scope")
|
||||
el-button(type="text" size="mini" @click.stop)
|
||||
el-checkbox(v-model="scope.row.$selected" @change="groupMemberModerationTableSelectionChange(scope.row)")
|
||||
el-table-column(:label="$t('dialog.group_member_moderation.avatar')" width="70" prop="photo")
|
||||
template(v-once #default="scope")
|
||||
el-popover(placement="right" height="500px" trigger="hover")
|
||||
img.friends-list-avatar(slot="reference" v-lazy="userImage(scope.row.user)")
|
||||
img.friends-list-avatar(v-lazy="userImageFull(scope.row.user)" style="height:500px;cursor:pointer" @click="showFullscreenImageDialog(userImageFull(scope.row.user))")
|
||||
el-table-column(:label="$t('dialog.group_member_moderation.display_name')" width="160" prop="$displayName" sortable)
|
||||
template(v-once #default="scope")
|
||||
span(style="cursor:pointer" @click="showUserDialog(scope.row.userId)")
|
||||
span(v-if="randomUserColours" v-text="scope.row.user.displayName" :style="{'color':scope.row.user.$userColour}")
|
||||
span(v-else v-text="scope.row.user.displayName")
|
||||
el-table-column(:label="$t('dialog.group_member_moderation.roles')" prop="roleIds" sortable)
|
||||
template(v-once #default="scope")
|
||||
template(v-for="roleId in scope.row.roleIds" :key="roleId")
|
||||
span(v-for="(role, rIndex) in groupMemberModeration.groupRef.roles" :key="rIndex" v-if="role.id === roleId" v-text="role.name")
|
||||
span(v-if="scope.row.roleIds.indexOf(roleId) < scope.row.roleIds.length - 1") ,
|
||||
el-table-column(:label="$t('dialog.group_member_moderation.notes')" prop="managerNotes" sortable)
|
||||
template(v-once #default="scope")
|
||||
span(v-text="scope.row.managerNotes" @click.stop)
|
||||
el-table-column(:label="$t('dialog.group_member_moderation.joined_at')" width="170" prop="joinedAt" sortable)
|
||||
template(v-once #default="scope")
|
||||
span {{ scope.row.joinedAt | formatDate('long') }}
|
||||
el-table-column(:label="$t('dialog.group_member_moderation.banned_at')" width="170" prop="joinedAt" sortable)
|
||||
template(v-once #default="scope")
|
||||
span {{ scope.row.bannedAt | formatDate('long') }}
|
||||
el-tab-pane(:label="$t('dialog.group_member_moderation.invites')" :disabled="!hasGroupPermission(groupDialog.ref, 'group-invites-manage')")
|
||||
div(style="margin-top:10px")
|
||||
el-button(type="default" @click="getAllGroupInvitesAndJoinRequests(groupMemberModeration.id)" size="mini" icon="el-icon-refresh" :loading="isGroupMembersLoading" circle)
|
||||
br
|
||||
el-tabs
|
||||
el-tab-pane
|
||||
span(slot="label")
|
||||
span(v-text="$t('dialog.group_member_moderation.sent_invites')" style="font-weight:bold;font-size:16px")
|
||||
span(style="color:#909399;font-size:12px;margin-left:5px") {{ groupInvitesModerationTable.data.length }}
|
||||
el-button(size="small" @click="selectAllGroupInvites") {{ $t('dialog.group_member_moderation.select_all') }}
|
||||
data-tables(v-bind="groupInvitesModerationTable" style="margin-top:10px")
|
||||
el-table-column(width="55" prop="$selected" :key="groupMemberModerationTableForceUpdate")
|
||||
template(v-once #default="scope")
|
||||
el-button(type="text" size="mini" @click.stop)
|
||||
el-checkbox(v-model="scope.row.$selected" @change="groupMemberModerationTableSelectionChange(scope.row)")
|
||||
el-table-column(:label="$t('dialog.group_member_moderation.avatar')" width="70" prop="photo")
|
||||
template(v-once #default="scope")
|
||||
el-popover(placement="right" height="500px" trigger="hover")
|
||||
img.friends-list-avatar(slot="reference" v-lazy="userImage(scope.row.user)")
|
||||
img.friends-list-avatar(v-lazy="userImageFull(scope.row.user)" style="height:500px;cursor:pointer" @click="showFullscreenImageDialog(userImageFull(scope.row.user))")
|
||||
el-table-column(:label="$t('dialog.group_member_moderation.display_name')" width="160" prop="$displayName" sortable)
|
||||
template(v-once #default="scope")
|
||||
span(style="cursor:pointer" @click="showUserDialog(scope.row.userId)")
|
||||
span(v-if="randomUserColours" v-text="scope.row.user.displayName" :style="{'color':scope.row.user.$userColour}")
|
||||
span(v-else v-text="scope.row.user.displayName")
|
||||
el-table-column(:label="$t('dialog.group_member_moderation.notes')" prop="managerNotes" sortable)
|
||||
template(v-once #default="scope")
|
||||
span(v-text="scope.row.managerNotes" @click.stop)
|
||||
br
|
||||
el-button(@click="groupMembersDeleteSentInvite" :disabled="groupMemberModeration.progressCurrent || !hasGroupPermission(groupDialog.ref, 'group-invites-manage')") {{ $t('dialog.group_member_moderation.delete_sent_invite') }}
|
||||
el-tab-pane
|
||||
span(slot="label")
|
||||
span(v-text="$t('dialog.group_member_moderation.join_requests')" style="font-weight:bold;font-size:16px")
|
||||
span(style="color:#909399;font-size:12px;margin-left:5px") {{ groupJoinRequestsModerationTable.data.length }}
|
||||
el-button(size="small" @click="selectAllGroupJoinRequests") {{ $t('dialog.group_member_moderation.select_all') }}
|
||||
data-tables(v-bind="groupJoinRequestsModerationTable" style="margin-top:10px")
|
||||
el-table-column(width="55" prop="$selected" :key="groupMemberModerationTableForceUpdate")
|
||||
template(v-once #default="scope")
|
||||
el-button(type="text" size="mini" @click.stop)
|
||||
el-checkbox(v-model="scope.row.$selected" @change="groupMemberModerationTableSelectionChange(scope.row)")
|
||||
el-table-column(:label="$t('dialog.group_member_moderation.avatar')" width="70" prop="photo")
|
||||
template(v-once #default="scope")
|
||||
el-popover(placement="right" height="500px" trigger="hover")
|
||||
img.friends-list-avatar(slot="reference" v-lazy="userImage(scope.row.user)")
|
||||
img.friends-list-avatar(v-lazy="userImageFull(scope.row.user)" style="height:500px;cursor:pointer" @click="showFullscreenImageDialog(userImageFull(scope.row.user))")
|
||||
el-table-column(:label="$t('dialog.group_member_moderation.display_name')" width="160" prop="$displayName" sortable)
|
||||
template(v-once #default="scope")
|
||||
span(style="cursor:pointer" @click="showUserDialog(scope.row.userId)")
|
||||
span(v-if="randomUserColours" v-text="scope.row.user.displayName" :style="{'color':scope.row.user.$userColour}")
|
||||
span(v-else v-text="scope.row.user.displayName")
|
||||
el-table-column(:label="$t('dialog.group_member_moderation.notes')" prop="managerNotes" sortable)
|
||||
template(v-once #default="scope")
|
||||
span(v-text="scope.row.managerNotes" @click.stop)
|
||||
br
|
||||
el-button(@click="groupMembersAcceptInviteRequest" :disabled="groupMemberModeration.progressCurrent || !hasGroupPermission(groupDialog.ref, 'group-invites-manage')") {{ $t('dialog.group_member_moderation.accept_join_requests') }}
|
||||
el-button(@click="groupMembersRejectInviteRequest" :disabled="groupMemberModeration.progressCurrent || !hasGroupPermission(groupDialog.ref, 'group-invites-manage')") {{ $t('dialog.group_member_moderation.reject_join_requests') }}
|
||||
el-button(@click="groupMembersBlockJoinRequest" :disabled="groupMemberModeration.progressCurrent || !hasGroupPermission(groupDialog.ref, 'group-invites-manage')") {{ $t('dialog.group_member_moderation.block_join_requests') }}
|
||||
el-tab-pane
|
||||
span(slot="label")
|
||||
span(v-text="$t('dialog.group_member_moderation.blocked_requests')" style="font-weight:bold;font-size:16px")
|
||||
span(style="color:#909399;font-size:12px;margin-left:5px") {{ groupBlockedModerationTable.data.length }}
|
||||
el-button(size="small" @click="selectAllGroupBlocked") {{ $t('dialog.group_member_moderation.select_all') }}
|
||||
data-tables(v-bind="groupBlockedModerationTable" style="margin-top:10px")
|
||||
el-table-column(width="55" prop="$selected" :key="groupMemberModerationTableForceUpdate")
|
||||
template(v-once #default="scope")
|
||||
el-button(type="text" size="mini" @click.stop)
|
||||
el-checkbox(v-model="scope.row.$selected" @change="groupMemberModerationTableSelectionChange(scope.row)")
|
||||
el-table-column(:label="$t('dialog.group_member_moderation.avatar')" width="70" prop="photo")
|
||||
template(v-once #default="scope")
|
||||
el-popover(placement="right" height="500px" trigger="hover")
|
||||
img.friends-list-avatar(slot="reference" v-lazy="userImage(scope.row.user)")
|
||||
img.friends-list-avatar(v-lazy="userImageFull(scope.row.user)" style="height:500px;cursor:pointer" @click="showFullscreenImageDialog(userImageFull(scope.row.user))")
|
||||
el-table-column(:label="$t('dialog.group_member_moderation.display_name')" width="160" prop="$displayName" sortable)
|
||||
template(v-once #default="scope")
|
||||
span(style="cursor:pointer" @click="showUserDialog(scope.row.userId)")
|
||||
span(v-if="randomUserColours" v-text="scope.row.user.displayName" :style="{'color':scope.row.user.$userColour}")
|
||||
span(v-else v-text="scope.row.user.displayName")
|
||||
el-table-column(:label="$t('dialog.group_member_moderation.notes')" prop="managerNotes" sortable)
|
||||
template(v-once #default="scope")
|
||||
span(v-text="scope.row.managerNotes" @click.stop)
|
||||
br
|
||||
el-button(@click="groupMembersDeleteBlockedRequest" :disabled="groupMemberModeration.progressCurrent || !hasGroupPermission(groupDialog.ref, 'group-invites-manage')") {{ $t('dialog.group_member_moderation.delete_blocked_requests') }}
|
||||
el-tab-pane(:label="$t('dialog.group_member_moderation.logs')" :disabled="!hasGroupPermission(groupDialog.ref, 'group-audit-view')")
|
||||
div(style="margin-top:10px")
|
||||
el-button(type="default" @click="getAllGroupLogs(groupMemberModeration.id)" size="mini" icon="el-icon-refresh" :loading="isGroupMembersLoading" circle)
|
||||
span(style="font-size:14px;margin-left:5px;margin-right:5px") {{ groupLogsModerationTable.data.length }}
|
||||
br
|
||||
el-select(v-model="groupMemberModeration.selectedAuditLogTypes" multiple collapse-tags :placeholder="$t('dialog.group_member_moderation.filter_type')")
|
||||
el-option-group(:label="$t('dialog.group_member_moderation.select_type')")
|
||||
el-option.x-friend-item(v-for="type in groupMemberModeration.auditLogTypes" :key="type" :label="getAuditLogTypeName(type)" :value="type")
|
||||
.detail
|
||||
span.name(v-text="getAuditLogTypeName(type)")
|
||||
el-input(v-model="groupLogsModerationTable.filters[0].value" :placeholder="$t('dialog.group_member_moderation.search_placeholder')" style="display:inline-block;width:150px;margin:10px")
|
||||
br
|
||||
data-tables(v-bind="groupLogsModerationTable" style="margin-top:10px")
|
||||
el-table-column(:label="$t('dialog.group_member_moderation.created_at')" width="170" prop="created_at" sortable)
|
||||
template(v-once #default="scope")
|
||||
span {{ scope.row.created_at | formatDate('long') }}
|
||||
el-table-column(:label="$t('dialog.group_member_moderation.type')" width="190" prop="eventType" sortable)
|
||||
template(v-once #default="scope")
|
||||
span(v-text="scope.row.eventType")
|
||||
el-table-column(:label="$t('dialog.group_member_moderation.display_name')" width="160" prop="actorDisplayName" sortable)
|
||||
template(v-once #default="scope")
|
||||
span(style="cursor:pointer" @click="showUserDialog(scope.row.actorId)")
|
||||
span(v-text="scope.row.actorDisplayName")
|
||||
el-table-column(:label="$t('dialog.group_member_moderation.description')" prop="description")
|
||||
template(v-once #default="scope")
|
||||
span(v-text="scope.row.description")
|
||||
el-table-column(:label="$t('dialog.group_member_moderation.data')" prop="data")
|
||||
template(v-once #default="scope")
|
||||
span(v-if="Object.keys(scope.row.data).length" v-text="JSON.stringify(scope.row.data)")
|
||||
br
|
||||
br
|
||||
span.name {{ $t('dialog.group_member_moderation.user_id') }}
|
||||
br
|
||||
el-input(v-model="groupMemberModeration.selectUserId" size="mini" style="margin-top:5px;width:340px" :placeholder="$t('dialog.group_member_moderation.user_id_placeholder')" clearable)
|
||||
el-button(size="small" @click="selectGroupMemberUserId" :disabled="!groupMemberModeration.selectUserId") {{ $t('dialog.group_member_moderation.select_user') }}
|
||||
br
|
||||
br
|
||||
span.name {{ $t('dialog.group_member_moderation.selected_users') }}
|
||||
el-button(type="default" @click="clearSelectedGroupMembers" size="mini" icon="el-icon-delete" circle style="margin-left:5px")
|
||||
br
|
||||
el-tag(v-for="user in groupMemberModeration.selectedUsersArray" type="info" disable-transitions="true" :key="user.id" style="margin-right:5px;margin-top:5px" closable @close="deleteSelectedGroupMember(user)")
|
||||
span {{ user.user?.displayName }} #[i.el-icon-warning(v-if="user.membershipStatus !== 'member'" style="margin-left:5px")]
|
||||
br
|
||||
br
|
||||
span.name {{ $t('dialog.group_member_moderation.notes') }}
|
||||
el-input.extra(v-model="groupMemberModeration.note" type="textarea" :rows="2" :autosize="{ minRows: 1, maxRows: 20 }" :placeholder="$t('dialog.group_member_moderation.note_placeholder')" size="mini" resize="none" style="margin-top:5px")
|
||||
br
|
||||
br
|
||||
span.name {{ $t('dialog.group_member_moderation.selected_roles') }}
|
||||
br
|
||||
el-select(v-model="groupMemberModeration.selectedRoles" clearable multiple :placeholder="$t('dialog.group_member_moderation.choose_roles_placeholder')" filterable style="margin-top:5px")
|
||||
el-option-group(:label="$t('dialog.group_member_moderation.roles')")
|
||||
el-option.x-friend-item(v-for="role in groupMemberModeration.groupRef.roles" :key="role.id" :label="role.name" :value="role.id" style="height:auto")
|
||||
.detail
|
||||
span.name(v-text="role.name")
|
||||
br
|
||||
br
|
||||
span.name {{ $t('dialog.group_member_moderation.actions') }}
|
||||
br
|
||||
el-button(@click="groupMembersAddRoles" :disabled="!groupMemberModeration.selectedRoles.length || groupMemberModeration.progressCurrent || !hasGroupPermission(groupDialog.ref, 'group-roles-assign')") {{ $t('dialog.group_member_moderation.add_roles') }}
|
||||
el-button(@click="groupMembersRemoveRoles" :disabled="!groupMemberModeration.selectedRoles.length || groupMemberModeration.progressCurrent || !hasGroupPermission(groupDialog.ref, 'group-roles-assign')") {{ $t('dialog.group_member_moderation.remove_roles') }}
|
||||
el-button(@click="groupMembersSaveNote" :disabled="groupMemberModeration.progressCurrent || !hasGroupPermission(groupDialog.ref, 'group-members-manage')") {{ $t('dialog.group_member_moderation.save_note') }}
|
||||
el-button(@click="groupMembersKick" :disabled="groupMemberModeration.progressCurrent || !hasGroupPermission(groupDialog.ref, 'group-members-remove')") {{ $t('dialog.group_member_moderation.kick') }}
|
||||
el-button(@click="groupMembersBan" :disabled="groupMemberModeration.progressCurrent || !hasGroupPermission(groupDialog.ref, 'group-bans-manage')") {{ $t('dialog.group_member_moderation.ban') }}
|
||||
el-button(@click="groupMembersUnban" :disabled="groupMemberModeration.progressCurrent || !hasGroupPermission(groupDialog.ref, 'group-bans-manage')") {{ $t('dialog.group_member_moderation.unban') }}
|
||||
span(v-if="groupMemberModeration.progressCurrent" style="margin-top:10px") #[i.el-icon-loading(style="margin-left:5px;margin-right:5px")] {{ $t('dialog.group_member_moderation.progress') }} {{ groupMemberModeration.progressCurrent }}/{{ groupMemberModeration.progressTotal }}
|
||||
el-button(v-if="groupMemberModeration.progressCurrent" @click="groupMemberModeration.progressTotal = 0" style="margin-left:5px") {{ $t('dialog.group_member_moderation.cancel') }}
|
||||
|
||||
//- dialog: group posts
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="groupPostEditDialog" :visible.sync="groupPostEditDialog.visible" :title="$t('dialog.group_post_edit.header')" width="650px")
|
||||
div(v-if="groupPostEditDialog.visible")
|
||||
h3(v-text="groupPostEditDialog.groupRef.name")
|
||||
el-form(:model="groupPostEditDialog" label-width="150px")
|
||||
el-form-item(:label="$t('dialog.group_post_edit.title')")
|
||||
el-input(v-model="groupPostEditDialog.title" size="mini")
|
||||
el-form-item(:label="$t('dialog.group_post_edit.message')")
|
||||
el-input(v-model="groupPostEditDialog.text" type="textarea" :rows="4" :autosize="{ minRows: 4, maxRows: 20 }" style="margin-top:10px" resize="none")
|
||||
el-form-item
|
||||
el-checkbox(v-if="!groupPostEditDialog.postId" v-model="groupPostEditDialog.sendNotification" size="small") {{ $t('dialog.group_post_edit.send_notification') }}
|
||||
el-form-item(:label="$t('dialog.group_post_edit.post_visibility')")
|
||||
el-radio-group(v-model="groupPostEditDialog.visibility" size="small")
|
||||
el-radio(label="public") {{ $t('dialog.group_post_edit.visibility_public') }}
|
||||
el-radio(label="group") {{ $t('dialog.group_post_edit.visibility_group') }}
|
||||
el-form-item(v-if="groupPostEditDialog.visibility === 'group'" :label="$t('dialog.new_instance.roles')")
|
||||
el-select(v-model="groupPostEditDialog.roleIds" multiple clearable :placeholder="$t('dialog.new_instance.role_placeholder')" style="width:100%")
|
||||
el-option-group(:label="$t('dialog.new_instance.role_placeholder')")
|
||||
el-option.x-friend-item(v-for="role in groupPostEditDialog.groupRef?.roles" :key="role.id" :label="role.name" :value="role.id" style="height:auto;width:478px")
|
||||
.detail
|
||||
span.name(v-text="role.name")
|
||||
el-form-item(:label="$t('dialog.group_post_edit.image')")
|
||||
template(v-if="gallerySelectDialog.selectedFileId")
|
||||
div(style="display:inline-block;flex:none;margin-right:5px")
|
||||
el-popover(placement="right" width="500px" trigger="click")
|
||||
img.x-link(slot="reference" v-lazy="gallerySelectDialog.selectedImageUrl" style="flex:none;width:60px;height:60px;border-radius:4px;object-fit:cover")
|
||||
img.x-link(v-lazy="gallerySelectDialog.selectedImageUrl" style="height:500px" @click="showFullscreenImageDialog(gallerySelectDialog.selectedImageUrl)")
|
||||
el-button(size="mini" @click="clearImageGallerySelect" style="vertical-align:top") {{ $t('dialog.invite_message.clear_selected_image') }}
|
||||
template(v-else)
|
||||
el-button(size="mini" @click="showGallerySelectDialog" style="margin-right:5px") {{ $t('dialog.invite_message.select_image') }}
|
||||
|
||||
template(#footer)
|
||||
el-button(size="small" @click="groupPostEditDialog.visible = false") {{ $t('dialog.group_post_edit.cancel') }}
|
||||
el-button(v-if="groupPostEditDialog.postId" size="small" @click="editGroupPost") {{ $t('dialog.group_post_edit.edit_post') }}
|
||||
el-button(v-else size="small" @click="createGroupPost") {{ $t('dialog.group_post_edit.create_post') }}
|
||||
60
html/src/mixins/dialogs/images.pug
Normal file
60
html/src/mixins/dialogs/images.pug
Normal file
@@ -0,0 +1,60 @@
|
||||
mixin images()
|
||||
//- dialog: Change avatar image
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="changeAvatarImageDialog" :visible.sync="changeAvatarImageDialogVisible" :title="$t('dialog.change_content_image.avatar')" width="850px")
|
||||
div(v-if="changeAvatarImageDialogVisible" v-loading="changeAvatarImageDialogLoading")
|
||||
input(type="file" accept="image/png,image/jpg,image/jpeg,image/webp,image/bmp,image/gif" @change="onFileChangeAvatarImage" id="AvatarImageUploadButton" style="display:none")
|
||||
span {{ $t('dialog.change_content_image.description') }}
|
||||
br
|
||||
el-button-group(style="padding-bottom:10px;padding-top:10px")
|
||||
el-button(type="default" size="small" @click="displayPreviousImages('Avatar', 'Change')" icon="el-icon-refresh") {{ $t('dialog.change_content_image.refresh') }}
|
||||
el-button(type="default" size="small" @click="uploadAvatarImage" icon="el-icon-upload2") {{ $t('dialog.change_content_image.upload') }}
|
||||
//- el-button(type="default" size="small" @click="deleteAvatarImage" icon="el-icon-delete") Delete Latest Image
|
||||
br
|
||||
div(style="display:inline-block" v-for="image in previousImagesTable" :key="image.version" v-if="image.file")
|
||||
.x-change-image-item(@click="setAvatarImage(image)" style="cursor:pointer" :class="{ 'current-image': compareCurrentImage(image) }")
|
||||
img.image(v-lazy="image.file.url")
|
||||
|
||||
//- dialog: Change world image
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="changeWorldImageDialog" :visible.sync="changeWorldImageDialogVisible" :title="$t('dialog.change_content_image.world')" width="850px")
|
||||
div(v-if="changeWorldImageDialogVisible" v-loading="changeWorldImageDialogLoading")
|
||||
input(type="file" accept="image/png,image/jpg,image/jpeg,image/webp,image/bmp,image/gif" @change="onFileChangeWorldImage" id="WorldImageUploadButton" style="display:none")
|
||||
span {{ $t('dialog.change_content_image.description') }}
|
||||
br
|
||||
el-button-group(style="padding-bottom:10px;padding-top:10px")
|
||||
el-button(type="default" size="small" @click="displayPreviousImages('World', 'Change')" icon="el-icon-refresh") {{ $t('dialog.change_content_image.refresh') }}
|
||||
el-button(type="default" size="small" @click="uploadWorldImage" icon="el-icon-upload2") {{ $t('dialog.change_content_image.upload') }}
|
||||
//- el-button(type="default" size="small" @click="deleteWorldImage" icon="el-icon-delete") Delete Latest Image
|
||||
br
|
||||
div(style="display:inline-block" v-for="image in previousImagesTable" :key="image.version" v-if="image.file")
|
||||
.x-change-image-item(@click="setWorldImage(image)" style="cursor:pointer" :class="{ 'current-image': compareCurrentImage(image) }")
|
||||
img.image(v-lazy="image.file.url")
|
||||
|
||||
//- dialog: Display previous avatar/world images
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="previousImagesDialog" :visible.sync="previousImagesDialogVisible" :title="$t('dialog.previous_images.header')" width="800px")
|
||||
div(v-if="previousImagesDialogVisible")
|
||||
div(style="display:inline-block" v-for="image in previousImagesTable" :key="image.version" v-if="image.file")
|
||||
el-popover.x-change-image-item(placement="right" width="500px" trigger="click")
|
||||
img.x-link(slot="reference" v-lazy="image.file.url")
|
||||
img.x-link(v-lazy="image.file.url" style="width:500px;height:375px" @click="showFullscreenImageDialog(image.file.url)")
|
||||
|
||||
//- dialog: gallery select
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="gallerySelectDialog" :visible.sync="gallerySelectDialog.visible" :title="$t('dialog.gallery_select.header')" width="100%")
|
||||
div(v-if="gallerySelectDialog.visible")
|
||||
span(slot="label") {{ $t('dialog.gallery_select.gallery') }}
|
||||
span(style="color:#909399;font-size:12px;margin-left:5px") {{ galleryTable.length }}/64
|
||||
br
|
||||
input(type="file" accept="image/png,image/jpg,image/jpeg,image/webp,image/bmp,image/gif" @change="onFileChangeGallery" id="GalleryUploadButton" style="display:none")
|
||||
el-button-group
|
||||
el-button(type="default" size="small" @click="selectImageGallerySelect('', '')" icon="el-icon-close") {{ $t('dialog.gallery_select.none') }}
|
||||
el-button(type="default" size="small" @click="refreshGalleryTable" icon="el-icon-refresh") {{ $t('dialog.gallery_select.refresh') }}
|
||||
el-button(type="default" size="small" @click="displayGalleryUpload" icon="el-icon-upload2" :disabled="!API.currentUser.$isVRCPlus") {{ $t('dialog.gallery_select.upload') }}
|
||||
br
|
||||
.x-friend-item(v-if="image.versions && image.versions.length > 0" v-for="image in galleryTable" :key="image.id" style="display:inline-block;margin-top:10px;width:unset;cursor:default")
|
||||
.vrcplus-icon(v-if="image.versions[image.versions.length - 1].file.url" @click="selectImageGallerySelect(image.versions[image.versions.length - 1].file.url, image.id)")
|
||||
img.avatar(v-lazy="image.versions[image.versions.length - 1].file.url")
|
||||
|
||||
//- dialog: full screen image
|
||||
el-dialog.x-dialog(ref="fullscreenImageDialog" :before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" :visible.sync="fullscreenImageDialog.visible" top="3vh" width="97vw")
|
||||
el-button(@click="copyImageUrl(fullscreenImageDialog.imageUrl)" size="mini" icon="el-icon-s-order" circle)
|
||||
el-button(type="default" size="mini" icon="el-icon-download" circle @click="downloadAndSaveImage(fullscreenImageDialog.imageUrl)" style="margin-left:5px")
|
||||
img(v-lazy="fullscreenImageDialog.imageUrl" style="width:100%;height:100vh;object-fit:contain")
|
||||
170
html/src/mixins/dialogs/invites.pug
Normal file
170
html/src/mixins/dialogs/invites.pug
Normal file
@@ -0,0 +1,170 @@
|
||||
mixin invites()
|
||||
//- dialog: invite
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="inviteDialog" :visible.sync="inviteDialog.visible" :title="$t('dialog.invite.header')" width="500px")
|
||||
div(v-if="inviteDialog.visible" v-loading="inviteDialog.loading")
|
||||
location(:location="inviteDialog.worldId" :link="false")
|
||||
br
|
||||
el-button(size="mini" v-text="$t('dialog.invite.add_self')" @click="addSelfToInvite" style="margin-top:10px")
|
||||
el-button(size="mini" v-text="$t('dialog.invite.add_friends_in_instance')" @click="addFriendsInInstanceToInvite" :disabled="inviteDialog.friendsInInstance.length === 0" style="margin-top:10px")
|
||||
el-button(size="mini" v-text="$t('dialog.invite.add_favorite_friends')" @click="addFavoriteFriendsToInvite" :disabled="vipFriends.length === 0" style="margin-top:10px")
|
||||
el-select(v-model="inviteDialog.userIds" multiple clearable :placeholder="$t('dialog.invite.select_placeholder')" filterable :disabled="inviteDialog.loading" style="width:100%;margin-top:15px")
|
||||
el-option-group(v-if="API.currentUser" :label="$t('side_panel.me')")
|
||||
el-option.x-friend-item(:label="API.currentUser.displayName" :value="API.currentUser.id" style="height:auto")
|
||||
.avatar(:class="userStatusClass(API.currentUser)")
|
||||
img(v-lazy="userImage(API.currentUser)")
|
||||
.detail
|
||||
span.name(v-text="API.currentUser.displayName")
|
||||
el-option-group(v-if="inviteDialog.friendsInInstance.length" :label="$t('dialog.invite.friends_in_instance')")
|
||||
el-option.x-friend-item(v-for="friend in inviteDialog.friendsInInstance" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto")
|
||||
template(v-if="friend.ref")
|
||||
.avatar(:class="userStatusClass(friend.ref)")
|
||||
img(v-lazy="userImage(friend.ref)")
|
||||
.detail
|
||||
span.name(v-text="friend.ref.displayName" :style="{'color':friend.ref.$userColour}")
|
||||
span(v-else v-text="friend.id")
|
||||
el-option-group(v-if="vipFriends.length" :label="$t('side_panel.favorite')")
|
||||
el-option.x-friend-item(v-for="friend in vipFriends" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto")
|
||||
template(v-if="friend.ref")
|
||||
.avatar(:class="userStatusClass(friend.ref)")
|
||||
img(v-lazy="userImage(friend.ref)")
|
||||
.detail
|
||||
span.name(v-text="friend.ref.displayName" :style="{'color':friend.ref.$userColour}")
|
||||
span(v-else v-text="friend.id")
|
||||
el-option-group(v-if="onlineFriends.length" :label="$t('side_panel.online')")
|
||||
el-option.x-friend-item(v-for="friend in onlineFriends" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto")
|
||||
template(v-if="friend.ref")
|
||||
.avatar(:class="userStatusClass(friend.ref)")
|
||||
img(v-lazy="userImage(friend.ref)")
|
||||
.detail
|
||||
span.name(v-text="friend.ref.displayName" :style="{'color':friend.ref.$userColour}")
|
||||
span(v-else v-text="friend.id")
|
||||
el-option-group(v-if="activeFriends.length" :label="$t('side_panel.active')")
|
||||
el-option.x-friend-item(v-for="friend in activeFriends" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto")
|
||||
template(v-if="friend.ref")
|
||||
.avatar
|
||||
img(v-lazy="userImage(friend.ref)")
|
||||
.detail
|
||||
span.name(v-text="friend.ref.displayName" :style="{'color':friend.ref.$userColour}")
|
||||
span(v-else v-text="friend.id")
|
||||
template(#footer)
|
||||
el-button(size="small" :disabled="inviteDialog.loading || !inviteDialog.userIds.length" @click="showSendInviteDialog()") {{ $t('dialog.invite.invite_with_message') }}
|
||||
el-button(type="primary" size="small" :disabled="inviteDialog.loading || !inviteDialog.userIds.length" @click="sendInvite()") {{ $t('dialog.invite.invite') }}
|
||||
|
||||
//- dialog: Edit Invite Message
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="editInviteMessageDialog" :visible.sync="editInviteMessageDialog.visible" :title="$t('dialog.edit_invite_message.header')" width="400px")
|
||||
div(style='font-size:12px')
|
||||
span {{ $t('dialog.edit_invite_message.description') }}
|
||||
el-input(type="textarea" v-model="editInviteMessageDialog.newMessage" size="mini" maxlength="64" show-word-limit :autosize="{ minRows:2, maxRows:5 }" placeholder="" style="margin-top:10px")
|
||||
template(#footer)
|
||||
el-button(type="small" @click="cancelEditInviteMessage") {{ $t('dialog.edit_invite_message.cancel') }}
|
||||
el-button(type="primary" size="small" @click="saveEditInviteMessage") {{ $t('dialog.edit_invite_message.save') }}
|
||||
|
||||
//- dialog: Edit And Send Invite Response Message
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="editAndSendInviteResponseDialog" :visible.sync="editAndSendInviteResponseDialog.visible" :title="$t('dialog.edit_send_invite_response_message.header')" width="400px")
|
||||
div(style='font-size:12px')
|
||||
span {{ $t('dialog.edit_send_invite_response_message.description') }}
|
||||
el-input(type="textarea" v-model="editAndSendInviteResponseDialog.newMessage" size="mini" maxlength="64" show-word-limit :autosize="{ minRows:2, maxRows:5 }" placeholder="" style="margin-top:10px")
|
||||
template(#footer)
|
||||
el-button(type="small" @click="cancelEditAndSendInviteResponse") {{ $t('dialog.edit_send_invite_response_message.cancel') }}
|
||||
el-button(type="primary" size="small" @click="saveEditAndSendInviteResponse") {{ $t('dialog.edit_send_invite_response_message.send') }}
|
||||
|
||||
//- dialog Table: Send Invite Response Message
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="sendInviteResponseDialog" :visible.sync="sendInviteResponseDialogVisible" :title="$t('dialog.invite_response_message.header')" width="800px")
|
||||
template(v-if="API.currentUser.$isVRCPlus")
|
||||
input.inviteImageUploadButton(type="file" accept="image/png,image/jpg,image/jpeg,image/webp,image/bmp,image/gif" @change="inviteImageUpload")
|
||||
data-tables(v-if="sendInviteResponseDialogVisible" v-bind="inviteResponseMessageTable" @row-click="showSendInviteResponseConfirmDialog" style="margin-top:10px;cursor:pointer")
|
||||
el-table-column(:label="$t('table.profile.invite_messages.slot')" prop="slot" sortable="custom" width="70")
|
||||
el-table-column(:label="$t('table.profile.invite_messages.message')" prop="message")
|
||||
el-table-column(:label="$t('table.profile.invite_messages.cool_down')" prop="updatedAt" sortable="custom" width="110" align="right")
|
||||
template(v-once #default="scope")
|
||||
countdown-timer(:datetime="scope.row.updatedAt" :hours="1")
|
||||
el-table-column(:label="$t('table.profile.invite_messages.action')" width="70" align="right")
|
||||
template(v-once #default="scope")
|
||||
el-button(type="text" icon="el-icon-edit" size="mini" @click="showEditAndSendInviteResponseDialog('response', scope.row)")
|
||||
template(#footer)
|
||||
el-button(type="small" @click="cancelSendInviteResponse") {{ $t('dialog.invite_response_message.cancel') }}
|
||||
el-button(type="small" @click="API.refreshInviteMessageTableData('response')") {{ $t('dialog.invite_response_message.refresh') }}
|
||||
|
||||
//- dialog Table: Send Invite Request Response Message
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="sendInviteRequestResponseDialog" :visible.sync="sendInviteRequestResponseDialogVisible" :title="$t('dialog.invite_request_response_message.header')" width="800px")
|
||||
template(v-if="API.currentUser.$isVRCPlus")
|
||||
input.inviteImageUploadButton(type="file" accept="image/png,image/jpg,image/jpeg,image/webp,image/bmp,image/gif" @change="inviteImageUpload")
|
||||
data-tables(v-if="sendInviteRequestResponseDialogVisible" v-bind="inviteRequestResponseMessageTable" @row-click="showSendInviteResponseConfirmDialog" style="margin-top:10px;cursor:pointer")
|
||||
el-table-column(:label="$t('table.profile.invite_messages.slot')" prop="slot" sortable="custom" width="70")
|
||||
el-table-column(:label="$t('table.profile.invite_messages.message')" prop="message")
|
||||
el-table-column(:label="$t('table.profile.invite_messages.cool_down')" prop="updatedAt" sortable="custom" width="110" align="right")
|
||||
template(v-once #default="scope")
|
||||
countdown-timer(:datetime="scope.row.updatedAt" :hours="1")
|
||||
el-table-column(:label="$t('table.profile.invite_messages.action')" width="70" align="right")
|
||||
template(v-once #default="scope")
|
||||
el-button(type="text" icon="el-icon-edit" size="mini" @click="showEditAndSendInviteResponseDialog('requestResponse', scope.row)")
|
||||
template(#footer)
|
||||
el-button(type="small" @click="cancelSendInviteRequestResponse") {{ $t('dialog.invite_request_response_message.cancel') }}
|
||||
el-button(type="small" @click="API.refreshInviteMessageTableData('requestResponse')") {{ $t('dialog.invite_request_response_message.refresh') }}
|
||||
|
||||
//- dialog: Send Invite Response Message Confirm
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="sendInviteResponseConfirmDialog" :visible.sync="sendInviteResponseConfirmDialog.visible" :title="$t('dialog.invite_response_message.header')" width="400px")
|
||||
div(style='font-size:12px')
|
||||
span {{ $t('dialog.invite_response_message.confirmation') }}
|
||||
template(#footer)
|
||||
el-button(type="small" @click="cancelInviteResponseConfirm") {{ $t('dialog.invite_response_message.cancel') }}
|
||||
el-button(type="primary" size="small" @click="sendInviteResponseConfirm") {{ $t('dialog.invite_response_message.confirm') }}
|
||||
|
||||
//- dialog Table: Send Invite Message
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="sendInviteDialog" :visible.sync="sendInviteDialogVisible" :title="$t('dialog.invite_message.header')" width="800px")
|
||||
template(v-if="API.currentUser.$isVRCPlus")
|
||||
//- template(v-if="gallerySelectDialog.selectedFileId")
|
||||
//- div(style="display:inline-block;flex:none;margin-right:5px")
|
||||
//- el-popover(placement="right" width="500px" trigger="click")
|
||||
//- img.x-link(slot="reference" v-lazy="gallerySelectDialog.selectedImageUrl" style="flex:none;width:60px;height:60px;border-radius:4px;object-fit:cover")
|
||||
//- img.x-link(v-lazy="gallerySelectDialog.selectedImageUrl" style="height:500px" @click="showFullscreenImageDialog(gallerySelectDialog.selectedImageUrl)")
|
||||
//- el-button(size="mini" @click="clearImageGallerySelect" style="vertical-align:top") {{ $t('dialog.invite_message.clear_selected_image') }}
|
||||
//- template(v-else)
|
||||
//- el-button(size="mini" @click="showGallerySelectDialog" style="margin-right:5px") {{ $t('dialog.invite_message.select_image') }}
|
||||
input.inviteImageUploadButton(type="file" accept="image/png,image/jpg,image/jpeg,image/webp,image/bmp,image/gif" @change="inviteImageUpload")
|
||||
data-tables(v-if="sendInviteDialogVisible" v-bind="inviteMessageTable" @row-click="showSendInviteConfirmDialog" style="margin-top:10px;cursor:pointer")
|
||||
el-table-column(:label="$t('table.profile.invite_messages.slot')" prop="slot" sortable="custom" width="70")
|
||||
el-table-column(:label="$t('table.profile.invite_messages.message')" prop="message")
|
||||
el-table-column(:label="$t('table.profile.invite_messages.cool_down')" prop="updatedAt" sortable="custom" width="110" align="right")
|
||||
template(v-once #default="scope")
|
||||
countdown-timer(:datetime="scope.row.updatedAt" :hours="1")
|
||||
el-table-column(:label="$t('table.profile.invite_messages.action')" width="70" align="right")
|
||||
template(v-once #default="scope")
|
||||
el-button(type="text" icon="el-icon-edit" size="mini" @click="showEditAndSendInviteDialog('message', scope.row)")
|
||||
template(#footer)
|
||||
el-button(type="small" @click="cancelSendInvite") {{ $t('dialog.invite_message.cancel') }}
|
||||
el-button(type="small" @click="API.refreshInviteMessageTableData('message')") {{ $t('dialog.invite_message.refresh') }}
|
||||
|
||||
//- dialog Table: Send Invite Request Message
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="sendInviteRequestDialog" :visible.sync="sendInviteRequestDialogVisible" :title="$t('dialog.invite_request_message.header')" width="800px")
|
||||
template(v-if="API.currentUser.$isVRCPlus")
|
||||
input.inviteImageUploadButton(type="file" accept="image/png,image/jpg,image/jpeg,image/webp,image/bmp,image/gif" @change="inviteImageUpload")
|
||||
data-tables(v-if="sendInviteRequestDialogVisible" v-bind="inviteRequestMessageTable" @row-click="showSendInviteConfirmDialog" style="margin-top:10px;cursor:pointer")
|
||||
el-table-column(:label="$t('table.profile.invite_messages.slot')" prop="slot" sortable="custom" width="70")
|
||||
el-table-column(:label="$t('table.profile.invite_messages.message')" prop="message")
|
||||
el-table-column(:label="$t('table.profile.invite_messages.cool_down')" prop="updatedAt" sortable="custom" width="110" align="right")
|
||||
template(v-once #default="scope")
|
||||
countdown-timer(:datetime="scope.row.updatedAt" :hours="1")
|
||||
el-table-column(:label="$t('table.profile.invite_messages.action')" width="70" align="right")
|
||||
template(v-once #default="scope")
|
||||
el-button(type="text" icon="el-icon-edit" size="mini" @click="showEditAndSendInviteDialog('request', scope.row)")
|
||||
template(#footer)
|
||||
el-button(type="small" @click="cancelSendInviteRequest") {{ $t('dialog.invite_request_message.cancel') }}
|
||||
el-button(type="small" @click="API.refreshInviteMessageTableData('request')") {{ $t('dialog.invite_request_message.refresh') }}
|
||||
|
||||
//- dialog: Send Invite Message Confirm
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="sendInviteConfirmDialog" :visible.sync="sendInviteConfirmDialog.visible" :title="$t('dialog.invite_message.header')" width="400px")
|
||||
div(style='font-size:12px')
|
||||
span {{ $t('dialog.invite_message.confirmation') }}
|
||||
template(#footer)
|
||||
el-button(type="small" @click="cancelInviteConfirm") {{ $t('dialog.invite_message.cancel') }}
|
||||
el-button(type="primary" size="small" @click="sendInviteConfirm") {{ $t('dialog.invite_message.confirm') }}
|
||||
|
||||
//- dialog: Edit And Send Invite Message
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="editAndSendInviteDialog" :visible.sync="editAndSendInviteDialog.visible" :title="$t('dialog.edit_send_invite_message.header')" width="400px")
|
||||
div(style='font-size:12px')
|
||||
span {{ $t('dialog.edit_send_invite_message.description') }}
|
||||
el-input(type="textarea" v-model="editAndSendInviteDialog.newMessage" size="mini" maxlength="64" show-word-limit :autosize="{ minRows:2, maxRows:5 }" placeholder="" style="margin-top:10px")
|
||||
template(#footer)
|
||||
el-button(type="small" @click="cancelEditAndSendInvite") {{ $t('dialog.edit_send_invite_message.cancel') }}
|
||||
el-button(type="primary" size="small" @click="saveEditAndSendInvite") {{ $t('dialog.edit_send_invite_message.send') }}
|
||||
38
html/src/mixins/dialogs/launch.pug
Normal file
38
html/src/mixins/dialogs/launch.pug
Normal file
@@ -0,0 +1,38 @@
|
||||
mixin launch()
|
||||
//- dialog: launch
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="launchDialog" :visible.sync="launchDialog.visible" :title="$t('dialog.launch.header')" width="450px")
|
||||
el-form(:model="launchDialog" label-width="80px")
|
||||
el-form-item(:label="$t('dialog.launch.url')")
|
||||
el-input(v-model="launchDialog.url" size="mini" @click.native="$event.target.tagName === 'INPUT' && $event.target.select()" style="width:260px")
|
||||
el-tooltip(placement="right" :content="$t('dialog.launch.copy_tooltip')" :disabled="hideTooltips")
|
||||
el-button(@click="copyInstanceMessage(launchDialog.url)" size="mini" icon="el-icon-s-order" style="margin-right:5px" circle)
|
||||
el-form-item(v-if="launchDialog.shortUrl" :label="$t('dialog.launch.short_url')")
|
||||
el-tooltip(placement="top" style="margin-left:5px" :content="$t('dialog.launch.short_url_notice')")
|
||||
i.el-icon-warning
|
||||
el-input(v-model="launchDialog.shortUrl" size="mini" @click.native="$event.target.tagName === 'INPUT' && $event.target.select()" style="width:241px")
|
||||
el-tooltip(placement="right" :content="$t('dialog.launch.copy_tooltip')" :disabled="hideTooltips")
|
||||
el-button(@click="copyInstanceMessage(launchDialog.shortUrl)" size="mini" icon="el-icon-s-order" style="margin-right:5px" circle)
|
||||
el-form-item(:label="$t('dialog.launch.location')")
|
||||
el-input(v-model="launchDialog.location" size="mini" @click.native="$event.target.tagName === 'INPUT' && $event.target.select()" style="width:260px")
|
||||
el-tooltip(placement="right" :content="$t('dialog.launch.copy_tooltip')" :disabled="hideTooltips")
|
||||
el-button(@click="copyInstanceMessage(launchDialog.location)" size="mini" icon="el-icon-s-order" style="margin-right:5px" circle)
|
||||
template(#footer)
|
||||
el-checkbox(v-model="launchDialog.desktop" @change="saveLaunchDialog" style="float:left;margin-top:5px") {{ $t('dialog.launch.start_as_desktop') }}
|
||||
el-button(size="small" @click="showPreviousInstanceInfoDialog(launchDialog.location)") {{ $t('dialog.launch.info') }}
|
||||
el-button(size="small" @click="showInviteDialog(launchDialog.location)" :disabled="!checkCanInvite(launchDialog.location)") {{ $t('dialog.launch.invite') }}
|
||||
el-button(type="primary" size="small" @click="launchGame(launchDialog.location, launchDialog.shortName, launchDialog.desktop)" :disabled="!launchDialog.secureOrShortName") {{ $t('dialog.launch.launch') }}
|
||||
|
||||
//- dialog: launch options
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="launchOptionsDialog" :visible.sync="launchOptionsDialog.visible" :title="$t('dialog.launch_options.header')" width="600px")
|
||||
div(style="font-size:12px")
|
||||
| {{ $t('dialog.launch_options.description') }} #[br]
|
||||
| {{ $t('dialog.launch_options.example') }} #[el-tag(size="mini") --fps=144]
|
||||
el-input(type="textarea" v-model="launchOptionsDialog.launchArguments" size="mini" show-word-limit :autosize="{ minRows:2, maxRows:5 }" placeholder="" style="margin-top:10px")
|
||||
div(style="font-size:12px;margin-top:10px")
|
||||
| {{ $t('dialog.launch_options.path_override') }}
|
||||
el-input(type="textarea" v-model="launchOptionsDialog.vrcLaunchPathOverride" placeholder="C:\\Program Files (x86)\\Steam\\steamapps\\common\\VRChat" :rows="1" style="display:block;margin-top:10px")
|
||||
template(#footer)
|
||||
div(style="display:flex")
|
||||
el-button(size="small" @click="openExternalLink('https://docs.vrchat.com/docs/launch-options')") {{ $t('dialog.launch_options.vrchat_docs') }}
|
||||
el-button(size="small" @click="openExternalLink('https://docs.unity3d.com/Manual/CommandLineArguments.html')") {{ $t('dialog.launch_options.unity_manual') }}
|
||||
el-button(type="primary" size="small" :disabled="launchOptionsDialog.loading" @click="updateLaunchOptions" style="margin-left:auto") {{ $t('dialog.launch_options.save') }}
|
||||
139
html/src/mixins/dialogs/newInstance.pug
Normal file
139
html/src/mixins/dialogs/newInstance.pug
Normal file
@@ -0,0 +1,139 @@
|
||||
mixin newInstance()
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="newInstanceDialog" :visible.sync="newInstanceDialog.visible" :title="$t('dialog.new_instance.header')" width="650px")
|
||||
el-tabs(type="card" v-model="newInstanceDialog.selectedTab")
|
||||
el-tab-pane(:label="$t('dialog.new_instance.normal')")
|
||||
el-form(v-if="newInstanceDialog.visible" :model="newInstanceDialog" label-width="150px")
|
||||
el-form-item(:label="$t('dialog.new_instance.access_type')")
|
||||
el-radio-group(v-model="newInstanceDialog.accessType" size="mini" @change="buildInstance")
|
||||
el-radio-button(label="public") {{ $t('dialog.new_instance.access_type_public') }}
|
||||
el-radio-button(label="group") {{ $t('dialog.new_instance.access_type_group') }}
|
||||
el-radio-button(label="friends+") {{ $t('dialog.new_instance.access_type_friend_plus') }}
|
||||
el-radio-button(label="friends") {{ $t('dialog.new_instance.access_type_friend') }}
|
||||
el-radio-button(label="invite+") {{ $t('dialog.new_instance.access_type_invite_plus') }}
|
||||
el-radio-button(label="invite") {{ $t('dialog.new_instance.access_type_invite') }}
|
||||
el-form-item(:label="$t('dialog.new_instance.group_access_type')" v-if="newInstanceDialog.accessType === 'group'")
|
||||
el-radio-group(v-model="newInstanceDialog.groupAccessType" size="mini" @change="buildInstance")
|
||||
el-radio-button(label="members" :disabled="!hasGroupPermission(newInstanceDialog.groupRef, 'group-instance-open-create')") {{ $t('dialog.new_instance.group_access_type_members') }}
|
||||
el-radio-button(label="plus" :disabled="!hasGroupPermission(newInstanceDialog.groupRef, 'group-instance-plus-create')") {{ $t('dialog.new_instance.group_access_type_plus') }}
|
||||
el-radio-button(label="public" :disabled="!hasGroupPermission(newInstanceDialog.groupRef, 'group-instance-public-create') || newInstanceDialog.groupRef.privacy === 'private'") {{ $t('dialog.new_instance.group_access_type_public') }}
|
||||
el-form-item(:label="$t('dialog.new_instance.region')")
|
||||
el-radio-group(v-model="newInstanceDialog.region" size="mini" @change="buildInstance")
|
||||
el-radio-button(label="US West") {{ $t('dialog.new_instance.region_usw') }}
|
||||
el-radio-button(label="US East") {{ $t('dialog.new_instance.region_use') }}
|
||||
el-radio-button(label="Europe") {{ $t('dialog.new_instance.region_eu') }}
|
||||
el-radio-button(label="Japan") {{ $t('dialog.new_instance.region_jp') }}
|
||||
el-form-item(:label="$t('dialog.new_instance.queueEnabled')" v-if="newInstanceDialog.accessType === 'group'")
|
||||
el-checkbox(v-model="newInstanceDialog.queueEnabled" @change="buildInstance")
|
||||
el-form-item(:label="$t('dialog.new_instance.world_id')")
|
||||
el-input(v-model="newInstanceDialog.worldId" size="mini" @click.native="$event.target.tagName === 'INPUT' && $event.target.select()" @change="buildInstance")
|
||||
el-form-item(:label="$t('dialog.new_instance.group_id')" v-if="newInstanceDialog.accessType === 'group'")
|
||||
el-select(v-model="newInstanceDialog.groupId" clearable :placeholder="$t('dialog.new_instance.group_placeholder')" filterable style="width:100%" @change="buildInstance")
|
||||
el-option-group(:label="$t('dialog.new_instance.group_placeholder')")
|
||||
el-option.x-friend-item(v-if="group && (hasGroupPermission(group, 'group-instance-public-create') || hasGroupPermission(group, 'group-instance-plus-create') || hasGroupPermission(group, 'group-instance-open-create'))" v-for="group in API.currentUserGroups.values()" :key="group.id" :label="group.name" :value="group.id" style="height:auto;width:478px")
|
||||
.avatar
|
||||
img(v-lazy="group.iconUrl")
|
||||
.detail
|
||||
span.name(v-text="group.name")
|
||||
el-form-item(:label="$t('dialog.new_instance.roles')" v-if="newInstanceDialog.accessType === 'group' && newInstanceDialog.groupAccessType === 'members'")
|
||||
el-select(v-model="newInstanceDialog.roleIds" multiple clearable :placeholder="$t('dialog.new_instance.role_placeholder')" style="width:100%" @change="buildInstance")
|
||||
el-option-group(:label="$t('dialog.new_instance.role_placeholder')")
|
||||
el-option.x-friend-item(v-for="role in newInstanceDialog.selectedGroupRoles" :key="role.id" :label="role.name" :value="role.id" style="height:auto;width:478px")
|
||||
.detail
|
||||
span.name(v-text="role.name")
|
||||
template(v-if="newInstanceDialog.instanceCreated")
|
||||
el-form-item(:label="$t('dialog.new_instance.location')")
|
||||
el-input(v-model="newInstanceDialog.location" size="mini" readonly @click.native="$event.target.tagName === 'INPUT' && $event.target.select()")
|
||||
el-form-item(:label="$t('dialog.new_instance.url')")
|
||||
el-input(v-model="newInstanceDialog.url" size="mini" readonly)
|
||||
el-tab-pane(:label="$t('dialog.new_instance.legacy')")
|
||||
el-form(v-if="newInstanceDialog.visible" :model="newInstanceDialog" label-width="150px")
|
||||
el-form-item(:label="$t('dialog.new_instance.access_type')")
|
||||
el-radio-group(v-model="newInstanceDialog.accessType" size="mini" @change="buildLegacyInstance")
|
||||
el-radio-button(label="public") {{ $t('dialog.new_instance.access_type_public') }}
|
||||
el-radio-button(label="group") {{ $t('dialog.new_instance.access_type_group') }}
|
||||
el-radio-button(label="friends+") {{ $t('dialog.new_instance.access_type_friend_plus') }}
|
||||
el-radio-button(label="friends") {{ $t('dialog.new_instance.access_type_friend') }}
|
||||
el-radio-button(label="invite+") {{ $t('dialog.new_instance.access_type_invite_plus') }}
|
||||
el-radio-button(label="invite") {{ $t('dialog.new_instance.access_type_invite') }}
|
||||
el-form-item(:label="$t('dialog.new_instance.group_access_type')" v-if="newInstanceDialog.accessType === 'group'")
|
||||
el-radio-group(v-model="newInstanceDialog.groupAccessType" size="mini" @change="buildLegacyInstance")
|
||||
el-radio-button(label="members") {{ $t('dialog.new_instance.group_access_type_members') }}
|
||||
el-radio-button(label="plus") {{ $t('dialog.new_instance.group_access_type_plus') }}
|
||||
el-radio-button(label="public") {{ $t('dialog.new_instance.group_access_type_public') }}
|
||||
//- el-form-item(label="Strict" v-if="newInstanceDialog.accessType === 'friends' || newInstanceDialog.accessType === 'invite'")
|
||||
//- el-checkbox(v-model="newInstanceDialog.strict") Prevent non friends joining via URL/Instance ID
|
||||
el-form-item(:label="$t('dialog.new_instance.region')")
|
||||
el-radio-group(v-model="newInstanceDialog.region" size="mini" @change="buildLegacyInstance")
|
||||
el-radio-button(label="US West") {{ $t('dialog.new_instance.region_usw') }}
|
||||
el-radio-button(label="US East") {{ $t('dialog.new_instance.region_use') }}
|
||||
el-radio-button(label="Europe") {{ $t('dialog.new_instance.region_eu') }}
|
||||
el-radio-button(label="Japan") {{ $t('dialog.new_instance.region_jp') }}
|
||||
el-form-item(:label="$t('dialog.new_instance.world_id')")
|
||||
el-input(v-model="newInstanceDialog.worldId" size="mini" @click.native="$event.target.tagName === 'INPUT' && $event.target.select()" @change="buildLegacyInstance")
|
||||
el-form-item(:label="$t('dialog.new_instance.instance_id')")
|
||||
el-input(v-model="newInstanceDialog.instanceName" :placeholder="$t('dialog.new_instance.instance_id_placeholder')" size="mini" @change="buildLegacyInstance")
|
||||
el-form-item(:label="$t('dialog.new_instance.instance_creator')" v-if="newInstanceDialog.accessType !== 'public' && newInstanceDialog.accessType !== 'group'")
|
||||
el-select(v-model="newInstanceDialog.userId" clearable :placeholder="$t('dialog.new_instance.instance_creator_placeholder')" filterable style="width:100%" @change="buildLegacyInstance")
|
||||
el-option-group(v-if="API.currentUser" :label="$t('side_panel.me')")
|
||||
el-option.x-friend-item(:label="API.currentUser.displayName" :value="API.currentUser.id" style="height:auto")
|
||||
.avatar(:class="userStatusClass(API.currentUser)")
|
||||
img(v-lazy="userImage(API.currentUser)")
|
||||
.detail
|
||||
span.name(v-text="API.currentUser.displayName")
|
||||
el-option-group(v-if="vipFriends.length" :label="$t('side_panel.favorite')")
|
||||
el-option.x-friend-item(v-for="friend in vipFriends" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto")
|
||||
template(v-if="friend.ref")
|
||||
.avatar(:class="userStatusClass(friend.ref)")
|
||||
img(v-lazy="userImage(friend.ref)")
|
||||
.detail
|
||||
span.name(v-text="friend.ref.displayName" :style="{'color':friend.ref.$userColour}")
|
||||
span(v-else v-text="friend.id")
|
||||
el-option-group(v-if="onlineFriends.length" :label="$t('side_panel.online')")
|
||||
el-option.x-friend-item(v-for="friend in onlineFriends" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto")
|
||||
template(v-if="friend.ref")
|
||||
.avatar(:class="userStatusClass(friend.ref)")
|
||||
img(v-lazy="userImage(friend.ref)")
|
||||
.detail
|
||||
span.name(v-text="friend.ref.displayName" :style="{'color':friend.ref.$userColour}")
|
||||
span(v-else v-text="friend.id")
|
||||
el-option-group(v-if="activeFriends.length" :label="$t('side_panel.active')")
|
||||
el-option.x-friend-item(v-for="friend in activeFriends" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto")
|
||||
template(v-if="friend.ref")
|
||||
.avatar
|
||||
img(v-lazy="userImage(friend.ref)")
|
||||
.detail
|
||||
span.name(v-text="friend.ref.displayName" :style="{'color':friend.ref.$userColour}")
|
||||
span(v-else v-text="friend.id")
|
||||
el-option-group(v-if="offlineFriends.length" :label="$t('side_panel.offline')")
|
||||
el-option.x-friend-item(v-for="friend in offlineFriends" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto")
|
||||
template(v-if="friend.ref")
|
||||
.avatar
|
||||
img(v-lazy="userImage(friend.ref)")
|
||||
.detail
|
||||
span.name(v-text="friend.ref.displayName" :style="{'color':friend.ref.$userColour}")
|
||||
span(v-else v-text="friend.id")
|
||||
el-form-item(:label="$t('dialog.new_instance.group_id')" v-if="newInstanceDialog.accessType === 'group'")
|
||||
el-select(v-model="newInstanceDialog.groupId" clearable :placeholder="$t('dialog.new_instance.group_placeholder')" filterable style="width:100%" @change="buildLegacyInstance")
|
||||
el-option-group(:label="$t('dialog.new_instance.group_placeholder')")
|
||||
el-option.x-friend-item(v-if="group" v-for="group in API.currentUserGroups.values()" :key="group.id" :label="group.name" :value="group.id" style="height:auto;width:478px")
|
||||
.avatar
|
||||
img(v-lazy="group.iconUrl")
|
||||
.detail
|
||||
span.name(v-text="group.name")
|
||||
el-form-item(:label="$t('dialog.new_instance.location')")
|
||||
el-input(v-model="newInstanceDialog.location" size="mini" readonly @click.native="$event.target.tagName === 'INPUT' && $event.target.select()")
|
||||
el-form-item(:label="$t('dialog.new_instance.url')")
|
||||
el-input(v-model="newInstanceDialog.url" size="mini" readonly)
|
||||
template(#footer v-if="newInstanceDialog.selectedTab === '0'")
|
||||
template(v-if="newInstanceDialog.instanceCreated")
|
||||
el-button(size="small" @click="copyInstanceUrl(newInstanceDialog.location)") {{ $t('dialog.new_instance.copy_url') }}
|
||||
el-button(size="small" @click="selfInvite(newInstanceDialog.location)") {{ $t('dialog.new_instance.self_invite') }}
|
||||
el-button(size="small" @click="showInviteDialog(newInstanceDialog.location)" :disabled="(newInstanceDialog.accessType === 'friends' || newInstanceDialog.accessType === 'invite') && newInstanceDialog.userId !== API.currentUser.id") {{ $t('dialog.new_instance.invite') }}
|
||||
el-button(type="primary" size="small" @click="showLaunchDialog(newInstanceDialog.location, newInstanceDialog.shortName)") {{ $t('dialog.new_instance.launch') }}
|
||||
template(v-else)
|
||||
el-button(type="primary" size="small" @click="createNewInstance()") {{ $t('dialog.new_instance.create_instance') }}
|
||||
template(#footer v-else-if="newInstanceDialog.selectedTab === '1'")
|
||||
el-button(size="small" @click="copyInstanceUrl(newInstanceDialog.location)") {{ $t('dialog.new_instance.copy_url') }}
|
||||
el-button(size="small" @click="selfInvite(newInstanceDialog.location)") {{ $t('dialog.new_instance.self_invite') }}
|
||||
el-button(size="small" @click="showInviteDialog(newInstanceDialog.location)" :disabled="(newInstanceDialog.accessType === 'friends' || newInstanceDialog.accessType === 'invite') && newInstanceDialog.userId !== API.currentUser.id") {{ $t('dialog.new_instance.invite') }}
|
||||
el-button(type="primary" size="small" @click="showLaunchDialog(newInstanceDialog.location, newInstanceDialog.shortName)") {{ $t('dialog.new_instance.launch') }}
|
||||
394
html/src/mixins/dialogs/openSourceSoftwareNotice.pug
Normal file
394
html/src/mixins/dialogs/openSourceSoftwareNotice.pug
Normal file
@@ -0,0 +1,394 @@
|
||||
mixin openSourceSoftwareNotice()
|
||||
//- dialog: open source software notice
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" :visible.sync="ossDialog" :title="$t('dialog.open_source.header')" width="650px")
|
||||
div(v-if="ossDialog" style="height:350px;overflow:hidden scroll;word-break:break-all")
|
||||
div
|
||||
span {{ $t('dialog.open_source.description') }}
|
||||
div(style="margin-top:15px")
|
||||
p(style="font-weight:bold") animate.css
|
||||
pre(style="font-size:12px;white-space:pre-line").
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2019 Daniel Eden
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
div(style="margin-top:15px")
|
||||
p(style="font-weight:bold") CefSharp
|
||||
pre(style="font-size:12px;white-space:pre-line").
|
||||
// Copyright © The CefSharp Authors. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
//
|
||||
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||
// Framework nor the name CefSharp nor the names of its contributors
|
||||
// may be used to endorse or promote products derived from this software
|
||||
// without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
div(style="margin-top:15px")
|
||||
p(style="font-weight:bold") DiscordRichPresence
|
||||
pre(style="font-size:12px;white-space:pre-line").
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2018 Lachee
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
div(style="margin-top:15px")
|
||||
p(style="font-weight:bold") element
|
||||
pre(style="font-size:12px;white-space:pre-line").
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016-present ElemeFE
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
div(style="margin-top:15px")
|
||||
p(style="font-weight:bold") librsync.net
|
||||
pre(style="font-size:12px;white-space:pre-line").
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Brad Dodson
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
div(style="margin-top:15px")
|
||||
p(style="font-weight:bold") Newtonsoft.Json
|
||||
pre(style="font-size:12px;white-space:pre-line").
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2007 James Newton-King
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
div(style="margin-top:15px")
|
||||
p(style="font-weight:bold") normalize
|
||||
pre(style="font-size:12px;white-space:pre-line").
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright © Nicolas Gallagher and Jonathan Neal
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
div(style="margin-top:15px")
|
||||
p(style="font-weight:bold") noty
|
||||
pre(style="font-size:12px;white-space:pre-line").
|
||||
Copyright (c) 2012 Nedim Arabacı
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
div(style="margin-top:15px")
|
||||
p(style="font-weight:bold") OpenVR SDK
|
||||
pre(style="font-size:12px;white-space:pre-line").
|
||||
Copyright (c) 2015, Valve Corporation
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation and/or
|
||||
other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
div(style="margin-top:15px")
|
||||
p(style="font-weight:bold") Twemoji
|
||||
pre(style="font-size:12px;white-space:pre-line").
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 Twitter
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
div(style="margin-top:15px")
|
||||
p(style="font-weight:bold") SharpDX
|
||||
pre(style="font-size:12px;white-space:pre-line").
|
||||
Copyright (c) 2010-2014 SharpDX - Alexandre Mutel
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
div(style="margin-top:15px")
|
||||
p(style="font-weight:bold") vue
|
||||
pre(style="font-size:12px;white-space:pre-line").
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2013-present, Yuxi (Evan) You
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
div(style="margin-top:15px")
|
||||
p(style="font-weight:bold") vue-data-tables
|
||||
pre(style="font-size:12px;white-space:pre-line").
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2018 Leon Zhang
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
div(style="margin-top:15px")
|
||||
p(style="font-weight:bold") vue-lazyload
|
||||
pre(style="font-size:12px;white-space:pre-line").
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 Awe
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
div(style="margin-top:15px")
|
||||
p(style="font-weight:bold") Encode Sans Font (from Dark Vanilla)
|
||||
pre(style="font-size:12px;white-space:pre-line").
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
Copyright (c) 2020 June 20, Impallari Type, Andres Torresi, Jacques Le Bailly
|
||||
(https://fonts.google.com/specimen/Encode+Sans),
|
||||
with Reserved Font Name: Encode Sans.
|
||||
|
||||
PREAMBLE:
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide development
|
||||
of collaborative font projects, to support the font creation efforts of academic
|
||||
and linguistic communities, and to provide a free and open framework in which
|
||||
fonts may be shared and improved in partnership with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and redistributed
|
||||
freely as long as they are not sold by themselves. The fonts, including any
|
||||
derivative works, can be bundled, embedded, redistributed and/or sold with any
|
||||
software provided that any reserved names are not used by derivative works.
|
||||
The fonts and derivatives, however, cannot be released under any other type of
|
||||
license. The requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
the Font Software, to use, study, copy, merge, embed, modify, redistribute, and
|
||||
sell modified and unmodified copies of the Font Software, subject to the
|
||||
following conditions:
|
||||
|
||||
1. Neither the Font Software nor any of its individual components, in Original or
|
||||
Modified Versions, may be sold by itself.
|
||||
|
||||
2. Original or Modified Versions of the Font Software may be bundled, redistributed
|
||||
and/or sold with any software, provided that each copy contains the above copyright
|
||||
notice and this license. These can be included either as stand-alone text files,
|
||||
human-readable headers or in the appropriate machine-readable metadata fields within
|
||||
text or binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3. No Modified Version of the Font Software may use the Reserved Font Name(s) unless
|
||||
explicit written permission is granted by the corresponding Copyright Holder. This
|
||||
restriction only applies to the primary font name as presented to the users.
|
||||
|
||||
4. The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall
|
||||
not be used to promote, endorse or advertise any Modified Version, except to
|
||||
acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with
|
||||
their explicit written permission.
|
||||
|
||||
5. The Font Software, modified or unmodified, in part or in whole, must be distributed
|
||||
entirely under this license, and must not be distributed under any other license.
|
||||
The requirement for fonts to remain under this license does not apply to any document
|
||||
created using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR
|
||||
OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM,
|
||||
DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL,
|
||||
OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER
|
||||
DEALINGS IN THE FONT SOFTWARE.
|
||||
73
html/src/mixins/dialogs/previousInstances.pug
Normal file
73
html/src/mixins/dialogs/previousInstances.pug
Normal file
@@ -0,0 +1,73 @@
|
||||
mixin previousInstances()
|
||||
//- dialog Table: Previous Instances User
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="previousInstancesUserDialog" :visible.sync="previousInstancesUserDialog.visible" :title="$t('dialog.previous_instances.header')" width="1000px")
|
||||
span(v-text="previousInstancesUserDialog.userRef.displayName" style="font-size:14px")
|
||||
el-input(v-model="previousInstancesUserDialogTable.filters[0].value" :placeholder="$t('dialog.previous_instances.search_placeholder')" style="display:block;width:150px;margin-top:15px")
|
||||
data-tables(v-if="previousInstancesUserDialog.visible" v-bind="previousInstancesUserDialogTable" v-loading="previousInstancesUserDialog.loading" style="margin-top:10px")
|
||||
el-table-column(:label="$t('table.previous_instances.date')" prop="created_at" sortable width="170")
|
||||
template(v-once #default="scope")
|
||||
span {{ scope.row.created_at | formatDate('long') }}
|
||||
el-table-column(:label="$t('table.previous_instances.world')" prop="name" sortable)
|
||||
template(v-once #default="scope")
|
||||
location(:location="scope.row.location" :hint="scope.row.worldName" :grouphint="scope.row.groupName")
|
||||
el-table-column(:label="$t('table.previous_instances.instance_creator')" prop="location" width="170")
|
||||
template(v-once #default="scope")
|
||||
display-name(:userid="scope.row.$location.userId" :location="scope.row.$location.tag" :key="previousInstancesUserDialog.forceUpdate")
|
||||
el-table-column(:label="$t('table.previous_instances.time')" prop="time" width="100" sortable)
|
||||
template(v-once #default="scope")
|
||||
span(v-text="scope.row.timer")
|
||||
el-table-column(:label="$t('table.previous_instances.action')" width="90" align="right")
|
||||
template(v-once #default="scope")
|
||||
el-button(type="text" icon="el-icon-info" size="mini" @click="showLaunchDialog(scope.row.location)")
|
||||
el-button(type="text" icon="el-icon-tickets" size="mini" @click="showPreviousInstanceInfoDialog(scope.row.location)")
|
||||
el-button(type="text" icon="el-icon-close" size="mini" @click="confirmDeleteGameLogUserInstance(scope.row)")
|
||||
|
||||
//- dialog Table: Previous Instances World
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="previousInstancesWorldDialog" :visible.sync="previousInstancesWorldDialog.visible" :title="$t('dialog.previous_instances.header')" width="1000px")
|
||||
span(v-text="previousInstancesWorldDialog.worldRef.name" style="font-size:14px")
|
||||
el-input(v-model="previousInstancesWorldDialogTable.filters[0].value" :placeholder="$t('dialog.previous_instances.search_placeholder')" style="display:block;width:150px;margin-top:15px")
|
||||
data-tables(v-if="previousInstancesWorldDialog.visible" v-bind="previousInstancesWorldDialogTable" v-loading="previousInstancesWorldDialog.loading" style="margin-top:10px")
|
||||
el-table-column(:label="$t('table.previous_instances.date')" prop="created_at" sortable width="170")
|
||||
template(v-once #default="scope")
|
||||
span {{ scope.row.created_at | formatDate('long') }}
|
||||
el-table-column(:label="$t('table.previous_instances.instance_name')" prop="name")
|
||||
template(v-once #default="scope")
|
||||
location-world(:locationobject="scope.row.$location" :grouphint="scope.row.groupName" :currentuserid="API.currentUser.id")
|
||||
el-table-column(:label="$t('table.previous_instances.instance_creator')" prop="location")
|
||||
template(v-once #default="scope")
|
||||
display-name(:userid="scope.row.$location.userId" :location="scope.row.$location.tag" :key="previousInstancesWorldDialog.forceUpdate")
|
||||
el-table-column(:label="$t('table.previous_instances.time')" prop="time" width="100" sortable)
|
||||
template(v-once #default="scope")
|
||||
span(v-text="scope.row.timer")
|
||||
el-table-column(:label="$t('table.previous_instances.action')" width="90" align="right")
|
||||
template(v-once #default="scope")
|
||||
el-button(type="text" icon="el-icon-tickets" size="mini" @click="showPreviousInstanceInfoDialog(scope.row.location)")
|
||||
el-button(type="text" icon="el-icon-close" size="mini" @click="confirmDeleteGameLogWorldInstance(scope.row)")
|
||||
|
||||
//- dialog Table: Previous Instance Info
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="previousInstanceInfoDialog" :visible.sync="previousInstanceInfoDialog.visible" :title="$t('dialog.previous_instances.info')" width="800px")
|
||||
location(:location="previousInstanceInfoDialog.$location.tag" style="font-size:14px")
|
||||
el-input(v-model="previousInstanceInfoDialogTable.filters[0].value" placeholder="Search" style="display:block;width:150px;margin-top:15px")
|
||||
data-tables(v-if="previousInstanceInfoDialog.visible" v-bind="previousInstanceInfoDialogTable" v-loading="previousInstanceInfoDialog.loading" style="margin-top:10px")
|
||||
el-table-column(:label="$t('table.previous_instances.date')" prop="created_at" sortable width="120")
|
||||
template(v-once #default="scope")
|
||||
el-tooltip(placement="left")
|
||||
template(#content)
|
||||
span {{ scope.row.created_at | formatDate('long') }}
|
||||
span {{ scope.row.created_at | formatDate('short') }}
|
||||
el-table-column(:label="$t('table.gameLog.icon')" prop="isFriend" width="70")
|
||||
template(v-once #default="scope")
|
||||
template(v-if="gameLogIsFriend(scope.row)")
|
||||
el-tooltip(v-if="gameLogIsFavorite(scope.row)" placement="top" content="Favorite")
|
||||
span ⭐
|
||||
el-tooltip(v-else placement="top" content="Friend")
|
||||
span 💚
|
||||
el-table-column(:label="$t('table.previous_instances.display_name')" prop="displayName" sortable)
|
||||
template(v-once #default="scope")
|
||||
span.x-link(v-text="scope.row.displayName" @click="lookupUser(scope.row)")
|
||||
el-table-column(:label="$t('table.previous_instances.time')" prop="time" width="90" sortable)
|
||||
template(v-once #default="scope")
|
||||
span(v-text="scope.row.timer")
|
||||
el-table-column(:label="$t('table.previous_instances.count')" prop="count" width="90" sortable)
|
||||
template(v-once #default="scope")
|
||||
span(v-text="scope.row.count")
|
||||
51
html/src/mixins/dialogs/screenshotMetadata.pug
Normal file
51
html/src/mixins/dialogs/screenshotMetadata.pug
Normal file
@@ -0,0 +1,51 @@
|
||||
mixin screenshotMetadata()
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="screenshotMetadataDialog" :visible.sync="screenshotMetadataDialog.visible" :title="$t('dialog.screenshot_metadata.header')" width="1050px")
|
||||
div(v-if="screenshotMetadataDialog.visible" v-loading="screenshotMetadataDialog.loading" @dragover.prevent @dragenter.prevent @drop="handleDrop" style="-webkit-app-region: drag")
|
||||
span(style="margin-left:5px;color:#909399;font-family:monospace") {{ $t('dialog.screenshot_metadata.drag') }}
|
||||
br
|
||||
br
|
||||
el-button(size="small" icon="el-icon-folder-opened" @click="AppApi.OpenScreenshotFileDialog()") {{ $t('dialog.screenshot_metadata.browse') }}
|
||||
el-button(size="small" icon="el-icon-picture-outline" @click="getAndDisplayLastScreenshot()") {{ $t('dialog.screenshot_metadata.last_screenshot') }}
|
||||
el-button(size="small" icon="el-icon-copy-document" @click="copyImageToClipboard(screenshotMetadataDialog.metadata.filePath)") {{ $t('dialog.screenshot_metadata.copy_image') }}
|
||||
el-button(size="small" icon="el-icon-folder" @click="openImageFolder(screenshotMetadataDialog.metadata.filePath)") {{ $t('dialog.screenshot_metadata.open_folder') }}
|
||||
el-button(v-if="API.currentUser.$isVRCPlus && screenshotMetadataDialog.metadata.filePath" size="small" icon="el-icon-upload2" @click="uploadScreenshotToGallery") {{ $t('dialog.screenshot_metadata.upload') }}
|
||||
br
|
||||
br
|
||||
//- Search bar input
|
||||
el-input(v-model="screenshotMetadataDialog.search" size="small" placeholder="Search" clearable style="width:200px" @input="screenshotMetadataSearch")
|
||||
//- Search index/total label
|
||||
template(v-if="screenshotMetadataDialog.searchIndex != null")
|
||||
span(style="white-space:pre-wrap;font-size:12px;margin-left:10px") {{ (screenshotMetadataDialog.searchIndex + 1) + "/" + screenshotMetadataDialog.searchResults.length }}
|
||||
//- Search type dropdown
|
||||
el-select(v-model="screenshotMetadataDialog.searchType" size="small" placeholder="Search Type" style="width:150px;margin-left:10px" @change="screenshotMetadataSearch")
|
||||
el-option(v-for="type in screenshotMetadataDialog.searchTypes" :key="type" :label="type" :value="type")
|
||||
br
|
||||
br
|
||||
span(v-text="screenshotMetadataDialog.metadata.fileName")
|
||||
br
|
||||
span(v-if="screenshotMetadataDialog.metadata.dateTime" style="margin-right:5px") {{ screenshotMetadataDialog.metadata.dateTime | formatDate('long') }}
|
||||
span(v-if="screenshotMetadataDialog.metadata.fileResolution" v-text="screenshotMetadataDialog.metadata.fileResolution" style="margin-right:5px")
|
||||
el-tag(v-if="screenshotMetadataDialog.metadata.fileSize" type="info" effect="plain" size="mini" v-text="screenshotMetadataDialog.metadata.fileSize")
|
||||
br
|
||||
location(v-if="screenshotMetadataDialog.metadata.world" :location="screenshotMetadataDialog.metadata.world.instanceId" :hint="screenshotMetadataDialog.metadata.world.name")
|
||||
br
|
||||
span.x-link(v-if="screenshotMetadataDialog.metadata.author" v-text="screenshotMetadataDialog.metadata.author.displayName" @click="showUserDialog(screenshotMetadataDialog.metadata.author.id)" style="color:#909399;font-family:monospace")
|
||||
br
|
||||
el-carousel(ref="screenshotMetadataCarousel" :interval="0" initial-index="1" indicator-position="none" arrow="always" height="600px" style="margin-top:10px" @change="screenshotMetadataCarouselChange")
|
||||
el-carousel-item
|
||||
span(placement="top" width="700px" trigger="click")
|
||||
img.x-link(slot="reference" v-lazy="screenshotMetadataDialog.metadata.previousFilePath" style="width:100%;height:100%;object-fit:contain")
|
||||
el-carousel-item
|
||||
span(placement="top" width="700px" trigger="click" @click="showFullscreenImageDialog(screenshotMetadataDialog.metadata.filePath)")
|
||||
img.x-link(slot="reference" v-lazy="screenshotMetadataDialog.metadata.filePath" style="width:100%;height:100%;object-fit:contain")
|
||||
el-carousel-item
|
||||
span(placement="top" width="700px" trigger="click")
|
||||
img.x-link(slot="reference" v-lazy="screenshotMetadataDialog.metadata.nextFilePath" style="width:100%;height:100%;object-fit:contain")
|
||||
br
|
||||
template(v-if="screenshotMetadataDialog.metadata.error")
|
||||
pre(v-text="screenshotMetadataDialog.metadata.error" style="white-space:pre-wrap;font-size:12px")
|
||||
br
|
||||
span(v-for="user in screenshotMetadataDialog.metadata.players" style="margin-top:5px")
|
||||
span.x-link(v-text="user.displayName" @click="lookupUser(user)")
|
||||
span(v-if="user.pos" v-text="'('+user.pos.x+', '+user.pos.y+', '+user.pos.z+')'" style="margin-left:5px;color:#909399;font-family:monospace")
|
||||
br
|
||||
195
html/src/mixins/dialogs/settings.pug
Normal file
195
html/src/mixins/dialogs/settings.pug
Normal file
@@ -0,0 +1,195 @@
|
||||
mixin settings()
|
||||
//- dialog: VRChat Config JSON
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="VRChatConfigDialog" :visible.sync="VRChatConfigDialog.visible" :title="$t('dialog.config_json.header')" width="420px")
|
||||
div(style='font-size:12px;word-break:keep-all')
|
||||
| {{ $t('dialog.config_json.description1') }} #[br]
|
||||
| {{ $t('dialog.config_json.description2') }}
|
||||
br
|
||||
span(style="margin-right:5px") {{ $t('dialog.config_json.cache_size') }}
|
||||
span(v-text="VRChatUsedCacheSize")
|
||||
span /
|
||||
span(v-text="VRChatTotalCacheSize")
|
||||
span GB
|
||||
el-tooltip(placement="top" :content="$t('dialog.config_json.refresh')" :disabled="hideTooltips")
|
||||
el-button(type="default" :loading="VRChatCacheSizeLoading" @click="getVRChatCacheSize" size="small" icon="el-icon-refresh" circle style="margin-left:5px")
|
||||
br
|
||||
span {{ $t('dialog.config_json.delete_all_cache') }}
|
||||
el-button(size="small" style="margin-left:5px" icon="el-icon-delete" @click="showDeleteAllVRChatCacheConfirm()") {{ $t('dialog.config_json.delete_cache') }}
|
||||
br
|
||||
span {{ $t('dialog.config_json.delete_old_cache') }}
|
||||
el-button(size="small" style="margin-left:5px" icon="el-icon-folder-delete" @click="sweepVRChatCache()") {{ $t('dialog.config_json.sweep_cache') }}
|
||||
br
|
||||
div(style="display:inline-block;margin-top:10px" v-for="(item, value) in VRChatConfigList" :key="value")
|
||||
span(v-text="item.name" style="word-break:keep-all")
|
||||
|:
|
||||
el-input(v-model="VRChatConfigFile[value]" :placeholder="item.default" size="mini" :type="item.type?item.type:'text'" :min="item.min" :max="item.max")
|
||||
div(style="display:inline-block;margin-top:10px")
|
||||
span {{ $t('dialog.config_json.camera_resolution') }}
|
||||
br
|
||||
el-dropdown(@command="(command) => setVRChatCameraResolution(command)" size="small" trigger="click" style="margin-top:5px")
|
||||
el-button(size="small")
|
||||
span #[span(v-text="getVRChatCameraResolution()")] #[i.el-icon-arrow-down.el-icon--right]
|
||||
el-dropdown-menu(#default="dropdown")
|
||||
el-dropdown-item(v-for="row in VRChatCameraResolutions" :key="row.index" v-text="row.name" :command="row")
|
||||
div(style="display:inline-block;margin-top:10px;margin-left:10px")
|
||||
span {{ $t('dialog.config_json.screenshot_resolution') }}
|
||||
br
|
||||
el-dropdown(@command="(command) => setVRChatScreenshotResolution(command)" size="small" trigger="click" style="margin-top:5px")
|
||||
el-button(size="small")
|
||||
span #[span(v-text="getVRChatScreenshotResolution()")] #[i.el-icon-arrow-down.el-icon--right]
|
||||
el-dropdown-menu(#default="dropdown")
|
||||
el-dropdown-item(v-for="row in VRChatScreenshotResolutions" :key="row.index" v-text="row.name" :command="row")
|
||||
el-checkbox(v-model="VRChatConfigFile.picture_output_split_by_date" style="margin-top:5px;display:block" :checked="true") {{ $t('dialog.config_json.picture_sort_by_date') }}
|
||||
el-checkbox(v-model="VRChatConfigFile.disableRichPresence" style="margin-top:5px;display:block") {{ $t('dialog.config_json.disable_discord_presence') }}
|
||||
template(#footer)
|
||||
el-button(size="small" @click="openExternalLink('https://docs.vrchat.com/docs/configuration-file')") {{ $t('dialog.config_json.vrchat_docs') }}
|
||||
el-button(size="small" @click="VRChatConfigDialog.visible = false") {{ $t('dialog.config_json.cancel') }}
|
||||
el-button(type="primary" size="small" :disabled="VRChatConfigDialog.loading" @click="saveVRChatConfigFile") {{ $t('dialog.config_json.save') }}
|
||||
|
||||
//- dialog: YouTube Api Dialog
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="youTubeApiDialog" :visible.sync="youTubeApiDialog.visible" :title="$t('dialog.youtube_api.header')" width="400px")
|
||||
div(style='font-size:12px;')
|
||||
| {{ $t('dialog.youtube_api.description') }} #[br]
|
||||
el-input(type="textarea" v-model="youTubeApiKey" :placeholder="$t('dialog.youtube_api.placeholder')" maxlength="39" show-word-limit style="display:block;margin-top:10px")
|
||||
template(#footer)
|
||||
div(style="display:flex")
|
||||
el-button(size="small" @click="openExternalLink('https://rapidapi.com/blog/how-to-get-youtube-api-key/')") {{ $t('dialog.youtube_api.guide') }}
|
||||
el-button(type="primary" size="small" @click="testYouTubeApiKey" style="margin-left:auto") {{ $t('dialog.youtube_api.save') }}
|
||||
|
||||
//- dialog: Discord username list
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" :visible.sync="discordNamesDialogVisible" :title="$t('dialog.discord_names.header')" width="650px")
|
||||
div(style='font-size:12px;')
|
||||
| {{ $t('dialog.discord_names.description') }}
|
||||
el-input(type="textarea" v-if="discordNamesDialogVisible" v-model="discordNamesContent" size="mini" rows="15" resize="none" readonly style="margin-top:15px")
|
||||
|
||||
//- dialog: Note export dialog
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="noteExportDialog" :visible.sync="noteExportDialog.visible" :title="$t('dialog.note_export.header')" width="1000px")
|
||||
div(style="font-size:12px")
|
||||
| {{ $t('dialog.note_export.description1') }} #[br]
|
||||
| {{ $t('dialog.note_export.description2') }} #[br]
|
||||
| {{ $t('dialog.note_export.description3') }} #[br]
|
||||
| {{ $t('dialog.note_export.description4') }} #[br]
|
||||
| {{ $t('dialog.note_export.description5') }} #[br]
|
||||
| {{ $t('dialog.note_export.description6') }} #[br]
|
||||
| {{ $t('dialog.note_export.description7') }} #[br]
|
||||
| {{ $t('dialog.note_export.description8') }} #[br]
|
||||
el-button(size="small" @click="updateNoteExportDialog" :disabled="noteExportDialog.loading" style="margin-top:10px") {{ $t('dialog.note_export.refresh') }}
|
||||
el-button(size="small" @click="exportNoteExport" :disabled="noteExportDialog.loading" style="margin-top:10px") {{ $t('dialog.note_export.export') }}
|
||||
el-button(v-if="noteExportDialog.loading" size="small" @click="cancelNoteExport" style="margin-top:10px") {{ $t('dialog.note_export.cancel') }}
|
||||
span(v-if="noteExportDialog.loading" style="margin:10px") #[i.el-icon-loading(style="margin-right:5px")] {{ $t('dialog.note_export.progress') }} {{ noteExportDialog.progress }}/{{ noteExportDialog.progressTotal }}
|
||||
template(v-if="noteExportDialog.errors")
|
||||
el-button(size="small" @click="noteExportDialog.errors = ''") {{ $t('dialog.note_export.clear_errors') }}
|
||||
h2(style="font-weight:bold;margin:0") {{ $t('dialog.note_export.errors') }}
|
||||
pre(v-text="noteExportDialog.errors" style="white-space:pre-wrap;font-size:12px")
|
||||
data-tables(v-if="noteExportDialog.visible" v-bind="noteExportTable" v-loading="noteExportDialog.loading" style="margin-top:10px")
|
||||
el-table-column(:label="$t('table.import.image')" width="70" prop="currentAvatarThumbnailImageUrl")
|
||||
template(v-once #default="scope")
|
||||
el-popover(placement="right" height="500px" trigger="hover")
|
||||
img.friends-list-avatar(slot="reference" v-lazy="userImage(scope.row.ref)")
|
||||
img.friends-list-avatar(v-lazy="userImageFull(scope.row.ref)" style="height:500px;cursor:pointer" @click="showFullscreenImageDialog(userImageFull(scope.row.ref))")
|
||||
el-table-column(:label="$t('table.import.name')" width="170" prop="name")
|
||||
template(v-once #default="scope")
|
||||
span.x-link(v-text="scope.row.name" @click="showUserDialog(scope.row.id)")
|
||||
el-table-column(:label="$t('table.import.note')" prop="memo")
|
||||
template(v-once #default="scope")
|
||||
el-input(v-model="scope.row.memo" type="textarea" maxlength="256" show-word-limit :rows="2" :autosize="{ minRows: 1, maxRows: 10 }" size="mini" resize="none")
|
||||
el-table-column(:label="$t('table.import.skip_export')" width="90" align="right")
|
||||
template(v-once #default="scope")
|
||||
el-button(type="text" icon="el-icon-close" size="mini" @click="removeFromNoteExportTable(scope.row)")
|
||||
|
||||
//- dialog: chatbox blacklist
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="chatboxBlacklistDialog" :visible.sync="chatboxBlacklistDialog.visible" :title="$t('dialog.chatbox_blacklist.header')" width="600px")
|
||||
div(v-loading="chatboxBlacklistDialog.loading" v-if="chatboxBlacklistDialog.visible")
|
||||
h2 {{ $t('dialog.chatbox_blacklist.keyword_blacklist') }}
|
||||
el-input(v-for="(item, index) in chatboxBlacklist" :key="index" :value="item" v-model="chatboxBlacklist[index]" size="small" style="margin-top:5px" @change="saveChatboxBlacklist")
|
||||
el-button(slot="append" icon="el-icon-delete" @click="chatboxBlacklist.splice(index, 1); saveChatboxBlacklist()")
|
||||
el-button(@click="chatboxBlacklist.push('')" size="mini" style="margin-top:5px") {{ $t('dialog.chatbox_blacklist.add_item') }}
|
||||
br
|
||||
h2 {{ $t('dialog.chatbox_blacklist.user_blacklist') }}
|
||||
el-tag(v-for="user in chatboxUserBlacklist" type="info" disable-transitions="true" :key="user[0]" style="margin-right:5px;margin-top:5px" closable @close="deleteChatboxUserBlacklist(user[0])")
|
||||
span {{user[1]}}
|
||||
|
||||
//- dialog: Notification position
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="notificationPositionDialog" :visible.sync="notificationPositionDialog.visible" :title="$t('dialog.notification_position.header')" width="400px")
|
||||
div(style='font-size:12px;')
|
||||
| {{ $t('dialog.notification_position.description') }}
|
||||
svg.notification-position(version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 300 200" style="margin-top:15px;" xml:space="preserve")
|
||||
path(style="fill:black;" d="M291.89,5A3.11,3.11,0,0,1,295,8.11V160.64a3.11,3.11,0,0,1-3.11,3.11H8.11A3.11,3.11,0,0,1,5,160.64V8.11A3.11,3.11,0,0,1,8.11,5H291.89m0-5H8.11A8.11,8.11,0,0,0,0,8.11V160.64a8.11,8.11,0,0,0,8.11,8.11H291.89a8.11,8.11,0,0,0,8.11-8.11V8.11A8.11,8.11,0,0,0,291.89,0Z")
|
||||
rect(style="fill:#c4c4c4;" x="5" y="5" width="290" height="158.75" rx="2.5")
|
||||
el-radio-group(v-model="notificationPosition" size="mini" @change="changeNotificationPosition")
|
||||
el-radio(label="topLeft" v-model="notificationPosition" style="margin:0;position:absolute;left:35px;top:120px;")
|
||||
el-radio(label="top" v-model="notificationPosition" style="margin:0;position:absolute;left:195px;top:120px;")
|
||||
el-radio(label="topRight" v-model="notificationPosition" style="margin:0;position:absolute;right:25px;top:120px;")
|
||||
el-radio(label="centerLeft" v-model="notificationPosition" style="margin:0;position:absolute;left:35px;top:200px;")
|
||||
el-radio(label="center" v-model="notificationPosition" style="margin:0;position:absolute;left:195px;top:200px;")
|
||||
el-radio(label="centerRight" v-model="notificationPosition" style="margin:0;position:absolute;right:25px;top:200px;")
|
||||
el-radio(label="bottomLeft" v-model="notificationPosition" style="margin:0;position:absolute;left:35px;top:280px;")
|
||||
el-radio(label="bottom" v-model="notificationPosition" style="margin:0;position:absolute;left:195px;top:280px;")
|
||||
el-radio(label="bottomRight" v-model="notificationPosition" style="margin:0;position:absolute;right:25px;top:280px;")
|
||||
template(#footer)
|
||||
div(style="display:flex")
|
||||
el-button(type="primary" size="small" style="margin-left:auto" @click="notificationPositionDialog.visible = false") {{ $t('dialog.notification_position.ok') }}
|
||||
|
||||
//- dialog: avatar database provider
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="avatarProviderDialog" :visible.sync="avatarProviderDialog.visible" :title="$t('dialog.avatar_database_provider.header')" width="600px")
|
||||
div
|
||||
el-input(v-for="(provider, index) in avatarRemoteDatabaseProviderList" :key="index" :value="provider" v-model="avatarRemoteDatabaseProviderList[index]" @change="saveAvatarProviderList" size="small" style="margin-top:5px")
|
||||
el-button(slot="append" icon="el-icon-delete" @click="removeAvatarProvider(provider)")
|
||||
el-button(@click="avatarRemoteDatabaseProviderList.push('')" size="mini" style="margin-top:5px") {{ $t('dialog.avatar_database_provider.add_provider') }}
|
||||
|
||||
//- dialog: Registry Auto Backup
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @closed="clearVrcRegistryDialog" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="registryBackupDialog" :visible.sync="registryBackupDialog.visible" :title="$t('dialog.registry_backup.header')" width="600px")
|
||||
div(v-if="registryBackupDialog.visible" style="margin-top:10px")
|
||||
div.options-container
|
||||
div.options-container-item
|
||||
span.name {{ $t('dialog.registry_backup.auto_backup') }}
|
||||
el-switch(v-model="vrcRegistryAutoBackup" @change="saveVrcRegistryAutoBackup")
|
||||
el-button(@click="promptVrcRegistryBackupName" size="small") {{ $t('dialog.registry_backup.backup') }}
|
||||
el-button(@click="AppApi.OpenVrcRegJsonFileDialog()" size="small") {{ $t('dialog.registry_backup.restore_from_file') }}
|
||||
el-button(@click="deleteVrcRegistry" size="small") {{ $t('dialog.registry_backup.reset') }}
|
||||
data-tables(v-bind="registryBackupTable" style="margin-top:10px")
|
||||
el-table-column(:label="$t('dialog.registry_backup.name')" prop="name")
|
||||
el-table-column(:label="$t('dialog.registry_backup.date')" prop="date")
|
||||
template(v-once #default="scope")
|
||||
span {{ scope.row.date | formatDate('long') }}
|
||||
el-table-column(:label="$t('dialog.registry_backup.action')" width="90" align="right")
|
||||
template(v-once #default="scope")
|
||||
el-tooltip(placement="top" :content="$t('dialog.registry_backup.restore')" :disabled="hideTooltips")
|
||||
el-button(type="text" icon="el-icon-upload2" size="mini" @click="restoreVrcRegistryBackup(scope.row)")
|
||||
el-tooltip(placement="top" :content="$t('dialog.registry_backup.save_to_file')" :disabled="hideTooltips")
|
||||
el-button(type="text" icon="el-icon-download" size="mini" @click="saveVrcRegistryBackupToFile(scope.row)")
|
||||
el-tooltip(placement="top" :content="$t('dialog.registry_backup.delete')" :disabled="hideTooltips")
|
||||
el-button(type="text" icon="el-icon-delete" size="mini" @click="deleteVrcRegistryBackup(scope.row)")
|
||||
|
||||
//- dialog: Enable primary password
|
||||
el-dialog.x-dialog(
|
||||
:visible.sync="enablePrimaryPasswordDialog.visible"
|
||||
:before-close="enablePrimaryPasswordDialog.beforeClose"
|
||||
ref="primaryPasswordDialog"
|
||||
:close-on-click-modal="false"
|
||||
:title="$t('dialog.primary_password.header')"
|
||||
width="400px"
|
||||
)
|
||||
el-input(
|
||||
v-model="enablePrimaryPasswordDialog.password"
|
||||
:placeholder="$t('dialog.primary_password.password_placeholder')"
|
||||
type="password"
|
||||
size="mini"
|
||||
maxlength="32"
|
||||
show-password
|
||||
autofocus
|
||||
)
|
||||
el-input(
|
||||
v-model="enablePrimaryPasswordDialog.rePassword"
|
||||
:placeholder="$t('dialog.primary_password.re_input_placeholder')"
|
||||
type="password"
|
||||
style="margin-top:5px"
|
||||
size="mini"
|
||||
maxlength="32"
|
||||
show-password
|
||||
)
|
||||
template(#footer)
|
||||
el-button(
|
||||
type="primary" size="small" @click="setPrimaryPassword"
|
||||
:disabled="enablePrimaryPasswordDialog.password.length===0||enablePrimaryPasswordDialog.password!==enablePrimaryPasswordDialog.rePassword"
|
||||
) {{ $t('dialog.primary_password.ok') }}
|
||||
67
html/src/mixins/dialogs/tags.pug
Normal file
67
html/src/mixins/dialogs/tags.pug
Normal file
@@ -0,0 +1,67 @@
|
||||
mixin tags()
|
||||
//- dialog: Set World Tags
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="setWorldTagsDialog" :visible.sync="setWorldTagsDialog.visible" :title="$t('dialog.set_world_tags.header')" width="400px")
|
||||
el-checkbox(v-model="setWorldTagsDialog.avatarScalingDisabled") {{ $t('dialog.set_world_tags.avatar_scaling_disabled') }}
|
||||
br
|
||||
el-checkbox(v-model="setWorldTagsDialog.focusViewDisabled") {{ $t('dialog.set_world_tags.focus_view_disabled') }}
|
||||
br
|
||||
el-checkbox(v-model="setWorldTagsDialog.stickersDisabled") {{ $t('dialog.set_world_tags.stickers_disabled') }}
|
||||
br
|
||||
el-checkbox(v-model="setWorldTagsDialog.debugAllowed") {{ $t('dialog.set_world_tags.enable_debugging') }}
|
||||
div(style='font-size:12px;margin-top:10px')
|
||||
| {{ $t('dialog.set_world_tags.author_tags') }} #[br]
|
||||
el-input(type="textarea" v-model="setWorldTagsDialog.authorTags" size="mini" show-word-limit :autosize="{ minRows:2, maxRows:5 }" placeholder="" style="margin-top:10px")
|
||||
div(style='font-size:12px;margin-top:10px')
|
||||
| {{ $t('dialog.set_world_tags.content_tags') }} #[br]
|
||||
el-checkbox(v-model="setWorldTagsDialog.contentHorror") {{ $t('dialog.set_world_tags.content_horror') }}
|
||||
br
|
||||
el-checkbox(v-model="setWorldTagsDialog.contentGore") {{ $t('dialog.set_world_tags.content_gore') }}
|
||||
br
|
||||
el-checkbox(v-model="setWorldTagsDialog.contentViolence") {{ $t('dialog.set_world_tags.content_violence') }}
|
||||
br
|
||||
el-checkbox(v-model="setWorldTagsDialog.contentAdult") {{ $t('dialog.set_world_tags.content_adult') }}
|
||||
br
|
||||
el-checkbox(v-model="setWorldTagsDialog.contentSex") {{ $t('dialog.set_world_tags.content_sex') }}
|
||||
//- el-input(type="textarea" v-model="setWorldTagsDialog.contentTags" size="mini" show-word-limit :autosize="{ minRows:2, maxRows:5 }" placeholder="" style="margin-top:10px")
|
||||
template(#footer)
|
||||
div(style="display:flex")
|
||||
el-button(size="small" @click="setWorldTagsDialog.visible = false") {{ $t('dialog.set_world_tags.cancel') }}
|
||||
el-button(type="primary" size="small" @click="saveSetWorldTagsDialog") {{ $t('dialog.set_world_tags.save') }}
|
||||
|
||||
//- dialog: Set Avatar Tags
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="setAvatarTagsDialog" :visible.sync="setAvatarTagsDialog.visible" :title="$t('dialog.set_avatar_tags.header')" width="770px")
|
||||
template(v-if="setAvatarTagsDialog.visible")
|
||||
el-checkbox(v-model="setAvatarTagsDialog.contentHorror" @change="updateSelectedAvatarTags") {{ $t('dialog.set_avatar_tags.content_horror') }}
|
||||
br
|
||||
el-checkbox(v-model="setAvatarTagsDialog.contentGore" @change="updateSelectedAvatarTags") {{ $t('dialog.set_avatar_tags.content_gore') }}
|
||||
br
|
||||
el-checkbox(v-model="setAvatarTagsDialog.contentViolence" @change="updateSelectedAvatarTags") {{ $t('dialog.set_avatar_tags.content_violence') }}
|
||||
br
|
||||
el-checkbox(v-model="setAvatarTagsDialog.contentAdult" @change="updateSelectedAvatarTags") {{ $t('dialog.set_avatar_tags.content_adult') }}
|
||||
br
|
||||
el-checkbox(v-model="setAvatarTagsDialog.contentSex" @change="updateSelectedAvatarTags") {{ $t('dialog.set_avatar_tags.content_sex') }}
|
||||
br
|
||||
el-input(v-model="setAvatarTagsDialog.selectedTagsCsv" @input="updateInputAvatarTags" size="mini" :autosize="{ minRows:2, maxRows:5 }" :placeholder="$t('dialog.set_avatar_tags.custom_tags_placeholder')" style="margin-top:10px")
|
||||
template(v-if="setAvatarTagsDialog.ownAvatars.length === setAvatarTagsDialog.selectedCount")
|
||||
el-button(size="small" @click="setAvatarTagsSelectToggle") {{ $t('dialog.set_avatar_tags.select_none') }}
|
||||
template(v-else)
|
||||
el-button(size="small" @click="setAvatarTagsSelectToggle") {{ $t('dialog.set_avatar_tags.select_all') }}
|
||||
span(style="margin-left:5px") {{ setAvatarTagsDialog.selectedCount }} / {{ setAvatarTagsDialog.ownAvatars.length }}
|
||||
span(v-if="setAvatarTagsDialog.loading" style="margin-left:5px")
|
||||
i.el-icon-loading
|
||||
br
|
||||
.x-friend-list(style="margin-top:10px;min-height:60px;max-height:280px")
|
||||
.x-friend-item(v-for="avatar in setAvatarTagsDialog.ownAvatars" :key="setAvatarTagsDialog.forceUpdate" @click="showAvatarDialog(avatar.id)" class="x-friend-item-border" style="width:350px")
|
||||
.avatar
|
||||
img(v-if="avatar.thumbnailImageUrl" v-lazy="avatar.thumbnailImageUrl")
|
||||
.detail
|
||||
span.name(v-text="avatar.name")
|
||||
span.extra(v-text="avatar.releaseStatus" v-if="avatar.releaseStatus === 'public'" style="color: #67c23a;")
|
||||
span.extra(v-text="avatar.releaseStatus" v-else-if="avatar.releaseStatus === 'private'" style="color: #f56c6c;")
|
||||
span.extra(v-text="avatar.releaseStatus" v-else)
|
||||
span.extra(v-text="avatar.$tagString")
|
||||
el-button(type="text" size="mini" @click.stop style="margin-left:5px")
|
||||
el-checkbox(v-model="avatar.$selected" @change="updateAvatarTagsSelection")
|
||||
template(#footer)
|
||||
el-button(size="small" @click="setAvatarTagsDialog.visible = false") {{ $t('dialog.set_avatar_tags.cancel') }}
|
||||
el-button(type="primary" size="small" @click="saveSetAvatarTagsDialog") {{ $t('dialog.set_avatar_tags.save') }}
|
||||
425
html/src/mixins/dialogs/userDialog.pug
Normal file
425
html/src/mixins/dialogs/userDialog.pug
Normal file
@@ -0,0 +1,425 @@
|
||||
mixin userDialog()
|
||||
el-dialog.x-dialog.x-user-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="userDialog" :visible.sync="userDialog.visible" :show-close="false" width="770px")
|
||||
div(v-loading="userDialog.loading")
|
||||
div(style="display:flex")
|
||||
el-popover(v-if="userDialog.ref.profilePicOverrideThumbnail || userDialog.ref.profilePicOverride" placement="right" width="500px" trigger="click")
|
||||
template(slot="reference")
|
||||
img.x-link(v-if="userDialog.ref.profilePicOverrideThumbnail" v-lazy="userDialog.ref.profilePicOverrideThumbnail" style="flex:none;height:120px;width:213.33px;border-radius:12px;object-fit:cover")
|
||||
img.x-link(v-else v-lazy="userDialog.ref.profilePicOverride" style="flex:none;height:120px;width:213.33px;border-radius:12px;object-fit:cover")
|
||||
img.x-link(v-lazy="userDialog.ref.profilePicOverride" style="height:400px" @click="showFullscreenImageDialog(userDialog.ref.profilePicOverride)")
|
||||
el-popover(v-else placement="right" width="500px" trigger="click")
|
||||
img.x-link(slot="reference" v-lazy="userDialog.ref.currentAvatarThumbnailImageUrl" style="flex:none;height:120px;width:160px;border-radius:12px;object-fit:cover")
|
||||
img.x-link(v-lazy="userDialog.ref.currentAvatarImageUrl" style="height:500px" @click="showFullscreenImageDialog(userDialog.ref.currentAvatarImageUrl)")
|
||||
div(style="flex:1;display:flex;align-items:center;margin-left:15px")
|
||||
div(style="flex:1")
|
||||
div
|
||||
el-tooltip(v-if="userDialog.ref.status" placement="top")
|
||||
template(#content)
|
||||
span(v-if="userDialog.ref.state === 'active'") {{ $t('dialog.user.status.active') }}
|
||||
span(v-else-if="userDialog.ref.state === 'offline'") {{ $t('dialog.user.status.offline') }}
|
||||
span(v-else-if="userDialog.ref.status === 'active'") {{ $t('dialog.user.status.online') }}
|
||||
span(v-else-if="userDialog.ref.status === 'join me'") {{ $t('dialog.user.status.join_me') }}
|
||||
span(v-else-if="userDialog.ref.status === 'ask me'") {{ $t('dialog.user.status.ask_me') }}
|
||||
span(v-else-if="userDialog.ref.status === 'busy'") {{ $t('dialog.user.status.busy') }}
|
||||
span(v-else) {{ $t('dialog.user.status.offline') }}
|
||||
i.x-user-status(:class="userStatusClass(userDialog.ref)")
|
||||
template(v-if="userDialog.previousDisplayNames.length > 0")
|
||||
el-tooltip(placement="bottom")
|
||||
template(#content)
|
||||
span {{ $t('dialog.user.previous_display_names') }}
|
||||
div(v-for="displayName in userDialog.previousDisplayNames" placement="top")
|
||||
span(v-text="displayName")
|
||||
i.el-icon-caret-bottom
|
||||
el-popover(placement="top" trigger="click")
|
||||
span.dialog-title(slot="reference" v-text="userDialog.ref.displayName" style="margin-left:5px;margin-right:5px;cursor:pointer")
|
||||
span(style="display:block;text-align:center;font-family:monospace") {{ userDialog.ref.displayName | textToHex }}
|
||||
el-tooltip(v-if="userDialog.ref.pronouns" placement="top" :content="$t('dialog.user.pronouns')" :disabled="hideTooltips")
|
||||
span.x-grey(v-text="userDialog.ref.pronouns" style="margin-right:5px;font-family:monospace;font-size:12px")
|
||||
el-tooltip(v-for="item in userDialog.ref.$languages" :key="item.key" placement="top")
|
||||
template(#content)
|
||||
span {{ item.value }} ({{ item.key }})
|
||||
span.flags(:class="languageClass(item.key)" style="display:inline-block;margin-right:5px")
|
||||
template(v-if="userDialog.ref.id === API.currentUser.id")
|
||||
br
|
||||
el-popover(placement="top" trigger="click")
|
||||
span.x-grey(slot="reference" v-text="API.currentUser.username" style="margin-right:10px;font-family:monospace;font-size:12px;cursor:pointer")
|
||||
span(style="display:block;text-align:center;font-family:monospace") {{ API.currentUser.username | textToHex }}
|
||||
div
|
||||
el-tag.name(type="info" effect="plain" size="mini" :class="userDialog.ref.$trustClass" v-text="userDialog.ref.$trustLevel" style="margin-right:5px;margin-top:5px")
|
||||
el-tag.x-tag-friend(v-if="userDialog.isFriend && userDialog.friend" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") {{ $t('dialog.user.tags.friend_no', { number: userDialog.friend.no }) }}
|
||||
el-tag.x-tag-troll(v-if="userDialog.ref.$isTroll" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") Nuisance
|
||||
el-tag.x-tag-troll(v-if="userDialog.ref.$isProbableTroll" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") Almost Nuisance
|
||||
el-tag.x-tag-vip(v-if="userDialog.ref.$isModerator" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") {{ $t('dialog.user.tags.vrchat_team') }}
|
||||
el-tag.x-tag-vrcplus(v-if="userDialog.ref.$isVRCPlus" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") VRC+
|
||||
el-tag.x-tag-platform-pc(v-if="userDialog.ref.last_platform === 'standalonewindows'" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") PC
|
||||
el-tag.x-tag-platform-quest(v-else-if="userDialog.ref.last_platform === 'android'" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") Android
|
||||
el-tag.x-tag-platform-ios(v-else-if="userDialog.ref.last_platform === 'ios'" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") iOS
|
||||
el-tag.x-tag-platform-other(v-else-if="userDialog.ref.last_platform" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") {{ userDialog.ref.last_platform }}
|
||||
el-tag.name(v-if="userDialog.ref.$customTag" type="info" effect="plain" size="mini" v-text="userDialog.ref.$customTag" :style="{'color':userDialog.ref.$customTagColour, 'border-color':userDialog.ref.$customTagColour}" style="margin-right:5px;margin-top:5px")
|
||||
div(style="margin-top:5px")
|
||||
span(v-text="userDialog.ref.statusDescription" style="font-size:12px")
|
||||
div(v-if="userDialog.ref.userIcon" style="flex:none;margin-right:10px")
|
||||
el-popover(placement="right" width="500px" trigger="click")
|
||||
img.x-link(slot="reference" v-lazy="userDialog.ref.userIcon" style="flex:none;width:120px;height:120px;border-radius:12px;object-fit:cover")
|
||||
img.x-link(v-lazy="userDialog.ref.userIcon" style="height:500px" @click="showFullscreenImageDialog(userDialog.ref.userIcon)")
|
||||
div(style="flex:none")
|
||||
template(v-if="(API.currentUser.id !== userDialog.ref.id && userDialog.isFriend) || userDialog.isFavorite")
|
||||
el-tooltip(v-if="userDialog.isFavorite" placement="top" :content="$t('dialog.user.actions.unfavorite_tooltip')" :disabled="hideTooltips")
|
||||
el-button(@click="userDialogCommand('Add Favorite')" type="warning" icon="el-icon-star-on" circle)
|
||||
el-tooltip(v-else placement="top" :content="$t('dialog.user.actions.favorite_tooltip')" :disabled="hideTooltips")
|
||||
el-button(type="default" @click="userDialogCommand('Add Favorite')" icon="el-icon-star-off" circle)
|
||||
el-dropdown(trigger="click" @command="userDialogCommand" size="small")
|
||||
el-button(:type="(userDialog.incomingRequest || userDialog.outgoingRequest) ? 'success' : (userDialog.isBlock || userDialog.isMute) ? 'danger' : 'default'" icon="el-icon-more" circle style="margin-left:5px")
|
||||
el-dropdown-menu(#default="dropdown")
|
||||
el-dropdown-item(icon="el-icon-refresh" command="Refresh") {{ $t('dialog.user.actions.refresh') }}
|
||||
template(v-if="userDialog.ref.id === API.currentUser.id")
|
||||
el-dropdown-item(icon="el-icon-picture-outline" command="Manage Gallery" divided) {{ $t('dialog.user.actions.manage_gallery_icon') }}
|
||||
el-dropdown-item(icon="el-icon-s-custom" command="Show Avatar Author") {{ $t('dialog.user.actions.show_avatar_author') }}
|
||||
el-dropdown-item(icon="el-icon-s-custom" command="Show Fallback Avatar Details") {{ $t('dialog.user.actions.show_fallback_avatar') }}
|
||||
el-dropdown-item(icon="el-icon-edit" command="Edit Social Status" divided) {{ $t('dialog.user.actions.edit_status') }}
|
||||
el-dropdown-item(icon="el-icon-edit" command="Edit Language") {{ $t('dialog.user.actions.edit_language') }}
|
||||
el-dropdown-item(icon="el-icon-edit" command="Edit Bio") {{ $t('dialog.user.actions.edit_bio') }}
|
||||
el-dropdown-item(icon="el-icon-edit" command="Edit Pronouns") {{ $t('dialog.user.actions.edit_pronouns') }}
|
||||
el-dropdown-item(icon="el-icon-switch-button" command="Logout" divided) {{ $t('dialog.user.actions.logout') }}
|
||||
template(v-else)
|
||||
template(v-if="userDialog.isFriend")
|
||||
el-dropdown-item(icon="el-icon-postcard" command="Request Invite" divided) {{ $t('dialog.user.actions.request_invite') }}
|
||||
el-dropdown-item(icon="el-icon-postcard" command="Request Invite Message") {{ $t('dialog.user.actions.request_invite_with_message') }}
|
||||
template(v-if="lastLocation.location && isGameRunning && checkCanInvite(lastLocation.location)")
|
||||
el-dropdown-item(icon="el-icon-message" command="Invite") {{ $t('dialog.user.actions.invite') }}
|
||||
el-dropdown-item(icon="el-icon-message" command="Invite Message") {{ $t('dialog.user.actions.invite_with_message') }}
|
||||
template(v-else-if="userDialog.incomingRequest")
|
||||
el-dropdown-item(icon="el-icon-check" command="Accept Friend Request") {{ $t('dialog.user.actions.accept_friend_request') }}
|
||||
el-dropdown-item(icon="el-icon-close" command="Decline Friend Request") {{ $t('dialog.user.actions.decline_friend_request') }}
|
||||
el-dropdown-item(v-else-if="userDialog.outgoingRequest" icon="el-icon-close" command="Cancel Friend Request") {{ $t('dialog.user.actions.cancel_friend_request') }}
|
||||
el-dropdown-item(v-else icon="el-icon-plus" command="Send Friend Request") {{ $t('dialog.user.actions.send_friend_request') }}
|
||||
el-dropdown-item(icon="el-icon-message" command="Invite To Group") {{ $t('dialog.user.actions.invite_to_group') }}
|
||||
//- el-dropdown-item(icon="el-icon-thumb" command="Send Boop" :disabled="!API.currentUser.isBoopingEnabled") {{ $t('dialog.user.actions.send_boop') }}
|
||||
el-dropdown-item(icon="el-icon-s-custom" command="Show Avatar Author" divided) {{ $t('dialog.user.actions.show_avatar_author') }}
|
||||
el-dropdown-item(icon="el-icon-s-custom" command="Show Fallback Avatar Details") {{ $t('dialog.user.actions.show_fallback_avatar') }}
|
||||
el-dropdown-item(icon="el-icon-tickets" command="Previous Instances") {{ $t('dialog.user.actions.show_previous_instances') }}
|
||||
el-dropdown-item(v-if="userDialog.ref.currentAvatarImageUrl" icon="el-icon-picture-outline" command="Previous Images") {{ $t('dialog.user.actions.show_previous_images') }}
|
||||
el-dropdown-item(v-if="userDialog.isBlock" icon="el-icon-circle-check" command="Unblock" divided style="color:#F56C6C") {{ $t('dialog.user.actions.moderation_unblock') }}
|
||||
el-dropdown-item(v-else icon="el-icon-circle-close" command="Block" divided :disabled="userDialog.ref.$isModerator") {{ $t('dialog.user.actions.moderation_block') }}
|
||||
el-dropdown-item(v-if="userDialog.isMute" icon="el-icon-microphone" command="Unmute" style="color:#F56C6C") {{ $t('dialog.user.actions.moderation_unmute') }}
|
||||
el-dropdown-item(v-else icon="el-icon-turn-off-microphone" command="Mute" :disabled="userDialog.ref.$isModerator") {{ $t('dialog.user.actions.moderation_mute') }}
|
||||
el-dropdown-item(v-if="userDialog.isMuteChat" icon="el-icon-chat-line-round" command="Unmute Chatbox" style="color:#F56C6C") {{ $t('dialog.user.actions.moderation_enable_chatbox') }}
|
||||
el-dropdown-item(v-else icon="el-icon-chat-dot-round" command="Mute Chatbox") {{ $t('dialog.user.actions.moderation_disable_chatbox') }}
|
||||
el-dropdown-item(icon="el-icon-user-solid" command="Show Avatar")
|
||||
i.el-icon-check.el-icon--left(v-if="userDialog.isShowAvatar")
|
||||
span {{ $t('dialog.user.actions.moderation_show_avatar') }}
|
||||
el-dropdown-item(icon="el-icon-user" command="Hide Avatar")
|
||||
i.el-icon-check.el-icon--left(v-if="userDialog.isHideAvatar")
|
||||
span {{ $t('dialog.user.actions.moderation_hide_avatar') }}
|
||||
el-dropdown-item(v-if="userDialog.isInteractOff" icon="el-icon-thumb" command="Enable Avatar Interaction" style="color:#F56C6C") {{ $t('dialog.user.actions.moderation_enable_avatar_interaction') }}
|
||||
el-dropdown-item(v-else icon="el-icon-circle-close" command="Disable Avatar Interaction") {{ $t('dialog.user.actions.moderation_disable_avatar_interaction') }}
|
||||
el-dropdown-item(icon="el-icon-s-flag" command="Report Hacking" :disabled="userDialog.ref.$isModerator") {{ $t('dialog.user.actions.report_hacking') }}
|
||||
template(v-if="userDialog.isFriend")
|
||||
el-dropdown-item(icon="el-icon-delete" command="Unfriend" divided style="color:#F56C6C") {{ $t('dialog.user.actions.unfriend') }}
|
||||
el-tabs(ref="userDialogTabs" @tab-click="userDialogTabClick")
|
||||
el-tab-pane(:label="$t('dialog.user.info.header')")
|
||||
template(v-if="isFriendOnline(userDialog.friend) || API.currentUser.id === userDialog.id")
|
||||
div(v-if="userDialog.ref.location" style="display:flex;flex-direction:column;margin-bottom:10px;padding-bottom:10px;border-bottom:1px solid #e4e7ed14")
|
||||
div(style="flex:none")
|
||||
template(v-if="isRealInstance(userDialog.$location.tag)")
|
||||
el-tooltip(placement="top" :content="$t('dialog.user.info.launch_invite_tooltip')" :disabled="hideTooltips")
|
||||
launch(:location="userDialog.$location.tag")
|
||||
el-tooltip(placement="top" :content="$t('dialog.user.info.self_invite_tooltip')" :disabled="hideTooltips")
|
||||
invite-yourself(:location="userDialog.$location.tag" :shortname="userDialog.$location.shortName" style="margin-left:5px")
|
||||
el-tooltip(placement="top" :content="$t('dialog.user.info.refresh_instance_info')" :disabled="hideTooltips")
|
||||
el-button(@click="refreshInstancePlayerCount(userDialog.$location.tag)" size="mini" icon="el-icon-refresh" style="margin-left:5px" circle)
|
||||
last-join(:location="userDialog.$location.tag" :currentlocation="lastLocation.location")
|
||||
instance-info(:location="userDialog.$location.tag" :instance="userDialog.instance.ref" :friendcount="userDialog.instance.friendCount" :updateelement="updateInstanceInfo")
|
||||
location(:location="userDialog.ref.location" :traveling="userDialog.ref.travelingToLocation" style="display:block;margin-top:5px")
|
||||
.x-friend-list(style="flex:1;margin-top:10px;max-height:150px")
|
||||
.x-friend-item(v-if="userDialog.$location.userId" @click="showUserDialog(userDialog.$location.userId)" class="x-friend-item-border")
|
||||
template(v-if="userDialog.$location.user")
|
||||
.avatar(:class="userStatusClass(userDialog.$location.user)")
|
||||
img(v-lazy="userImage(userDialog.$location.user)")
|
||||
.detail
|
||||
span.name(v-text="userDialog.$location.user.displayName" :style="{'color':userDialog.$location.user.$userColour}")
|
||||
span.extra {{ $t('dialog.user.info.instance_creator') }}
|
||||
span(v-else v-text="userDialog.$location.userId")
|
||||
.x-friend-item(v-for="user in userDialog.users" :key="user.id" @click="showUserDialog(user.id)" class="x-friend-item-border")
|
||||
.avatar(:class="userStatusClass(user)")
|
||||
img(v-lazy="userImage(user)")
|
||||
.detail
|
||||
span.name(v-text="user.displayName" :style="{'color':user.$userColour}")
|
||||
span.extra(v-if="user.location === 'traveling'")
|
||||
i.el-icon-loading(style="margin-right:5px")
|
||||
timer(:epoch="user.$travelingToTime")
|
||||
span.extra(v-else)
|
||||
timer(:epoch="user.$location_at")
|
||||
.x-friend-list(style="max-height:none")
|
||||
.x-friend-item(v-if="!hideUserNotes" style="width:100%;cursor:default")
|
||||
.detail
|
||||
span.name {{ $t('dialog.user.info.note') }}
|
||||
el-input(v-model="userDialog.note" type="textarea" maxlength="256" show-word-limit :rows="2" :autosize="{ minRows: 1, maxRows: 20 }" @change="checkNote(userDialog.ref, userDialog.note)" @input="cleanNote(userDialog.note)" :placeholder="$t('dialog.user.info.note_placeholder')" size="mini" resize="none")
|
||||
div(style="float:right")
|
||||
i.el-icon-loading(v-if="userDialog.noteSaving" style="margin-left:5px")
|
||||
i.el-icon-more-outline(v-else-if="userDialog.note !== userDialog.ref.note" style="margin-left:5px")
|
||||
el-button(v-if="userDialog.note" type="text" icon="el-icon-delete" size="mini" @click="deleteNote(userDialog.id)" style="margin-left:5px")
|
||||
.x-friend-item(v-if="!hideUserMemos" style="width:100%;cursor:default")
|
||||
.detail
|
||||
span.name {{ $t('dialog.user.info.memo') }}
|
||||
el-input.extra(v-model="userDialog.memo" @change="onUserMemoChange" type="textarea" :rows="2" :autosize="{ minRows: 1, maxRows: 20 }" :placeholder="$t('dialog.user.info.memo_placeholder')" size="mini" resize="none")
|
||||
.x-friend-item(style="width:100%;cursor:default")
|
||||
.detail
|
||||
span.name(v-if="userDialog.id !== API.currentUser.id && userDialog.ref.profilePicOverride && userDialog.ref.currentAvatarImageUrl") {{ $t('dialog.user.info.avatar_info_last_seen') }}
|
||||
span.name(v-else) {{ $t('dialog.user.info.avatar_info') }}
|
||||
.extra
|
||||
avatar-info(:imageurl="userDialog.ref.currentAvatarImageUrl" :userid="userDialog.id" :avatartags="userDialog.ref.currentAvatarTags")
|
||||
.x-friend-item(style="width:100%;cursor:default")
|
||||
.detail
|
||||
span.name {{ $t('dialog.user.info.represented_group') }}
|
||||
.extra(v-if="userDialog.representedGroup?.isRepresenting")
|
||||
div(style="display:inline-block;flex:none;margin-right:5px")
|
||||
el-popover(placement="right" width="500px" trigger="click")
|
||||
img.x-link(slot="reference" v-lazy="userDialog.representedGroup.iconUrl" style="flex:none;width:60px;height:60px;border-radius:4px;object-fit:cover")
|
||||
img.x-link(v-lazy="userDialog.representedGroup.iconUrl" style="height:500px" @click="showFullscreenImageDialog(userDialog.representedGroup.iconUrl)")
|
||||
span(style="vertical-align:top;cursor:pointer" @click="showGroupDialog(userDialog.representedGroup.groupId)")
|
||||
span(v-if="userDialog.representedGroup.ownerId === userDialog.id" style="margin-right:5px") 👑
|
||||
span(v-text="userDialog.representedGroup.name" style="margin-right:5px")
|
||||
span ({{ userDialog.representedGroup.memberCount }})
|
||||
.extra(v-else) -
|
||||
.x-friend-item(style="width:100%;cursor:default")
|
||||
.detail
|
||||
span.name {{ $t('dialog.user.info.bio') }}
|
||||
pre.extra(style="font-family:inherit;font-size:12px;white-space:pre-wrap;margin:0 0.5em 0 0") {{ userDialog.ref.bio || '-' }}
|
||||
div(v-if="userDialog.id === API.currentUser.id" style="float:right")
|
||||
el-button(type="text" icon="el-icon-edit" size="mini" @click="showBioDialog" style="margin-left:5px")
|
||||
div(style="margin-top:5px")
|
||||
el-tooltip(v-if="link" v-for="(link, index) in userDialog.ref.bioLinks" :key="index")
|
||||
template(#content)
|
||||
span(v-text="link")
|
||||
img(:src="getFaviconUrl(link)" style="width:16px;height:16px;vertical-align:middle;margin-right:5px;cursor:pointer" @click.stop="openExternalLink(link)")
|
||||
template(v-if="API.currentUser.id !== userDialog.id")
|
||||
.x-friend-item(style="cursor:default")
|
||||
.detail
|
||||
span.name {{ $t('dialog.user.info.last_seen') }}
|
||||
el-tooltip(v-if="!hideTooltips" placement="top" style="margin-left:5px" :content="$t('dialog.user.info.accuracy_notice')")
|
||||
i.el-icon-warning
|
||||
span.extra {{ userDialog.lastSeen | formatDate('long') }}
|
||||
.x-friend-item(@click="showPreviousInstancesUserDialog(userDialog.ref)")
|
||||
.detail
|
||||
span.name {{ $t('dialog.user.info.join_count') }}
|
||||
el-tooltip(v-if="!hideTooltips" placement="top" style="margin-left:5px" :content="$t('dialog.user.info.accuracy_notice')")
|
||||
i.el-icon-warning
|
||||
span.extra(v-if="userDialog.joinCount === 0") -
|
||||
span.extra(v-else v-text="userDialog.joinCount")
|
||||
.x-friend-item(style="cursor:default")
|
||||
.detail
|
||||
span.name {{ $t('dialog.user.info.time_together') }}
|
||||
el-tooltip(v-if="!hideTooltips" placement="top" style="margin-left:5px" :content="$t('dialog.user.info.accuracy_notice')")
|
||||
i.el-icon-warning
|
||||
span.extra(v-if="userDialog.timeSpent === 0") -
|
||||
span.extra(v-else) {{ timeToText(userDialog.timeSpent) }}
|
||||
template(v-else)
|
||||
.x-friend-item(@click="showPreviousInstancesUserDialog(userDialog.ref)")
|
||||
.detail
|
||||
span.name {{ $t('dialog.user.info.play_time') }}
|
||||
el-tooltip(v-if="!hideTooltips" placement="top" style="margin-left:5px" :content="$t('dialog.user.info.accuracy_notice')")
|
||||
i.el-icon-warning
|
||||
span.extra(v-if="userDialog.timeSpent === 0") -
|
||||
span.extra(v-else) {{ timeToText(userDialog.timeSpent) }}
|
||||
.x-friend-item(style="cursor:default")
|
||||
el-tooltip(placement="top")
|
||||
template(#content)
|
||||
span {{ userOnlineForTimestamp(userDialog) | formatDate('short') }}
|
||||
.detail
|
||||
span.name(v-if="userDialog.ref.state === 'online' && userDialog.ref.$online_for") {{ $t('dialog.user.info.online_for') }}
|
||||
el-tooltip(v-if="!hideTooltips" placement="top" style="margin-left:5px" :content="$t('dialog.user.info.accuracy_notice')")
|
||||
i.el-icon-warning
|
||||
span.name(v-else) {{ $t('dialog.user.info.offline_for') }}
|
||||
el-tooltip(v-if="!hideTooltips" placement="top" style="margin-left:5px" :content="$t('dialog.user.info.accuracy_notice')")
|
||||
i.el-icon-warning
|
||||
span.extra {{ userOnlineFor(userDialog) }}
|
||||
.x-friend-item(style="cursor:default")
|
||||
el-tooltip(placement="top")
|
||||
template(#content)
|
||||
span {{ $t('dialog.user.info.last_login') }} {{ userDialog.ref.last_login | formatDate('short') }}
|
||||
.detail
|
||||
span.name {{ $t('dialog.user.info.last_activity') }}
|
||||
span.extra {{ userDialog.ref.last_activity | formatDate('long') }}
|
||||
.x-friend-item(style="cursor:default")
|
||||
.detail
|
||||
span.name {{ $t('dialog.user.info.date_joined') }}
|
||||
span.extra(v-text="userDialog.ref.date_joined")
|
||||
.x-friend-item(v-if="API.currentUser.id !== userDialog.id" style="cursor:default")
|
||||
el-tooltip(placement="top")
|
||||
template(#content v-if="userDialog.dateFriendedInfo.length")
|
||||
template(v-for="ref in userDialog.dateFriendedInfo")
|
||||
span {{ ref.type }}: {{ ref.created_at | formatDate('long') }}
|
||||
br
|
||||
template(#content v-else)
|
||||
span -
|
||||
.detail
|
||||
span.name(v-if="userDialog.unFriended") {{ $t('dialog.user.info.unfriended') }}
|
||||
el-tooltip(v-if="!hideTooltips" placement="top" style="margin-left:5px" :content="$t('dialog.user.info.accuracy_notice')")
|
||||
i.el-icon-warning
|
||||
span.name(v-else) {{ $t('dialog.user.info.friended') }}
|
||||
el-tooltip(v-if="!hideTooltips" placement="top" style="margin-left:5px" :content="$t('dialog.user.info.accuracy_notice')")
|
||||
i.el-icon-warning
|
||||
span.extra {{ userDialog.dateFriended | formatDate('long') }}
|
||||
template(v-if="API.currentUser.id === userDialog.id")
|
||||
.x-friend-item(@click="toggleAvatarCopying")
|
||||
.detail
|
||||
span.name {{ $t('dialog.user.info.avatar_cloning') }}
|
||||
span.extra(v-if="API.currentUser.allowAvatarCopying" style="color:#67C23A") {{ $t('dialog.user.info.avatar_cloning_allow') }}
|
||||
span.extra(v-else style="color:#F56C6C") {{ $t('dialog.user.info.avatar_cloning_deny') }}
|
||||
//- .x-friend-item(@click="toggleAllowBooping")
|
||||
//- .detail
|
||||
//- span.name {{ $t('dialog.user.info.booping') }}
|
||||
//- span.extra(v-if="API.currentUser.isBoopingEnabled" style="color:#67C23A") {{ $t('dialog.user.info.avatar_cloning_allow') }}
|
||||
//- span.extra(v-else style="color:#F56C6C") {{ $t('dialog.user.info.avatar_cloning_deny') }}
|
||||
template(v-else)
|
||||
.x-friend-item(style="cursor:default")
|
||||
.detail
|
||||
span.name {{ $t('dialog.user.info.avatar_cloning') }}
|
||||
span.extra(v-if="userDialog.ref.allowAvatarCopying" style="color:#67C23A") {{ $t('dialog.user.info.avatar_cloning_allow') }}
|
||||
span.extra(v-else style="color:#F56C6C") {{ $t('dialog.user.info.avatar_cloning_deny') }}
|
||||
.x-friend-item(v-if="userDialog.ref.id === API.currentUser.id && API.currentUser.homeLocation" @click="showWorldDialog(API.currentUser.homeLocation)" style="width:100%")
|
||||
.detail
|
||||
span.name {{ $t('dialog.user.info.home_location') }}
|
||||
span.extra
|
||||
span(v-text="userDialog.$homeLocationName")
|
||||
el-button(@click.stop="resetHome()" size="mini" icon="el-icon-delete" circle style="margin-left:5px")
|
||||
.x-friend-item(style="width:100%;cursor:default")
|
||||
.detail
|
||||
span.name {{ $t('dialog.user.info.id') }}
|
||||
span.extra {{ userDialog.id }}
|
||||
el-tooltip(placement="top" :content="$t('dialog.user.info.id_tooltip')" :disabled="hideTooltips")
|
||||
el-dropdown(trigger="click" @click.native.stop size="mini" style="margin-left:5px")
|
||||
el-button(type="default" icon="el-icon-s-order" size="mini" circle)
|
||||
el-dropdown-menu(#default="dropdown")
|
||||
el-dropdown-item(@click.native="copyUserId(userDialog.id)") {{ $t('dialog.user.info.copy_id') }}
|
||||
el-dropdown-item(@click.native="copyUserURL(userDialog.id)") {{ $t('dialog.user.info.copy_url') }}
|
||||
el-dropdown-item(@click.native="copyUserDisplayName(userDialog.ref.displayName)") {{ $t('dialog.user.info.copy_display_name') }}
|
||||
el-tab-pane(:label="$t('dialog.user.groups.header')")
|
||||
el-button(type="default" :loading="userDialog.isGroupsLoading" @click="getUserGroups(userDialog.id)" size="mini" icon="el-icon-refresh" circle)
|
||||
span(style="margin-left:5px") {{ $t('dialog.user.groups.total_count', { count: userGroups.groups.length }) }}
|
||||
div(v-loading="userDialog.isGroupsLoading" style="margin-top:10px")
|
||||
template(v-if="userGroups.ownGroups.length > 0")
|
||||
span(style="font-weight:bold;font-size:16px") {{ $t('dialog.user.groups.own_groups') }}
|
||||
span(style="color:#909399;font-size:12px;margin-left:5px") {{ userGroups.ownGroups.length }}/{{ API.cachedConfig?.constants?.GROUPS?.MAX_OWNED }}
|
||||
.x-friend-list(style="margin-top:10px;margin-bottom:15px;min-height:60px")
|
||||
.x-friend-item(v-for="group in userGroups.ownGroups" :key="group.id" @click="showGroupDialog(group.id)" class="x-friend-item-border")
|
||||
.avatar
|
||||
img(v-lazy="group.iconUrl")
|
||||
.detail
|
||||
span.name(v-text="group.name")
|
||||
span.extra
|
||||
el-tooltip(v-if="group.isRepresenting" placement="top" :content="$t('dialog.group.members.representing')")
|
||||
i.el-icon-collection-tag(style="margin-right:5px")
|
||||
el-tooltip(v-if="group.memberVisibility !== 'visible'" placement="top")
|
||||
template(#content)
|
||||
span {{ $t('dialog.group.members.visibility') }} {{ group.memberVisibility }}
|
||||
i.el-icon-view(style="margin-right:5px")
|
||||
span ({{ group.memberCount }})
|
||||
template(v-if="userGroups.mutualGroups.length > 0")
|
||||
span(style="font-weight:bold;font-size:16px") {{ $t('dialog.user.groups.mutual_groups') }}
|
||||
span(style="color:#909399;font-size:12px;margin-left:5px") {{ userGroups.mutualGroups.length }}
|
||||
.x-friend-list(style="margin-top:10px;margin-bottom:15px;min-height:60px")
|
||||
.x-friend-item(v-for="group in userGroups.mutualGroups" :key="group.id" @click="showGroupDialog(group.id)" class="x-friend-item-border")
|
||||
.avatar
|
||||
img(v-lazy="group.iconUrl")
|
||||
.detail
|
||||
span.name(v-text="group.name")
|
||||
span.extra
|
||||
el-tooltip(v-if="group.isRepresenting" placement="top" :content="$t('dialog.group.members.representing')")
|
||||
i.el-icon-collection-tag(style="margin-right:5px")
|
||||
el-tooltip(v-if="group.memberVisibility !== 'visible'" placement="top")
|
||||
template(#content)
|
||||
span {{ $t('dialog.group.members.visibility') }} {{ group.memberVisibility }}
|
||||
i.el-icon-view(style="margin-right:5px")
|
||||
span ({{ group.memberCount }})
|
||||
template(v-if="userGroups.remainingGroups.length > 0")
|
||||
span(style="font-weight:bold;font-size:16px") {{ $t('dialog.user.groups.groups') }}
|
||||
span(style="color:#909399;font-size:12px;margin-left:5px") {{ userGroups.remainingGroups.length }}
|
||||
template(v-if="API.currentUser.id === userDialog.id")
|
||||
|/
|
||||
template(v-if="API.currentUser.$isVRCPlus")
|
||||
| {{ API.cachedConfig?.constants?.GROUPS?.MAX_JOINED_PLUS }}
|
||||
template(v-else)
|
||||
| {{ API.cachedConfig?.constants?.GROUPS?.MAX_JOINED }}
|
||||
.x-friend-list(style="margin-top:10px;margin-bottom:15px;min-height:60px")
|
||||
.x-friend-item(v-for="group in userGroups.remainingGroups" :key="group.id" @click="showGroupDialog(group.id)" class="x-friend-item-border")
|
||||
.avatar
|
||||
img(v-lazy="group.iconUrl")
|
||||
.detail
|
||||
span.name(v-text="group.name")
|
||||
span.extra
|
||||
el-tooltip(v-if="group.isRepresenting" placement="top" :content="$t('dialog.group.members.representing')")
|
||||
i.el-icon-collection-tag(style="margin-right:5px")
|
||||
el-tooltip(v-if="group.memberVisibility !== 'visible'" placement="top")
|
||||
template(#content)
|
||||
span {{ $t('dialog.group.members.visibility') }} {{ group.memberVisibility }}
|
||||
i.el-icon-view(style="margin-right:5px")
|
||||
span ({{ group.memberCount }})
|
||||
el-tab-pane(:label="$t('dialog.user.worlds.header')")
|
||||
el-button(type="default" :loading="userDialog.isWorldsLoading" @click="refreshUserDialogWorlds()" size="mini" icon="el-icon-refresh" circle)
|
||||
span(style="margin-left:5px") {{ $t('dialog.user.worlds.total_count', { count: userDialog.worlds.length }) }}
|
||||
div(style="float:right")
|
||||
span(style="margin-right:5px") {{ $t('dialog.user.worlds.sort_by') }}
|
||||
el-dropdown(@click.native.stop trigger="click" size="small" style="margin-right:5px" :disabled="userDialog.isWorldsLoading")
|
||||
el-button(size="mini")
|
||||
span {{ userDialog.worldSorting.name }} #[i.el-icon-arrow-down.el-icon--right]
|
||||
el-dropdown-menu(#default="dropdown")
|
||||
el-dropdown-item(v-for="(item) in userDialogWorldSortingOptions" v-text="item.name" @click.native="setUserDialogWorldSorting(item)")
|
||||
span(style="margin-right:5px") {{ $t('dialog.user.worlds.order_by') }}
|
||||
el-dropdown(@click.native.stop trigger="click" size="small" style="margin-right:5px" :disabled="userDialog.isWorldsLoading")
|
||||
el-button(size="mini")
|
||||
span {{ userDialog.worldOrder.name }} #[i.el-icon-arrow-down.el-icon--right]
|
||||
el-dropdown-menu(#default="dropdown")
|
||||
el-dropdown-item(v-for="(item) in userDialogWorldOrderOptions" v-text="item.name" @click.native="setUserDialogWorldOrder(item)")
|
||||
.x-friend-list(v-loading="userDialog.isWorldsLoading" style="margin-top:10px;min-height:60px")
|
||||
.x-friend-item(v-for="world in userDialog.worlds" :key="world.id" @click="showWorldDialog(world.id)" class="x-friend-item-border")
|
||||
.avatar
|
||||
img(v-lazy="world.thumbnailImageUrl")
|
||||
.detail
|
||||
span.name(v-text="world.name")
|
||||
span.extra(v-if="world.occupants") ({{ world.occupants }})
|
||||
el-tab-pane(:label="$t('dialog.user.favorite_worlds.header')")
|
||||
el-button(type="default" :loading="userDialog.isFavoriteWorldsLoading" @click="getUserFavoriteWorlds(userDialog.id)" size="mini" icon="el-icon-refresh" circle)
|
||||
el-tabs.zero-margin-tabs(type="card" ref="favoriteWorlds" v-loading="userDialog.isFavoriteWorldsLoading" style="margin-top:10px")
|
||||
template(v-for="(list, index) in userFavoriteWorlds" v-if="list")
|
||||
el-tab-pane
|
||||
span(slot="label")
|
||||
span(v-text="list[0]" style="font-weight:bold;font-size:16px")
|
||||
i.x-user-status(style="margin-left:5px" :class="userFavoriteWorldsStatus(list[1])")
|
||||
span(style="color:#909399;font-size:12px;margin-left:5px") {{ list[2].length }}/{{ API.favoriteLimits.maxFavoritesPerGroup.world }}
|
||||
.x-friend-list(style="margin-top:10px;margin-bottom:15px;min-height:60px")
|
||||
.x-friend-item(v-for="world in list[2]" :key="world.id" @click="showWorldDialog(world.id)" class="x-friend-item-border")
|
||||
.avatar
|
||||
img(v-lazy="world.thumbnailImageUrl")
|
||||
.detail
|
||||
span.name(v-text="world.name")
|
||||
span.extra(v-if="world.occupants") ({{ world.occupants }})
|
||||
el-tab-pane(:label="$t('dialog.user.avatars.header')")
|
||||
template(v-if="userDialog.ref.id === API.currentUser.id")
|
||||
el-button(type="default" :loading="userDialog.isAvatarsLoading" @click="refreshUserDialogAvatars()" size="mini" icon="el-icon-refresh" circle)
|
||||
span(style="margin-left:5px") {{ $t('dialog.user.avatars.total_count', { count: userDialogAvatars.length }) }}
|
||||
el-radio-group(v-if="userDialog.ref.id === API.currentUser.id" v-model="userDialog.avatarSorting" size="mini" style="margin-left:30px;margin-right:30px" @change="changeUserDialogAvatarSorting")
|
||||
el-radio(label="name") {{ $t('dialog.user.avatars.sort_by_name') }}
|
||||
el-radio(label="update") {{ $t('dialog.user.avatars.sort_by_update') }}
|
||||
el-radio-group(v-if="userDialog.ref.id === API.currentUser.id" v-model="userDialog.avatarReleaseStatus" size="mini" style="margin-left:30px")
|
||||
el-radio(label="all") {{ $t('dialog.user.avatars.all') }}
|
||||
el-radio(label="public") {{ $t('dialog.user.avatars.public') }}
|
||||
el-radio(label="private") {{ $t('dialog.user.avatars.private') }}
|
||||
.x-friend-list(style="margin-top:10px;min-height:60px")
|
||||
.x-friend-item(v-for="avatar in userDialogAvatars" @click="showAvatarDialog(avatar.id)" class="x-friend-item-border")
|
||||
.avatar
|
||||
img(v-if="avatar.thumbnailImageUrl" v-lazy="avatar.thumbnailImageUrl")
|
||||
.detail
|
||||
span.name(v-text="avatar.name")
|
||||
span.extra(v-text="avatar.releaseStatus" v-if="avatar.releaseStatus === 'public'" style="color: #67c23a;")
|
||||
span.extra(v-text="avatar.releaseStatus" v-else-if="avatar.releaseStatus === 'private'" style="color: #f56c6c;")
|
||||
span.extra(v-text="avatar.releaseStatus" v-else)
|
||||
el-tab-pane(:label="$t('dialog.user.json.header')")
|
||||
el-button(type="default" @click="refreshUserDialogTreeData()" size="mini" icon="el-icon-refresh" circle)
|
||||
el-button(type="default" @click="downloadAndSaveJson(userDialog.id, userDialog.ref)" size="mini" icon="el-icon-download" circle style="margin-left:5px")
|
||||
el-tree(:data="userDialog.treeData" style="margin-top:5px;font-size:12px")
|
||||
template(#default="scope")
|
||||
span
|
||||
span(v-text="scope.data.key" style="font-weight:bold;margin-right:5px")
|
||||
span(v-if="!scope.data.children" v-text="scope.data.value")
|
||||
57
html/src/mixins/dialogs/vrcx.pug
Normal file
57
html/src/mixins/dialogs/vrcx.pug
Normal file
@@ -0,0 +1,57 @@
|
||||
mixin vrcx()
|
||||
//- dialog: Cache Download
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="downloadDialog" :visible.sync="downloadDialog.visible" :title="$t('dialog.download_history.header')" width="770px")
|
||||
template(v-if="downloadDialog.visible")
|
||||
div(v-if="downloadInProgress && downloadCurrent.ref")
|
||||
span(v-text="downloadCurrent.ref.name")
|
||||
el-button(type="text" icon="el-icon-close" size="mini" @click="cancelDownload(downloadCurrent.id)" style="margin-left:5px")
|
||||
el-progress(:percentage="downloadProgress" :format="downloadProgressText")
|
||||
template(v-if="downloadQueueTable.data.length >= 1")
|
||||
span(style="margin-top:15px") {{ $t('dialog.download_history.queue') }}
|
||||
data-tables(v-bind="downloadQueueTable" style="margin-top:10px")
|
||||
el-table-column(:label="$t('table.download_history.name')" prop="name")
|
||||
el-table-column(:label="$t('table.download_history.type')" prop="type" width="70")
|
||||
el-table-column(:label="$t('table.download_history.cancel')" width="60" align="right")
|
||||
template(v-once #default="scope")
|
||||
el-button(type="text" icon="el-icon-close" size="mini" @click="cancelDownload(scope.row.ref.id)")
|
||||
span(style="margin-top:15px") {{ $t('dialog.download_history.history') }}
|
||||
data-tables(v-bind="downloadHistoryTable" style="margin-top:10px")
|
||||
el-table-column(:label="$t('table.download_history.time')" prop="date" width="90")
|
||||
template(v-once #default="scope")
|
||||
timer(:epoch="scope.row.date")
|
||||
el-table-column(:label="$t('table.download_history.name')" prop="name")
|
||||
template(v-once #default="scope")
|
||||
span(v-text="scope.row.ref.name")
|
||||
el-table-column(:label="$t('table.download_history.type')" prop="type" width="70")
|
||||
el-table-column(:label="$t('table.download_history.status')" prop="status" width="80")
|
||||
template(#footer)
|
||||
el-button(v-if="downloadQueue.size >= 1" size="small" @click="cancelAllDownloads") {{ $t('dialog.download_history.cancel_all') }}
|
||||
el-button(size="small" @click="downloadDialog.visible = false") {{ $t('dialog.download_history.close') }}
|
||||
|
||||
//- dialog: update VRCX
|
||||
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="VRCXUpdateDialog" :visible.sync="VRCXUpdateDialog.visible" :title="$t('dialog.vrcx_updater.header')" width="400px")
|
||||
div(v-loading="checkingForVRCXUpdate" style="margin-top:15px")
|
||||
div(v-if="VRCXUpdateDialog.updatePending" style="margin-bottom:15px")
|
||||
span(v-text="pendingVRCXInstall")
|
||||
br
|
||||
span {{ $t('dialog.vrcx_updater.ready_for_update') }}
|
||||
el-select(v-model="branch" @change="loadBranchVersions" style="display:inline-block;width:150px;margin-right:15px")
|
||||
el-option(v-once v-for="branch in branches" :key="branch.name" :label="branch.name" :value="branch.name")
|
||||
el-select(v-model="VRCXUpdateDialog.release" style="display:inline-block;width:150px")
|
||||
el-option(v-for="item in VRCXUpdateDialog.releases" :key="item.name" :label="item.tag_name" :value="item.name")
|
||||
div(v-if="!VRCXUpdateDialog.updatePending && VRCXUpdateDialog.release === appVersion" style="margin-top:15px")
|
||||
span {{ $t('dialog.vrcx_updater.latest_version') }}
|
||||
template(#footer)
|
||||
el-button(v-if="(VRCXUpdateDialog.updatePending && VRCXUpdateDialog.release !== pendingVRCXInstall) || VRCXUpdateDialog.release !== appVersion" type="primary" size="small" @click="installVRCXUpdate") {{ $t('dialog.vrcx_updater.download') }}
|
||||
el-button(v-if="VRCXUpdateDialog.updatePending" type="primary" size="small" @click="restartVRCX(true)") {{ $t('dialog.vrcx_updater.install') }}
|
||||
|
||||
//- dialog: change log
|
||||
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")
|
||||
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")
|
||||
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://patreon.com/Natsumi_VRCX')") {{ $t('dialog.change_log.donate') }}
|
||||
el-button(type="small" @click="changeLogDialog.visible = false") {{ $t('dialog.change_log.close') }}
|
||||
216
html/src/mixins/dialogs/worldDialog.pug
Normal file
216
html/src/mixins/dialogs/worldDialog.pug
Normal file
@@ -0,0 +1,216 @@
|
||||
|
||||
mixin worldDialog()
|
||||
el-dialog.x-dialog.x-world-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="worldDialog" :visible.sync="worldDialog.visible" :show-close="false" width="770px")
|
||||
div(v-loading="worldDialog.loading")
|
||||
div(style="display:flex")
|
||||
el-popover(placement="right" width="500px" trigger="click")
|
||||
img.x-link(slot="reference" v-lazy="worldDialog.ref.thumbnailImageUrl" style="flex:none;width:160px;height:120px;border-radius:12px")
|
||||
img.x-link(v-lazy="worldDialog.ref.imageUrl" style="width:500px;height:375px" @click="showFullscreenImageDialog(worldDialog.ref.imageUrl)")
|
||||
div(style="flex:1;display:flex;align-items:center;margin-left:15px")
|
||||
div(style="flex:1")
|
||||
div
|
||||
i.el-icon-s-home(v-show="API.currentUser.$homeLocation && API.currentUser.$homeLocation.worldId === worldDialog.id" style="margin-right:5px")
|
||||
span.dialog-title(v-text="worldDialog.ref.name")
|
||||
div(style="margin-top:5px")
|
||||
span.x-link.x-grey(v-text="worldDialog.ref.authorName" @click="showUserDialog(worldDialog.ref.authorId)" style="font-family:monospace")
|
||||
div
|
||||
el-tag(v-if="worldDialog.ref.$isLabs" type="primary" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") {{ $t('dialog.world.tags.labs') }}
|
||||
el-tag(v-else-if="worldDialog.ref.releaseStatus === 'public'" type="success" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") {{ $t('dialog.world.tags.public') }}
|
||||
el-tag(v-else type="danger" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") {{ $t('dialog.world.tags.private') }}
|
||||
el-tag.x-tag-platform-pc(v-if="worldDialog.isPC" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") PC
|
||||
span.x-grey(v-if="worldDialog.bundleSizes['standalonewindows']" style=";margin-left:5px;border-left:inherit;padding-left:5px") {{ worldDialog.bundleSizes['standalonewindows'].fileSize }}
|
||||
el-tag.x-tag-platform-quest(v-if="worldDialog.isQuest" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") Android
|
||||
span.x-grey(v-if="worldDialog.bundleSizes['android']" style="margin-left:5px;border-left:inherit;padding-left:5px") {{ worldDialog.bundleSizes['android'].fileSize }}
|
||||
el-tag.x-tag-platform-ios(v-if="worldDialog.isIos" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") iOS
|
||||
span.x-grey(v-if="worldDialog.bundleSizes['ios']" style="margin-left:5px;border-left:inherit;padding-left:5px") {{ worldDialog.bundleSizes['ios'].fileSize }}
|
||||
el-tag(v-if="worldDialog.avatarScalingDisabled" type="warning" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") {{ $t('dialog.world.tags.avatar_scaling_disabled') }}
|
||||
el-tag(v-if="worldDialog.focusViewDisabled" type="warning" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") {{ $t('dialog.world.tags.focus_view_disabled') }}
|
||||
el-tag(v-if="worldDialog.stickersDisabled" type="warning" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") {{ $t('dialog.world.tags.stickers_disabled') }}
|
||||
el-tag(v-if="worldDialog.ref.unityPackageUrl" type="success" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") {{ $t('dialog.world.tags.future_proofing') }}
|
||||
el-tag.x-link(v-if="worldDialog.inCache" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px" @click="openFolderGeneric(worldDialog.cachePath)")
|
||||
span(v-text="worldDialog.cacheSize")
|
||||
| {{ $t('dialog.world.tags.cache')}}
|
||||
div
|
||||
template(v-for="tag in worldDialog.ref.tags")
|
||||
el-tag(v-if="tag.startsWith('content_')" :key="tag" effect="plain" size="mini" style="margin-right:5px;margin-top:5px")
|
||||
template(v-if="tag === 'content_horror'") {{ $t('dialog.world.tags.content_horror') }}
|
||||
template(v-else-if="tag === 'content_gore'") {{ $t('dialog.world.tags.content_gore') }}
|
||||
template(v-else-if="tag === 'content_violence'") {{ $t('dialog.world.tags.content_violence') }}
|
||||
template(v-else-if="tag === 'content_adult'") {{ $t('dialog.world.tags.content_adult') }}
|
||||
template(v-else-if="tag === 'content_sex'") {{ $t('dialog.world.tags.content_sex') }}
|
||||
template(v-else) {{ tag.replace('content_', '') }}
|
||||
div(style="margin-top:5px")
|
||||
span(v-show="worldDialog.ref.name !== worldDialog.ref.description" v-text="worldDialog.ref.description" style="font-size:12px")
|
||||
div(style="flex:none;margin-left:10px")
|
||||
el-tooltip(v-if="worldDialog.inCache" placement="top" :content="$t('dialog.world.actions.delete_cache_tooltip')" :disabled="hideTooltips")
|
||||
el-button(icon="el-icon-delete" circle @click="deleteVRChatCache(worldDialog.ref)" :disabled="isGameRunning && worldDialog.cacheLocked")
|
||||
el-tooltip(v-if="worldDialog.isFavorite" placement="top" :content="$t('dialog.world.actions.favorites_tooltip')" :disabled="hideTooltips")
|
||||
el-button(type="default" icon="el-icon-star-on" circle @click="worldDialogCommand('Add Favorite')" style="margin-left:5px")
|
||||
el-tooltip(v-else placement="top" :content="$t('dialog.world.actions.favorites_tooltip')" :disabled="hideTooltips")
|
||||
el-button(type="default" icon="el-icon-star-off" circle @click="worldDialogCommand('Add Favorite')" style="margin-left:5px")
|
||||
el-dropdown(trigger="click" @command="worldDialogCommand" size="small" style="margin-left:5px")
|
||||
el-button(type="default" icon="el-icon-more" circle)
|
||||
el-dropdown-menu(#default="dropdown")
|
||||
el-dropdown-item(icon="el-icon-refresh" command="Refresh") {{ $t('dialog.world.actions.refresh') }}
|
||||
el-dropdown-item(icon="el-icon-s-flag" command="New Instance" divided) {{ $t('dialog.world.actions.new_instance') }}
|
||||
el-dropdown-item(v-if="API.currentUser.$homeLocation && API.currentUser.$homeLocation.worldId === worldDialog.id" icon="el-icon-magic-stick" command="Reset Home" divided) {{ $t('dialog.world.actions.reset_home') }}
|
||||
el-dropdown-item(v-else icon="el-icon-s-home" command="Make Home" divided) {{ $t('dialog.world.actions.make_home') }}
|
||||
el-dropdown-item(icon="el-icon-tickets" command="Previous Instances") {{ $t('dialog.world.actions.show_previous_instances') }}
|
||||
template(v-if="API.currentUser.id !== worldDialog.ref.authorId")
|
||||
el-dropdown-item(icon="el-icon-picture-outline" command="Previous Images") {{ $t('dialog.world.actions.show_previous_images') }}
|
||||
el-dropdown-item(:disabled="!worldDialog.hasPersistData" icon="el-icon-upload" command="Delete Persistent Data") {{ $t('dialog.world.actions.delete_persistent_data') }}
|
||||
template(v-else)
|
||||
el-dropdown-item(icon="el-icon-edit" command="Rename") {{ $t('dialog.world.actions.rename') }}
|
||||
el-dropdown-item(icon="el-icon-edit" command="Change Description") {{ $t('dialog.world.actions.change_description') }}
|
||||
el-dropdown-item(icon="el-icon-edit" command="Change Capacity") {{ $t('dialog.world.actions.change_capacity') }}
|
||||
el-dropdown-item(icon="el-icon-edit" command="Change Recommended Capacity") {{ $t('dialog.world.actions.change_recommended_capacity') }}
|
||||
el-dropdown-item(icon="el-icon-edit" command="Change YouTube Preview") {{ $t('dialog.world.actions.change_preview') }}
|
||||
el-dropdown-item(icon="el-icon-edit" command="Change Tags") {{ $t('dialog.world.actions.change_tags') }}
|
||||
el-dropdown-item(icon="el-icon-picture-outline" command="Change Image") {{ $t('dialog.world.actions.change_image') }}
|
||||
el-dropdown-item(v-if="worldDialog.ref.unityPackageUrl" icon="el-icon-download" command="Download Unity Package") {{ $t('dialog.world.actions.download_package') }}
|
||||
el-dropdown-item(v-if="worldDialog.ref.tags.includes('system_approved') || worldDialog.ref.tags.includes('system_labs')" icon="el-icon-view" command="Unpublish" divided) {{ $t('dialog.world.actions.unpublish') }}
|
||||
el-dropdown-item(v-else icon="el-icon-view" command="Publish" divided) {{ $t('dialog.world.actions.publish_to_labs') }}
|
||||
el-dropdown-item(:disabled="!worldDialog.hasPersistData" icon="el-icon-upload" command="Delete Persistent Data") {{ $t('dialog.world.actions.delete_persistent_data') }}
|
||||
el-dropdown-item(icon="el-icon-delete" command="Delete" style="color:#F56C6C") {{ $t('dialog.world.actions.delete') }}
|
||||
el-tabs
|
||||
el-tab-pane(:label="$t('dialog.world.instances.header')")
|
||||
div.
|
||||
#[i.el-icon-user] {{ $t('dialog.world.instances.public_count', { count: worldDialog.ref.publicOccupants }) }}
|
||||
#[i.el-icon-user-solid(style="margin-left:10px")] {{ $t('dialog.world.instances.private_count', { count: worldDialog.ref.privateOccupants }) }}
|
||||
#[i.el-icon-check(style="margin-left:10px")] {{ $t('dialog.world.instances.capacity_count', { count: worldDialog.ref.recommendedCapacity, max: worldDialog.ref.capacity }) }}
|
||||
div(v-for="room in worldDialog.rooms" :key="room.id")
|
||||
div(style="margin:5px 0")
|
||||
location-world(:locationobject="room.$location" :currentuserid="API.currentUser.id" :worlddialogshortname="worldDialog.$location.shortName")
|
||||
el-tooltip(placement="top" :content="$t('dialog.world.instances.self_invite_tooltip')" :disabled="hideTooltips")
|
||||
invite-yourself(:location="room.$location.tag" :shortname="room.$location.shortName" style="margin-left:5px")
|
||||
el-tooltip(placement="top" :content="$t('dialog.world.instances.refresh_instance_info')" :disabled="hideTooltips")
|
||||
el-button(@click="refreshInstancePlayerCount(room.tag)" size="mini" icon="el-icon-refresh" style="margin-left:5px" circle)
|
||||
last-join(:location="room.$location.tag" :currentlocation="lastLocation.location")
|
||||
instance-info(:location="room.tag" :instance="room.ref" :friendcount="room.friendCount" :updateelement="updateInstanceInfo")
|
||||
.x-friend-list(style="margin:10px 0;max-height:unset" v-if="room.$location.userId || room.users.length")
|
||||
.x-friend-item(v-if="room.$location.userId" @click="showUserDialog(room.$location.userId)" class="x-friend-item-border")
|
||||
template(v-if="room.$location.user")
|
||||
.avatar(:class="userStatusClass(room.$location.user)")
|
||||
img(v-lazy="userImage(room.$location.user)")
|
||||
.detail
|
||||
span.name(v-text="room.$location.user.displayName" :style="{'color':room.$location.user.$userColour}")
|
||||
span.extra {{ $t('dialog.world.instances.instance_creator') }}
|
||||
span(v-else v-text="room.$location.userId")
|
||||
.x-friend-item(v-for="user in room.users" :key="user.id" @click="showUserDialog(user.id)" class="x-friend-item-border")
|
||||
.avatar(:class="userStatusClass(user)")
|
||||
img(v-lazy="userImage(user)")
|
||||
.detail
|
||||
span.name(v-text="user.displayName" :style="{'color':user.$userColour}")
|
||||
span.extra(v-if="user.location === 'traveling'")
|
||||
i.el-icon-loading(style="margin-right:5px")
|
||||
timer(:epoch="user.$travelingToTime")
|
||||
span.extra(v-else)
|
||||
timer(:epoch="user.$location_at")
|
||||
el-tab-pane(:label="$t('dialog.world.info.header')")
|
||||
.x-friend-list(style="max-height:none")
|
||||
.x-friend-item(style="width:100%;cursor:default")
|
||||
.detail
|
||||
span.name {{ $t('dialog.world.info.memo') }}
|
||||
el-input.extra(v-model="worldDialog.memo" @change="onWorldMemoChange" type="textarea" :rows="2" :autosize="{ minRows: 1, maxRows: 20 }" :placeholder="$t('dialog.world.info.memo_placeholder')" size="mini" resize="none")
|
||||
div(style="width:100%;display:flex")
|
||||
.x-friend-item(style="width:100%;cursor:default")
|
||||
.detail
|
||||
span.name {{ $t('dialog.world.info.id') }}
|
||||
span.extra {{ worldDialog.id }}
|
||||
el-tooltip(placement="top" :content="$t('dialog.world.info.id_tooltip')" :disabled="hideTooltips")
|
||||
el-dropdown(trigger="click" @click.native.stop size="mini" style="margin-left:5px")
|
||||
el-button(type="default" icon="el-icon-s-order" size="mini" circle)
|
||||
el-dropdown-menu(#default="dropdown")
|
||||
el-dropdown-item(@click.native="copyWorldId(worldDialog.id)") {{ $t('dialog.world.info.copy_id') }}
|
||||
el-dropdown-item(@click.native="copyWorldUrl(worldDialog.id)") {{ $t('dialog.world.info.copy_url') }}
|
||||
el-dropdown-item(@click.native="copyWorldName(worldDialog.ref.name)") {{ $t('dialog.world.info.copy_name') }}
|
||||
.x-friend-item(v-if="worldDialog.ref.previewYoutubeId" style="width:350px" @click="openExternalLink(`https://www.youtube.com/watch?v=${worldDialog.ref.previewYoutubeId}`)")
|
||||
.detail
|
||||
span.name {{ $t('dialog.world.info.youtube_preview') }}
|
||||
span.extra https://www.youtube.com/watch?v={{ worldDialog.ref.previewYoutubeId }}
|
||||
.x-friend-item(style="width:100%;cursor:default")
|
||||
.detail
|
||||
span.name {{ $t('dialog.world.info.author_tags') }}
|
||||
span.extra(v-if="worldDialog.ref.tags?.filter(tag => tag.startsWith('author_tag')).length > 0") {{ worldDialog.ref.tags.filter(tag => tag.startsWith('author_tag')).map(tag => tag.replace('author_tag_', '')).join(', ') }}
|
||||
span.extra(v-else) -
|
||||
.x-friend-item(style="cursor:default")
|
||||
.detail
|
||||
span.name {{ $t('dialog.world.info.players') }}
|
||||
span.extra {{ worldDialog.ref.occupants | commaNumber }}
|
||||
.x-friend-item(style="cursor:default")
|
||||
.detail
|
||||
span.name {{ $t('dialog.world.info.favorites') }}
|
||||
span.extra {{ worldDialog.ref.favorites | commaNumber }}
|
||||
| #[template(v-if="worldDialog.ref.favorites > 0 && worldDialog.ref.visits > 0") ({{ Math.round(((worldDialog.ref.favorites - worldDialog.ref.visits) / worldDialog.ref.visits * 100 + 100) * 100) / 100 }}%)]
|
||||
.x-friend-item(style="cursor:default")
|
||||
.detail
|
||||
span.name {{ $t('dialog.world.info.visits') }}
|
||||
span.extra {{ worldDialog.ref.visits | commaNumber }}
|
||||
.x-friend-item(style="cursor:default")
|
||||
.detail
|
||||
span.name {{ $t('dialog.world.info.capacity') }}
|
||||
span.extra {{ worldDialog.ref.recommendedCapacity | commaNumber }} ({{ worldDialog.ref.capacity | commaNumber }})
|
||||
.x-friend-item(style="cursor:default")
|
||||
.detail
|
||||
span.name {{ $t('dialog.world.info.created_at') }}
|
||||
span.extra {{ worldDialog.ref.created_at | formatDate('long') }}
|
||||
.x-friend-item(style="cursor:default")
|
||||
.detail
|
||||
span.name {{ $t('dialog.world.info.last_updated') }}
|
||||
span.extra(v-if="worldDialog.lastUpdated") {{ worldDialog.lastUpdated | formatDate('long') }}
|
||||
span.extra(v-else) {{ worldDialog.ref.updated_at | formatDate('long') }}
|
||||
.x-friend-item(v-if="worldDialog.ref.labsPublicationDate !== 'none'" style="cursor:default")
|
||||
.detail
|
||||
span.name {{ $t('dialog.world.info.labs_publication_date') }}
|
||||
span.extra {{ worldDialog.ref.labsPublicationDate | formatDate('long') }}
|
||||
.x-friend-item(v-if="worldDialog.ref.publicationDate !== 'none'" style="cursor:default")
|
||||
.detail
|
||||
span.name {{ $t('dialog.world.info.publication_date') }}
|
||||
el-tooltip(v-if="worldDialog.ref.publicationDate && worldDialog.ref.publicationDate !== 'none' && worldDialog.ref.labsPublicationDate && worldDialog.ref.labsPublicationDate !== 'none'" placement="top" style="margin-left:5px")
|
||||
template(#content)
|
||||
span {{ $t('dialog.world.info.time_in_labs') }} {{ timeToText(new Date(worldDialog.ref.publicationDate) - new Date(worldDialog.ref.labsPublicationDate)) }}
|
||||
i.el-icon-arrow-down
|
||||
span.extra {{ worldDialog.ref.publicationDate | formatDate('long') }}
|
||||
.x-friend-item(style="cursor:default")
|
||||
.detail
|
||||
span.name {{ $t('dialog.world.info.version') }}
|
||||
span.extra(v-text="worldDialog.ref.version")
|
||||
.x-friend-item(style="cursor:default")
|
||||
.detail
|
||||
span.name {{ $t('dialog.world.info.heat') }}
|
||||
span.extra {{ worldDialog.ref.heat | commaNumber }} {{ '🔥'.repeat(worldDialog.ref.heat) }}
|
||||
.x-friend-item(style="cursor:default")
|
||||
.detail
|
||||
span.name {{ $t('dialog.world.info.popularity') }}
|
||||
span.extra {{ worldDialog.ref.popularity | commaNumber }} {{ '💖'.repeat(worldDialog.ref.popularity) }}
|
||||
.x-friend-item(style="width:100%;cursor:default")
|
||||
.detail
|
||||
span.name {{ $t('dialog.world.info.platform') }}
|
||||
span.extra(v-text="worldDialogPlatform")
|
||||
.x-friend-item(style="cursor:default")
|
||||
.detail
|
||||
span.name {{ $t('dialog.world.info.last_visited') }}
|
||||
el-tooltip(v-if="!hideTooltips" placement="top" style="margin-left:5px" :content="$t('dialog.world.info.accuracy_notice')")
|
||||
i.el-icon-warning
|
||||
span.extra {{ worldDialog.lastVisit | formatDate('long') }}
|
||||
.x-friend-item(@click="showPreviousInstancesWorldDialog(worldDialog.ref)")
|
||||
.detail
|
||||
span.name {{ $t('dialog.world.info.visit_count') }}
|
||||
el-tooltip(v-if="!hideTooltips" placement="top" style="margin-left:5px" :content="$t('dialog.world.info.accuracy_notice')")
|
||||
i.el-icon-warning
|
||||
span.extra(v-text="worldDialog.visitCount")
|
||||
.x-friend-item(style="cursor:default")
|
||||
.detail
|
||||
span.name {{ $t('dialog.world.info.time_spent') }}
|
||||
el-tooltip(v-if="!hideTooltips" placement="top" style="margin-left:5px" :content="$t('dialog.world.info.accuracy_notice')")
|
||||
i.el-icon-warning
|
||||
span.extra(v-if="worldDialog.timeSpent === 0") -
|
||||
span.extra(v-else) {{ timeToText(worldDialog.timeSpent) }}
|
||||
el-tab-pane(:label="$t('dialog.world.json.header')")
|
||||
el-button(type="default" @click="refreshWorldDialogTreeData()" size="mini" icon="el-icon-refresh" circle)
|
||||
el-button(type="default" @click="downloadAndSaveJson(worldDialog.id, worldDialog.ref)" size="mini" icon="el-icon-download" circle style="margin-left:5px")
|
||||
el-tree(:data="worldDialog.treeData" style="margin-top:5px;font-size:12px")
|
||||
template(#default="scope")
|
||||
span
|
||||
span(v-text="scope.data.key" style="font-weight:bold;margin-right:5px")
|
||||
span(v-if="!scope.data.children" v-text="scope.data.value")
|
||||
113
html/src/mixins/friendsListSidebar.pug
Normal file
113
html/src/mixins/friendsListSidebar.pug
Normal file
@@ -0,0 +1,113 @@
|
||||
|
||||
mixin friendsListSidebar()
|
||||
.x-aside-container(v-show="$refs.menu && $refs.menu.activeIndex !== 'friendsList'" id="aside")
|
||||
div(style="display:flex;align-items:baseline")
|
||||
el-select(v-model="quickSearch" clearable :placeholder="$t('side_panel.search_placeholder')" filterable remote :remote-method="quickSearchRemoteMethod" popper-class="x-quick-search" @change="quickSearchChange" @visible-change="quickSearchVisibleChange" style="flex:1;padding:10px")
|
||||
el-option(v-for="item in quickSearchItems" :key="item.value" :value="item.value" :label="item.label")
|
||||
.x-friend-item
|
||||
template(v-if="item.ref")
|
||||
.detail
|
||||
span.name(v-text="item.ref.displayName" :style="{'color':item.ref.$userColour}")
|
||||
span.extra(v-if="!item.ref.isFriend")
|
||||
span.extra(v-else-if="item.ref.state === 'offline'") {{ $t('side_panel.search_result_active') }}
|
||||
span.extra(v-else-if="item.ref.state === 'active'") {{ $t('side_panel.search_result_offline') }}
|
||||
location.extra(v-else :location="item.ref.location" :traveling="item.ref.travelingToLocation" :link="false")
|
||||
img.avatar(v-lazy="userImage(item.ref)")
|
||||
span(v-else) {{ $t('side_panel.search_result_more') }} #[span(v-text="item.label" style="font-weight:bold")]
|
||||
el-tooltip(placement="bottom" :content="$t('side_panel.direct_access_tooltip')" :disabled="hideTooltips")
|
||||
el-button(type="default" @click="directAccessPaste" size="mini" icon="el-icon-discover" circle)
|
||||
el-tooltip(placement="bottom" :content="$t('side_panel.refresh_tooltip')" :disabled="hideTooltips")
|
||||
el-button(type="default" @click="refreshFriendsList" :loading="API.isRefreshFriendsLoading" size="mini" icon="el-icon-refresh" circle style="margin-right:10px")
|
||||
el-tabs.zero-margin-tabs(stretch="true" style="height:calc(100% - 60px;margin-top:5px")
|
||||
el-tab-pane
|
||||
template(#label)
|
||||
span {{ $t('side_panel.friends') }}
|
||||
span(style="color:#909399;font-size:12px;margin-left:10px") ({{ onlineFriendCount }}/{{ friends.size }})
|
||||
.x-friend-list(style="padding:10px 5px")
|
||||
.x-friend-group.x-link(@click="isFriendsGroupMe = !isFriendsGroupMe; saveFriendsGroupStates()" style="padding:0px 0px 5px")
|
||||
i.el-icon-arrow-right(:class="{ rotate: isFriendsGroupMe }")
|
||||
span(style="margin-left:5px") {{ $t('side_panel.me') }}
|
||||
div(v-show="isFriendsGroupMe")
|
||||
.x-friend-item(:key="API.currentUser.id" @click="showUserDialog(API.currentUser.id)")
|
||||
.avatar(:class="userStatusClass(API.currentUser)")
|
||||
img(v-lazy="userImage(API.currentUser)")
|
||||
.detail
|
||||
span.name(v-text="API.currentUser.displayName" :style="{'color':API.currentUser.$userColour}")
|
||||
location.extra(v-if="isGameRunning && !gameLogDisabled" :location="lastLocation.location" :traveling="lastLocationDestination" :link="false")
|
||||
location.extra(v-else-if="isRealInstance(API.currentUser.$locationTag) || isRealInstance(API.currentUser.$travelingToLocation)" :location="API.currentUser.$locationTag" :traveling="API.currentUser.$travelingToLocation" :link="false")
|
||||
span.extra(v-else v-text="API.currentUser.statusDescription")
|
||||
.x-friend-group.x-link(@click="isVIPFriends = !isVIPFriends; saveFriendsGroupStates()" v-show="vipFriends.length")
|
||||
i.el-icon-arrow-right(:class="{ rotate: isVIPFriends }")
|
||||
span(style="margin-left:5px") {{ $t('side_panel.favorite') }} ― {{ vipFriends.length }}
|
||||
div(v-show="isVIPFriends")
|
||||
.x-friend-item(v-for="friend in vipFriends" :key="friend.id" @click="showUserDialog(friend.id)")
|
||||
template(v-if="friend.ref")
|
||||
.avatar(:class="userStatusClass(friend.ref, friend.pendingOffline)")
|
||||
img(v-lazy="userImage(friend.ref)")
|
||||
.detail
|
||||
span.name(v-if="!hideNicknames && friend.$nickName" :style="{'color':friend.ref.$userColour}") {{ friend.ref.displayName }} ({{ friend.$nickName }})
|
||||
span.name(v-else v-text="friend.ref.displayName" :style="{'color':friend.ref.$userColour}")
|
||||
span.extra(v-if="friend.pendingOffline") #[i.el-icon-warning-outline] {{ $t('side_panel.pending_offline') }}
|
||||
location.extra(v-else :location="friend.ref.location" :traveling="friend.ref.travelingToLocation" :link="false")
|
||||
template(v-else)
|
||||
span(v-text="friend.name || friend.id")
|
||||
el-button(type="text" icon="el-icon-close" size="mini" @click.stop="confirmDeleteFriend(friend.id)" style="margin-left:5px")
|
||||
.x-friend-group.x-link(@click="isOnlineFriends = !isOnlineFriends; saveFriendsGroupStates()" v-show="onlineFriends.length")
|
||||
i.el-icon-arrow-right(:class="{ rotate: isOnlineFriends }")
|
||||
span(style="margin-left:5px") {{ $t('side_panel.online') }} ― {{ onlineFriends.length }}
|
||||
div(v-show="isOnlineFriends")
|
||||
.x-friend-item(v-for="friend in onlineFriends" :key="friend.id" @click="showUserDialog(friend.id)")
|
||||
template(v-if="friend.ref")
|
||||
.avatar(:class="userStatusClass(friend.ref, friend.pendingOffline)")
|
||||
img(v-lazy="userImage(friend.ref)")
|
||||
.detail
|
||||
span.name(v-if="!hideNicknames && friend.$nickName" :style="{'color':friend.ref.$userColour}") {{ friend.ref.displayName }} ({{ friend.$nickName }})
|
||||
span.name(v-else v-text="friend.ref.displayName" :style="{'color':friend.ref.$userColour}")
|
||||
span.extra(v-if="friend.pendingOffline") #[i.el-icon-warning-outline] {{ $t('side_panel.pending_offline') }}
|
||||
location.extra(v-else :location="friend.ref.location" :traveling="friend.ref.travelingToLocation" :link="false")
|
||||
template(v-else)
|
||||
span(v-text="friend.name || friend.id")
|
||||
el-button(type="text" icon="el-icon-close" size="mini" @click.stop="confirmDeleteFriend(friend.id)" style="margin-left:5px")
|
||||
.x-friend-group.x-link(@click="isActiveFriends = !isActiveFriends; saveFriendsGroupStates()" v-show="activeFriends.length")
|
||||
i.el-icon-arrow-right(:class="{ rotate: isActiveFriends }")
|
||||
span(style="margin-left:5px") {{ $t('side_panel.active') }} ― {{ activeFriends.length }}
|
||||
div(v-show="isActiveFriends")
|
||||
.x-friend-item(v-for="friend in activeFriends" :key="friend.id" @click="showUserDialog(friend.id)")
|
||||
template(v-if="friend.ref")
|
||||
.avatar
|
||||
img(v-lazy="userImage(friend.ref)")
|
||||
.detail
|
||||
span.name(v-if="!hideNicknames && friend.$nickName" :style="{'color':friend.ref.$userColour}") {{ friend.ref.displayName }} ({{ friend.$nickName }})
|
||||
span.name(v-else v-text="friend.ref.displayName" :style="{'color':friend.ref.$userColour}")
|
||||
span.extra(v-text="friend.ref.statusDescription" :link="false")
|
||||
template(v-else)
|
||||
span(v-text="friend.name || friend.id")
|
||||
el-button(type="text" icon="el-icon-close" size="mini" @click.stop="confirmDeleteFriend(friend.id)" style="margin-left:5px")
|
||||
.x-friend-group.x-link(@click="isOfflineFriends = !isOfflineFriends; saveFriendsGroupStates()" v-show="offlineFriends.length")
|
||||
i.el-icon-arrow-right(:class="{ rotate: isOfflineFriends }")
|
||||
span(style="margin-left:5px") {{ $t('side_panel.offline') }} ― {{ offlineFriends.length }}
|
||||
div(v-show="isOfflineFriends")
|
||||
.x-friend-item(v-for="friend in offlineFriends" :key="friend.id" @click="showUserDialog(friend.id)")
|
||||
template(v-if="friend.ref")
|
||||
.avatar
|
||||
img(v-lazy="userImage(friend.ref)")
|
||||
.detail
|
||||
span.name(v-if="!hideNicknames && friend.$nickName" :style="{'color':friend.ref.$userColour}") {{ friend.ref.displayName }} ({{ friend.$nickName }})
|
||||
span.name(v-else v-text="friend.ref.displayName" :style="{'color':friend.ref.$userColour}")
|
||||
span.extra(v-text="friend.ref.statusDescription")
|
||||
template(v-else)
|
||||
span(v-text="friend.name || friend.id")
|
||||
el-button(type="text" icon="el-icon-close" size="mini" @click.stop="confirmDeleteFriend(friend.id)" style="margin-left:5px")
|
||||
el-tab-pane
|
||||
template(#label)
|
||||
span {{ $t('side_panel.groups') }}
|
||||
span(style="color:#909399;font-size:12px;margin-left:10px") ({{ groupInstances.length }})
|
||||
.x-friend-list(style="padding:10px 5px")
|
||||
.x-friend-item(v-for="ref in groupInstances" :key="ref.instance.id" @click="showGroupDialog(ref.instance.ownerId)")
|
||||
.avatar
|
||||
img(v-lazy="ref.group.iconUrl")
|
||||
.detail
|
||||
span.name
|
||||
span(v-text="ref.group.name")
|
||||
span(style="font-weight:normal;margin-left:5px") ({{ ref.instance.userCount }}/{{ ref.instance.capacity }})
|
||||
location.extra(:location="ref.instance.location" :link="false")
|
||||
@@ -9,14 +9,12 @@ mixin feedTab()
|
||||
el-select(v-model="feedTable.filter" @change="feedTableLookup" multiple clearable collapse-tags style="flex:1" :placeholder="$t('view.feed.filter_placeholder')")
|
||||
el-option(v-once v-for="type in ['GPS', 'Online', 'Offline', 'Status', 'Avatar', 'Bio']" :key="type" :label="type" :value="type")
|
||||
el-input(v-model="feedTable.search" :placeholder="$t('view.feed.search_placeholder')" @keyup.native.13="feedTableLookup" @change="feedTableLookup" clearable style="flex:none;width:150px;margin:0 10px")
|
||||
//- el-tooltip(placement="bottom" content="Clear feed" :disabled="hideTooltips")
|
||||
//- el-button(type="default" @click="clearFeed()" icon="el-icon-delete" circle style="flex:none")
|
||||
el-table-column(type="expand" width="20")
|
||||
template(v-once #default="scope")
|
||||
div(style="position:relative;font-size:14px")
|
||||
template(v-if="scope.row.type === 'GPS'")
|
||||
location(v-if="scope.row.previousLocation" :location="scope.row.previousLocation")
|
||||
el-tag(type="info" effect="plain" size="mini" style="margin-left:5px") {{ scope.row.time | timeToText }}
|
||||
el-tag(type="info" effect="plain" size="mini" style="margin-left:5px") {{ timeToText(scope.row.time) }}
|
||||
br
|
||||
span
|
||||
i.el-icon-right
|
||||
@@ -24,7 +22,7 @@ mixin feedTab()
|
||||
template(v-else-if="scope.row.type === 'Offline'")
|
||||
template(v-if="scope.row.location")
|
||||
location(:location="scope.row.location" :hint="scope.row.worldName" :grouphint="scope.row.groupName")
|
||||
el-tag(type="info" effect="plain" size="mini" style="margin-left:5px") {{ scope.row.time | timeToText }}
|
||||
el-tag(type="info" effect="plain" size="mini" style="margin-left:5px") {{ timeToText(scope.row.time) }}
|
||||
template(v-else-if="scope.row.type === 'Online'")
|
||||
location(v-if="scope.row.location" :location="scope.row.location" :hint="scope.row.worldName" :grouphint="scope.row.groupName")
|
||||
template(v-else-if="scope.row.type === 'Avatar'")
|
||||
|
||||
@@ -67,7 +67,7 @@ mixin friendsListTab()
|
||||
el-table-column(:label="$t('table.friendList.joinCount')" width="120" prop="$joinCount" sortable)
|
||||
el-table-column(:label="$t('table.friendList.timeTogether')" width="140" prop="$timeSpent" sortable)
|
||||
template(v-once #default="scope")
|
||||
span(v-if="scope.row.$timeSpent") {{ scope.row.$timeSpent | timeToText }}
|
||||
span(v-if="scope.row.$timeSpent") {{ timeToText(scope.row.$timeSpent) }}
|
||||
el-table-column(:label="$t('table.friendList.lastSeen')" width="170" prop="$lastSeen" sortable :sort-method="(a, b) => sortAlphabetically(a, b, '$lastSeen')")
|
||||
template(v-once #default="scope")
|
||||
span {{ scope.row.$lastSeen | formatDate('long') }}
|
||||
|
||||
@@ -6,8 +6,6 @@ mixin gameLogTab()
|
||||
el-select(v-model="gameLogTable.filter" @change="gameLogTableLookup" multiple clearable collapse-tags style="flex:1" :placeholder="$t('view.game_log.filter_placeholder')")
|
||||
el-option(v-once v-for="type in ['Location', 'OnPlayerJoined', 'OnPlayerLeft', 'PortalSpawn', 'VideoPlay', 'Event', 'External', 'StringLoad', 'ImageLoad']" :key="type" :label="type" :value="type")
|
||||
el-input(v-model="gameLogTable.search" :placeholder="$t('view.game_log.search_placeholder')" @keyup.native.13="gameLogTableLookup" @change="gameLogTableLookup" clearable style="flex:none;width:150px;margin:0 10px")
|
||||
//- el-tooltip(placement="bottom" content="Reload game log" :disabled="hideTooltips")
|
||||
//- el-button(type="default" @click="resetGameLog" icon="el-icon-refresh" circle style="flex:none")
|
||||
el-table-column(:label="$t('table.gameLog.date')" prop="created_at" sortable="custom" width="120")
|
||||
template(v-once #default="scope")
|
||||
el-tooltip(placement="right")
|
||||
|
||||
@@ -186,7 +186,7 @@ class Database {
|
||||
|
||||
// memos
|
||||
|
||||
async getMemo(userId) {
|
||||
async getUserMemo(userId) {
|
||||
var row = {};
|
||||
await sqliteService.execute(
|
||||
(dbRow) => {
|
||||
@@ -204,7 +204,7 @@ class Database {
|
||||
return row;
|
||||
}
|
||||
|
||||
async getAllMemos() {
|
||||
async getAllUserMemos() {
|
||||
var memos = [];
|
||||
await sqliteService.execute((dbRow) => {
|
||||
var row = {
|
||||
@@ -216,7 +216,7 @@ class Database {
|
||||
return memos;
|
||||
}
|
||||
|
||||
setMemo(entry) {
|
||||
setUserMemo(entry) {
|
||||
sqliteService.executeNonQuery(
|
||||
`INSERT OR REPLACE INTO memos (user_id, edited_at, memo) VALUES (@user_id, @edited_at, @memo)`,
|
||||
{
|
||||
@@ -227,7 +227,7 @@ class Database {
|
||||
);
|
||||
}
|
||||
|
||||
deleteMemo(userId) {
|
||||
deleteUserMemo(userId) {
|
||||
sqliteService.executeNonQuery(
|
||||
`DELETE FROM memos WHERE user_id = @user_id`,
|
||||
{
|
||||
|
||||
233
html/src/vr.js
233
html/src/vr.js
@@ -1,4 +1,4 @@
|
||||
// Copyright(c) 2019-2022 pypy, Natsumi and individual contributors.
|
||||
// Copyright(c) 2019-2024 pypy, Natsumi and individual contributors.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This work is licensed under the terms of the MIT license.
|
||||
@@ -15,10 +15,14 @@ import ElementUI from 'element-ui';
|
||||
import * as workerTimers from 'worker-timers';
|
||||
import MarqueeText from 'vue-marquee-text-component';
|
||||
import * as localizedStrings from './localization/localizedStrings.js';
|
||||
|
||||
import _utils from './classes/utils.js';
|
||||
|
||||
Vue.component('marquee-text', MarqueeText);
|
||||
|
||||
(async function () {
|
||||
var $app = null;
|
||||
const $utils = new _utils().$utils;
|
||||
let $app = {};
|
||||
|
||||
await CefSharp.BindObjectAsync('AppApiVr');
|
||||
|
||||
@@ -32,76 +36,19 @@ Vue.component('marquee-text', MarqueeText);
|
||||
timeout: 3000
|
||||
});
|
||||
|
||||
// localization
|
||||
Vue.use(VueI18n);
|
||||
|
||||
var i18n = new VueI18n({
|
||||
const i18n = new VueI18n({
|
||||
locale: 'en',
|
||||
fallbackLocale: 'en',
|
||||
messages: localizedStrings
|
||||
});
|
||||
|
||||
// var $t = i18n.t.bind(i18n);
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const $t = i18n.t.bind(i18n);
|
||||
Vue.use(ElementUI, {
|
||||
i18n: (key, value) => i18n.t(key, value)
|
||||
});
|
||||
|
||||
var escapeTag = (s) =>
|
||||
String(s).replace(/["&'<>]/gu, (c) => `&#${c.charCodeAt(0)};`);
|
||||
Vue.filter('escapeTag', escapeTag);
|
||||
|
||||
var escapeTagRecursive = (obj) => {
|
||||
if (typeof obj === 'string') {
|
||||
return escapeTag(obj);
|
||||
}
|
||||
if (typeof obj === 'object') {
|
||||
for (var key in obj) {
|
||||
obj[key] = escapeTagRecursive(obj[key]);
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
};
|
||||
|
||||
var commaNumber = (n) =>
|
||||
String(Number(n) || 0).replace(/(\d)(?=(\d{3})+(?!\d))/gu, '$1,');
|
||||
Vue.filter('commaNumber', commaNumber);
|
||||
|
||||
var textToHex = (s) =>
|
||||
String(s)
|
||||
.split('')
|
||||
.map((c) => c.charCodeAt(0).toString(16))
|
||||
.join(' ');
|
||||
Vue.filter('textToHex', textToHex);
|
||||
|
||||
var timeToText = function (sec) {
|
||||
var n = Number(sec);
|
||||
if (isNaN(n)) {
|
||||
return escapeTag(sec);
|
||||
}
|
||||
n = Math.floor(n / 1000);
|
||||
var arr = [];
|
||||
if (n < 0) {
|
||||
n = -n;
|
||||
}
|
||||
if (n >= 86400) {
|
||||
arr.push(`${Math.floor(n / 86400)}d`);
|
||||
n %= 86400;
|
||||
}
|
||||
if (n >= 3600) {
|
||||
arr.push(`${Math.floor(n / 3600)}h`);
|
||||
n %= 3600;
|
||||
}
|
||||
if (n >= 60) {
|
||||
arr.push(`${Math.floor(n / 60)}m`);
|
||||
n %= 60;
|
||||
}
|
||||
if (arr.length === 0 && n < 60) {
|
||||
arr.push(`${n}s`);
|
||||
}
|
||||
return arr.join(' ');
|
||||
};
|
||||
Vue.filter('timeToText', timeToText);
|
||||
|
||||
Vue.component('location', {
|
||||
template:
|
||||
'<span><span>{{ text }}</span>' +
|
||||
@@ -130,7 +77,7 @@ Vue.component('marquee-text', MarqueeText);
|
||||
methods: {
|
||||
parse() {
|
||||
this.text = this.location;
|
||||
var L = $app.parseLocation(this.location);
|
||||
var L = $utils.parseLocation(this.location);
|
||||
if (L.isOffline) {
|
||||
this.text = 'Offline';
|
||||
} else if (L.isPrivate) {
|
||||
@@ -176,18 +123,7 @@ Vue.component('marquee-text', MarqueeText);
|
||||
}
|
||||
});
|
||||
|
||||
var removeFromArray = function (array, item) {
|
||||
var { length } = array;
|
||||
for (var i = 0; i < length; ++i) {
|
||||
if (array[i] === item) {
|
||||
array.splice(i, 1);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
var $app = {
|
||||
const app = {
|
||||
i18n,
|
||||
data: {
|
||||
// 1 = 대시보드랑 손목에 보이는거
|
||||
@@ -228,7 +164,9 @@ Vue.component('marquee-text', MarqueeText);
|
||||
deviceCount: 0
|
||||
},
|
||||
computed: {},
|
||||
methods: {},
|
||||
methods: {
|
||||
...$utils
|
||||
},
|
||||
watch: {},
|
||||
el: '#x-app',
|
||||
mounted() {
|
||||
@@ -239,113 +177,7 @@ Vue.component('marquee-text', MarqueeText);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$app.methods.parseLocation = function (tag) {
|
||||
var _tag = String(tag || '');
|
||||
var ctx = {
|
||||
tag: _tag,
|
||||
isOffline: false,
|
||||
isPrivate: false,
|
||||
isTraveling: false,
|
||||
worldId: '',
|
||||
instanceId: '',
|
||||
instanceName: '',
|
||||
accessType: '',
|
||||
accessTypeName: '',
|
||||
region: '',
|
||||
shortName: '',
|
||||
userId: null,
|
||||
hiddenId: null,
|
||||
privateId: null,
|
||||
friendsId: null,
|
||||
groupId: null,
|
||||
groupAccessType: null,
|
||||
canRequestInvite: false,
|
||||
strict: false
|
||||
};
|
||||
if (_tag === 'offline' || _tag === 'offline:offline') {
|
||||
ctx.isOffline = true;
|
||||
} else if (_tag === 'private' || _tag === 'private:private') {
|
||||
ctx.isPrivate = true;
|
||||
} else if (_tag === 'traveling' || _tag === 'traveling:traveling') {
|
||||
ctx.isTraveling = true;
|
||||
} else if (_tag.startsWith('local') === false) {
|
||||
var sep = _tag.indexOf(':');
|
||||
// technically not part of instance id, but might be there when coping id from url so why not support it
|
||||
var shortNameQualifier = '&shortName=';
|
||||
var shortNameIndex = _tag.indexOf(shortNameQualifier);
|
||||
if (shortNameIndex >= 0) {
|
||||
ctx.shortName = _tag.substr(
|
||||
shortNameIndex + shortNameQualifier.length
|
||||
);
|
||||
_tag = _tag.substr(0, shortNameIndex);
|
||||
}
|
||||
if (sep >= 0) {
|
||||
ctx.worldId = _tag.substr(0, sep);
|
||||
ctx.instanceId = _tag.substr(sep + 1);
|
||||
ctx.instanceId.split('~').forEach((s, i) => {
|
||||
if (i) {
|
||||
var A = s.indexOf('(');
|
||||
var Z = A >= 0 ? s.lastIndexOf(')') : -1;
|
||||
var key = Z >= 0 ? s.substr(0, A) : s;
|
||||
var value = A < Z ? s.substr(A + 1, Z - A - 1) : '';
|
||||
if (key === 'hidden') {
|
||||
ctx.hiddenId = value;
|
||||
} else if (key === 'private') {
|
||||
ctx.privateId = value;
|
||||
} else if (key === 'friends') {
|
||||
ctx.friendsId = value;
|
||||
} else if (key === 'canRequestInvite') {
|
||||
ctx.canRequestInvite = true;
|
||||
} else if (key === 'region') {
|
||||
ctx.region = value;
|
||||
} else if (key === 'group') {
|
||||
ctx.groupId = value;
|
||||
} else if (key === 'groupAccessType') {
|
||||
ctx.groupAccessType = value;
|
||||
} else if (key === 'strict') {
|
||||
ctx.strict = true;
|
||||
}
|
||||
} else {
|
||||
ctx.instanceName = s;
|
||||
}
|
||||
});
|
||||
ctx.accessType = 'public';
|
||||
if (ctx.privateId !== null) {
|
||||
if (ctx.canRequestInvite) {
|
||||
// InvitePlus
|
||||
ctx.accessType = 'invite+';
|
||||
} else {
|
||||
// InviteOnly
|
||||
ctx.accessType = 'invite';
|
||||
}
|
||||
ctx.userId = ctx.privateId;
|
||||
} else if (ctx.friendsId !== null) {
|
||||
// FriendsOnly
|
||||
ctx.accessType = 'friends';
|
||||
ctx.userId = ctx.friendsId;
|
||||
} else if (ctx.hiddenId !== null) {
|
||||
// FriendsOfGuests
|
||||
ctx.accessType = 'friends+';
|
||||
ctx.userId = ctx.hiddenId;
|
||||
} else if (ctx.groupId !== null) {
|
||||
// Group
|
||||
ctx.accessType = 'group';
|
||||
}
|
||||
ctx.accessTypeName = ctx.accessType;
|
||||
if (ctx.groupAccessType !== null) {
|
||||
if (ctx.groupAccessType === 'public') {
|
||||
ctx.accessTypeName = 'groupPublic';
|
||||
} else if (ctx.groupAccessType === 'plus') {
|
||||
ctx.accessTypeName = 'groupPlus';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ctx.worldId = _tag;
|
||||
}
|
||||
}
|
||||
return ctx;
|
||||
};
|
||||
Object.assign($app, app);
|
||||
|
||||
$app.methods.configUpdate = function (json) {
|
||||
this.config = JSON.parse(json);
|
||||
@@ -454,14 +286,14 @@ Vue.component('marquee-text', MarqueeText);
|
||||
this.cpuUsage = cpuUsage.toFixed(0);
|
||||
}
|
||||
if (this.lastLocation.date !== 0) {
|
||||
this.lastLocationTimer = timeToText(
|
||||
this.lastLocationTimer = $utils.timeToText(
|
||||
Date.now() - this.lastLocation.date
|
||||
);
|
||||
} else {
|
||||
this.lastLocationTimer = '';
|
||||
}
|
||||
if (this.lastLocation.onlineFor) {
|
||||
this.onlineForTimer = timeToText(
|
||||
this.onlineForTimer = $utils.timeToText(
|
||||
Date.now() - this.lastLocation.onlineFor
|
||||
);
|
||||
} else {
|
||||
@@ -520,7 +352,7 @@ Vue.component('marquee-text', MarqueeText);
|
||||
if (this.config.pcUptimeOnFeed) {
|
||||
AppApiVr.GetUptime().then((uptime) => {
|
||||
if (uptime) {
|
||||
this.pcUptime = timeToText(uptime);
|
||||
this.pcUptime = $utils.timeToText(uptime);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
@@ -538,8 +370,8 @@ Vue.component('marquee-text', MarqueeText);
|
||||
console.error('noty is undefined');
|
||||
return;
|
||||
}
|
||||
var noty = escapeTagRecursive(noty);
|
||||
var message = escapeTag(message) || '';
|
||||
var noty = $utils.escapeTagRecursive(noty);
|
||||
var message = $utils.escapeTag(message) || '';
|
||||
var text = '';
|
||||
var img = '';
|
||||
if (image) {
|
||||
@@ -727,25 +559,6 @@ Vue.component('marquee-text', MarqueeText);
|
||||
return style;
|
||||
};
|
||||
|
||||
$app.methods.displayLocation = function (location, worldName, groupName) {
|
||||
var text = worldName;
|
||||
var L = this.parseLocation(location);
|
||||
if (L.isOffline) {
|
||||
text = 'Offline';
|
||||
} else if (L.isPrivate) {
|
||||
text = 'Private';
|
||||
} else if (L.isTraveling) {
|
||||
text = 'Traveling';
|
||||
} else if (L.worldId) {
|
||||
if (groupName) {
|
||||
text = `${worldName} ${L.accessTypeName}(${groupName})`;
|
||||
} else if (L.instanceId) {
|
||||
text = `${worldName} ${L.accessTypeName}`;
|
||||
}
|
||||
}
|
||||
return escapeTag(text);
|
||||
};
|
||||
|
||||
$app.methods.notyClear = function () {
|
||||
Noty.closeAll();
|
||||
};
|
||||
@@ -769,7 +582,7 @@ Vue.component('marquee-text', MarqueeText);
|
||||
var dt = Date.now();
|
||||
this.hudFeed.forEach((item) => {
|
||||
if (item.time + this.config.photonOverlayMessageTimeout < dt) {
|
||||
removeFromArray(this.hudFeed, item);
|
||||
$utils.removeFromArray(this.hudFeed, item);
|
||||
}
|
||||
});
|
||||
if (this.hudFeed.length > 10) {
|
||||
@@ -790,7 +603,7 @@ Vue.component('marquee-text', MarqueeText);
|
||||
item.text === data.text
|
||||
) {
|
||||
combo = item.combo + 1;
|
||||
removeFromArray(this.hudFeed, item);
|
||||
$utils.removeFromArray(this.hudFeed, item);
|
||||
}
|
||||
});
|
||||
this.hudFeed.unshift({
|
||||
|
||||
Reference in New Issue
Block a user