Skip to content

Commit

Permalink
fix(frontend): typos
Browse files Browse the repository at this point in the history
  • Loading branch information
he3als committed Oct 18, 2024
1 parent e157488 commit 4d241bc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
10 changes: 5 additions & 5 deletions apps/frontend/src/components/ui/servers/ServerStats.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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),
Expand All @@ -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),
Expand Down Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<div class="h-full w-full gap-2 overflow-y-auto">
<div class="card flex flex-col gap-4">
<h1 class="m-0 text-2xl font-bold">Server Preferences</h1>
<div v-for="(value, key) in userPrefrences" :key="key" class="flex justify-between">
<div v-for="(value, key) in userPreferences" :key="key" class="flex justify-between">
<label for="server-name-field" class="flex flex-col gap-2">
<span class="text-lg font-bold text-contrast">{{ preferences[key].displayName }}</span>
<span> {{ preferences[key].description }} </span>
</label>
<input v-model="newUserprefrences[key]" class="switch stylized-toggle" type="checkbox" />
<input v-model="newUserPreferences[key]" class="switch stylized-toggle" type="checkbox" />
</div>
</div>
</div>
Expand All @@ -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",
Expand All @@ -48,7 +48,7 @@ const savePreferences = () => {
};
const resetPreferences = () => {
newUserprefrences.value = userPrefrences.value;
newUserPreferences.value = userPreferences.value;
};
const preferences = {
Expand All @@ -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",
},
};
Expand All @@ -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)));
</script>

0 comments on commit 4d241bc

Please sign in to comment.