Skip to content

Commit

Permalink
feat(frontend): ability to reset startup command to default
Browse files Browse the repository at this point in the history
  • Loading branch information
thewander02 committed Oct 18, 2024
1 parent 52aa37c commit eb01a93
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions apps/frontend/src/composables/pyroServers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ interface Allocation {

interface Startup {
invocation: string;
original_invocation: string;
jdk_version: "lts8" | "lts11" | "lts17" | "lts21";
jdk_build: "corretto" | "temurin" | "graal";
}
Expand Down
17 changes: 12 additions & 5 deletions apps/frontend/src/pages/servers/manage/[id]/options/startup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@

<div class="gap-2">
<div class="card flex flex-col gap-4">
<label for="startup-command-field" class="flex flex-col gap-2">
<span class="text-lg font-bold text-contrast">Startup Command</span>
<span> The command that runs when your server is started. </span>
</label>
<div class="flex justify-between">
<label for="startup-command-field" class="flex flex-col gap-2">
<span class="text-lg font-bold text-contrast">Startup Command</span>
<span> The command that runs when your server is started. </span>
</label>
<Button @click="resetToDefault"> Original Command </Button>
</div>
<textarea
id="startup-command-field"
v-model="invocation"
Expand Down Expand Up @@ -65,7 +68,7 @@
</template>

<script setup lang="ts">
import { DropdownSelect } from "@modrinth/ui";
import { DropdownSelect, Button } from "@modrinth/ui";
import type { Server } from "~/composables/pyroServers";
const props = defineProps<{
Expand Down Expand Up @@ -159,4 +162,8 @@ const resetStartup = () => {
jdkBuild.value =
jdkBuildMap.find((v) => v.value === startupSettings.value?.jdk_build)?.label || "";
};
const resetToDefault = () => {
invocation.value = startupSettings.value?.original_invocation;
};
</script>

0 comments on commit eb01a93

Please sign in to comment.