gui: Added confirm step and fee options.

Fee options only apply to the script coin side of xmr swaps.
This commit is contained in:
tecnovert
2020-12-16 23:19:39 +02:00
parent 5cd8286aa3
commit b3c00efe16
12 changed files with 317 additions and 69 deletions

View File

@@ -53,7 +53,9 @@
{% if data.was_received == 'True' %}
<input name="accept_bid" type="submit" value="Accept Bid"><br/>
{% endif %}
{% if data.can_abandon == true %}
<input name="abandon_bid" type="submit" value="Abandon Bid" onclick="confirmPopup()">
{% endif %}
{% if data.show_txns %}
<input name="hide_txns" type="submit" value="Hide Info">
{% else %}

View File

@@ -36,9 +36,11 @@
<input name="edit_bid_submit" type="submit" value="Submit">
{% else %}
{% if data.was_received == 'True' %}
<input name="accept_bid" type="submit" value="Accept Bid"><br/>
<input name="accept_bid" type="submit" value="Accept Bid" onclick="confirmPopup(\"Accept\")"><br/>
{% endif %}
{% if data.can_abandon == true %}
<input name="abandon_bid" type="submit" value="Abandon Bid" onclick="confirmPopup(\"Abandon\")">
{% endif %}
<input name="abandon_bid" type="submit" value="Abandon Bid" onclick="confirmPopup()">
{% if data.show_txns %}
<input name="hide_txns" type="submit" value="Hide Info">
{% else %}
@@ -91,8 +93,8 @@
<p><a href="/">home</a></p>
<script>
function confirmPopup() {
confirm("Are you sure?");
function confirmPopup(name) {
confirm(name + " Bid - Are you sure?");
}
</script>
</body></html>

View File

@@ -33,7 +33,7 @@
{% if data.xmr_type == true %}
<tr><td>Chain A offer fee rate</td><td>{{ data.a_fee_rate }}</td></tr>
<tr><td>Chain A local fee rate</td><td>{{ data.a_fee_rate_verify }} {% if data.a_fee_warn == true %} WARNING {% endif %}</td></tr>
<tr><td>Chain A local fee rate</td><td>{{ data.a_fee_rate_verify }}, fee source: {{ data.a_fee_rate_verify_src }} {% if data.a_fee_warn == true %} WARNING {% endif %}</td></tr>
{% endif %}
</table>
@@ -57,7 +57,7 @@
{% else %}
<input type="submit" name="newbid" value="New Bid">
{% endif %}
{% if data.sent == 'True' %}
{% if data.sent == 'True' and data.was_revoked != true %}
<input name="revoke_offer" type="submit" value="Revoke Offer" onclick="confirmPopup()">
{% endif %}
<input type="hidden" name="formid" value="{{ form_id }}">

View File

@@ -0,0 +1,67 @@
{% include 'header.html' %}
<h3>Confirm New Offer</h3>
{% for m in messages %}
<p>{{ m }}</p>
{% endfor %}
<form method="post">
<table>
<tr><td>Send From Address</td><td><select name="addr_from_" disabled>
{% for a in addrs %}
<option{% if data.addr_from==a %} selected{% endif %} value="{{ a }}">{{ a }}</option>
{% endfor %}
<option{% if data.addr_from=="-1" %} selected{% endif %} value="-1">-- New Address --</option>
</select></td></tr>
<tr><td>Coin From</td><td>
<select name="coin_from_" disabled><option value="-1">-- Select Coin --</option>
{% for c in coins %}
<option{% if data.coin_from==c[0] %} selected{% endif %} value="{{ c[0] }}">{{ c[1] }}</option>
{% endfor %}
</select>
</td><td>Amount From</td><td><input type="text" name="amt_from" value="{{ data.amt_from }}" readonly></td><td>The amount you will send.</td></tr>
</td><td>Fee Rate From</td><td><input name="fee_rate_from" value="{{ data.from_fee_override }}" readonly></td><td>Fee Rate Source</td><td>{{ data.from_fee_src }}</td></tr>
</td><td>Fee From Confirm Target</td><td><input type="number" name="fee_from_conf" min="1" max="32" value="{{ data.fee_from_conf }}" readonly></td></tr>
</td><td>Fee From Extra Fee</td><td>
<select name="fee_from_extra_" disabled>
<option value="0">None</option>
<option value="10"{% if data.fee_from_extra==10 %} selected{% endif %}>10%</option>
<option value="50"{% if data.fee_from_extra==50 %} selected{% endif %}>50%</option>
<option value="100"{% if data.fee_from_extra==100 %} selected{% endif %}>100%</option>
</select></td></tr>
<tr><td>Coin To</td><td>
<select name="coin_to_" disabled><option value="-1">-- Select Coin --</option>
{% for c in coins %}
<option{% if data.coin_to==c[0] %} selected{% endif %} value="{{ c[0] }}">{{ c[1] }}</option>
{% endfor %}
</select>
</td><td>Amount To</td><td><input type="text" name="amt_to" value="{{ data.amt_to }}" readonly></td><td>The amount you will receive.</td></tr>
</td><td>Fee Rate From</td><td><input name="fee_rate_to" value="{{ data.to_fee_override }}" readonly></td><td>Fee Rate Source</td><td>{{ data.to_fee_src }}</td></tr>
</td><td>Fee To Confirm Target</td><td><input type="number" name="fee_to_conf" min="1" max="32" value="{{ data.fee_to_conf }}" readonly></td></tr>
</td><td>Fee To Extra Fee</td><td>
<select name="fee_to_extra_" disabled>
<option value="0">None</option>
<option value="10"{% if data.fee_to_extra==10 %} selected{% endif %}>10%</option>
<option value="50"{% if data.fee_to_extra==50 %} selected{% endif %}>50%</option>
<option value="100"{% if data.fee_to_extra==100 %} selected{% endif %}>100%</option>
</select></td></tr>
<tr><td>Contract locked (hrs)</td><td><input type="number" name="lockhrs" min="1" max="64" value="{{ data.lockhrs }}" readonly></td>{% if data.swap_style != 'xmr' %}<td colspan=2>Participate txn will be locked for half the time.</td>{% endif %}</tr>
<tr><td>Auto Accept Bids</td><td colspan=3><input type="checkbox" name="autoaccept" value="aa" {% if data.autoaccept==true %} checked{% endif %} readonly></td></tr>
</table>
<input name="submit_offer" type="submit" value="Confirm Offer">
<input type="submit" value="Back">
<input type="hidden" name="formid" value="{{ form_id }}">
<input type="hidden" name="addr_from" value="{{ data.addr_from }}">
<input type="hidden" name="coin_from" value="{{ data.coin_from }}">
<input type="hidden" name="fee_from_extra" value="{{ data.fee_from_extra }}">
<input type="hidden" name="coin_to" value="{{ data.coin_to }}">
<input type="hidden" name="fee_to_extra" value="{{ data.fee_to_extra }}">
</form>
<p><a href="/">home</a></p>
</body></html>

View File

@@ -10,32 +10,48 @@
<table>
<tr><td>Send From Address</td><td><select name="addr_from">
{% for a in addrs %}
<option value="{{ a }}">{{ a }}</option>
<option{% if data.addr_from==a %} selected{% endif %} value="{{ a }}">{{ a }}</option>
{% endfor %}
<option value="-1">-- New Address --</option>
<option{% if data.addr_from=="-1" %} selected{% endif %} value="-1">-- New Address --</option>
</select></td></tr>
<tr><td>Coin From</td><td>
<select name="coin_from"><option value="-1">-- Select Coin --</option>
{% for c in coins %}
<option value="{{ c[0] }}">{{ c[1] }}</option>
<option{% if data.coin_from==c[0] %} selected{% endif %} value="{{ c[0] }}">{{ c[1] }}</option>
{% endfor %}
</select>
</td><td>Amount From</td><td><input type="text" name="amt_from"></td></tr>
</td><td>Amount From</td><td><input type="text" name="amt_from" value="{{ data.amt_from }}"></td><td>The amount you will send.</td></tr>
</td><td>Fee From Confirm Target</td><td><input type="number" name="fee_from_conf" min="1" max="32" value="{{ data.fee_from_conf }}"></td></tr>
</td><td>Fee From Extra Fee</td><td>
<select name="fee_from_extra">
<option value="0">None</option>
<option value="10"{% if data.fee_from_extra==10 %} selected{% endif %}>10%</option>
<option value="50"{% if data.fee_from_extra==50 %} selected{% endif %}>50%</option>
<option value="100"{% if data.fee_from_extra==100 %} selected{% endif %}>100%</option>
</select></td></tr>
<tr><td>Coin To</td><td>
<select name="coin_to"><option value="-1">-- Select Coin --</option>
{% for c in coins %}
<option value="{{ c[0] }}">{{ c[1] }}</option>
<option{% if data.coin_to==c[0] %} selected{% endif %} value="{{ c[0] }}">{{ c[1] }}</option>
{% endfor %}
</select>
</td><td>Amount To</td><td><input type="text" name="amt_to"></td></tr>
</td><td>Amount To</td><td><input type="text" name="amt_to" value="{{ data.amt_to }}"></td><td>The amount you will receive.</td></tr>
</td><td>Fee To Confirm Target</td><td><input type="number" name="fee_to_conf" min="1" max="32" value="{{ data.fee_to_conf }}"></td></tr>
</td><td>Fee To Extra Fee</td><td>
<select name="fee_to_extra">
<option value="0">None</option>
<option value="10"{% if data.fee_to_extra==10 %} selected{% endif %}>10%</option>
<option value="50"{% if data.fee_to_extra==50 %} selected{% endif %}>50%</option>
<option value="100"{% if data.fee_to_extra==100 %} selected{% endif %}>100%</option>
</select></td></tr>
<tr><td>Contract locked (hrs)</td><td><input type="number" name="lockhrs" min="1" max="64" value="32"></td><td colspan=2>Participate txn will be locked for half the time.</td></tr>
<tr><td>Auto Accept Bids</td><td colspan=3><input type="checkbox" name="autoaccept" value="aa" checked></td></tr>
<tr><td>Contract locked (hrs)</td><td><input type="number" name="lockhrs" min="1" max="64" value="{{ data.lockhrs }}"></td><td colspan=2>Participate txn will be locked for half the time.</td></tr>
<tr><td>Auto Accept Bids</td><td colspan=3><input type="checkbox" name="autoaccept" value="aa" {% if data.autoaccept==true %} checked{% endif %}></td></tr>
</table>
<input type="submit" value="Submit">
<input name="check_offer" type="submit" value="Submit">
<input type="hidden" name="formid" value="{{ form_id }}">
</form>