mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-06 22:46:06 +02:00
Instance closed icon
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
/></span>
|
/></span>
|
||||||
<template v-if="state.canCloseInstance">
|
<template v-if="state.canCloseInstance">
|
||||||
<el-button
|
<el-button
|
||||||
:disabled="props.instance.closedAt"
|
:disabled="!!props.instance.closedAt"
|
||||||
size="small"
|
size="small"
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="closeInstance(props.location)">
|
@click="closeInstance(props.location)">
|
||||||
@@ -49,12 +49,6 @@
|
|||||||
style="margin-left: 5px; color: lightcoral"
|
style="margin-left: 5px; color: lightcoral"
|
||||||
>{{ t('dialog.user.info.instance_full') }}</span
|
>{{ t('dialog.user.info.instance_full') }}</span
|
||||||
>
|
>
|
||||||
<span v-if="props.instance.hardClose" style="margin-left: 5px; color: lightcoral">{{
|
|
||||||
t('dialog.user.info.instance_hard_closed')
|
|
||||||
}}</span>
|
|
||||||
<span v-else-if="props.instance.closedAt" style="margin-left: 5px; color: lightcoral">{{
|
|
||||||
t('dialog.user.info.instance_closed')
|
|
||||||
}}</span>
|
|
||||||
<span v-if="props.instance.queueSize" style="margin-left: 5px"
|
<span v-if="props.instance.queueSize" style="margin-left: 5px"
|
||||||
>{{ t('dialog.user.info.instance_queue') }} {{ props.instance.queueSize }}</span
|
>{{ t('dialog.user.info.instance_queue') }} {{ props.instance.queueSize }}</span
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -12,20 +12,26 @@
|
|||||||
</span>
|
</span>
|
||||||
<span v-if="groupName" :class="{ 'x-link': link }" @click="handleShowGroupDialog">({{ groupName }})</span>
|
<span v-if="groupName" :class="{ 'x-link': link }" @click="handleShowGroupDialog">({{ groupName }})</span>
|
||||||
<span v-if="region" :class="['flags', 'inline-block', 'ml-5', region]"></span>
|
<span v-if="region" :class="['flags', 'inline-block', 'ml-5', region]"></span>
|
||||||
|
<el-tooltip v-if="isClosed" :content="t('dialog.user.info.instance_closed')">
|
||||||
|
<el-icon :class="['inline-block', 'ml-5']" style="color: lightcoral"><WarnTriangleFilled /></el-icon>
|
||||||
|
</el-tooltip>
|
||||||
<el-icon v-if="strict" :class="['inline-block', 'ml-5']"><Lock /></el-icon>
|
<el-icon v-if="strict" :class="['inline-block', 'ml-5']"><Lock /></el-icon>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { Loading, Lock } from '@element-plus/icons-vue';
|
import { Loading, Lock, WarnTriangleFilled } from '@element-plus/icons-vue';
|
||||||
import { ref, watchEffect } from 'vue';
|
import { ref, watchEffect } from 'vue';
|
||||||
import { getGroupName, getWorldName, parseLocation } from '../shared/utils';
|
import { getGroupName, getWorldName, parseLocation } from '../shared/utils';
|
||||||
import { useGroupStore, useInstanceStore, useSearchStore, useWorldStore } from '../stores';
|
import { useGroupStore, useInstanceStore, useSearchStore, useWorldStore } from '../stores';
|
||||||
|
import { instanceRequest } from '../api';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
const { t } = useI18n();
|
||||||
|
|
||||||
const { cachedWorlds, showWorldDialog } = useWorldStore();
|
const { cachedWorlds, showWorldDialog } = useWorldStore();
|
||||||
const { showGroupDialog } = useGroupStore();
|
const { showGroupDialog } = useGroupStore();
|
||||||
const { getInstanceName, showPreviousInstancesInfoDialog } = useInstanceStore();
|
const { showPreviousInstancesInfoDialog } = useInstanceStore();
|
||||||
const { verifyShortName } = useSearchStore();
|
const { verifyShortName } = useSearchStore();
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@@ -51,6 +57,7 @@
|
|||||||
const strict = ref(false);
|
const strict = ref(false);
|
||||||
const isTraveling = ref(false);
|
const isTraveling = ref(false);
|
||||||
const groupName = ref('');
|
const groupName = ref('');
|
||||||
|
const isClosed = ref(false);
|
||||||
|
|
||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
parse();
|
parse();
|
||||||
@@ -64,8 +71,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function parse() {
|
function parse() {
|
||||||
|
text.value = '';
|
||||||
|
region.value = '';
|
||||||
|
strict.value = false;
|
||||||
isTraveling.value = false;
|
isTraveling.value = false;
|
||||||
groupName.value = '';
|
groupName.value = '';
|
||||||
|
isClosed.value = false;
|
||||||
|
|
||||||
let instanceId = props.location;
|
let instanceId = props.location;
|
||||||
if (typeof props.traveling !== 'undefined' && props.location === 'traveling') {
|
if (typeof props.traveling !== 'undefined' && props.location === 'traveling') {
|
||||||
instanceId = props.traveling;
|
instanceId = props.traveling;
|
||||||
@@ -73,10 +85,21 @@
|
|||||||
}
|
}
|
||||||
const L = parseLocation(instanceId);
|
const L = parseLocation(instanceId);
|
||||||
setText(L, L.instanceName);
|
setText(L, L.instanceName);
|
||||||
getInstanceName(instanceId)
|
if (!L.isRealInstance) {
|
||||||
.then((name) => {
|
return;
|
||||||
if (name && currentInstanceId() === L.tag) {
|
}
|
||||||
setText(L, name);
|
|
||||||
|
instanceRequest
|
||||||
|
.getCachedInstance({ worldId: L.worldId, instanceId: L.instanceId })
|
||||||
|
.then((args) => {
|
||||||
|
if (currentInstanceId() === L.tag) {
|
||||||
|
if (args.json.displayName) {
|
||||||
|
setText(L, args.json.displayName);
|
||||||
|
}
|
||||||
|
if (args.json.closedAt) {
|
||||||
|
isClosed.value = true;
|
||||||
|
}
|
||||||
|
console.log(args.json.closedAt);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
|
|||||||
@@ -1,24 +1,29 @@
|
|||||||
<template>
|
<template>
|
||||||
<span>
|
<span>
|
||||||
<span @click="showLaunchDialog" class="x-link">
|
<span @click="showLaunchDialog" class="x-link">
|
||||||
<el-icon v-if="isUnlocked" style="display: inline-block; margin-right: 5px"><Unlock /></el-icon>
|
<el-icon v-if="isUnlocked" :class="['inline-block', 'mr-5']"><Unlock /></el-icon>
|
||||||
<span>#{{ instanceName }} {{ accessTypeName }}</span>
|
<span>#{{ instanceName }} {{ accessTypeName }}</span>
|
||||||
</span>
|
</span>
|
||||||
<span v-if="groupName" @click="showGroupDialog" class="x-link">({{ groupName }})</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>
|
<span v-if="region" :class="['flags', 'inline-block', 'ml-5', region]"></span>
|
||||||
|
<el-tooltip v-if="isClosed" :content="t('dialog.user.info.instance_closed')">
|
||||||
|
<el-icon :class="['inline-block', 'ml-5']" style="color: lightcoral"><WarnTriangleFilled /></el-icon>
|
||||||
|
</el-tooltip>
|
||||||
<el-icon v-if="strict" style="display: inline-block; margin-left: 5px"><Lock /></el-icon>
|
<el-icon v-if="strict" style="display: inline-block; margin-left: 5px"><Lock /></el-icon>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { Lock, Unlock } from '@element-plus/icons-vue';
|
import { Lock, Unlock, WarnTriangleFilled } from '@element-plus/icons-vue';
|
||||||
import { ref, watch } from 'vue';
|
import { ref, watch } from 'vue';
|
||||||
import { getGroupName, parseLocation } from '../shared/utils';
|
import { getGroupName, parseLocation } from '../shared/utils';
|
||||||
import { useGroupStore, useLaunchStore, useInstanceStore } from '../stores';
|
import { useGroupStore, useLaunchStore } from '../stores';
|
||||||
|
import { instanceRequest } from '../api';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
const { t } = useI18n();
|
||||||
|
|
||||||
const launchStore = useLaunchStore();
|
const launchStore = useLaunchStore();
|
||||||
const groupStore = useGroupStore();
|
const groupStore = useGroupStore();
|
||||||
const { getInstanceName } = useInstanceStore();
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
locationobject: Object,
|
locationobject: Object,
|
||||||
@@ -38,6 +43,7 @@
|
|||||||
const isUnlocked = ref(false);
|
const isUnlocked = ref(false);
|
||||||
const strict = ref(false);
|
const strict = ref(false);
|
||||||
const groupName = ref('');
|
const groupName = ref('');
|
||||||
|
const isClosed = ref(false);
|
||||||
|
|
||||||
function parse() {
|
function parse() {
|
||||||
const locObj = props.locationobject;
|
const locObj = props.locationobject;
|
||||||
@@ -53,10 +59,22 @@
|
|||||||
region.value = locObj.region || 'us';
|
region.value = locObj.region || 'us';
|
||||||
|
|
||||||
instanceName.value = locObj.instanceName;
|
instanceName.value = locObj.instanceName;
|
||||||
getInstanceName(locObj.tag)
|
|
||||||
.then((name) => {
|
const L = parseLocation(locObj.tag);
|
||||||
if (name && props.locationobject.tag === locObj.tag) {
|
if (!L.isRealInstance) {
|
||||||
instanceName.value = name;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
instanceRequest
|
||||||
|
.getCachedInstance({ worldId: L.worldId, instanceId: L.instanceId })
|
||||||
|
.then((args) => {
|
||||||
|
if (locObj.tag === L.tag) {
|
||||||
|
if (args.json.displayName) {
|
||||||
|
instanceName.value = args.json.displayName;
|
||||||
|
}
|
||||||
|
if (args.json.closedAt) {
|
||||||
|
isClosed.value = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
@@ -94,3 +112,17 @@
|
|||||||
groupStore.showGroupDialog(L.groupId);
|
groupStore.showGroupDialog(L.groupId);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.inline-block {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ml-5 {
|
||||||
|
margin-left: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mr-5 {
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -861,8 +861,8 @@
|
|||||||
"vrcplus_hides_avatar": "When a VRC+ profile photo is set, avatar info is hidden. This also hides avatar changes in the feed",
|
"vrcplus_hides_avatar": "When a VRC+ profile photo is set, avatar info is hidden. This also hides avatar changes in the feed",
|
||||||
"accuracy_notice": "Info from local database may not be accurate",
|
"accuracy_notice": "Info from local database may not be accurate",
|
||||||
"instance_full": "full",
|
"instance_full": "full",
|
||||||
"instance_closed": "closed",
|
"instance_closed": "Instance closed",
|
||||||
"instance_hard_closed": "hard closed",
|
"instance_hard_closed": "Instance hard closed",
|
||||||
"close_instance": "Close Instance",
|
"close_instance": "Close Instance",
|
||||||
"instance_age_gated": "age gated",
|
"instance_age_gated": "age gated",
|
||||||
"open_previous_instance": "Open Previous Instances"
|
"open_previous_instance": "Open Previous Instances"
|
||||||
|
|||||||
Reference in New Issue
Block a user