forked from nathanwoodburn/firewalletbrowser
feat: Added more inputs and outputs
This commit is contained in:
40
templates/components/address.html
Normal file
40
templates/components/address.html
Normal 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>
|
||||
5
templates/components/dns-input.html
Normal file
5
templates/components/dns-input.html
Normal 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}}" />
|
||||
13
templates/components/dns-output.html
Normal file
13
templates/components/dns-output.html
Normal 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>
|
||||
4
templates/components/tx.html
Normal file
4
templates/components/tx.html
Normal 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>
|
||||
Reference in New Issue
Block a user