bindable restart input

This commit is contained in:
Fran Jurmanović
2025-05-07 00:41:11 +02:00
parent 719ae2175f
commit d21d41ea9e
6 changed files with 11 additions and 5 deletions

View File

@@ -5,6 +5,7 @@
const { config, id }: { config: AssistRules; id: string } = $props();
const editedConfig = $state({ ...config });
let formLoading = $state(false);
let restart = $state(true);
</script>
<form
@@ -193,7 +194,7 @@
type="checkbox"
id="restart"
name="restart"
checked
bind:checked={restart}
/></label
>
<button disabled={formLoading} type="submit" class="btn btn-blue">Save</button>

View File

@@ -5,6 +5,7 @@
const { config, id }: { config: Configuration; id: string } = $props();
const editedConfig = $state({ ...config });
let formLoading = $state(false);
let restart = $state(true);
</script>
<form
@@ -113,7 +114,7 @@
type="checkbox"
id="restart"
name="restart"
checked
bind:checked={restart}
/></label
>
<button disabled={formLoading} type="submit" class="btn btn-blue">Save</button>

View File

@@ -7,6 +7,7 @@
const editedConfig = $state({ ...config });
if (!editedConfig.sessions) editedConfig.sessions = [];
let formLoading = $state(false);
let restart = $state(true);
</script>
<form
@@ -339,7 +340,7 @@
type="checkbox"
id="restart"
name="restart"
checked
bind:checked={restart}
/></label
>
<button disabled={formLoading} type="submit" class="btn btn-blue">Save</button>

View File

@@ -5,6 +5,7 @@
const { config, id }: { config: EventRules; id: string } = $props();
const editedConfig = $state({ ...config });
let formLoading = $state(false);
let restart = $state(true);
</script>
<form
@@ -229,7 +230,7 @@
type="checkbox"
id="restart"
name="restart"
checked
bind:checked={restart}
/></label
>
<button disabled={formLoading} type="submit" class="btn btn-blue">Save</button>

View File

@@ -5,6 +5,7 @@
const { config, id }: { config: ServerSettings; id: string } = $props();
const editedConfig = $state({ ...config });
let formLoading = $state(false);
let restart = $state(true);
const carGroups = ['FreeForAll', 'GT3', 'GT4', 'GT2', 'GTC', 'TCX'];
</script>
@@ -342,7 +343,7 @@
type="checkbox"
id="restart"
name="restart"
checked
bind:checked={restart}
/></label
>
<button disabled={formLoading} type="submit" class="btn btn-blue">Save</button>

View File

@@ -47,6 +47,7 @@ async function destructureFormData(
const formData = await event.request.formData();
const id = formData.get('id') as string;
const restart = formData.get('restart') as string;
console.log(restart);
const file = formData.get('file') as configFile;
const object: any = {};
formData.forEach((value, key) => {