Create the initial version of the TableManager class for configuring settings

This commit is contained in:
Oliver-Akins 2025-05-11 17:24:09 -06:00
parent 4bfce858ef
commit 8a2d946b63
21 changed files with 718 additions and 115 deletions

View file

@ -0,0 +1,7 @@
<div class="alert-box warning center">
{{#if table}}
<span class="large">Select a Subtable</span>
{{else}}
<span class="large">Select a Table</span>
{{/if}}
</div>

View file

@ -0,0 +1,57 @@
<div class="{{#if buckets.locked}}alert-box locked{{/if}}">
{{#if buckets.locked}}
<p class="center">
This bucket configuration has been locked, preventing editing
of the settings.
</p>
{{/if}}
<div class="input-group">
<label for="{{meta.idp}}-min">
Minimum
</label>
<input
id="{{meta.idp}}-min"
type="number"
name="buckets.min"
value="{{ buckets.min }}"
{{disabled buckets.locked}}
>
<p class="hint">
The minimum allowed value. Leave empty for no minimum.
</p>
</div>
<div class="input-group">
<label for="{{meta.idp}}-max">
Maximum
</label>
<input
id="{{meta.idp}}-max"
type="number"
name="buckets.max"
value="{{ buckets.max }}"
{{disabled buckets.locked}}
>
<p class="hint">
The maximum allowed value. Leave empty for no maximum.
</p>
</div>
<div class="input-group">
<label for="{{meta.idp}}-step">
Step
</label>
<input
id="{{meta.idp}}-min"
type="number"
name="buckets.step"
value="{{ buckets.step }}"
minimum="1"
placeholder="1"
{{disabled buckets.locked}}
>
<p class="hint">
The step value, if a minimum is not provided this will not be
saved and the existing value will be removed from the saved
configuration.
</p>
</div>
</div>

View file

@ -0,0 +1,50 @@
<div class="{{#if buckets.locked}}alert-box locked{{/if}}">
{{#if buckets.locked}}
<p class="center">
This bucket configuration has been locked, preventing editing
of the settings.
</p>
{{/if}}
<div class="input-group">
<label for="{{meta.idp}}-min">
Minimum
</label>
<input
id="{{meta.idp}}-min"
type="number"
name="buckets.min"
value="{{ buckets.min }}"
required
{{disabled buckets.locked}}
>
</div>
<div class="input-group">
<label for="{{meta.idp}}-max">
Maximum
</label>
<input
id="{{meta.idp}}-max"
type="number"
name="buckets.max"
value="{{ buckets.max }}"
required
{{disabled buckets.locked}}
>
</div>
<div class="input-group">
<label for="{{meta.idp}}-step">
Step
</label>
<input
id="{{meta.idp}}-step"
type="number"
name="buckets.step"
value="{{ buckets.step }}"
required
{{disabled buckets.locked}}
>
<p class="hint">
The size of the step between values within the range.
</p>
</div>
</div>

View file

@ -0,0 +1,17 @@
<div class="{{#if buckets.locked}}alert-box locked{{/if}}">
<div class="input-group">
<label for="">
Valid Options
</label>
<string-tags
name="buckets.choices"
value="{{ buckets.choices }}"
></string-tags>
<p class="hint">
These are the only values that are allowed to be provided to
the database and are case-sensitive. Leave this empty to
allow any string to be valid. Empty strings are never valid and
extra spaces are removed the start and end of the options.
</p>
</div>
</div>

View file

@ -0,0 +1,5 @@
<button
type="submit"
>
Save
</button>

View file

@ -7,6 +7,7 @@
id="{{meta.idp}}-selected-table"
data-bind="_selectedTable"
>
<option value="">Select a Table</option>
{{ st-options table tables }}
</select>
</div>
@ -19,6 +20,7 @@
id="{{meta.idp}}-selected-subtable"
data-bind="_selectedSubtable"
>
<option value="">Select a Subtable</option>
{{ st-options subtable subtables }}
</select>
</div>