mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-22 16:23:50 +02:00
replace ElMessageBox.prompt
This commit is contained in:
@@ -529,7 +529,6 @@
|
||||
import { ArrowUpDown, Check, Ellipsis, Loader, MoreHorizontal, Plus, RefreshCcw, RefreshCw } from 'lucide-vue-next';
|
||||
import { InputGroupField, InputGroupSearch } from '@/components/ui/input-group';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import { Spinner } from '@/components/ui/spinner';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
@@ -1344,19 +1343,18 @@
|
||||
|
||||
function changeFavoriteGroupName(group) {
|
||||
const currentName = group.displayName || group.name;
|
||||
ElMessageBox.prompt(
|
||||
t('prompt.change_favorite_group_name.description'),
|
||||
t('prompt.change_favorite_group_name.header'),
|
||||
{
|
||||
confirmButtonText: t('prompt.change_favorite_group_name.change'),
|
||||
cancelButtonText: t('prompt.change_favorite_group_name.cancel'),
|
||||
inputPlaceholder: t('prompt.change_favorite_group_name.input_placeholder'),
|
||||
inputPattern: /\S+/,
|
||||
modalStore
|
||||
.prompt({
|
||||
title: t('prompt.change_favorite_group_name.header'),
|
||||
description: t('prompt.change_favorite_group_name.description'),
|
||||
confirmText: t('prompt.change_favorite_group_name.change'),
|
||||
cancelText: t('prompt.change_favorite_group_name.cancel'),
|
||||
pattern: /\S+/,
|
||||
inputValue: currentName,
|
||||
inputErrorMessage: t('prompt.change_favorite_group_name.input_error')
|
||||
}
|
||||
)
|
||||
.then(({ value }) => {
|
||||
errorMessage: t('prompt.change_favorite_group_name.input_error')
|
||||
})
|
||||
.then(({ ok, value }) => {
|
||||
if (!ok) return;
|
||||
const newName = value.trim();
|
||||
if (!newName || newName === currentName) {
|
||||
return;
|
||||
@@ -1419,19 +1417,18 @@
|
||||
}
|
||||
|
||||
function promptLocalAvatarFavoriteGroupRename(group) {
|
||||
ElMessageBox.prompt(
|
||||
t('prompt.local_favorite_group_rename.description'),
|
||||
t('prompt.local_favorite_group_rename.header'),
|
||||
{
|
||||
distinguishCancelAndClose: true,
|
||||
confirmButtonText: t('prompt.local_favorite_group_rename.save'),
|
||||
cancelButtonText: t('prompt.local_favorite_group_rename.cancel'),
|
||||
inputPattern: /\S+/,
|
||||
inputErrorMessage: t('prompt.local_favorite_group_rename.input_error'),
|
||||
modalStore
|
||||
.prompt({
|
||||
title: t('prompt.local_favorite_group_rename.header'),
|
||||
description: t('prompt.local_favorite_group_rename.description'),
|
||||
confirmText: t('prompt.local_favorite_group_rename.save'),
|
||||
cancelText: t('prompt.local_favorite_group_rename.cancel'),
|
||||
pattern: /\S+/,
|
||||
errorMessage: t('prompt.local_favorite_group_rename.input_error'),
|
||||
inputValue: group
|
||||
}
|
||||
)
|
||||
.then(({ value }) => {
|
||||
})
|
||||
.then(({ ok, value }) => {
|
||||
if (!ok) return;
|
||||
if (value) {
|
||||
renameLocalAvatarFavoriteGroup(value, group);
|
||||
nextTick(() => {
|
||||
|
||||
@@ -312,7 +312,6 @@
|
||||
import { computed, nextTick, onBeforeMount, onMounted, onUnmounted, ref, watch } from 'vue';
|
||||
import { ArrowUpDown, Check, Ellipsis, MoreHorizontal, RefreshCw } from 'lucide-vue-next';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import { InputGroupSearch } from '@/components/ui/input-group';
|
||||
import { Spinner } from '@/components/ui/spinner';
|
||||
import { storeToRefs } from 'pinia';
|
||||
@@ -809,19 +808,18 @@
|
||||
|
||||
function changeFavoriteGroupName(group) {
|
||||
const currentName = group.displayName || group.name;
|
||||
ElMessageBox.prompt(
|
||||
t('prompt.change_favorite_group_name.description'),
|
||||
t('prompt.change_favorite_group_name.header'),
|
||||
{
|
||||
confirmButtonText: t('prompt.change_favorite_group_name.change'),
|
||||
cancelButtonText: t('prompt.change_favorite_group_name.cancel'),
|
||||
inputPlaceholder: t('prompt.change_favorite_group_name.input_placeholder'),
|
||||
inputPattern: /\S+/,
|
||||
modalStore
|
||||
.prompt({
|
||||
title: t('prompt.change_favorite_group_name.header'),
|
||||
description: t('prompt.change_favorite_group_name.description'),
|
||||
confirmText: t('prompt.change_favorite_group_name.change'),
|
||||
cancelText: t('prompt.change_favorite_group_name.cancel'),
|
||||
pattern: /\S+/,
|
||||
inputValue: currentName,
|
||||
inputErrorMessage: t('prompt.change_favorite_group_name.input_error')
|
||||
}
|
||||
)
|
||||
.then(({ value }) => {
|
||||
errorMessage: t('prompt.change_favorite_group_name.input_error')
|
||||
})
|
||||
.then(({ ok, value }) => {
|
||||
if (!ok) return;
|
||||
const newName = value.trim();
|
||||
if (!newName || newName === currentName) {
|
||||
return;
|
||||
|
||||
@@ -440,7 +440,6 @@
|
||||
import { ArrowUpDown, Ellipsis, MoreHorizontal, Plus, RefreshCcw, RefreshCw } from 'lucide-vue-next';
|
||||
import { InputGroupField, InputGroupSearch } from '@/components/ui/input-group';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import { Spinner } from '@/components/ui/spinner';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
@@ -1145,19 +1144,18 @@
|
||||
}
|
||||
|
||||
function promptLocalWorldFavoriteGroupRename(group) {
|
||||
ElMessageBox.prompt(
|
||||
t('prompt.local_favorite_group_rename.description'),
|
||||
t('prompt.local_favorite_group_rename.header'),
|
||||
{
|
||||
distinguishCancelAndClose: true,
|
||||
confirmButtonText: t('prompt.local_favorite_group_rename.save'),
|
||||
cancelButtonText: t('prompt.local_favorite_group_rename.cancel'),
|
||||
inputPattern: /\S+/,
|
||||
inputErrorMessage: t('prompt.local_favorite_group_rename.input_error'),
|
||||
modalStore
|
||||
.prompt({
|
||||
title: t('prompt.local_favorite_group_rename.header'),
|
||||
description: t('prompt.local_favorite_group_rename.description'),
|
||||
confirmText: t('prompt.local_favorite_group_rename.save'),
|
||||
cancelText: t('prompt.local_favorite_group_rename.cancel'),
|
||||
pattern: /\S+/,
|
||||
errorMessage: t('prompt.local_favorite_group_rename.input_error'),
|
||||
inputValue: group
|
||||
}
|
||||
)
|
||||
.then(({ value }) => {
|
||||
})
|
||||
.then(({ ok, value }) => {
|
||||
if (!ok) return;
|
||||
if (value) {
|
||||
renameLocalWorldFavoriteGroup(value, group);
|
||||
nextTick(() => {
|
||||
@@ -1238,19 +1236,18 @@
|
||||
|
||||
function changeFavoriteGroupName(group) {
|
||||
const currentName = group.displayName || group.name;
|
||||
ElMessageBox.prompt(
|
||||
t('prompt.change_favorite_group_name.description'),
|
||||
t('prompt.change_favorite_group_name.header'),
|
||||
{
|
||||
confirmButtonText: t('prompt.change_favorite_group_name.change'),
|
||||
cancelButtonText: t('prompt.change_favorite_group_name.cancel'),
|
||||
inputPlaceholder: t('prompt.change_favorite_group_name.input_placeholder'),
|
||||
inputPattern: /\S+/,
|
||||
modalStore
|
||||
.prompt({
|
||||
title: t('prompt.change_favorite_group_name.header'),
|
||||
description: t('prompt.change_favorite_group_name.description'),
|
||||
confirmText: t('prompt.change_favorite_group_name.change'),
|
||||
cancelText: t('prompt.change_favorite_group_name.cancel'),
|
||||
pattern: /\S+/,
|
||||
inputValue: currentName,
|
||||
inputErrorMessage: t('prompt.change_favorite_group_name.input_error')
|
||||
}
|
||||
)
|
||||
.then(({ value }) => {
|
||||
errorMessage: t('prompt.change_favorite_group_name.input_error')
|
||||
})
|
||||
.then(({ ok, value }) => {
|
||||
if (!ok) return;
|
||||
const newName = value.trim();
|
||||
if (!newName || newName === currentName) {
|
||||
return;
|
||||
|
||||
@@ -88,7 +88,7 @@ function DetailCell({ row, isPrevious, onShowAvatar, onShowGroup, onShowWorld, o
|
||||
></i>
|
||||
</TooltipWrapper>
|
||||
<span>
|
||||
<ArrowRight / />
|
||||
<ArrowRight />
|
||||
</span>
|
||||
<TooltipWrapper
|
||||
side="top"
|
||||
@@ -126,7 +126,7 @@ function DetailCell({ row, isPrevious, onShowAvatar, onShowGroup, onShowWorld, o
|
||||
{r.previousGroupName || r.previousGroupId}
|
||||
</span>
|
||||
<span>
|
||||
<ArrowRight / />
|
||||
<ArrowRight />
|
||||
</span>
|
||||
<span
|
||||
class="x-link"
|
||||
@@ -179,7 +179,6 @@ function DetailCell({ row, isPrevious, onShowAvatar, onShowGroup, onShowWorld, o
|
||||
Android
|
||||
</span>
|
||||
) : null}
|
||||
|
||||
<span
|
||||
class="x-link"
|
||||
onClick={(e) => {
|
||||
@@ -192,7 +191,7 @@ function DetailCell({ row, isPrevious, onShowAvatar, onShowGroup, onShowWorld, o
|
||||
|
||||
{!r.inCache ? (
|
||||
<span style="color: #aaa">
|
||||
<Download / />
|
||||
<Download />
|
||||
|
||||
</span>
|
||||
) : null}
|
||||
|
||||
@@ -50,7 +50,6 @@
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { DataTableLayout } from '@/components/ui/data-table';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
@@ -178,12 +177,16 @@
|
||||
}
|
||||
|
||||
function promptVrcRegistryBackupName() {
|
||||
ElMessageBox.prompt('Enter a name for the backup', 'Backup Name', {
|
||||
inputPattern: /\S+/,
|
||||
inputErrorMessage: 'Name is required',
|
||||
inputValue: 'Backup'
|
||||
})
|
||||
.then(({ value }) => {
|
||||
modalStore
|
||||
.prompt({
|
||||
title: 'Backup Name',
|
||||
description: 'Enter a name for the backup',
|
||||
inputValue: 'Backup',
|
||||
pattern: /\S+/,
|
||||
errorMessage: 'Name is required'
|
||||
})
|
||||
.then(({ ok, value }) => {
|
||||
if (!ok) return;
|
||||
handleBackupVrcRegistry(value);
|
||||
})
|
||||
.catch(() => {});
|
||||
|
||||
@@ -580,7 +580,6 @@
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { ButtonGroup } from '@/components/ui/button-group';
|
||||
import { Checkbox } from '@/components/ui/checkbox';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import { InputGroupTextareaField } from '@/components/ui/input-group';
|
||||
import { TabsUnderline } from '@/components/ui/tabs';
|
||||
import { VirtualCombobox } from '@/components/ui/virtual-combobox';
|
||||
@@ -597,7 +596,7 @@
|
||||
openExternalLink
|
||||
} from '../../shared/utils';
|
||||
import { inventoryRequest, miscRequest, userRequest, vrcPlusIconRequest, vrcPlusImageRequest } from '../../api';
|
||||
import { useAdvancedSettingsStore, useAuthStore, useGalleryStore, useUserStore } from '../../stores';
|
||||
import { useAdvancedSettingsStore, useAuthStore, useGalleryStore, useModalStore, useUserStore } from '../../stores';
|
||||
import { emojiAnimationStyleList, emojiAnimationStyleUrl } from '../../shared/constants';
|
||||
import { AppDebug } from '../../service/appConfig';
|
||||
import { handleImageUploadInput } from '../../shared/utils/imageUpload';
|
||||
@@ -606,6 +605,7 @@
|
||||
|
||||
const { t } = useI18n();
|
||||
const router = useRouter();
|
||||
const modalStore = useModalStore();
|
||||
|
||||
const {
|
||||
galleryTable,
|
||||
@@ -1161,11 +1161,15 @@
|
||||
}
|
||||
|
||||
async function redeemReward() {
|
||||
ElMessageBox.prompt(t('prompt.redeem.description'), t('prompt.redeem.header'), {
|
||||
confirmButtonText: t('prompt.redeem.redeem'),
|
||||
cancelButtonText: t('prompt.redeem.cancel')
|
||||
})
|
||||
.then(({ value }) => {
|
||||
modalStore
|
||||
.prompt({
|
||||
title: t('prompt.redeem.header'),
|
||||
description: t('prompt.redeem.description'),
|
||||
confirmText: t('prompt.redeem.redeem'),
|
||||
cancelText: t('prompt.redeem.cancel')
|
||||
})
|
||||
.then(({ ok, value }) => {
|
||||
if (!ok) return;
|
||||
if (value) {
|
||||
inventoryRequest
|
||||
.redeemReward({
|
||||
|
||||
Reference in New Issue
Block a user