mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-06-14 19:51:58 +08:00
feat: 优化网页消息提醒样式
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, watch } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { toast } from 'vue-sonner'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Label } from '@/components/ui/label'
|
||||
import { Separator } from '@/components/ui/separator'
|
||||
@@ -122,8 +121,6 @@ async function applyConfig() {
|
||||
}
|
||||
unifiedAudio.disconnect()
|
||||
}
|
||||
|
||||
toast.success(t('config.applied'))
|
||||
} catch (e) {
|
||||
console.info('[AudioConfig] Failed to apply config:', e)
|
||||
} finally {
|
||||
|
||||
@@ -202,8 +202,6 @@ async function applyHidConfig() {
|
||||
|
||||
await configStore.updateHid(config)
|
||||
|
||||
toast.success(t('config.applied'))
|
||||
|
||||
// HID state will be updated via WebSocket device_info event
|
||||
} catch (e) {
|
||||
console.info('[HidConfig] Failed to apply config:', e)
|
||||
|
||||
@@ -207,7 +207,6 @@ async function connectImage(image: MsdImage) {
|
||||
try {
|
||||
await msdApi.connect('image', image.id, cdromMode.value, readOnly.value)
|
||||
await systemStore.fetchMsdState()
|
||||
toast.success(t('msd.imageMounted', { name: image.name }))
|
||||
} catch (e) {
|
||||
console.error('Failed to connect image:', e)
|
||||
} finally {
|
||||
@@ -225,7 +224,6 @@ async function connectDrive() {
|
||||
try {
|
||||
await msdApi.connect('drive')
|
||||
await systemStore.fetchMsdState()
|
||||
toast.success(t('common.connected'))
|
||||
} catch (e) {
|
||||
console.error('Failed to connect drive:', e)
|
||||
} finally {
|
||||
@@ -242,7 +240,6 @@ async function disconnect() {
|
||||
try {
|
||||
await msdApi.disconnect()
|
||||
await systemStore.fetchMsdState()
|
||||
toast.success(t('msd.disconnected'))
|
||||
} catch (e) {
|
||||
console.error('Failed to disconnect:', e)
|
||||
} finally {
|
||||
@@ -263,11 +260,9 @@ async function executeDelete() {
|
||||
if (deleteTarget.value.type === 'image') {
|
||||
await msdApi.deleteImage(deleteTarget.value.id)
|
||||
images.value = images.value.filter(i => i.id !== deleteTarget.value!.id)
|
||||
toast.success(t('common.success'))
|
||||
} else {
|
||||
await msdApi.deleteDriveFile(deleteTarget.value.id)
|
||||
await loadDriveFiles()
|
||||
toast.success(t('common.success'))
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Failed to delete:', e)
|
||||
@@ -313,7 +308,6 @@ async function createDrive() {
|
||||
await loadDriveInfo()
|
||||
await loadDriveFiles()
|
||||
showDriveInitDialog.value = false
|
||||
toast.success(t('common.success'))
|
||||
} catch (e) {
|
||||
console.error('Failed to initialize drive:', e)
|
||||
} finally {
|
||||
@@ -330,7 +324,6 @@ async function deleteDrive() {
|
||||
driveFiles.value = []
|
||||
currentPath.value = '/'
|
||||
showDeleteDriveDialog.value = false
|
||||
toast.success(t('msd.driveDeleted'))
|
||||
} catch (e) {
|
||||
console.error('Failed to delete drive:', e)
|
||||
} finally {
|
||||
|
||||
@@ -525,7 +525,6 @@ async function applyVideoConfig() {
|
||||
fps: toConfigFps(selectedFps.value),
|
||||
})
|
||||
|
||||
toast.success(t('config.applied'))
|
||||
isDirty.value = false
|
||||
// Stream state will be updated via WebSocket system.device_info event
|
||||
} catch (e) {
|
||||
|
||||
@@ -14,7 +14,7 @@ const props = defineProps<ToasterProps>()
|
||||
'--normal-bg': 'var(--popover)',
|
||||
'--normal-text': 'var(--popover-foreground)',
|
||||
'--normal-border': 'var(--border)',
|
||||
'--border-radius': 'var(--radius)',
|
||||
'--border-radius': 'calc(var(--radius) + 0.1875rem)',
|
||||
}"
|
||||
v-bind="props"
|
||||
>
|
||||
@@ -36,7 +36,7 @@ const props = defineProps<ToasterProps>()
|
||||
</div>
|
||||
</template>
|
||||
<template #close-icon>
|
||||
<XIcon class="size-4" />
|
||||
<XIcon class="size-3 shrink-0" />
|
||||
</template>
|
||||
</Sonner>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user