parent
8af63fc22a
commit
7210f1b947
@ -3,6 +3,7 @@
|
||||
import { tracks as tracksstore } from "../store.js";
|
||||
let trackname_input;
|
||||
let trackname_input_value;
|
||||
let track_min_duration;
|
||||
let tracklength;
|
||||
import { TrackService } from "@odit/lfk-client-js";
|
||||
export let modal_open;
|
||||
@ -19,6 +20,7 @@
|
||||
TrackService.trackControllerPost({
|
||||
distance: parseInt(tracklength),
|
||||
name: trackname_input_value,
|
||||
minimumLapTime: track_min_duration,
|
||||
})
|
||||
.then((result) => {
|
||||
Toastify({
|
||||
@ -115,6 +117,22 @@
|
||||
class="inline-flex items-center px-3 rounded-r-md border border-l-0 border-gray-300 bg-gray-50 text-gray-500 text-sm">m</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
for="track_min_duration"
|
||||
class="block text-sm font-medium text-gray-700">Minimum lap
|
||||
time in s</label>
|
||||
<div class="mt-1 flex rounded-md shadow-sm">
|
||||
<input
|
||||
bind:value={track_min_duration}
|
||||
type="number"
|
||||
name="track_min_duration"
|
||||
class="focus:ring-indigo-500 focus:border-indigo-500 flex-1 block w-full rounded-none rounded-r-md sm:text-sm border-gray-300"
|
||||
placeholder="1600" />
|
||||
<span
|
||||
class="inline-flex items-center px-3 rounded-r-md border border-l-0 border-gray-300 bg-gray-50 text-gray-500 text-sm">s</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -31,6 +31,7 @@
|
||||
tabledata.push([
|
||||
track.name,
|
||||
track.distance,
|
||||
track.minimumLapTime || 0,
|
||||
html(`
|
||||
<button class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-gray-400 text-base font-medium text-white sm:w-auto sm:text-sm">Edit</button>
|
||||
<button class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-500 text-base font-medium text-white sm:w-auto sm:text-sm">Delete</button>
|
||||
@ -39,7 +40,12 @@
|
||||
});
|
||||
if (datatable_inited === false) {
|
||||
datatable = new Grid({
|
||||
columns: [$_("track-name"), $_("track-length-in-m"), "Action"],
|
||||
columns: [
|
||||
$_("track-name"),
|
||||
$_("track-length-in-m"),
|
||||
"Minimum lap time in s",
|
||||
"Action",
|
||||
],
|
||||
language: getlang($json("datatable")),
|
||||
sort: true,
|
||||
search: { enabled: true },
|
||||
|
Loading…
x
Reference in New Issue
Block a user