feat: Added more inputs and outputs
All checks were successful
Build Docker / Build Image (push) Successful in 32s

This commit is contained in:
2024-02-04 15:08:24 +11:00
parent 5bb4e1bc4c
commit 441a0274ff
9 changed files with 217 additions and 4 deletions

View File

@@ -0,0 +1,40 @@
<div style="margin-top: 25px;">
<label class="form-label">{{paramName}}</label>
<input id="{{param}}" class="form-control" type="text" placeholder="Address or @domain" name="{{param}}" value="{{address}}" />
<span id="addressValid"></span>
<script>
function checkAddress(inputValue) {
// Make API request to "/checkaddress"
var apiUrl = '/checkaddress?address=' + encodeURIComponent(inputValue);
fetch(apiUrl)
.then(response => response.json())
.then(data => {
// Update the content of the span with the response data
var addressCheckSpan = document.getElementById('addressValid');
addressCheckSpan.textContent = data.result; // You can replace 'addressInfo' with the actual property you receive from the API
})
.catch(error => {
console.error('Error fetching data:', error);
});
}
// Function to handle input field blur event
function handleBlur() {
var inputField = document.getElementById('{{param}}');
var inputValue = inputField.value;
// Check if the input value is not empty
if (inputValue.trim() !== '') {
checkAddress(inputValue);
} else {
var addressCheckSpan = document.getElementById('addressValid');
addressCheckSpan.textContent = 'Invalid address';
}
}
// Add a blur event listener to the input field
var inputField = document.getElementById('{{param}}');
inputField.addEventListener('blur', handleBlur);
</script>
</div>

View File

@@ -0,0 +1,5 @@
<h4>TODO DNS LATER</h4>
<p>For a temporary work around edit any domains DNS and before pressing save</p>
<p>Copy the text in the url after ?dns=</p>
<label for="{{param}}">{{paramName}}</label>
<input class="form-control" type="text" name="{{param}}" />

View File

@@ -0,0 +1,13 @@
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
{{dns | safe}}
</tbody>
</table>
</div>

View File

@@ -0,0 +1,4 @@
<span style="display: block;font-size: 12px;">TX: {{tx}}</span>
<span style="display: block;">Check your transaction on a block explorer</span>
<a class="card-link" href="https://niami.io/tx/{{tx}}" target="_blank">Niami</a>
<a class="card-link" href="https://3xpl.com/handshake/transaction/{{tx}}" target="_blank">3xpl</a>