migration of open-etc-friends-pool for use with Etica/EGAZ
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

59 lines
2.2 KiB

<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">&times;</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>