diff --git a/resources/scripts/components/admin/nests/eggs/EggRouter.tsx b/resources/scripts/components/admin/nests/eggs/EggRouter.tsx index 14d4cf544..c2cee96fa 100644 --- a/resources/scripts/components/admin/nests/eggs/EggRouter.tsx +++ b/resources/scripts/components/admin/nests/eggs/EggRouter.tsx @@ -25,7 +25,7 @@ const EggRouter = () => { useEffect(() => { if (!error) clearFlashes('egg'); - if (error) clearAndAddHttpError({ error, key: 'egg' }); + if (error) clearAndAddHttpError({ key: 'egg', error }); }, [ error ]); if (!egg || (error && isValidating)) { diff --git a/resources/scripts/components/admin/servers/ServerRouter.tsx b/resources/scripts/components/admin/servers/ServerRouter.tsx index 1d0d14ce3..b7ba294e6 100644 --- a/resources/scripts/components/admin/servers/ServerRouter.tsx +++ b/resources/scripts/components/admin/servers/ServerRouter.tsx @@ -26,7 +26,7 @@ export default () => { useEffect(() => { if (!error) clearFlashes('server'); - if (error) clearAndAddHttpError({ error, key: 'server' }); + if (error) clearAndAddHttpError({ key: 'server', error }); }, [ error ]); if (!server || (error && isValidating)) { diff --git a/resources/scripts/components/admin/settings/SettingsContainer.tsx b/resources/scripts/components/admin/settings/SettingsContainer.tsx index da6461036..29f4c07bb 100644 --- a/resources/scripts/components/admin/settings/SettingsContainer.tsx +++ b/resources/scripts/components/admin/settings/SettingsContainer.tsx @@ -21,7 +21,7 @@ export default () => { - + diff --git a/resources/scripts/components/dashboard/forms/DisableTwoFactorModal.tsx b/resources/scripts/components/dashboard/forms/DisableTwoFactorModal.tsx index 854d0837a..60659fc3d 100644 --- a/resources/scripts/components/dashboard/forms/DisableTwoFactorModal.tsx +++ b/resources/scripts/components/dashboard/forms/DisableTwoFactorModal.tsx @@ -30,7 +30,7 @@ const DisableTwoFactorModal = () => { .catch(error => { console.error(error); - clearAndAddHttpError({ error, key: 'account:two-factor' }); + clearAndAddHttpError({ key: 'account:two-factor', error }); setSubmitting(false); setPropOverrides(null); }); diff --git a/resources/scripts/components/dashboard/forms/SetupTwoFactorModal.tsx b/resources/scripts/components/dashboard/forms/SetupTwoFactorModal.tsx index aea603995..87f10d438 100644 --- a/resources/scripts/components/dashboard/forms/SetupTwoFactorModal.tsx +++ b/resources/scripts/components/dashboard/forms/SetupTwoFactorModal.tsx @@ -31,7 +31,7 @@ const SetupTwoFactorModal = () => { .then(setToken) .catch(error => { console.error(error); - clearAndAddHttpError({ error, key: 'account:two-factor' }); + clearAndAddHttpError({ key: 'account:two-factor', error }); }); }, []); @@ -44,7 +44,7 @@ const SetupTwoFactorModal = () => { .catch(error => { console.error(error); - clearAndAddHttpError({ error, key: 'account:two-factor' }); + clearAndAddHttpError({ key: 'account:two-factor', error }); }) .then(() => { setSubmitting(false); diff --git a/resources/scripts/components/server/backups/BackupContainer.tsx b/resources/scripts/components/server/backups/BackupContainer.tsx index 1201252b5..7be95aab1 100644 --- a/resources/scripts/components/server/backups/BackupContainer.tsx +++ b/resources/scripts/components/server/backups/BackupContainer.tsx @@ -25,7 +25,7 @@ const BackupContainer = () => { return; } - clearAndAddHttpError({ error, key: 'backups' }); + clearAndAddHttpError({ key: 'backups', error }); }, [ error ]); if (!backups || (error && isValidating)) { diff --git a/resources/scripts/components/server/features/java_version/JavaVersionModalFeature.tsx b/resources/scripts/components/server/features/java_version/JavaVersionModalFeature.tsx index 3756b55b0..3c9d5a767 100644 --- a/resources/scripts/components/server/features/java_version/JavaVersionModalFeature.tsx +++ b/resources/scripts/components/server/features/java_version/JavaVersionModalFeature.tsx @@ -50,7 +50,7 @@ const JavaVersionModalFeature = () => { const updateJava = () => { setLoading(true); - clearFlashes('feature:javaVersion'); + clearFlashes('feature:java-version'); setSelectedDockerImage(uuid, selectedVersion) .then(() => { @@ -63,39 +63,38 @@ const JavaVersionModalFeature = () => { }) .catch(error => { console.error(error); - clearAndAddHttpError({ key: 'feature:javaVersion', error }); + clearAndAddHttpError({ key: 'feature:java-version', error }); }) .then(() => setLoading(false)); }; useEffect(() => { - clearFlashes('feature:javaVersion'); + clearFlashes('feature:java-version'); }, []); return ( setVisible(false)} closeOnBackground={false} showSpinnerOverlay={loading}> - + +

Invalid Java version, update Docker image?

This server is unable to start due to the required Java version not being met.

By pressing {'"Update Docker Image"'} below you are acknowledging that the Docker image this server uses will be changed to an image below that has the Java version you are requesting.

+

Please select a Java version from the list below.

- setSelectedVersion(e.target.value)}> + {dockerImageList.map((key, index) => ( + + ))}
+
diff --git a/resources/scripts/components/server/files/FileEditContainer.tsx b/resources/scripts/components/server/files/FileEditContainer.tsx index db9bcb0da..34e7e141c 100644 --- a/resources/scripts/components/server/files/FileEditContainer.tsx +++ b/resources/scripts/components/server/files/FileEditContainer.tsx @@ -73,7 +73,7 @@ export default () => { }) .catch(error => { console.error(error); - addError({ message: httpErrorToHuman(error), key: 'files:view' }); + addError({ key: 'files:view', message: httpErrorToHuman(error) }); }) .then(() => setLoading(false)); }; diff --git a/resources/scripts/components/server/files/UploadButton.tsx b/resources/scripts/components/server/files/UploadButton.tsx index e9c37aae9..67582129b 100644 --- a/resources/scripts/components/server/files/UploadButton.tsx +++ b/resources/scripts/components/server/files/UploadButton.tsx @@ -110,7 +110,7 @@ export default ({ className }: WithClassname) => { .then(() => mutate()) .catch(error => { console.error(error); - clearAndAddHttpError({ error, key: 'files' }); + clearAndAddHttpError({ key: 'files', error }); }); }; diff --git a/resources/scripts/components/server/schedules/RunScheduleButton.tsx b/resources/scripts/components/server/schedules/RunScheduleButton.tsx index 96424b06e..875de28f3 100644 --- a/resources/scripts/components/server/schedules/RunScheduleButton.tsx +++ b/resources/scripts/components/server/schedules/RunScheduleButton.tsx @@ -24,7 +24,7 @@ const RunScheduleButton = ({ schedule }: { schedule: Schedule }) => { }) .catch(error => { console.error(error); - clearAndAddHttpError({ error, key: 'schedules' }); + clearAndAddHttpError({ key: 'schedules', error }); }) .then(() => setLoading(false)); }, []); diff --git a/resources/scripts/components/server/schedules/ScheduleContainer.tsx b/resources/scripts/components/server/schedules/ScheduleContainer.tsx index c1609674a..958f3fef9 100644 --- a/resources/scripts/components/server/schedules/ScheduleContainer.tsx +++ b/resources/scripts/components/server/schedules/ScheduleContainer.tsx @@ -31,7 +31,7 @@ export default () => { getServerSchedules(uuid) .then(schedules => setSchedules(schedules)) .catch(error => { - addError({ message: httpErrorToHuman(error), key: 'schedules' }); + addError({ key: 'schedules', message: httpErrorToHuman(error) }); console.error(error); }) .then(() => setLoading(false)); diff --git a/resources/scripts/components/server/schedules/ScheduleEditContainer.tsx b/resources/scripts/components/server/schedules/ScheduleEditContainer.tsx index fdd602304..33fda7a06 100644 --- a/resources/scripts/components/server/schedules/ScheduleEditContainer.tsx +++ b/resources/scripts/components/server/schedules/ScheduleEditContainer.tsx @@ -65,7 +65,7 @@ export default () => { .then(schedule => appendSchedule(schedule)) .catch(error => { console.error(error); - clearAndAddHttpError({ error, key: 'schedules' }); + clearAndAddHttpError({ key: 'schedules', error }); }) .then(() => setIsLoading(false)); }, [ scheduleId ]); diff --git a/resources/scripts/components/server/schedules/ScheduleTaskRow.tsx b/resources/scripts/components/server/schedules/ScheduleTaskRow.tsx index 56515808b..d4bdcc0d6 100644 --- a/resources/scripts/components/server/schedules/ScheduleTaskRow.tsx +++ b/resources/scripts/components/server/schedules/ScheduleTaskRow.tsx @@ -58,7 +58,7 @@ export default ({ schedule, task }: Props) => { .catch(error => { console.error(error); setIsLoading(false); - addError({ message: httpErrorToHuman(error), key: 'schedules' }); + addError({ key: 'schedules', message: httpErrorToHuman(error) }); }); }; diff --git a/resources/scripts/components/server/schedules/TaskDetailsModal.tsx b/resources/scripts/components/server/schedules/TaskDetailsModal.tsx index f8eca30ae..7cc39f555 100644 --- a/resources/scripts/components/server/schedules/TaskDetailsModal.tsx +++ b/resources/scripts/components/server/schedules/TaskDetailsModal.tsx @@ -81,7 +81,7 @@ const TaskDetailsModal = ({ schedule, task }: Props) => { clearFlashes('schedule:task'); if (backupLimit === 0 && values.action === 'backup') { setSubmitting(false); - addError({ message: 'A backup task cannot be created when the server\'s backup limit is set to 0.', key: 'schedule:task' }); + addError({ key: 'schedule:task', message: 'A backup task cannot be created when the server\'s backup limit is set to 0.' }); } else { createOrUpdateScheduleTask(uuid, schedule.id, task?.id, values) .then(task => { @@ -96,7 +96,7 @@ const TaskDetailsModal = ({ schedule, task }: Props) => { .catch(error => { console.error(error); setSubmitting(false); - addError({ message: httpErrorToHuman(error), key: 'schedule:task' }); + addError({ key: 'schedule:task', message: httpErrorToHuman(error) }); }); } }; diff --git a/resources/scripts/components/server/settings/ReinstallServerBox.tsx b/resources/scripts/components/server/settings/ReinstallServerBox.tsx index 83253d2bf..2ef8af921 100644 --- a/resources/scripts/components/server/settings/ReinstallServerBox.tsx +++ b/resources/scripts/components/server/settings/ReinstallServerBox.tsx @@ -16,12 +16,12 @@ export default () => { const { addFlash, clearFlashes } = useStoreActions((actions: Actions) => actions.flashes); const reinstall = () => { - clearFlashes('settings'); + clearFlashes('server:settings'); setIsSubmitting(true); reinstallServer(uuid) .then(() => { addFlash({ - key: 'settings', + key: 'server:settings', type: 'success', message: 'Your server has begun the reinstallation process.', }); @@ -29,7 +29,7 @@ export default () => { .catch(error => { console.error(error); - addFlash({ key: 'settings', type: 'error', message: httpErrorToHuman(error) }); + addFlash({ key: 'server:settings', type: 'error', message: httpErrorToHuman(error) }); }) .then(() => { setIsSubmitting(false); diff --git a/resources/scripts/components/server/settings/RenameServerBox.tsx b/resources/scripts/components/server/settings/RenameServerBox.tsx index 7e6832c6f..8ed91ca31 100644 --- a/resources/scripts/components/server/settings/RenameServerBox.tsx +++ b/resources/scripts/components/server/settings/RenameServerBox.tsx @@ -45,12 +45,12 @@ export default () => { const { addError, clearFlashes } = useStoreActions((actions: Actions) => actions.flashes); const submit = ({ name }: Values, { setSubmitting }: FormikHelpers) => { - clearFlashes('settings'); + clearFlashes('server:settings'); renameServer(server.uuid, name) .then(() => setServer({ ...server, name })) .catch(error => { console.error(error); - addError({ key: 'settings', message: httpErrorToHuman(error) }); + addError({ key: 'server:settings', message: httpErrorToHuman(error) }); }) .then(() => setSubmitting(false)); }; diff --git a/resources/scripts/components/server/settings/SettingsContainer.tsx b/resources/scripts/components/server/settings/SettingsContainer.tsx index bad273803..c479ecc6f 100644 --- a/resources/scripts/components/server/settings/SettingsContainer.tsx +++ b/resources/scripts/components/server/settings/SettingsContainer.tsx @@ -23,7 +23,8 @@ export default () => { return ( - + +
diff --git a/resources/scripts/components/server/startup/VariableBox.tsx b/resources/scripts/components/server/startup/VariableBox.tsx index 86b014f1f..8bbfddd1c 100644 --- a/resources/scripts/components/server/startup/VariableBox.tsx +++ b/resources/scripts/components/server/startup/VariableBox.tsx @@ -38,7 +38,7 @@ const VariableBox = ({ variable }: Props) => { }), false)) .catch(error => { console.error(error); - clearAndAddHttpError({ error, key: FLASH_KEY }); + clearAndAddHttpError({ key: FLASH_KEY, error }); }) .then(() => setLoading(false)); }, 500);