implement line for admin control panel

This commit is contained in:
waltem01 2024-03-08 11:46:17 +01:00
parent 15e49614e0
commit b1703955d8

View File

@ -369,6 +369,75 @@
/>
</form>
<!-- Draw line -->
<form
class="grid grid-cols-10"
method="POST"
data-endpoint="line"
on:submit|preventDefault={post}
>
<label class="border-2 border-black border-r-0 border-b-0 pl-1" for="line">Line:</label>
<!-- X coordinate -->
<label class="border-2 border-black border-b-0 border-r-0 pl-1" for="lx1">X1:</label>
<input
class="border-2 border-black border-b-0 border-r-0 cursor-text pl-1 bg-gray-100"
id="lx1"
name="x1"
type="number"
min="0"
max={(matrix?.width ?? 192) / (matrix?.scale?.factor ?? 3) - 1}
step="1"
value="0"
required
/>
<!-- Y coordinate -->
<label class="border-2 border-black border-b-0 border-r-0 pl-1" for="ly1">Y1:</label>
<input
class="border-2 border-black border-b-0 border-r-0 cursor-text pl-1 bg-gray-100"
id="ly1"
name="y1"
type="number"
min="0"
max={(matrix?.height ?? 192) / (matrix?.scale?.factor ?? 3) - 1}
step="1"
value="0"
required
/>
<!-- Width -->
<label class="border-2 border-black border-b-0 border-r-0 pl-1" for="lx2">X2:</label>
<input
class="border-2 border-black border-b-0 border-r-0 cursor-text pl-1 bg-gray-100"
id="lx2"
name="x2"
type="number"
min="0"
max={(matrix?.width ?? 192) / (matrix?.scale?.factor ?? 3) - 1}
step="1"
value="15"
required
/>
<!-- Height -->
<label class="border-2 border-black border-b-0 border-r-0 pl-1" for="ly2">Y2:</label>
<input
class="border-2 border-black border-b-0 border-r-0 cursor-text pl-1 bg-gray-100"
id="ly2"
name="y2"
type="number"
min="0"
max={(matrix?.height ?? 192) / (matrix?.scale?.factor ?? 3) - 1}
step="1"
value="15"
required
/>
<input
class="border-2 border-black border-b-0 cursor-pointer hover:bg-gray-200"
id="line"
name="line"
type="submit"
value="Submit"
/>
</form>
<!-- Draw rectangle -->
<form
class="grid grid-cols-10"