3 changed files with 63 additions and 0 deletions
@ -0,0 +1,59 @@
|
||||
<div class="container"> |
||||
<div id="settings" style="margin-top:50px;" class="mainbox col-md-6 col-md-offset-3 col-sm-8 col-sm-offset-2"> |
||||
<div class="row"> |
||||
<div id="alertSuccess" class="alert alert-success" role="alert"> |
||||
Success |
||||
</div> |
||||
<div id="alertError" class="alert alert-danger" role="alert"> |
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close"> |
||||
<span aria-hidden="true">×</span></button> |
||||
Error |
||||
</div> |
||||
</div> |
||||
|
||||
<form action="/api/settings" method="post"> |
||||
|
||||
<div class="form-group"> |
||||
<label for="threshold">Payment Threshold</label> |
||||
<input class="form-control" id="threshold" name="threshold" placeholder="min 0.5 - max 10000" min="0.5" max="10000" |
||||
type='number' step='1'> |
||||
<small id="thresholdHelp" class="form-text text-dark">Payment threshold in {{config.Unit}} (Min: 0.5, Max: 10000)</small> |
||||
</div> |
||||
|
||||
<div class="form-group"> |
||||
<label for="ip_address">Active Worker IP address</label> |
||||
<input class="form-control" name="ip_address" id="ip_address" placeholder="192.168.0.1" type="text"> |
||||
<small id="ip_address" class="form-text text-dark"> |
||||
Please complete your worker`s IP address in order to validate and save your settings. |
||||
</small> |
||||
</div> |
||||
<button type="submit" class="btn btn-primary">Submit</button> |
||||
|
||||
</form> |
||||
</div> |
||||
</div> |
||||
|
||||
<script> |
||||
$(document).ready(function () { |
||||
var $form = $('form'); |
||||
$form.submit(function () { |
||||
$.post($(this).attr('action'), $(this).serialize(), function (response) { |
||||
console.log(response.result); |
||||
if (response.result == "success") { |
||||
$('#alertSuccess').html(response.result); |
||||
$("#alertSuccess").fadeIn(); //or fadeIn |
||||
setTimeout(function() { |
||||
$("#alertSuccess").fadeOut(); //or fadeOut |
||||
}, 5000); |
||||
} else { |
||||
$('#alertError').html(response.result); |
||||
$("#alertError").fadeIn(); //or fadeIn |
||||
setTimeout(function() { |
||||
$("#alertError").fadeOut(); //or fadeOut |
||||
}, 5000); |
||||
} |
||||
}, 'json'); |
||||
return false; |
||||
}); |
||||
}); |
||||
</script> |
||||
Loading…
Reference in new issue