Adding default values for ttl and prio, closes #4
This commit is contained in:
parent
bda3384ad7
commit
ec47c6b175
|
@ -158,8 +158,8 @@ limitations under the License.
|
||||||
</td>
|
</td>
|
||||||
<td><select id="addType" class="form-control select-narrow-70"></select></td>
|
<td><select id="addType" class="form-control select-narrow-70"></select></td>
|
||||||
<td><input id="addContent" type="text" class="form-control input-sm" data-regex="^.+$"></td>
|
<td><input id="addContent" type="text" class="form-control input-sm" data-regex="^.+$"></td>
|
||||||
<td><input id="addPrio" type="text" class="form-control input-sm" size="1" data-regex="^[0-9]+$"></td>
|
<td><input id="addPrio" type="text" class="form-control input-sm" placeholder="0" size="1" data-regex="^[0-9]*$"></td>
|
||||||
<td><input id="addTtl" type="text" class="form-control input-sm" size="3" data-regex="^[0-9]+$"></td>
|
<td><input id="addTtl" type="text" class="form-control input-sm" placeholder="86400" size="3" data-regex="^[0-9]*$"></td>
|
||||||
<td colspan="3"><button id="addButton" class="btn btn-success btn-sm"> Add </button></td>
|
<td colspan="3"><button id="addButton" class="btn btn-success btn-sm"> Add </button></td>
|
||||||
</tfoot>
|
</tfoot>
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -331,11 +331,17 @@ function addRecord() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var prio = $('#addPrio').val();
|
||||||
|
if(prio.length === 0) prio = 0;
|
||||||
|
|
||||||
|
var ttl = $('#addTtl').val();
|
||||||
|
if(ttl.length === 0) ttl = 86400;
|
||||||
|
|
||||||
var data = {
|
var data = {
|
||||||
type: $('#addType').val(),
|
type: $('#addType').val(),
|
||||||
content: $('#addContent').val(),
|
content: $('#addContent').val(),
|
||||||
prio: $('#addPrio').val(),
|
prio: prio,
|
||||||
ttl: $('#addTtl').val(),
|
ttl: ttl,
|
||||||
action: "addRecord",
|
action: "addRecord",
|
||||||
domain: location.hash.substring(1),
|
domain: location.hash.substring(1),
|
||||||
csrfToken: $('#csrfToken').text()
|
csrfToken: $('#csrfToken').text()
|
||||||
|
|
Loading…
Reference in a new issue