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><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="addPrio" type="text" class="form-control input-sm" 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="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" placeholder="86400" size="3" data-regex="^[0-9]*$"></td>
|
||||
<td colspan="3"><button id="addButton" class="btn btn-success btn-sm"> Add </button></td>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
|
|
@ -331,11 +331,17 @@ function addRecord() {
|
|||
return;
|
||||
}
|
||||
|
||||
var prio = $('#addPrio').val();
|
||||
if(prio.length === 0) prio = 0;
|
||||
|
||||
var ttl = $('#addTtl').val();
|
||||
if(ttl.length === 0) ttl = 86400;
|
||||
|
||||
var data = {
|
||||
type: $('#addType').val(),
|
||||
content: $('#addContent').val(),
|
||||
prio: $('#addPrio').val(),
|
||||
ttl: $('#addTtl').val(),
|
||||
prio: prio,
|
||||
ttl: ttl,
|
||||
action: "addRecord",
|
||||
domain: location.hash.substring(1),
|
||||
csrfToken: $('#csrfToken').text()
|
||||
|
|
Loading…
Reference in a new issue