From 4d241bc03d3ee31baf0a508fea954a63a8670fe9 Mon Sep 17 00:00:00 2001 From: he3als <65787561+he3als@users.noreply.github.com> Date: Fri, 18 Oct 2024 20:18:14 +0100 Subject: [PATCH] fix(frontend): typos --- .../src/components/ui/servers/ServerStats.vue | 10 +++++----- .../manage/[id]/options/preferences.vue | 18 +++++++++--------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/apps/frontend/src/components/ui/servers/ServerStats.vue b/apps/frontend/src/components/ui/servers/ServerStats.vue index 99208752e..03646712d 100644 --- a/apps/frontend/src/components/ui/servers/ServerStats.vue +++ b/apps/frontend/src/components/ui/servers/ServerStats.vue @@ -70,7 +70,7 @@ import WarningIcon from "~/assets/images/utils/issues.svg?component"; const route = useNativeRoute(); const serverId = route.params.id; -const userPrefrences = useStorage(`pyro-server-${serverId}-preferences`, { +const userPreferences = useStorage(`pyro-server-${serverId}-preferences`, { ramAsNumber: false, autoRestart: false, backupWhileRunning: false, @@ -114,7 +114,7 @@ const metrics = ref([ { title: "Memory usage", value: "0%", - max: userPrefrences.value.ramAsNumber + max: userPreferences.value.ramAsNumber ? formatBytes(props.data.current.ram_total_bytes) : "100%", icon: markRaw(DBIcon), @@ -125,7 +125,7 @@ const metrics = ref([ const updateMetrics = () => { console.log(props.data.current.ram_usage_bytes); metrics.value = metrics.value.map((metric, index) => { - if (userPrefrences.value.ramAsNumber && index === 1) { + if (userPreferences.value.ramAsNumber && index === 1) { return { ...metric, value: formatBytes(props.data.current.ram_usage_bytes), @@ -171,7 +171,7 @@ const getPotentialWarning = (metric: (typeof metrics.value)[0]) => { }) .join(" "); let data = metric.data.at(-1) || 0; - if (userPrefrences.value.ramAsNumber) { + if (userPreferences.value.ramAsNumber) { data = (props.data.current.ram_usage_bytes / props.data.current.ram_total_bytes) * 100; } switch (true) { @@ -185,7 +185,7 @@ const getPotentialWarning = (metric: (typeof metrics.value)[0]) => { const generateOptions = (metric: (typeof metrics.value)[0]) => { let color = "var(--color-brand)"; let data = metric.data.at(-1) || 0; - if (userPrefrences.value.ramAsNumber) { + if (userPreferences.value.ramAsNumber) { data = (props.data.current.ram_usage_bytes / props.data.current.ram_total_bytes) * 100; } switch (true) { diff --git a/apps/frontend/src/pages/servers/manage/[id]/options/preferences.vue b/apps/frontend/src/pages/servers/manage/[id]/options/preferences.vue index 7c5373e00..a7ce767f7 100644 --- a/apps/frontend/src/pages/servers/manage/[id]/options/preferences.vue +++ b/apps/frontend/src/pages/servers/manage/[id]/options/preferences.vue @@ -2,12 +2,12 @@

Server Preferences

-
+
- +
@@ -33,12 +33,12 @@ const props = defineProps<{ }>(); const hasUnsavedChanges = computed(() => { - return JSON.stringify(newUserprefrences.value) !== JSON.stringify(userPrefrences.value); + return JSON.stringify(newUserPreferences.value) !== JSON.stringify(userPreferences.value); }); const savePreferences = () => { - userPrefrences.value = newUserprefrences.value; - newUserprefrences.value = JSON.parse(JSON.stringify(userPrefrences.value)); + userPreferences.value = newUserPreferences.value; + newUserPreferences.value = JSON.parse(JSON.stringify(userPreferences.value)); addNotification({ group: "serverOptions", type: "success", @@ -48,7 +48,7 @@ const savePreferences = () => { }; const resetPreferences = () => { - newUserprefrences.value = userPrefrences.value; + newUserPreferences.value = userPreferences.value; }; const preferences = { @@ -63,7 +63,7 @@ const preferences = { backupWhileRunning: { displayName: "Backup while running (not implemented)", description: - "Allow creation of a backup without stoping the server. This may lead to corrupted backups, use with caution", + "Allow creation of a backup without stopping the server. This may lead to corrupted backups, use with caution", }, }; @@ -73,6 +73,6 @@ const defaultPreferences = { backupWhileRunning: false, }; -const userPrefrences = useStorage(`pyro-server-${serverId}-preferences`, defaultPreferences); -const newUserprefrences = ref(JSON.parse(JSON.stringify(userPrefrences.value))); +const userPreferences = useStorage(`pyro-server-${serverId}-preferences`, defaultPreferences); +const newUserPreferences = ref(JSON.parse(JSON.stringify(userPreferences.value)));