mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-23 00:33:50 +02:00
replace ElMessage with Sonner
This commit is contained in:
@@ -55,8 +55,8 @@
|
||||
|
||||
<script setup>
|
||||
import { computed, ref } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { Badge } from '../../../components/ui/badge';
|
||||
@@ -104,17 +104,11 @@
|
||||
D.vrcLaunchPathOverride.endsWith('.exe') &&
|
||||
!D.vrcLaunchPathOverride.endsWith('launch.exe')
|
||||
) {
|
||||
ElMessage({
|
||||
message: 'Invalid path, you must enter VRChat folder or launch.exe',
|
||||
type: 'error'
|
||||
});
|
||||
toast.error('Invalid path, you must enter VRChat folder or launch.exe');
|
||||
return;
|
||||
}
|
||||
configRepository.setString('vrcLaunchPathOverride', D.vrcLaunchPathOverride);
|
||||
ElMessage({
|
||||
message: 'Updated launch options',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('Updated launch options');
|
||||
closeDialog();
|
||||
}
|
||||
|
||||
|
||||
@@ -77,9 +77,10 @@
|
||||
|
||||
<script setup>
|
||||
import { Delete, Download, Upload } from '@element-plus/icons-vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { ref, watch } from 'vue';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { downloadAndSaveJson, formatDateFilter, removeFromArray } from '../../../shared/utils';
|
||||
@@ -134,17 +135,11 @@
|
||||
const data = JSON.stringify(row.data);
|
||||
AppApi.SetVRChatRegistry(data)
|
||||
.then(() => {
|
||||
ElMessage({
|
||||
message: 'VRC registry settings restored',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('VRC registry settings restored');
|
||||
})
|
||||
.catch((e) => {
|
||||
console.error(e);
|
||||
ElMessage({
|
||||
message: `Failed to restore VRC registry settings, check console for full error: ${e}`,
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(`Failed to restore VRC registry settings, check console for full error: ${e}`);
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
@@ -172,10 +167,7 @@
|
||||
return;
|
||||
}
|
||||
AppApi.DeleteVRChatRegistryFolder().then(() => {
|
||||
ElMessage({
|
||||
message: 'VRC registry settings deleted',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('VRC registry settings deleted');
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
@@ -256,23 +248,14 @@
|
||||
}
|
||||
AppApi.SetVRChatRegistry(json)
|
||||
.then(() => {
|
||||
ElMessage({
|
||||
message: 'VRC registry settings restored',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('VRC registry settings restored');
|
||||
})
|
||||
.catch((e) => {
|
||||
console.error(e);
|
||||
ElMessage({
|
||||
message: `Failed to restore VRC registry settings, check console for full error: ${e}`,
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(`Failed to restore VRC registry settings, check console for full error: ${e}`);
|
||||
});
|
||||
} catch {
|
||||
ElMessage({
|
||||
message: 'Invalid JSON',
|
||||
type: 'error'
|
||||
});
|
||||
toast.error('Invalid JSON');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -104,8 +104,8 @@
|
||||
<script setup>
|
||||
import { reactive, watch } from 'vue';
|
||||
import { ArrowDown } from '@element-plus/icons-vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { getLanguageName, languageCodes } from '../../../localization';
|
||||
@@ -173,10 +173,7 @@
|
||||
async function saveTranslationApiConfig() {
|
||||
if (form.translationApiType === 'openai') {
|
||||
if (!form.translationApiEndpoint || !form.translationApiModel) {
|
||||
ElMessage({
|
||||
message: t('dialog.translation_api.msg_fill_endpoint_model'),
|
||||
type: 'warning'
|
||||
});
|
||||
toast.warning(t('dialog.translation_api.msg_fill_endpoint_model'));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -189,10 +186,7 @@
|
||||
setTranslationApiKey(form.translationApiKey)
|
||||
]);
|
||||
|
||||
ElMessage({
|
||||
message: t('dialog.translation_api.msg_settings_saved'),
|
||||
type: 'success'
|
||||
});
|
||||
toast.success(t('dialog.translation_api.msg_settings_saved'));
|
||||
closeDialog();
|
||||
}
|
||||
|
||||
@@ -201,10 +195,7 @@
|
||||
return;
|
||||
}
|
||||
if (!form.translationApiEndpoint || !form.translationApiModel) {
|
||||
ElMessage({
|
||||
message: t('dialog.translation_api.msg_fill_endpoint_model'),
|
||||
type: 'warning'
|
||||
});
|
||||
toast.warning(t('dialog.translation_api.msg_fill_endpoint_model'));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -218,23 +209,14 @@
|
||||
key: form.translationApiKey
|
||||
});
|
||||
if (data) {
|
||||
ElMessage({
|
||||
message: t('dialog.translation_api.msg_test_success'),
|
||||
type: 'success'
|
||||
});
|
||||
toast.success(t('dialog.translation_api.msg_test_success'));
|
||||
} else {
|
||||
console.error('[TranslationAPI] Test returned empty result');
|
||||
ElMessage({
|
||||
message: t('dialog.translation_api.msg_test_failed'),
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(t('dialog.translation_api.msg_test_failed'));
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('[TranslationAPI] Test failed', err);
|
||||
ElMessage({
|
||||
message: t('dialog.translation_api.msg_test_failed'),
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(t('dialog.translation_api.msg_test_failed'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -183,8 +183,9 @@
|
||||
<script setup>
|
||||
import { ArrowDown, Delete, FolderDelete, FolderOpened, Refresh } from '@element-plus/icons-vue';
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { VRChatCameraResolutions, VRChatScreenshotResolutions } from '../../../shared/constants';
|
||||
@@ -279,15 +280,9 @@
|
||||
async function deleteAllVRChatCache() {
|
||||
try {
|
||||
await AssetBundleManager.DeleteAllCache();
|
||||
ElMessage({
|
||||
message: 'All VRChat cache deleted',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('All VRChat cache deleted');
|
||||
} catch (error) {
|
||||
ElMessage({
|
||||
message: `Error deleting VRChat cache: ${error.message}`,
|
||||
type: 'error'
|
||||
});
|
||||
toast.error(`Error deleting VRChat cache: ${error.message}`);
|
||||
}
|
||||
getVRChatCacheSize();
|
||||
}
|
||||
@@ -379,10 +374,7 @@
|
||||
const parsedConfig = JSON.parse(config);
|
||||
VRChatConfigFile.value = { ...VRChatConfigFile.value, ...parsedConfig };
|
||||
} catch {
|
||||
ElMessage({
|
||||
message: 'Invalid JSON in config.json',
|
||||
type: 'error'
|
||||
});
|
||||
toast.error('Invalid JSON in config.json');
|
||||
throw new Error('Invalid JSON in config.json');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { openExternalLink } from '../../../shared/utils';
|
||||
@@ -57,26 +57,17 @@
|
||||
async function testYouTubeApiKey() {
|
||||
const previousKey = youTubeApiKey.value;
|
||||
if (!youTubeApiKey.value) {
|
||||
ElMessage({
|
||||
message: 'YouTube API key removed',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('YouTube API key removed');
|
||||
closeDialog();
|
||||
return;
|
||||
}
|
||||
const data = await lookupYouTubeVideo('dQw4w9WgXcQ');
|
||||
if (!data) {
|
||||
setYouTubeApiKey(previousKey);
|
||||
ElMessage({
|
||||
message: 'Invalid YouTube API key',
|
||||
type: 'error'
|
||||
});
|
||||
toast.error('Invalid YouTube API key');
|
||||
} else {
|
||||
setYouTubeApiKey(youTubeApiKey.value);
|
||||
ElMessage({
|
||||
message: 'YouTube API key valid!',
|
||||
type: 'success'
|
||||
});
|
||||
toast.success('YouTube API key valid!');
|
||||
closeDialog();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user