update design
This commit is contained in:
@@ -18,187 +18,172 @@
|
|||||||
formLoading = false;
|
formLoading = false;
|
||||||
};
|
};
|
||||||
}}
|
}}
|
||||||
|
class="space-y-6 max-w-3xl"
|
||||||
>
|
>
|
||||||
<input type="hidden" name="id" value={id} />
|
<input type="hidden" name="id" value={id} />
|
||||||
<input type="hidden" name="file" value={configFile.assistRules} />
|
<input type="hidden" name="file" value={configFile.assistRules} />
|
||||||
<div class="sm:mx-auto sm:w-full sm:max-w-7xl">
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||||
<div class="border-b border-gray-900/10 pb-12">
|
<!-- Stability Control Level Max -->
|
||||||
<h2 class="text-base/7 font-semibold text-gray-900">Assist Rules</h2>
|
<div>
|
||||||
<div class="mt-10 grid grid-cols-1 gap-x-6 gap-y-8 sm:grid-cols-6">
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
<!-- Stability Control Level Max -->
|
Stability Control Level Max:
|
||||||
<div class="sm:col-span-6">
|
<input
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
bind:value={editedConfig.stabilityControlLevelMax}
|
||||||
Stability Control Level Max:
|
disabled={formLoading}
|
||||||
<div class="mt-2">
|
name="stabilityControlLevelMax"
|
||||||
<div class="input-block">
|
type="number"
|
||||||
<input
|
class="form form-input"
|
||||||
bind:value={editedConfig.stabilityControlLevelMax}
|
/>
|
||||||
disabled={formLoading}
|
</label>
|
||||||
name="stabilityControlLevelMax"
|
|
||||||
type="number"
|
|
||||||
class="form form-input"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Disable Autosteer -->
|
|
||||||
<div class="sm:col-span-6">
|
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
|
||||||
Disable Autosteer:
|
|
||||||
<div class="mt-2 grid grid-cols-1">
|
|
||||||
<select
|
|
||||||
bind:value={editedConfig.disableAutosteer}
|
|
||||||
disabled={formLoading}
|
|
||||||
name="disableAutosteer"
|
|
||||||
class="form form-select"
|
|
||||||
>
|
|
||||||
<option value={0}>No</option>
|
|
||||||
<option value={1}>Yes</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Disable Auto Lights -->
|
|
||||||
<div class="sm:col-span-6">
|
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
|
||||||
Disable Auto Lights:
|
|
||||||
<div class="mt-2 grid grid-cols-1">
|
|
||||||
<select
|
|
||||||
bind:value={editedConfig.disableAutoLights}
|
|
||||||
disabled={formLoading}
|
|
||||||
name="disableAutoLights"
|
|
||||||
class="form form-select"
|
|
||||||
>
|
|
||||||
<option value={0}>No</option>
|
|
||||||
<option value={1}>Yes</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Disable Auto Wiper -->
|
|
||||||
<div class="sm:col-span-6">
|
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
|
||||||
Disable Auto Wiper:
|
|
||||||
<div class="mt-2 grid grid-cols-1">
|
|
||||||
<select
|
|
||||||
bind:value={editedConfig.disableAutoWiper}
|
|
||||||
disabled={formLoading}
|
|
||||||
name="disableAutoWiper"
|
|
||||||
class="form form-select"
|
|
||||||
>
|
|
||||||
<option value={0}>No</option>
|
|
||||||
<option value={1}>Yes</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Disable Auto Engine Start -->
|
|
||||||
<div class="sm:col-span-6">
|
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
|
||||||
Disable Auto Engine Start:
|
|
||||||
<div class="mt-2 grid grid-cols-1">
|
|
||||||
<select
|
|
||||||
bind:value={editedConfig.disableAutoEngineStart}
|
|
||||||
disabled={formLoading}
|
|
||||||
name="disableAutoEngineStart"
|
|
||||||
class="form form-select"
|
|
||||||
>
|
|
||||||
<option value={0}>No</option>
|
|
||||||
<option value={1}>Yes</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Disable Auto Pit Limiter -->
|
|
||||||
<div class="sm:col-span-6">
|
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
|
||||||
Disable Auto Pit Limiter:
|
|
||||||
<div class="mt-2 grid grid-cols-1">
|
|
||||||
<select
|
|
||||||
bind:value={editedConfig.disableAutoPitLimiter}
|
|
||||||
disabled={formLoading}
|
|
||||||
name="disableAutoPitLimiter"
|
|
||||||
class="form form-select"
|
|
||||||
>
|
|
||||||
<option value={0}>No</option>
|
|
||||||
<option value={1}>Yes</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Disable Auto Gear -->
|
|
||||||
<div class="sm:col-span-6">
|
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
|
||||||
Disable Auto Gear:
|
|
||||||
<div class="mt-2 grid grid-cols-1">
|
|
||||||
<select
|
|
||||||
bind:value={editedConfig.disableAutoGear}
|
|
||||||
disabled={formLoading}
|
|
||||||
name="disableAutoGear"
|
|
||||||
class="form form-select"
|
|
||||||
>
|
|
||||||
<option value={0}>No</option>
|
|
||||||
<option value={1}>Yes</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Disable Auto Clutch -->
|
|
||||||
<div class="sm:col-span-6">
|
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
|
||||||
Disable Auto Clutch:
|
|
||||||
<div class="mt-2 grid grid-cols-1">
|
|
||||||
<select
|
|
||||||
bind:value={editedConfig.disableAutoClutch}
|
|
||||||
disabled={formLoading}
|
|
||||||
name="disableAutoClutch"
|
|
||||||
class="form form-select"
|
|
||||||
>
|
|
||||||
<option value={0}>No</option>
|
|
||||||
<option value={1}>Yes</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Disable Ideal Line -->
|
|
||||||
<div class="sm:col-span-6">
|
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
|
||||||
Disable Ideal Line:
|
|
||||||
<div class="mt-2 grid grid-cols-1">
|
|
||||||
<select
|
|
||||||
bind:value={editedConfig.disableIdealLine}
|
|
||||||
disabled={formLoading}
|
|
||||||
name="disableIdealLine"
|
|
||||||
class="form form-select"
|
|
||||||
>
|
|
||||||
<option value={0}>No</option>
|
|
||||||
<option value={1}>Yes</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-6 flex items-center justify-end gap-x-6">
|
|
||||||
<label
|
<!-- Disable Autosteer -->
|
||||||
><span class="mx-3">Restart server</span><input
|
<div>
|
||||||
type="checkbox"
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
id="restart"
|
Disable Autosteer:
|
||||||
name="restart"
|
<select
|
||||||
bind:checked={restart}
|
bind:value={editedConfig.disableAutosteer}
|
||||||
/></label
|
disabled={formLoading}
|
||||||
>
|
name="disableAutosteer"
|
||||||
<button disabled={formLoading} type="submit" class="btn btn-blue">Save</button>
|
class="form form-select"
|
||||||
|
>
|
||||||
|
<option value={0}>No</option>
|
||||||
|
<option value={1}>Yes</option>
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Disable Auto Lights -->
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
|
Disable Auto Lights:
|
||||||
|
<select
|
||||||
|
bind:value={editedConfig.disableAutoLights}
|
||||||
|
disabled={formLoading}
|
||||||
|
name="disableAutoLights"
|
||||||
|
class="form form-select"
|
||||||
|
>
|
||||||
|
<option value={0}>No</option>
|
||||||
|
<option value={1}>Yes</option>
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Disable Auto Wiper -->
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
|
Disable Auto Wiper:
|
||||||
|
<select
|
||||||
|
bind:value={editedConfig.disableAutoWiper}
|
||||||
|
disabled={formLoading}
|
||||||
|
name="disableAutoWiper"
|
||||||
|
class="form form-select"
|
||||||
|
>
|
||||||
|
<option value={0}>No</option>
|
||||||
|
<option value={1}>Yes</option>
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Disable Auto Engine Start -->
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
|
Disable Auto Engine Start:
|
||||||
|
<select
|
||||||
|
bind:value={editedConfig.disableAutoEngineStart}
|
||||||
|
disabled={formLoading}
|
||||||
|
name="disableAutoEngineStart"
|
||||||
|
class="form form-select"
|
||||||
|
>
|
||||||
|
<option value={0}>No</option>
|
||||||
|
<option value={1}>Yes</option>
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Disable Auto Pit Limiter -->
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
|
Disable Auto Pit Limiter:
|
||||||
|
<select
|
||||||
|
bind:value={editedConfig.disableAutoPitLimiter}
|
||||||
|
disabled={formLoading}
|
||||||
|
name="disableAutoPitLimiter"
|
||||||
|
class="form form-select"
|
||||||
|
>
|
||||||
|
<option value={0}>No</option>
|
||||||
|
<option value={1}>Yes</option>
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Disable Auto Gear -->
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
|
Disable Auto Gear:
|
||||||
|
<select
|
||||||
|
bind:value={editedConfig.disableAutoGear}
|
||||||
|
disabled={formLoading}
|
||||||
|
name="disableAutoGear"
|
||||||
|
class="form form-select"
|
||||||
|
>
|
||||||
|
<option value={0}>No</option>
|
||||||
|
<option value={1}>Yes</option>
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Disable Auto Clutch -->
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
|
Disable Auto Clutch:
|
||||||
|
<select
|
||||||
|
bind:value={editedConfig.disableAutoClutch}
|
||||||
|
disabled={formLoading}
|
||||||
|
name="disableAutoClutch"
|
||||||
|
class="form form-select"
|
||||||
|
>
|
||||||
|
<option value={0}>No</option>
|
||||||
|
<option value={1}>Yes</option>
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Disable Ideal Line -->
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
|
Disable Ideal Line:
|
||||||
|
<select
|
||||||
|
bind:value={editedConfig.disableIdealLine}
|
||||||
|
disabled={formLoading}
|
||||||
|
name="disableIdealLine"
|
||||||
|
class="form form-select"
|
||||||
|
>
|
||||||
|
<option value={0}>No</option>
|
||||||
|
<option value={1}>Yes</option>
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="pt-4 border-t border-gray-700">
|
||||||
|
<label class="flex items-center">
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
bind:checked={restart}
|
||||||
|
class="h-4 w-4 text-green-600 focus:ring-green-500 border-gray-600 rounded bg-gray-700"
|
||||||
|
/>
|
||||||
|
<span class="ml-2 text-sm text-gray-300">Restart server after saving</span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex justify-end">
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
disabled={formLoading}
|
||||||
|
class="px-4 py-2 bg-green-600 hover:bg-green-700 rounded-md text-sm font-medium"
|
||||||
|
>
|
||||||
|
Save Changes
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|||||||
@@ -18,107 +18,96 @@
|
|||||||
formLoading = false;
|
formLoading = false;
|
||||||
};
|
};
|
||||||
}}
|
}}
|
||||||
|
class="space-y-6 max-w-3xl"
|
||||||
>
|
>
|
||||||
<input type="hidden" name="id" value={id} />
|
<input type="hidden" name="id" value={id} />
|
||||||
<input type="hidden" name="file" value={configFile.configuration} />
|
<input type="hidden" name="file" value={configFile.configuration} />
|
||||||
<div class="sm:mx-auto sm:w-full sm:max-w-7xl">
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||||
<div class="border-b border-gray-900/10 pb-12">
|
<div>
|
||||||
<h2 class="text-base/7 font-semibold text-gray-900">Configuration</h2>
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
<div class="mt-10 grid grid-cols-1 gap-x-6 gap-y-8 sm:grid-cols-6">
|
UDP Port:
|
||||||
<div class="sm:col-span-2">
|
<input
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
disabled={formLoading}
|
||||||
UDP Port:
|
name="udpPort"
|
||||||
<div class="mt-2">
|
type="number"
|
||||||
<div class="input-block">
|
class="form form-input"
|
||||||
<input
|
bind:value={editedConfig.udpPort}
|
||||||
disabled={formLoading}
|
/>
|
||||||
name="udpPort"
|
</label>
|
||||||
type="number"
|
|
||||||
class="form form-input"
|
|
||||||
bind:value={editedConfig.udpPort}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div></label
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
<div class="sm:col-span-2">
|
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
|
||||||
TCP Port:
|
|
||||||
<div class="mt-2">
|
|
||||||
<div class="input-block">
|
|
||||||
<input
|
|
||||||
disabled={formLoading}
|
|
||||||
name="tcpPort"
|
|
||||||
type="number"
|
|
||||||
class="form form-input"
|
|
||||||
bind:value={editedConfig.tcpPort}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div></label
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
<div class="sm:col-span-2">
|
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
|
||||||
Max Connections:
|
|
||||||
<div class="mt-2">
|
|
||||||
<div class="input-block">
|
|
||||||
<input
|
|
||||||
disabled={formLoading}
|
|
||||||
name="maxConnections"
|
|
||||||
type="number"
|
|
||||||
class="form form-input"
|
|
||||||
bind:value={editedConfig.maxConnections}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div></label
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
<div class="sm:col-span-2">
|
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
|
||||||
Lan Discovery:
|
|
||||||
<div class="mt-2 grid grid-cols-1">
|
|
||||||
<select
|
|
||||||
bind:value={editedConfig.lanDiscovery}
|
|
||||||
disabled={formLoading}
|
|
||||||
name="lanDiscovery"
|
|
||||||
class="form form-select"
|
|
||||||
>
|
|
||||||
<option value={0}>No</option>
|
|
||||||
<option value={1}>Yes</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div class="sm:col-span-2">
|
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
|
||||||
Register To Lobby:
|
|
||||||
<div class="mt-2 grid grid-cols-1">
|
|
||||||
<select
|
|
||||||
bind:value={editedConfig.registerToLobby}
|
|
||||||
disabled={formLoading}
|
|
||||||
name="registerToLobby"
|
|
||||||
class="form form-select"
|
|
||||||
>
|
|
||||||
<option value={0}>No</option>
|
|
||||||
<option value={1}>Yes</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<input type="hidden" name="configVersion" value={1} />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-6 flex items-center justify-end gap-x-6">
|
<div>
|
||||||
<label
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
><span class="mx-3">Restart server</span><input
|
TCP Port:
|
||||||
type="checkbox"
|
<input
|
||||||
id="restart"
|
disabled={formLoading}
|
||||||
name="restart"
|
name="tcpPort"
|
||||||
bind:checked={restart}
|
type="number"
|
||||||
/></label
|
class="form form-input"
|
||||||
>
|
bind:value={editedConfig.tcpPort}
|
||||||
<button disabled={formLoading} type="submit" class="btn btn-blue">Save</button>
|
/>
|
||||||
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
|
Max Connections:
|
||||||
|
<input
|
||||||
|
disabled={formLoading}
|
||||||
|
name="maxConnections"
|
||||||
|
type="number"
|
||||||
|
class="form form-input"
|
||||||
|
bind:value={editedConfig.maxConnections}
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
|
Lan Discovery:
|
||||||
|
<select
|
||||||
|
bind:value={editedConfig.lanDiscovery}
|
||||||
|
disabled={formLoading}
|
||||||
|
name="lanDiscovery"
|
||||||
|
class="form form-select"
|
||||||
|
>
|
||||||
|
<option value={0}>No</option>
|
||||||
|
<option value={1}>Yes</option>
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
|
Register To Lobby:
|
||||||
|
<select
|
||||||
|
bind:value={editedConfig.registerToLobby}
|
||||||
|
disabled={formLoading}
|
||||||
|
name="registerToLobby"
|
||||||
|
class="form form-select"
|
||||||
|
>
|
||||||
|
<option value={0}>No</option>
|
||||||
|
<option value={1}>Yes</option>
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<input type="hidden" name="configVersion" value={1} />
|
||||||
|
</div>
|
||||||
|
<div class="pt-4 border-t border-gray-700">
|
||||||
|
<label class="flex items-center">
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
bind:checked={restart}
|
||||||
|
class="h-4 w-4 text-green-600 focus:ring-green-500 border-gray-600 rounded bg-gray-700"
|
||||||
|
/>
|
||||||
|
<span class="ml-2 text-sm text-gray-300">Restart server after saving</span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex justify-end">
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
disabled={formLoading}
|
||||||
|
class="px-4 py-2 bg-green-600 hover:bg-green-700 rounded-md text-sm font-medium"
|
||||||
|
>
|
||||||
|
Save Changes
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|||||||
@@ -20,331 +20,285 @@
|
|||||||
formLoading = false;
|
formLoading = false;
|
||||||
};
|
};
|
||||||
}}
|
}}
|
||||||
|
class="space-y-6 max-w-3xl"
|
||||||
>
|
>
|
||||||
<input type="hidden" name="id" value={id} />
|
<input type="hidden" name="id" value={id} />
|
||||||
<input type="hidden" name="file" value={configFile.event} />
|
<input type="hidden" name="file" value={configFile.event} />
|
||||||
<div class="sm:mx-auto sm:w-full sm:max-w-7xl">
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||||
<div class="border-b border-gray-900/10 pb-12">
|
<div>
|
||||||
<h2 class="text-base/7 font-semibold text-gray-900">Event</h2>
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
<div class="mt-10 grid grid-cols-1 gap-x-6 gap-y-8 sm:grid-cols-6">
|
Track:
|
||||||
<div class="sm:col-span-6">
|
<select
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
bind:value={editedConfig.track}
|
||||||
Track:
|
disabled={formLoading}
|
||||||
<div class="mt-2 grid grid-cols-1">
|
name="track"
|
||||||
<select
|
class="form form-select"
|
||||||
bind:value={editedConfig.track}
|
>
|
||||||
disabled={formLoading}
|
{#each tracks as track}
|
||||||
name="track"
|
<option value={track.track}>{track.track}</option>
|
||||||
class="form form-select"
|
{/each}
|
||||||
>
|
</select>
|
||||||
{#each tracks as track}
|
</label>
|
||||||
<option value={track.track}>{track.track}</option>
|
</div>
|
||||||
{/each}
|
<div>
|
||||||
</select>
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
</div>
|
Pre-Race waiting time seconds:
|
||||||
</label>
|
<input
|
||||||
</div>
|
disabled={formLoading}
|
||||||
<div class="sm:col-span-2">
|
name="preRaceWaitingTimeSeconds"
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
type="number"
|
||||||
Pre-Race waiting time seconds:
|
class="form form-input"
|
||||||
<div class="mt-2">
|
bind:value={editedConfig.preRaceWaitingTimeSeconds}
|
||||||
<div class="input-block">
|
/>
|
||||||
<input
|
</label>
|
||||||
disabled={formLoading}
|
</div>
|
||||||
name="preRaceWaitingTimeSeconds"
|
<div>
|
||||||
type="number"
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
class="form form-input"
|
Session over time seconds:
|
||||||
bind:value={editedConfig.preRaceWaitingTimeSeconds}
|
<input
|
||||||
/>
|
disabled={formLoading}
|
||||||
</div>
|
name="sessionOverTimeSeconds"
|
||||||
</div></label
|
type="number"
|
||||||
>
|
class="form form-input"
|
||||||
</div>
|
bind:value={editedConfig.sessionOverTimeSeconds}
|
||||||
<div class="sm:col-span-2">
|
/>
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
</label>
|
||||||
Session over time seconds:
|
</div>
|
||||||
<div class="mt-2">
|
<div>
|
||||||
<div class="input-block">
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
<input
|
Ambient temp:
|
||||||
disabled={formLoading}
|
<input
|
||||||
name="sessionOverTimeSeconds"
|
disabled={formLoading}
|
||||||
type="number"
|
name="ambientTemp"
|
||||||
class="form form-input"
|
type="number"
|
||||||
bind:value={editedConfig.sessionOverTimeSeconds}
|
class="form form-input"
|
||||||
/>
|
bind:value={editedConfig.ambientTemp}
|
||||||
</div>
|
/>
|
||||||
</div></label
|
</label>
|
||||||
>
|
</div>
|
||||||
</div>
|
<div>
|
||||||
<div class="sm:col-span-2">
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
Cloud level:
|
||||||
Ambient temp:
|
<input
|
||||||
<div class="mt-2">
|
disabled={formLoading}
|
||||||
<div class="input-block">
|
name="cloudLevel"
|
||||||
<input
|
type="number"
|
||||||
disabled={formLoading}
|
class="form form-input"
|
||||||
name="ambientTemp"
|
bind:value={editedConfig.cloudLevel}
|
||||||
type="number"
|
step=".01"
|
||||||
class="form form-input"
|
/>
|
||||||
bind:value={editedConfig.ambientTemp}
|
</label>
|
||||||
/>
|
</div>
|
||||||
</div>
|
<div>
|
||||||
</div></label
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
>
|
Rain:
|
||||||
</div>
|
<input
|
||||||
<div class="sm:col-span-2">
|
disabled={formLoading}
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
name="rain"
|
||||||
Cloud level:
|
type="number"
|
||||||
<div class="mt-2">
|
class="form form-input"
|
||||||
<div class="input-block">
|
bind:value={editedConfig.rain}
|
||||||
<input
|
step=".01"
|
||||||
disabled={formLoading}
|
/>
|
||||||
name="cloudLevel"
|
</label>
|
||||||
type="number"
|
</div>
|
||||||
class="form form-input"
|
<div>
|
||||||
bind:value={editedConfig.cloudLevel}
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
step=".01"
|
Weather randomness:
|
||||||
/>
|
<input
|
||||||
</div>
|
disabled={formLoading}
|
||||||
</div></label
|
name="weatherRandomness"
|
||||||
>
|
type="number"
|
||||||
</div>
|
class="form form-input"
|
||||||
<div class="sm:col-span-2">
|
bind:value={editedConfig.weatherRandomness}
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
/>
|
||||||
Rain:
|
</label>
|
||||||
<div class="mt-2">
|
</div>
|
||||||
<div class="input-block">
|
<div>
|
||||||
<input
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
disabled={formLoading}
|
Post-Qualy seconds:
|
||||||
name="rain"
|
<input
|
||||||
type="number"
|
disabled={formLoading}
|
||||||
class="form form-input"
|
name="postQualySeconds"
|
||||||
bind:value={editedConfig.rain}
|
type="number"
|
||||||
step=".01"
|
class="form form-input"
|
||||||
/>
|
bind:value={editedConfig.postQualySeconds}
|
||||||
</div>
|
/>
|
||||||
</div></label
|
</label>
|
||||||
>
|
</div>
|
||||||
</div>
|
<div>
|
||||||
<div class="sm:col-span-2">
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
Post-Race seconds:
|
||||||
Weather randomness:
|
<input
|
||||||
<div class="mt-2">
|
disabled={formLoading}
|
||||||
<div class="input-block">
|
name="postRaceSeconds"
|
||||||
<input
|
type="number"
|
||||||
disabled={formLoading}
|
class="form form-input"
|
||||||
name="weatherRandomness"
|
bind:value={editedConfig.postRaceSeconds}
|
||||||
type="number"
|
/>
|
||||||
class="form form-input"
|
</label>
|
||||||
bind:value={editedConfig.weatherRandomness}
|
</div>
|
||||||
/>
|
<div>
|
||||||
</div>
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
</div></label
|
Simracer weather conditions:
|
||||||
>
|
<input
|
||||||
</div>
|
disabled={formLoading}
|
||||||
<div class="sm:col-span-2">
|
name="simracerWeatherConditions"
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
type="number"
|
||||||
Post-Qualy seconds:
|
class="form form-input"
|
||||||
<div class="mt-2">
|
bind:value={editedConfig.simracerWeatherConditions}
|
||||||
<div class="input-block">
|
/>
|
||||||
<input
|
</label>
|
||||||
disabled={formLoading}
|
</div>
|
||||||
name="postQualySeconds"
|
<div>
|
||||||
type="number"
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
class="form form-input"
|
Is fixed condition qualification:
|
||||||
bind:value={editedConfig.postQualySeconds}
|
<select
|
||||||
/>
|
bind:value={editedConfig.isFixedConditionQualification}
|
||||||
</div>
|
disabled={formLoading}
|
||||||
</div></label
|
name="isFixedConditionQualification"
|
||||||
>
|
class="form form-select"
|
||||||
</div>
|
>
|
||||||
<div class="sm:col-span-2">
|
<option value={0}>No</option>
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
<option value={1}>Yes</option>
|
||||||
Post-Race seconds:
|
</select>
|
||||||
<div class="mt-2">
|
</label>
|
||||||
<div class="input-block">
|
</div>
|
||||||
<input
|
<div />
|
||||||
disabled={formLoading}
|
<div>
|
||||||
name="postRaceSeconds"
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
type="number"
|
Sessions:
|
||||||
class="form form-input"
|
<div class="mt-2 space-y-4">
|
||||||
bind:value={editedConfig.postRaceSeconds}
|
{#each editedConfig.sessions as session, index}
|
||||||
/>
|
<div class="mb-4 rounded-lg border border-gray-700 bg-gray-800 p-4">
|
||||||
</div>
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||||
</div></label
|
<!-- Hour of Day -->
|
||||||
>
|
<div>
|
||||||
</div>
|
<label class="block text-sm font-medium text-gray-300 mb-1"
|
||||||
<div class="sm:col-span-2">
|
>Hour of Day:
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
<input
|
||||||
Simracer weather conditions:
|
bind:value={session.hourOfDay}
|
||||||
<div class="mt-2">
|
name={`sessions[${index}].hourOfDay`}
|
||||||
<div class="input-block">
|
disabled={formLoading}
|
||||||
<input
|
type="number"
|
||||||
disabled={formLoading}
|
class="form form-input"
|
||||||
name="simracerWeatherConditions"
|
/>
|
||||||
type="number"
|
</label>
|
||||||
class="form form-input"
|
|
||||||
bind:value={editedConfig.simracerWeatherConditions}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div></label
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
<div class="sm:col-span-2">
|
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
|
||||||
Is fixed condition qualification:
|
|
||||||
<div class="mt-2 grid grid-cols-1">
|
|
||||||
<select
|
|
||||||
bind:value={editedConfig.isFixedConditionQualification}
|
|
||||||
disabled={formLoading}
|
|
||||||
name="isFixedConditionQualification"
|
|
||||||
class="form form-select"
|
|
||||||
>
|
|
||||||
<option value={0}>No</option>
|
|
||||||
<option value={1}>Yes</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div class="sm:col-span-6">
|
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
|
||||||
Sessions:
|
|
||||||
<div class="mt-2">
|
|
||||||
{#each editedConfig.sessions as session, index}
|
|
||||||
<div class="mb-4 rounded-lg border p-4">
|
|
||||||
<div class="grid grid-cols-2 gap-4">
|
|
||||||
<!-- Hour of Day -->
|
|
||||||
<div>
|
|
||||||
<label class="block text-sm font-medium text-gray-700"
|
|
||||||
>Hour of Day:
|
|
||||||
<div class="mt-2">
|
|
||||||
<div class="input-block">
|
|
||||||
<input
|
|
||||||
bind:value={session.hourOfDay}
|
|
||||||
name={`sessions[${index}].hourOfDay`}
|
|
||||||
disabled={formLoading}
|
|
||||||
type="number"
|
|
||||||
class="form form-input"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div></label
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
<!-- Day of Weekend -->
|
|
||||||
<div>
|
|
||||||
<label class="block text-sm font-medium text-gray-700"
|
|
||||||
>Day of Weekend:
|
|
||||||
<div class="mt-2">
|
|
||||||
<div class="input-block">
|
|
||||||
<input
|
|
||||||
bind:value={session.dayOfWeekend}
|
|
||||||
name={`sessions[${index}].dayOfWeekend`}
|
|
||||||
disabled={formLoading}
|
|
||||||
type="number"
|
|
||||||
class="form form-input"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<!-- Time Multiplier -->
|
|
||||||
<div>
|
|
||||||
<label class="block text-sm font-medium text-gray-700"
|
|
||||||
>Time Multiplier:
|
|
||||||
<div class="mt-2">
|
|
||||||
<div class="input-block">
|
|
||||||
<input
|
|
||||||
bind:value={session.timeMultiplier}
|
|
||||||
name={`sessions[${index}].timeMultiplier`}
|
|
||||||
disabled={formLoading}
|
|
||||||
type="number"
|
|
||||||
class="form form-input"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div></label
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
<!-- Session Type -->
|
|
||||||
<div>
|
|
||||||
<label class="block text-sm font-medium text-gray-700"
|
|
||||||
>Session Type:
|
|
||||||
<div class="mt-2 grid grid-cols-1">
|
|
||||||
<select
|
|
||||||
bind:value={session.sessionType}
|
|
||||||
name={`sessions[${index}].sessionType`}
|
|
||||||
disabled={formLoading}
|
|
||||||
class="form form-select"
|
|
||||||
>
|
|
||||||
<option value="P">Practice</option>
|
|
||||||
<option value="Q">Qualifying</option>
|
|
||||||
<option value="R">Race</option>
|
|
||||||
</select>
|
|
||||||
</div></label
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
<!-- Session Duration Minutes -->
|
|
||||||
<div>
|
|
||||||
<label class="block text-sm font-medium text-gray-700"
|
|
||||||
>Session Duration (Minutes):
|
|
||||||
<div class="mt-2">
|
|
||||||
<div class="input-block">
|
|
||||||
<input
|
|
||||||
bind:value={session.sessionDurationMinutes}
|
|
||||||
name={`sessions[${index}].sessionDurationMinutes`}
|
|
||||||
disabled={formLoading}
|
|
||||||
type="number"
|
|
||||||
class="form form-input"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
onclick={() => {
|
|
||||||
editedConfig.sessions = editedConfig.sessions.filter((_, i) => i !== index);
|
|
||||||
}}
|
|
||||||
class="mt-2 text-sm text-red-600 hover:text-red-800"
|
|
||||||
>
|
|
||||||
Remove Session
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
{/each}
|
<!-- Day of Weekend -->
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
|
Day of Weekend:
|
||||||
|
<input
|
||||||
|
bind:value={session.dayOfWeekend}
|
||||||
|
name={`sessions[${index}].dayOfWeekend`}
|
||||||
|
disabled={formLoading}
|
||||||
|
type="number"
|
||||||
|
class="form form-input"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<!-- Time Multiplier -->
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
|
Time Multiplier:
|
||||||
|
<input
|
||||||
|
bind:value={session.timeMultiplier}
|
||||||
|
name={`sessions[${index}].timeMultiplier`}
|
||||||
|
disabled={formLoading}
|
||||||
|
type="number"
|
||||||
|
class="form form-input"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<!-- Session Type -->
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
|
Session Type:
|
||||||
|
<select
|
||||||
|
bind:value={session.sessionType}
|
||||||
|
name={`sessions[${index}].sessionType`}
|
||||||
|
disabled={formLoading}
|
||||||
|
class="form form-select"
|
||||||
|
>
|
||||||
|
<option value="P">Practice</option>
|
||||||
|
<option value="Q">Qualifying</option>
|
||||||
|
<option value="R">Race</option>
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<!-- Session Duration Minutes -->
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
|
Session Duration (Minutes):
|
||||||
|
<input
|
||||||
|
bind:value={session.sessionDurationMinutes}
|
||||||
|
name={`sessions[${index}].sessionDurationMinutes`}
|
||||||
|
disabled={formLoading}
|
||||||
|
type="number"
|
||||||
|
class="form form-input"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onclick={() => {
|
onclick={() => {
|
||||||
editedConfig.sessions = [
|
editedConfig.sessions = editedConfig.sessions.filter((_, i) => i !== index);
|
||||||
...editedConfig.sessions,
|
|
||||||
{
|
|
||||||
hourOfDay: 14,
|
|
||||||
dayOfWeekend: 1,
|
|
||||||
timeMultiplier: 1,
|
|
||||||
sessionType: 'Practice',
|
|
||||||
sessionDurationMinutes: 60
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}}
|
}}
|
||||||
class="btn btn-blue mt-2"
|
class="mt-4 px-3 py-1 bg-red-600 hover:bg-red-700 rounded-md text-xs font-medium text-white flex items-center"
|
||||||
>
|
>
|
||||||
Add Session
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 mr-1" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" />
|
||||||
|
</svg>
|
||||||
|
Remove Session
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</label>
|
{/each}
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onclick={() => {
|
||||||
|
editedConfig.sessions = [
|
||||||
|
...editedConfig.sessions,
|
||||||
|
{
|
||||||
|
hourOfDay: 14,
|
||||||
|
dayOfWeekend: 1,
|
||||||
|
timeMultiplier: 1,
|
||||||
|
sessionType: 'Practice',
|
||||||
|
sessionDurationMinutes: 60
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}}
|
||||||
|
class="px-4 py-2 bg-green-600 hover:bg-green-700 rounded-md text-sm font-medium text-white flex items-center"
|
||||||
|
>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 mr-1" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4" />
|
||||||
|
</svg>
|
||||||
|
Add Session
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-6 flex items-center justify-end gap-x-6">
|
</div>
|
||||||
<label
|
<div class="pt-4 border-t border-gray-700">
|
||||||
><span class="mx-3">Restart server</span><input
|
<label class="flex items-center">
|
||||||
type="checkbox"
|
<input
|
||||||
id="restart"
|
type="checkbox"
|
||||||
name="restart"
|
bind:checked={restart}
|
||||||
bind:checked={restart}
|
class="h-4 w-4 text-green-600 focus:ring-green-500 border-gray-600 rounded bg-gray-700"
|
||||||
/></label
|
/>
|
||||||
>
|
<span class="ml-2 text-sm text-gray-300">Restart server after saving</span>
|
||||||
<button disabled={formLoading} type="submit" class="btn btn-blue">Save</button>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="flex justify-end">
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
disabled={formLoading}
|
||||||
|
class="px-4 py-2 bg-green-600 hover:bg-green-700 rounded-md text-sm font-medium"
|
||||||
|
>
|
||||||
|
Save Changes
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|||||||
@@ -18,223 +18,194 @@
|
|||||||
formLoading = false;
|
formLoading = false;
|
||||||
};
|
};
|
||||||
}}
|
}}
|
||||||
|
class="space-y-6 max-w-3xl"
|
||||||
>
|
>
|
||||||
<input type="hidden" name="id" value={id} />
|
<input type="hidden" name="id" value={id} />
|
||||||
<input type="hidden" name="file" value={configFile.eventRules} />
|
<input type="hidden" name="file" value={configFile.eventRules} />
|
||||||
<div class="sm:mx-auto sm:w-full sm:max-w-7xl">
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||||
<div class="border-b border-gray-900/10 pb-12">
|
<!-- Qualify Standing Type -->
|
||||||
<h2 class="text-base/7 font-semibold text-gray-900">Event Rules</h2>
|
<div>
|
||||||
<div class="mt-10 grid grid-cols-1 gap-x-6 gap-y-8 sm:grid-cols-6">
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
<!-- Qualify Standing Type -->
|
Qualify Standing Type:
|
||||||
<div class="sm:col-span-6">
|
<input
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
bind:value={editedConfig.qualifyStandingType}
|
||||||
Qualify Standing Type:
|
disabled={formLoading}
|
||||||
<div class="mt-2">
|
name="qualifyStandingType"
|
||||||
<div class="input-block">
|
type="number"
|
||||||
<input
|
class="form form-input"
|
||||||
bind:value={editedConfig.qualifyStandingType}
|
/>
|
||||||
disabled={formLoading}
|
</label>
|
||||||
name="qualifyStandingType"
|
|
||||||
type="number"
|
|
||||||
class="form form-input"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Pit Window Length Sec -->
|
|
||||||
<div class="sm:col-span-6">
|
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
|
||||||
Pit Window Length (Sec):
|
|
||||||
<div class="mt-2">
|
|
||||||
<div class="input-block">
|
|
||||||
<input
|
|
||||||
bind:value={editedConfig.pitWindowLengthSec}
|
|
||||||
disabled={formLoading}
|
|
||||||
name="pitWindowLengthSec"
|
|
||||||
type="number"
|
|
||||||
class="form form-input"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Driver Stint Time Sec -->
|
|
||||||
<div class="sm:col-span-6">
|
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
|
||||||
Driver Stint Time (Sec):
|
|
||||||
<div class="mt-2">
|
|
||||||
<div class="input-block">
|
|
||||||
<input
|
|
||||||
bind:value={editedConfig.driverStintTimeSec}
|
|
||||||
disabled={formLoading}
|
|
||||||
name="driverStintTimeSec"
|
|
||||||
type="number"
|
|
||||||
class="form form-input"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Mandatory Pitstop Count -->
|
|
||||||
<div class="sm:col-span-6">
|
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
|
||||||
Mandatory Pitstop Count:
|
|
||||||
<div class="mt-2">
|
|
||||||
<div class="input-block">
|
|
||||||
<input
|
|
||||||
bind:value={editedConfig.mandatoryPitstopCount}
|
|
||||||
disabled={formLoading}
|
|
||||||
name="mandatoryPitstopCount"
|
|
||||||
type="number"
|
|
||||||
class="form form-input"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Max Total Driving Time -->
|
|
||||||
<div class="sm:col-span-6">
|
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
|
||||||
Max Total Driving Time:
|
|
||||||
<div class="mt-2">
|
|
||||||
<div class="input-block">
|
|
||||||
<input
|
|
||||||
bind:value={editedConfig.maxTotalDrivingTime}
|
|
||||||
disabled={formLoading}
|
|
||||||
name="maxTotalDrivingTime"
|
|
||||||
type="number"
|
|
||||||
class="form form-input"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Is Refuelling Allowed In Race -->
|
|
||||||
<div class="sm:col-span-6">
|
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
|
||||||
Is Refuelling Allowed In Race:
|
|
||||||
<div class="mt-2 grid grid-cols-1">
|
|
||||||
<select
|
|
||||||
bind:value={editedConfig.isRefuellingAllowedInRace}
|
|
||||||
disabled={formLoading}
|
|
||||||
name="isRefuellingAllowedInRace"
|
|
||||||
class="form form-select"
|
|
||||||
>
|
|
||||||
<option value={0}>No</option>
|
|
||||||
<option value={1}>Yes</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Is Refuelling Time Fixed -->
|
|
||||||
<div class="sm:col-span-6">
|
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
|
||||||
Is Refuelling Time Fixed:
|
|
||||||
<div class="mt-2 grid grid-cols-1">
|
|
||||||
<select
|
|
||||||
bind:value={editedConfig.isRefuellingTimeFixed}
|
|
||||||
disabled={formLoading}
|
|
||||||
name="isRefuellingTimeFixed"
|
|
||||||
class="form form-select"
|
|
||||||
>
|
|
||||||
<option value={0}>No</option>
|
|
||||||
<option value={1}>Yes</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Is Mandatory Pitstop Refuelling Required -->
|
|
||||||
<div class="sm:col-span-6">
|
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
|
||||||
Is Mandatory Pitstop Refuelling Required:
|
|
||||||
<div class="mt-2 grid grid-cols-1">
|
|
||||||
<select
|
|
||||||
bind:value={editedConfig.isMandatoryPitstopRefuellingRequired}
|
|
||||||
disabled={formLoading}
|
|
||||||
name="isMandatoryPitstopRefuellingRequired"
|
|
||||||
class="form form-select"
|
|
||||||
>
|
|
||||||
<option value={0}>No</option>
|
|
||||||
<option value={1}>Yes</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Is Mandatory Pitstop Tyre Change Required -->
|
|
||||||
<div class="sm:col-span-6">
|
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
|
||||||
Is Mandatory Pitstop Tyre Change Required:
|
|
||||||
<div class="mt-2 grid grid-cols-1">
|
|
||||||
<select
|
|
||||||
bind:value={editedConfig.isMandatoryPitstopTyreChangeRequired}
|
|
||||||
disabled={formLoading}
|
|
||||||
name="isMandatoryPitstopTyreChangeRequired"
|
|
||||||
class="form form-select"
|
|
||||||
>
|
|
||||||
<option value={0}>No</option>
|
|
||||||
<option value={1}>Yes</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Is Mandatory Pitstop Swap Driver Required -->
|
|
||||||
<div class="sm:col-span-6">
|
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
|
||||||
Is Mandatory Pitstop Swap Driver Required:
|
|
||||||
<div class="mt-2 grid grid-cols-1">
|
|
||||||
<select
|
|
||||||
bind:value={editedConfig.isMandatoryPitstopSwapDriverRequired}
|
|
||||||
disabled={formLoading}
|
|
||||||
name="isMandatoryPitstopSwapDriverRequired"
|
|
||||||
class="form form-select"
|
|
||||||
>
|
|
||||||
<option value={0}>No</option>
|
|
||||||
<option value={1}>Yes</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Tyre Set Count -->
|
|
||||||
<div class="sm:col-span-6">
|
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
|
||||||
Tyre Set Count:
|
|
||||||
<div class="mt-2">
|
|
||||||
<div class="input-block">
|
|
||||||
<input
|
|
||||||
bind:value={editedConfig.tyreSetCount}
|
|
||||||
disabled={formLoading}
|
|
||||||
name="tyreSetCount"
|
|
||||||
type="number"
|
|
||||||
class="form form-input"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-6 flex items-center justify-end gap-x-6">
|
|
||||||
<label
|
<!-- Pit Window Length Sec -->
|
||||||
><span class="mx-3">Restart server</span><input
|
<div>
|
||||||
type="checkbox"
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
id="restart"
|
Pit Window Length (Sec):
|
||||||
name="restart"
|
<input
|
||||||
bind:checked={restart}
|
bind:value={editedConfig.pitWindowLengthSec}
|
||||||
/></label
|
disabled={formLoading}
|
||||||
>
|
name="pitWindowLengthSec"
|
||||||
<button disabled={formLoading} type="submit" class="btn btn-blue">Save</button>
|
type="number"
|
||||||
|
class="form form-input"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Driver Stint Time Sec -->
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
|
Driver Stint Time (Sec):
|
||||||
|
<input
|
||||||
|
bind:value={editedConfig.driverStintTimeSec}
|
||||||
|
disabled={formLoading}
|
||||||
|
name="driverStintTimeSec"
|
||||||
|
type="number"
|
||||||
|
class="form form-input"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Mandatory Pitstop Count -->
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
|
Mandatory Pitstop Count:
|
||||||
|
<input
|
||||||
|
bind:value={editedConfig.mandatoryPitstopCount}
|
||||||
|
disabled={formLoading}
|
||||||
|
name="mandatoryPitstopCount"
|
||||||
|
type="number"
|
||||||
|
class="form form-input"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Max Total Driving Time -->
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
|
Max Total Driving Time:
|
||||||
|
<input
|
||||||
|
bind:value={editedConfig.maxTotalDrivingTime}
|
||||||
|
disabled={formLoading}
|
||||||
|
name="maxTotalDrivingTime"
|
||||||
|
type="number"
|
||||||
|
class="form form-input"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Is Refuelling Allowed In Race -->
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
|
Is Refuelling Allowed In Race:
|
||||||
|
<select
|
||||||
|
bind:value={editedConfig.isRefuellingAllowedInRace}
|
||||||
|
disabled={formLoading}
|
||||||
|
name="isRefuellingAllowedInRace"
|
||||||
|
class="form form-select"
|
||||||
|
>
|
||||||
|
<option value={0}>No</option>
|
||||||
|
<option value={1}>Yes</option>
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Is Refuelling Time Fixed -->
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
|
Is Refuelling Time Fixed:
|
||||||
|
<select
|
||||||
|
bind:value={editedConfig.isRefuellingTimeFixed}
|
||||||
|
disabled={formLoading}
|
||||||
|
name="isRefuellingTimeFixed"
|
||||||
|
class="form form-select"
|
||||||
|
>
|
||||||
|
<option value={0}>No</option>
|
||||||
|
<option value={1}>Yes</option>
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Is Mandatory Pitstop Refuelling Required -->
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
|
Is Mandatory Pitstop Refuelling Required:
|
||||||
|
<select
|
||||||
|
bind:value={editedConfig.isMandatoryPitstopRefuellingRequired}
|
||||||
|
disabled={formLoading}
|
||||||
|
name="isMandatoryPitstopRefuellingRequired"
|
||||||
|
class="form form-select"
|
||||||
|
>
|
||||||
|
<option value={0}>No</option>
|
||||||
|
<option value={1}>Yes</option>
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Is Mandatory Pitstop Tyre Change Required -->
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
|
Is Mandatory Pitstop Tyre Change Required:
|
||||||
|
<select
|
||||||
|
bind:value={editedConfig.isMandatoryPitstopTyreChangeRequired}
|
||||||
|
disabled={formLoading}
|
||||||
|
name="isMandatoryPitstopTyreChangeRequired"
|
||||||
|
class="form form-select"
|
||||||
|
>
|
||||||
|
<option value={0}>No</option>
|
||||||
|
<option value={1}>Yes</option>
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Is Mandatory Pitstop Swap Driver Required -->
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
|
Is Mandatory Pitstop Swap Driver Required:
|
||||||
|
<select
|
||||||
|
bind:value={editedConfig.isMandatoryPitstopSwapDriverRequired}
|
||||||
|
disabled={formLoading}
|
||||||
|
name="isMandatoryPitstopSwapDriverRequired"
|
||||||
|
class="form form-select"
|
||||||
|
>
|
||||||
|
<option value={0}>No</option>
|
||||||
|
<option value={1}>Yes</option>
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Tyre Set Count -->
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
|
Tyre Set Count:
|
||||||
|
<input
|
||||||
|
bind:value={editedConfig.tyreSetCount}
|
||||||
|
disabled={formLoading}
|
||||||
|
name="tyreSetCount"
|
||||||
|
type="number"
|
||||||
|
class="form form-input"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="pt-4 border-t border-gray-700">
|
||||||
|
<label class="flex items-center">
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
bind:checked={restart}
|
||||||
|
class="h-4 w-4 text-green-600 focus:ring-green-500 border-gray-600 rounded bg-gray-700"
|
||||||
|
/>
|
||||||
|
<span class="ml-2 text-sm text-gray-300">Restart server after saving</span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex justify-end">
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
disabled={formLoading}
|
||||||
|
class="px-4 py-2 bg-green-600 hover:bg-green-700 rounded-md text-sm font-medium"
|
||||||
|
>
|
||||||
|
Save Changes
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|||||||
@@ -19,335 +19,288 @@
|
|||||||
formLoading = false;
|
formLoading = false;
|
||||||
};
|
};
|
||||||
}}
|
}}
|
||||||
|
class="space-y-6 max-w-3xl"
|
||||||
>
|
>
|
||||||
<input type="hidden" name="id" value={id} />
|
<input type="hidden" name="id" value={id} />
|
||||||
<input type="hidden" name="file" value={configFile.settings} />
|
<input type="hidden" name="file" value={configFile.settings} />
|
||||||
<div class="sm:mx-auto sm:w-full sm:max-w-7xl">
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||||
<div class="border-b border-gray-900/10 pb-12">
|
<!-- Server Name -->
|
||||||
<h2 class="text-base/7 font-semibold text-gray-900">Settings</h2>
|
<div>
|
||||||
<div class="mt-10 grid grid-cols-1 gap-x-6 gap-y-8 sm:grid-cols-6">
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
<!-- Server Name -->
|
Server Name:
|
||||||
<div class="sm:col-span-6">
|
<input
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
bind:value={editedConfig.serverName}
|
||||||
Server Name:
|
disabled={formLoading}
|
||||||
<div class="mt-2">
|
name="serverName"
|
||||||
<div class="input-block">
|
type="text"
|
||||||
<input
|
class="form form-input"
|
||||||
bind:value={editedConfig.serverName}
|
/>
|
||||||
disabled={formLoading}
|
</label>
|
||||||
name="serverName"
|
|
||||||
type="text"
|
|
||||||
class="form form-input"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Admin Password -->
|
|
||||||
<div class="sm:col-span-6">
|
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
|
||||||
Admin Password:
|
|
||||||
<div class="mt-2">
|
|
||||||
<div class="input-block">
|
|
||||||
<input
|
|
||||||
bind:value={editedConfig.adminPassword}
|
|
||||||
disabled={formLoading}
|
|
||||||
name="adminPassword"
|
|
||||||
type="password"
|
|
||||||
class="form form-input"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Car Group -->
|
|
||||||
<div class="sm:col-span-6">
|
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
|
||||||
Car Group:
|
|
||||||
<div class="mt-2 grid grid-cols-1">
|
|
||||||
<select
|
|
||||||
bind:value={editedConfig.carGroup}
|
|
||||||
disabled={formLoading}
|
|
||||||
name="carGroup"
|
|
||||||
class="form form-select"
|
|
||||||
>
|
|
||||||
{#each carGroups as group}
|
|
||||||
<option value={group}>{group}</option>
|
|
||||||
{/each}
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Track Medals Requirement -->
|
|
||||||
<div class="sm:col-span-6">
|
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
|
||||||
Track Medals Requirement:
|
|
||||||
<div class="mt-2">
|
|
||||||
<div class="input-block">
|
|
||||||
<input
|
|
||||||
bind:value={editedConfig.trackMedalsRequirement}
|
|
||||||
disabled={formLoading}
|
|
||||||
name="trackMedalsRequirement"
|
|
||||||
type="number"
|
|
||||||
class="form form-input"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Safety Rating Requirement -->
|
|
||||||
<div class="sm:col-span-6">
|
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
|
||||||
Safety Rating Requirement:
|
|
||||||
<div class="mt-2">
|
|
||||||
<div class="input-block">
|
|
||||||
<input
|
|
||||||
bind:value={editedConfig.safetyRatingRequirement}
|
|
||||||
disabled={formLoading}
|
|
||||||
name="safetyRatingRequirement"
|
|
||||||
type="number"
|
|
||||||
class="form form-input"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Racecraft Rating Requirement -->
|
|
||||||
<div class="sm:col-span-6">
|
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
|
||||||
Racecraft Rating Requirement:
|
|
||||||
<div class="mt-2">
|
|
||||||
<div class="input-block">
|
|
||||||
<input
|
|
||||||
bind:value={editedConfig.racecraftRatingRequirement}
|
|
||||||
disabled={formLoading}
|
|
||||||
name="racecraftRatingRequirement"
|
|
||||||
type="number"
|
|
||||||
class="form form-input"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Password -->
|
|
||||||
<div class="sm:col-span-6">
|
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
|
||||||
Password:
|
|
||||||
<div class="mt-2">
|
|
||||||
<div class="input-block">
|
|
||||||
<input
|
|
||||||
bind:value={editedConfig.password}
|
|
||||||
disabled={formLoading}
|
|
||||||
name="password"
|
|
||||||
type="password"
|
|
||||||
class="form form-input"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Spectator Password -->
|
|
||||||
<div class="sm:col-span-6">
|
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
|
||||||
Spectator Password:
|
|
||||||
<div class="mt-2">
|
|
||||||
<div class="input-block">
|
|
||||||
<input
|
|
||||||
bind:value={editedConfig.spectatorPassword}
|
|
||||||
disabled={formLoading}
|
|
||||||
name="spectatorPassword"
|
|
||||||
type="password"
|
|
||||||
class="form form-input"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Max Car Slots -->
|
|
||||||
<div class="sm:col-span-6">
|
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
|
||||||
Max Car Slots:
|
|
||||||
<div class="mt-2">
|
|
||||||
<div class="input-block">
|
|
||||||
<input
|
|
||||||
bind:value={editedConfig.maxCarSlots}
|
|
||||||
disabled={formLoading}
|
|
||||||
name="maxCarSlots"
|
|
||||||
type="number"
|
|
||||||
class="form form-input"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Dump Leaderboards -->
|
|
||||||
<div class="sm:col-span-6">
|
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
|
||||||
Dump Leaderboards:
|
|
||||||
<div class="mt-2 grid grid-cols-1">
|
|
||||||
<select
|
|
||||||
bind:value={editedConfig.dumpLeaderboards}
|
|
||||||
disabled={formLoading}
|
|
||||||
name="dumpLeaderboards"
|
|
||||||
class="form form-select"
|
|
||||||
>
|
|
||||||
<option value={0}>No</option>
|
|
||||||
<option value={1}>Yes</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Is Race Locked -->
|
|
||||||
<div class="sm:col-span-6">
|
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
|
||||||
Is Race Locked:
|
|
||||||
<div class="mt-2 grid grid-cols-1">
|
|
||||||
<select
|
|
||||||
bind:value={editedConfig.isRaceLocked}
|
|
||||||
disabled={formLoading}
|
|
||||||
name="isRaceLocked"
|
|
||||||
class="form form-select"
|
|
||||||
>
|
|
||||||
<option value={0}>No</option>
|
|
||||||
<option value={1}>Yes</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Randomize Track When Empty -->
|
|
||||||
<div class="sm:col-span-6">
|
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
|
||||||
Randomize Track When Empty:
|
|
||||||
<div class="mt-2 grid grid-cols-1">
|
|
||||||
<select
|
|
||||||
bind:value={editedConfig.randomizeTrackWhenEmpty}
|
|
||||||
disabled={formLoading}
|
|
||||||
name="randomizeTrackWhenEmpty"
|
|
||||||
class="form form-select"
|
|
||||||
>
|
|
||||||
<option value={0}>No</option>
|
|
||||||
<option value={1}>Yes</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Central Entry List Path -->
|
|
||||||
<div class="sm:col-span-6">
|
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
|
||||||
Central Entry List Path:
|
|
||||||
<div class="mt-2">
|
|
||||||
<div class="input-block">
|
|
||||||
<input
|
|
||||||
bind:value={editedConfig.centralEntryListPath}
|
|
||||||
disabled={formLoading}
|
|
||||||
name="centralEntryListPath"
|
|
||||||
type="text"
|
|
||||||
class="form form-input"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Allow Auto DQ -->
|
|
||||||
<div class="sm:col-span-6">
|
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
|
||||||
Allow Auto DQ:
|
|
||||||
<div class="mt-2 grid grid-cols-1">
|
|
||||||
<select
|
|
||||||
bind:value={editedConfig.allowAutoDQ}
|
|
||||||
disabled={formLoading}
|
|
||||||
name="allowAutoDQ"
|
|
||||||
class="form form-select"
|
|
||||||
>
|
|
||||||
<option value={0}>No</option>
|
|
||||||
<option value={1}>Yes</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Short Formation Lap -->
|
|
||||||
<div class="sm:col-span-6">
|
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
|
||||||
Short Formation Lap:
|
|
||||||
<div class="mt-2 grid grid-cols-1">
|
|
||||||
<select
|
|
||||||
bind:value={editedConfig.shortFormationLap}
|
|
||||||
disabled={formLoading}
|
|
||||||
name="shortFormationLap"
|
|
||||||
class="form form-select"
|
|
||||||
>
|
|
||||||
<option value={0}>No</option>
|
|
||||||
<option value={1}>Yes</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Formation Lap Type -->
|
|
||||||
<div class="sm:col-span-6">
|
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
|
||||||
Formation Lap Type:
|
|
||||||
<div class="mt-2 grid grid-cols-1">
|
|
||||||
<select
|
|
||||||
bind:value={editedConfig.formationLapType}
|
|
||||||
disabled={formLoading}
|
|
||||||
name="formationLapType"
|
|
||||||
class="form form-select"
|
|
||||||
>
|
|
||||||
<option value={0}>Old Limiter Lap</option>
|
|
||||||
<option value={1}
|
|
||||||
>Free (replaces /manual start), only usable for private servers</option
|
|
||||||
>
|
|
||||||
<option value={3}>Default formation lap with position control and UI</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Ignore Premature Disconnects -->
|
|
||||||
<div class="sm:col-span-6">
|
|
||||||
<label class="block text-sm/6 font-medium text-gray-900">
|
|
||||||
Ignore Premature Disconnects:
|
|
||||||
<div class="mt-2 grid grid-cols-1">
|
|
||||||
<select
|
|
||||||
bind:value={editedConfig.ignorePrematureDisconnects}
|
|
||||||
disabled={formLoading}
|
|
||||||
name="ignorePrematureDisconnects"
|
|
||||||
class="form form-select"
|
|
||||||
>
|
|
||||||
<option value={0}>No</option>
|
|
||||||
<option value={1}>Yes</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-6 flex items-center justify-end gap-x-6">
|
|
||||||
<label
|
<!-- Admin Password -->
|
||||||
><span class="mx-3">Restart server</span><input
|
<div>
|
||||||
type="checkbox"
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
id="restart"
|
Admin Password:
|
||||||
name="restart"
|
<input
|
||||||
bind:checked={restart}
|
bind:value={editedConfig.adminPassword}
|
||||||
/></label
|
disabled={formLoading}
|
||||||
>
|
name="adminPassword"
|
||||||
<button disabled={formLoading} type="submit" class="btn btn-blue">Save</button>
|
type="password"
|
||||||
|
class="form form-input"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Car Group -->
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
|
Car Group:
|
||||||
|
<select
|
||||||
|
bind:value={editedConfig.carGroup}
|
||||||
|
disabled={formLoading}
|
||||||
|
name="carGroup"
|
||||||
|
class="form form-select"
|
||||||
|
>
|
||||||
|
{#each carGroups as group}
|
||||||
|
<option value={group}>{group}</option>
|
||||||
|
{/each}
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Track Medals Requirement -->
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
|
Track Medals Requirement:
|
||||||
|
<input
|
||||||
|
bind:value={editedConfig.trackMedalsRequirement}
|
||||||
|
disabled={formLoading}
|
||||||
|
name="trackMedalsRequirement"
|
||||||
|
type="number"
|
||||||
|
class="form form-input"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Safety Rating Requirement -->
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
|
Safety Rating Requirement:
|
||||||
|
<input
|
||||||
|
bind:value={editedConfig.safetyRatingRequirement}
|
||||||
|
disabled={formLoading}
|
||||||
|
name="safetyRatingRequirement"
|
||||||
|
type="number"
|
||||||
|
class="form form-input"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Racecraft Rating Requirement -->
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
|
Racecraft Rating Requirement:
|
||||||
|
<input
|
||||||
|
bind:value={editedConfig.racecraftRatingRequirement}
|
||||||
|
disabled={formLoading}
|
||||||
|
name="racecraftRatingRequirement"
|
||||||
|
type="number"
|
||||||
|
class="form form-input"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Password -->
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
|
Password:
|
||||||
|
<input
|
||||||
|
bind:value={editedConfig.password}
|
||||||
|
disabled={formLoading}
|
||||||
|
name="password"
|
||||||
|
type="password"
|
||||||
|
class="form form-input"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Spectator Password -->
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
|
Spectator Password:
|
||||||
|
<input
|
||||||
|
bind:value={editedConfig.spectatorPassword}
|
||||||
|
disabled={formLoading}
|
||||||
|
name="spectatorPassword"
|
||||||
|
type="password"
|
||||||
|
class="form form-input"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Max Car Slots -->
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
|
Max Car Slots:
|
||||||
|
<input
|
||||||
|
bind:value={editedConfig.maxCarSlots}
|
||||||
|
disabled={formLoading}
|
||||||
|
name="maxCarSlots"
|
||||||
|
type="number"
|
||||||
|
class="form form-input"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Dump Leaderboards -->
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
|
Dump Leaderboards:
|
||||||
|
<select
|
||||||
|
bind:value={editedConfig.dumpLeaderboards}
|
||||||
|
disabled={formLoading}
|
||||||
|
name="dumpLeaderboards"
|
||||||
|
class="form form-select"
|
||||||
|
>
|
||||||
|
<option value={0}>No</option>
|
||||||
|
<option value={1}>Yes</option>
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Is Race Locked -->
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
|
Is Race Locked:
|
||||||
|
<select
|
||||||
|
bind:value={editedConfig.isRaceLocked}
|
||||||
|
disabled={formLoading}
|
||||||
|
name="isRaceLocked"
|
||||||
|
class="form form-select"
|
||||||
|
>
|
||||||
|
<option value={0}>No</option>
|
||||||
|
<option value={1}>Yes</option>
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Randomize Track When Empty -->
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
|
Randomize Track When Empty:
|
||||||
|
<select
|
||||||
|
bind:value={editedConfig.randomizeTrackWhenEmpty}
|
||||||
|
disabled={formLoading}
|
||||||
|
name="randomizeTrackWhenEmpty"
|
||||||
|
class="form form-select"
|
||||||
|
>
|
||||||
|
<option value={0}>No</option>
|
||||||
|
<option value={1}>Yes</option>
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Central Entry List Path -->
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
|
Central Entry List Path:
|
||||||
|
<input
|
||||||
|
bind:value={editedConfig.centralEntryListPath}
|
||||||
|
disabled={formLoading}
|
||||||
|
name="centralEntryListPath"
|
||||||
|
type="text"
|
||||||
|
class="form form-input"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Allow Auto DQ -->
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
|
Allow Auto DQ:
|
||||||
|
<select
|
||||||
|
bind:value={editedConfig.allowAutoDQ}
|
||||||
|
disabled={formLoading}
|
||||||
|
name="allowAutoDQ"
|
||||||
|
class="form form-select"
|
||||||
|
>
|
||||||
|
<option value={0}>No</option>
|
||||||
|
<option value={1}>Yes</option>
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Short Formation Lap -->
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
|
Short Formation Lap:
|
||||||
|
<select
|
||||||
|
bind:value={editedConfig.shortFormationLap}
|
||||||
|
disabled={formLoading}
|
||||||
|
name="shortFormationLap"
|
||||||
|
class="form form-select"
|
||||||
|
>
|
||||||
|
<option value={0}>No</option>
|
||||||
|
<option value={1}>Yes</option>
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Formation Lap Type -->
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
|
Formation Lap Type:
|
||||||
|
<select
|
||||||
|
bind:value={editedConfig.formationLapType}
|
||||||
|
disabled={formLoading}
|
||||||
|
name="formationLapType"
|
||||||
|
class="form form-select"
|
||||||
|
>
|
||||||
|
<option value={0}>Old Limiter Lap</option>
|
||||||
|
<option value={1}
|
||||||
|
>Free (replaces /manual start), only usable for private servers</option
|
||||||
|
>
|
||||||
|
<option value={3}>Default formation lap with position control and UI</option>
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Ignore Premature Disconnects -->
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-300 mb-1">
|
||||||
|
Ignore Premature Disconnects:
|
||||||
|
<select
|
||||||
|
bind:value={editedConfig.ignorePrematureDisconnects}
|
||||||
|
disabled={formLoading}
|
||||||
|
name="ignorePrematureDisconnects"
|
||||||
|
class="form form-select"
|
||||||
|
>
|
||||||
|
<option value={0}>No</option>
|
||||||
|
<option value={1}>Yes</option>
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="pt-4 border-t border-gray-700">
|
||||||
|
<label class="flex items-center">
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
bind:checked={restart}
|
||||||
|
class="h-4 w-4 text-green-600 focus:ring-green-500 border-gray-600 rounded bg-gray-700"
|
||||||
|
/>
|
||||||
|
<span class="ml-2 text-sm text-gray-300">Restart server after saving</span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex justify-end">
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
disabled={formLoading}
|
||||||
|
class="px-4 py-2 bg-green-600 hover:bg-green-700 rounded-md text-sm font-medium"
|
||||||
|
>
|
||||||
|
Save Changes
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|||||||
@@ -2,40 +2,86 @@
|
|||||||
import type { Server } from '$models/server';
|
import type { Server } from '$models/server';
|
||||||
|
|
||||||
let { server }: { server: Server } = $props();
|
let { server }: { server: Server } = $props();
|
||||||
|
|
||||||
|
function getStatusColor(status: string) {
|
||||||
|
switch (status) {
|
||||||
|
case 'SERVICE_RUNNING\r\n': return 'bg-green-500';
|
||||||
|
case 'SERVICE_STOPPED\r\n': return 'bg-red-500';
|
||||||
|
case 'SERVICE_RESTARTING\r\n': return 'bg-yellow-500';
|
||||||
|
default: return 'bg-gray-500';
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<a
|
<div class="bg-gray-800 rounded-lg shadow-lg overflow-hidden border border-gray-700">
|
||||||
href={`dashboard/server/${server.id}`}
|
<a
|
||||||
class="w-full max-w-sm rounded-lg border border-gray-200 bg-white shadow-sm dark:border-gray-700 dark:bg-gray-800"
|
href={`dashboard/server/${server.id}`}
|
||||||
>
|
>
|
||||||
<div class="flex flex-col items-center pb-4">
|
<div class="p-4">
|
||||||
<h2 class="mb-1 text-xl font-medium text-gray-900 dark:text-white">{server.name}</h2>
|
<div class="flex justify-between items-start">
|
||||||
<p class="text-sm text-gray-500 dark:text-gray-400">Status: {server.status}</p>
|
<div>
|
||||||
<div class="mt-12 flex">
|
<h3 class="text-lg font-medium">{server.name}</h3>
|
||||||
<form method="POST" action="?/start">
|
<div class="flex items-center mt-1">
|
||||||
<input type="hidden" name="id" value={server.id} />
|
<span class={`inline-block w-2 h-2 rounded-full ${getStatusColor(server.status)} mr-2`}></span>
|
||||||
<button
|
<span class="text-sm capitalize">{server.status}</span>
|
||||||
class="btn btn-blue"
|
</div>
|
||||||
disabled={server.status.startsWith('SERVICE_RUNNING')}
|
</div>
|
||||||
onclick={(e) => e.stopPropagation()}
|
<button
|
||||||
type="submit">Start</button
|
class="text-gray-400 hover:text-white"
|
||||||
>
|
>
|
||||||
<button
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
|
||||||
class="btn btn-blue"
|
<path d="M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z" />
|
||||||
disabled={server.status.startsWith('SERVICE_STOPPED')}
|
</svg>
|
||||||
onclick={(e) => e.stopPropagation()}
|
</button>
|
||||||
formaction="?/stop">Stop</button
|
</div>
|
||||||
>
|
|
||||||
<button
|
<div class="mt-4 grid grid-cols-2 gap-2 text-sm text-gray-300">
|
||||||
class="btn btn-blue"
|
<div>
|
||||||
disabled={server.status.startsWith('SERVICE_STOPPED')}
|
<span class="text-gray-500">Track:</span> {server.track}
|
||||||
onclick={(e) => e.stopPropagation()}
|
</div>
|
||||||
formaction="?/restart">Restart</button
|
<div>
|
||||||
>
|
<span class="text-gray-500">Class:</span> {server.carClass}
|
||||||
</form>
|
</div>
|
||||||
|
<div>
|
||||||
|
<span class="text-gray-500">Players:</span> {server.players}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span class="text-gray-500">Uptime:</span> {server.uptime}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</a>
|
||||||
</a>
|
|
||||||
|
<form method="POST" action="?/start">
|
||||||
|
<div class="bg-gray-900 px-4 py-3 flex justify-between">
|
||||||
|
<input type="hidden" name="id" value={server.id} />
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
disabled={server.status.startsWith('SERVICE_RUNNING')}
|
||||||
|
onclick={(e) => e.stopPropagation()}
|
||||||
|
class="px-3 py-1 bg-green-600 hover:bg-green-700 rounded-md text-xs font-medium disabled:opacity-50 disabled:cursor-not-allowed"
|
||||||
|
>
|
||||||
|
Start
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
disabled={server.status.startsWith('SERVICE_STOPPED')}
|
||||||
|
onclick={(e) => e.stopPropagation()}
|
||||||
|
class="px-3 py-1 bg-yellow-600 hover:bg-yellow-700 rounded-md text-xs font-medium disabled:opacity-50 disabled:cursor-not-allowed"
|
||||||
|
formaction="?/restart"
|
||||||
|
>
|
||||||
|
Restart
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
disabled={server.status.startsWith('SERVICE_STOPPED')}
|
||||||
|
onclick={(e) => e.stopPropagation()}
|
||||||
|
class="px-3 py-1 bg-red-600 hover:bg-red-700 rounded-md text-xs font-medium disabled:opacity-50 disabled:cursor-not-allowed"
|
||||||
|
formaction="?/stop"
|
||||||
|
>
|
||||||
|
Stop
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,28 +0,0 @@
|
|||||||
<script lang="ts">
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<aside class="fixed top-0 left-0 z-40 h-screen w-64">
|
|
||||||
<div class="h-full overflow-y-auto bg-gray-50 px-3 py-4 dark:bg-gray-800">
|
|
||||||
<ul class="space-y-2 font-medium">
|
|
||||||
<li>
|
|
||||||
<a
|
|
||||||
href="/dashboard"
|
|
||||||
class="group flex items-center rounded-lg p-2 text-gray-900 hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700"
|
|
||||||
>
|
|
||||||
<span class="ms-3">Dashboard</span>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a
|
|
||||||
href="/logout"
|
|
||||||
class="group flex items-center rounded-lg p-2 text-gray-900 hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700"
|
|
||||||
>
|
|
||||||
<span class="ms-3">Logout</span>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</aside>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
</style>
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
<script>
|
|
||||||
import Sidebar from '$components/Sidebar.svelte';
|
|
||||||
import '../../app.css';
|
|
||||||
let { children } = $props();
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div class="layout">
|
|
||||||
<Sidebar />
|
|
||||||
<div class="p-4 sm:ml-64">
|
|
||||||
{@render children()}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<style></style>
|
|
||||||
@@ -6,10 +6,41 @@
|
|||||||
let servers: Server[] = data.servers;
|
let servers: Server[] = data.servers;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="server-grid">
|
<div class="min-h-screen bg-gray-900 text-white">
|
||||||
|
<header class="bg-gray-800 shadow-md">
|
||||||
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4 flex justify-between items-center">
|
||||||
|
<h1 class="text-2xl font-bold">ACC Server Manager</h1>
|
||||||
|
<div class="flex items-center space-x-4">
|
||||||
|
<a href="/logout">
|
||||||
|
<button
|
||||||
|
class="text-gray-300 hover:text-white flex items-center"
|
||||||
|
>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" />
|
||||||
|
</svg>
|
||||||
|
<span class="ml-1 hidden sm:inline">Logout</span>
|
||||||
|
</button>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<main class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
|
||||||
|
<div class="flex justify-between items-center mb-6">
|
||||||
|
<h2 class="text-xl font-semibold">Your Servers</h2>
|
||||||
|
<div class="flex space-x-2">
|
||||||
|
<a href="/dashboard" class="px-3 py-1 bg-gray-700 hover:bg-gray-600 rounded-md text-sm">
|
||||||
|
Refresh
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||||
{#each servers as server}
|
{#each servers as server}
|
||||||
<ServerCard {server} />
|
<ServerCard {server} />
|
||||||
{/each}
|
{/each}
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
|
|||||||
@@ -12,72 +12,144 @@
|
|||||||
const id = data.id;
|
const id = data.id;
|
||||||
const server = data.server;
|
const server = data.server;
|
||||||
let tab = $state(configFile.event);
|
let tab = $state(configFile.event);
|
||||||
|
|
||||||
|
function getStatusColor(status: string) {
|
||||||
|
console.log({status})
|
||||||
|
switch (status) {
|
||||||
|
case 'SERVICE_RUNNING\r\n': return 'bg-green-500';
|
||||||
|
case 'SERVICE_STOPPED\r\n': return 'bg-red-500';
|
||||||
|
case 'SERVICE_RESTARTING\r\n': return 'bg-yellow-500';
|
||||||
|
default: return 'bg-gray-500';
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
<title>{server.name}</title>
|
<title>{server.name}</title>
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|
||||||
<aside class="fixed top-0 left-64 z-40 h-screen w-48">
|
<div class="min-h-screen bg-gray-900 text-white flex">
|
||||||
<div class="h-full overflow-y-auto bg-gray-50 px-1 py-4 dark:bg-gray-700">
|
<!-- Sidebar -->
|
||||||
<div class="flex items-center justify-center">
|
<aside class="w-64 bg-gray-800 border-r border-gray-700 flex-shrink-0">
|
||||||
<h2 class="bold mb-5 text-gray-300">{server.name}</h2>
|
<!-- Update the sidebar header to make the server name clickable -->
|
||||||
|
<div class="p-4 border-b border-gray-700">
|
||||||
|
<a href="/dashboard" class="hover:text-green-400 transition-colors">
|
||||||
|
<h2 class="text-lg font-semibold truncate">{server.name}</h2>
|
||||||
|
</a>
|
||||||
|
<div class="flex items-center mt-1">
|
||||||
|
<span class={`inline-block w-2 h-2 rounded-full ${getStatusColor(server.status)} mr-2`}></span>
|
||||||
|
<span class="text-sm capitalize">{server.status}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<nav class="p-2">
|
||||||
|
<ul class="space-y-1">
|
||||||
|
<li>
|
||||||
|
<button
|
||||||
|
class={`w-full text-left px-3 py-2 rounded-md ${tab === configFile.event ? 'bg-green-600 text-white' : 'text-gray-300 hover:bg-gray-700'}`}
|
||||||
|
disabled={tab === configFile.event || !configs.event}
|
||||||
|
onclick={() => (tab = configFile.event)}
|
||||||
|
>
|
||||||
|
Event
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<button
|
||||||
|
class={`w-full text-left px-3 py-2 rounded-md ${tab === configFile.configuration ? 'bg-green-600 text-white' : 'text-gray-300 hover:bg-gray-700'}`}
|
||||||
|
disabled={tab === configFile.configuration || !configs.configuration}
|
||||||
|
onclick={() => (tab = configFile.configuration)}
|
||||||
|
>
|
||||||
|
Configuration
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<button
|
||||||
|
class={`w-full text-left px-3 py-2 rounded-md ${tab === configFile.settings ? 'bg-green-600 text-white' : 'text-gray-300 hover:bg-gray-700'}`}
|
||||||
|
disabled={tab === configFile.settings || !configs.settings}
|
||||||
|
onclick={() => (tab = configFile.settings)}
|
||||||
|
>
|
||||||
|
Settings
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
|
{#if configs.assistRules}
|
||||||
|
<li>
|
||||||
|
<button
|
||||||
|
class={`w-full text-left px-3 py-2 rounded-md ${tab === configFile.assistRules ? 'bg-green-600 text-white' : 'text-gray-300 hover:bg-gray-700'}`}
|
||||||
|
disabled={tab === configFile.assistRules || !configs.assistRules}
|
||||||
|
onclick={() => (tab = configFile.assistRules)}
|
||||||
|
>
|
||||||
|
Assist Rules
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
|
{/if}
|
||||||
|
{#if configs.eventRules}
|
||||||
|
<li>
|
||||||
|
<button
|
||||||
|
class={`w-full text-left px-3 py-2 rounded-md ${tab === configFile.eventRules ? 'bg-green-600 text-white' : 'text-gray-300 hover:bg-gray-700'}`}
|
||||||
|
disabled={tab === configFile.eventRules || !configs.eventRules}
|
||||||
|
onclick={() => (tab = configFile.eventRules)}
|
||||||
|
>
|
||||||
|
Event Rules
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</aside>
|
||||||
|
|
||||||
|
<main class="flex-1 overflow-auto">
|
||||||
|
<header class="bg-gray-800 shadow-md p-4 flex justify-between items-center">
|
||||||
|
<h1 class="text-xl font-semibold">
|
||||||
|
{#if tab === configFile.event}
|
||||||
|
Event
|
||||||
|
{:else if tab === configFile.configuration}
|
||||||
|
Configuration
|
||||||
|
{:else if tab === configFile.settings}
|
||||||
|
Settings
|
||||||
|
{:else if tab === configFile.assistRules}
|
||||||
|
Assist Rules
|
||||||
|
{:else if tab === configFile.eventRules}
|
||||||
|
Event Rules
|
||||||
|
{/if}
|
||||||
|
</h1>
|
||||||
|
<div class="flex space-x-3">
|
||||||
|
<a
|
||||||
|
href="/dashboard"
|
||||||
|
class="px-3 py-1.5 bg-gray-700 hover:bg-gray-600 rounded-md text-sm flex items-center"
|
||||||
|
>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 mr-1" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 19l-7-7m0 0l7-7m-7 7h18" />
|
||||||
|
</svg>
|
||||||
|
Back to Dashboard
|
||||||
|
</a>
|
||||||
|
<a
|
||||||
|
href="/logout"
|
||||||
|
class="px-3 py-1.5 bg-red-700 hover:bg-red-800 rounded-md text-sm flex items-center"
|
||||||
|
>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 mr-1" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" />
|
||||||
|
</svg>
|
||||||
|
Logout
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
<div class="p-6">
|
||||||
|
{#if tab === configFile.event}
|
||||||
|
<EditorEvent config={configs.event} {tracks} {id} />
|
||||||
|
{:else if tab === configFile.configuration}
|
||||||
|
<EditorConfiguration config={configs.configuration} {id} />
|
||||||
|
{:else if tab === configFile.settings}
|
||||||
|
<EditorSettings config={configs.settings} {id} />
|
||||||
|
{:else if tab === configFile.assistRules}
|
||||||
|
<EditorAssistRules config={configs.assistRules} {id} />
|
||||||
|
{:else if tab === configFile.eventRules}
|
||||||
|
<EditorEventRules config={configs.eventRules} {id} />
|
||||||
|
{:else}
|
||||||
|
<div class="bg-gray-800 rounded-lg p-6 text-center">
|
||||||
|
<p class="text-gray-400">Select a section from the sidebar to edit settings</p>
|
||||||
</div>
|
</div>
|
||||||
<ul class="space-y-2 font-medium">
|
{/if}
|
||||||
<li>
|
|
||||||
<button
|
|
||||||
class="btn btn-sidebar"
|
|
||||||
disabled={tab === configFile.event || !configs.event}
|
|
||||||
onclick={() => (tab = configFile.event)}
|
|
||||||
>
|
|
||||||
<span class="ms-3">Event</span>
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
class="btn btn-sidebar"
|
|
||||||
disabled={tab === configFile.configuration || !configs.configuration}
|
|
||||||
onclick={() => (tab = configFile.configuration)}
|
|
||||||
>
|
|
||||||
<span class="ms-3">Configuration</span>
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
class="btn btn-sidebar"
|
|
||||||
disabled={tab === configFile.settings || !configs.settings}
|
|
||||||
onclick={() => (tab = configFile.settings)}
|
|
||||||
>
|
|
||||||
<span class="ms-3">Settings</span>
|
|
||||||
</button>
|
|
||||||
{#if configs.assistRules}
|
|
||||||
<button
|
|
||||||
class="btn btn-sidebar"
|
|
||||||
disabled={tab === configFile.assistRules}
|
|
||||||
onclick={() => (tab = configFile.assistRules)}
|
|
||||||
>
|
|
||||||
<span class="ms-3">Assist Rules</span>
|
|
||||||
</button>
|
|
||||||
{/if}
|
|
||||||
{#if configs.eventRules}
|
|
||||||
<button
|
|
||||||
class="btn btn-sidebar"
|
|
||||||
disabled={tab === configFile.eventRules}
|
|
||||||
onclick={() => (tab = configFile.eventRules)}
|
|
||||||
>
|
|
||||||
<span class="ms-3">Event Rules</span>
|
|
||||||
</button>
|
|
||||||
{/if}
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
</div>
|
||||||
</aside>
|
</main>
|
||||||
<div class="sm:ml-48">
|
|
||||||
{#if tab === configFile.event}
|
|
||||||
<EditorEvent config={configs.event} {tracks} {id} />
|
|
||||||
{:else if tab === configFile.configuration}
|
|
||||||
<EditorConfiguration config={configs.configuration} {id} />
|
|
||||||
{:else if tab === configFile.settings}
|
|
||||||
<EditorSettings config={configs.settings} {id} />
|
|
||||||
{:else if tab === configFile.assistRules}
|
|
||||||
<EditorAssistRules config={configs.assistRules} {id} />
|
|
||||||
{:else if tab === configFile.eventRules}
|
|
||||||
<EditorEventRules config={configs.eventRules} {id} />
|
|
||||||
{/if}
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -13,67 +13,73 @@
|
|||||||
<title>ACC Server Manager - Login</title>
|
<title>ACC Server Manager - Login</title>
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|
||||||
<div class="flex min-h-full flex-col justify-center px-6 py-12 lg:px-8">
|
<div class="min-h-screen flex items-center justify-center bg-gray-900">
|
||||||
<div class="sm:mx-auto sm:w-full sm:max-w-sm">
|
<div class="w-full max-w-md p-8 space-y-8 bg-gray-800 rounded-lg shadow-lg">
|
||||||
<h2 class="mt-10 text-center text-2xl/9 font-bold tracking-tight text-gray-900">
|
<div class="text-center">
|
||||||
Sign in to your account
|
<h1 class="text-3xl font-bold text-white">ACC Server Manager</h1>
|
||||||
</h2>
|
<p class="mt-2 text-gray-400">Sign in to manage your servers</p>
|
||||||
</div>
|
|
||||||
{#if error}
|
|
||||||
<div class="sm:mx-auto sm:w-full sm:max-w-sm">
|
|
||||||
<p class="error">{error}</p>
|
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{#if error}
|
||||||
|
<div class="p-3 bg-red-900/50 border border-red-700 rounded-md text-red-200 text-sm">
|
||||||
<form
|
{error}
|
||||||
method="POST"
|
</div>
|
||||||
action="?/login"
|
{/if}
|
||||||
use:enhance={() => {
|
<form
|
||||||
formLoading = true;
|
method="POST"
|
||||||
}}
|
action="?/login"
|
||||||
>
|
use:enhance={() => {
|
||||||
<div class="mt-10 sm:mx-auto sm:w-full sm:max-w-sm">
|
formLoading = true;
|
||||||
<div class="space-y-6">
|
}}
|
||||||
<div>
|
>
|
||||||
<label for="text" class="block text-sm/6 font-medium text-gray-900">Username</label>
|
<div class="space-y-4">
|
||||||
<div class="mt-2">
|
<div>
|
||||||
<input
|
<label for="username" class="block text-sm font-medium text-gray-300">Username</label>
|
||||||
type="text"
|
<input
|
||||||
name="username"
|
type="text"
|
||||||
id="username"
|
name="username"
|
||||||
autocomplete="username"
|
id="username"
|
||||||
required
|
autocomplete="username"
|
||||||
class="form form-login"
|
required
|
||||||
bind:value={username}
|
bind:value={username}
|
||||||
disabled={formLoading}
|
disabled={formLoading}
|
||||||
/>
|
class="mt-1 block w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded-md text-white placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-green-500 focus:border-transparent"
|
||||||
</div>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<div class="flex items-center justify-between">
|
<label for="password" class="block text-sm font-medium text-gray-300">Password</label>
|
||||||
<label for="password" class="block text-sm/6 font-medium text-gray-900">Password</label>
|
<input
|
||||||
</div>
|
type="password"
|
||||||
<div class="mt-2">
|
name="password"
|
||||||
<input
|
id="password"
|
||||||
type="password"
|
autocomplete="current-password"
|
||||||
name="password"
|
required
|
||||||
id="password"
|
bind:value={password}
|
||||||
autocomplete="current-password"
|
disabled={formLoading}
|
||||||
required
|
class="mt-1 block w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded-md text-white placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-green-500 focus:border-transparent"
|
||||||
class="form form-login"
|
/>
|
||||||
bind:value={password}
|
|
||||||
disabled={formLoading}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<button type="submit" class="btn btn-login" disabled={formLoading}>Sign in</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
|
||||||
|
<div>
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
disabled={formLoading}
|
||||||
|
class="w-full flex justify-center mt-4 py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-green-600 hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 disabled:opacity-50 disabled:cursor-not-allowed"
|
||||||
|
>
|
||||||
|
{#if formLoading}
|
||||||
|
<svg class="animate-spin -ml-1 mr-3 h-5 w-5 text-white" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
|
||||||
|
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
|
||||||
|
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
|
||||||
|
</svg>
|
||||||
|
Signing in...
|
||||||
|
{:else}
|
||||||
|
Sign in
|
||||||
|
{/if}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
@@ -7,11 +7,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.form-input {
|
.form-input {
|
||||||
@apply min-w-0 grow py-1.5 pr-3 pl-1 text-base text-gray-900 placeholder:text-gray-400 focus:outline-none sm:text-sm/6;
|
@apply w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded-md text-white focus:outline-none focus:ring-2 focus:ring-green-500 focus:border-transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-select {
|
.form-select {
|
||||||
@apply col-start-1 row-start-1 w-full appearance-none rounded-md bg-white py-1.5 pr-8 pl-3 text-base text-gray-900 outline-1 -outline-offset-1 outline-gray-300 focus:outline-2 focus:-outline-offset-2 focus:outline-indigo-600 sm:text-sm/6;
|
@apply w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded-md text-white focus:outline-none focus:ring-2 focus:ring-green-500 focus:border-transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.form:disabled {
|
.form:disabled {
|
||||||
|
|||||||
Reference in New Issue
Block a user