feat(notifications): replace docker toast usage with nuxtui toast composable in ConnectSettings, DockerContainersTable, and RCloneOverview components

This commit is contained in:
Ajit Mehrotra
2025-12-15 14:46:30 -05:00
parent 6458457a7f
commit d10e0540eb
2 changed files with 16 additions and 11 deletions
@@ -26,6 +26,7 @@ defineOptions({
});
const { connectPluginInstalled } = storeToRefs(useServerStore());
const toast = useToast();
/**--------------------------------------------
* Settings State & Form definition
@@ -74,10 +75,12 @@ watchDebounced(
// show a toast when the update is done
onMutateSettingsDone((result) => {
actualRestartRequired.value = result.data?.updateSettings?.restartRequired ?? false;
globalThis.toast.success(t('connectSettings.updatedApiSettingsToast'), {
toast.add({
title: t('connectSettings.updatedApiSettingsToast'),
description: actualRestartRequired.value
? t('connectSettings.apiRestartingToastDescription')
: undefined,
color: 'success',
});
});
+12 -10
View File
@@ -36,20 +36,22 @@ const {
refetchQueries: [{ query: GET_RCLONE_REMOTES }],
});
const toast = useToast();
onDeleteDone((result) => {
const data = result?.data;
if (data?.rclone?.deleteRCloneRemote) {
if (window.toast) {
window.toast.success('Remote Deleted', {
description: 'Remote deleted successfully',
});
}
toast.add({
title: 'Remote Deleted',
description: 'Remote deleted successfully',
color: 'success',
});
} else {
if (window.toast) {
window.toast.error('Deletion Failed', {
description: 'Failed to delete remote. Please try again.',
});
}
toast.add({
title: 'Deletion Failed',
description: 'Failed to delete remote. Please try again.',
color: 'error',
});
}
});