Compare commits
No commits in common. "ff91995337c1a6b5e938df62c7f0075dce66e784" and "5b15141ecc0a5ed6a689e739b0f8990be244fa53" have entirely different histories.
ff91995337
...
5b15141ecc
@ -3,14 +3,12 @@
|
||||
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;
|
||||
let processed_last_submit = true;
|
||||
import Toastify from "toastify-js";
|
||||
import "toastify-js/src/toastify.css";
|
||||
$: smart_track_min_duration_placeholder = parseInt(tracklength || 0) * 0.369;
|
||||
function submit() {
|
||||
if (processed_last_submit === true) {
|
||||
processed_last_submit = false;
|
||||
@ -21,7 +19,6 @@
|
||||
TrackService.trackControllerPost({
|
||||
distance: parseInt(tracklength),
|
||||
name: trackname_input_value,
|
||||
minimumLapTime: track_min_duration,
|
||||
})
|
||||
.then((result) => {
|
||||
Toastify({
|
||||
@ -101,7 +98,7 @@
|
||||
bind:this={trackname_input}
|
||||
type="text"
|
||||
name="trackname"
|
||||
class="mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm rounded-l-md sm:text-sm border-gray-300 border bg-gray-50 text-gray-500 rounded-md p-2" />
|
||||
class="mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md" />
|
||||
</div>
|
||||
<div class="col-span-6">
|
||||
<label
|
||||
@ -112,25 +109,10 @@
|
||||
bind:value={tracklength}
|
||||
type="number"
|
||||
name="track_length_m"
|
||||
class="focus:ring-indigo-500 focus:border-indigo-500 flex-1 block w-full rounded-none rounded-l-md sm:text-sm border-gray-300 border bg-gray-50 text-gray-500 p-2"
|
||||
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="1000" />
|
||||
<span
|
||||
class="inline-flex items-center px-3 rounded-r-md border 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-l-md sm:text-sm border-gray-300 border bg-gray-50 text-gray-500 p-2"
|
||||
placeholder={smart_track_min_duration_placeholder} />
|
||||
<span
|
||||
class="inline-flex items-center px-3 rounded-r-md border border-gray-300 bg-gray-50 text-gray-500 text-sm">s</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">m</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -31,7 +31,6 @@
|
||||
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>
|
||||
@ -40,12 +39,7 @@
|
||||
});
|
||||
if (datatable_inited === false) {
|
||||
datatable = new Grid({
|
||||
columns: [
|
||||
$_("track-name"),
|
||||
$_("track-length-in-m"),
|
||||
$_("minimum-lap-time-in-s"),
|
||||
$_("action"),
|
||||
],
|
||||
columns: [$_("track-name"), $_("track-length-in-m"), "Action"],
|
||||
language: getlang($json("datatable")),
|
||||
sort: true,
|
||||
search: { enabled: true },
|
||||
|
@ -68,8 +68,6 @@
|
||||
"users": "Users",
|
||||
"teams": "Teams",
|
||||
"faq": "FAQ",
|
||||
"minimum-lap-time-in-s": "Minimum lap time in s",
|
||||
"action": "Action",
|
||||
"this-might-take-a-moment": "This might take a moment 👀",
|
||||
"stats-are-being-loaded": "stats are being loaded...",
|
||||
"general-stats": "General Stats"
|
||||
|
Loading…
x
Reference in New Issue
Block a user