mirror of
https://github.com/basicswap/basicswap.git
synced 2025-11-06 02:38:11 +01:00
Add travis build status to readme.
Move templates dir. Add version to index. Remove bitcoin config from docker json config - extra coins can be enabled with prepare -addcoin.
This commit is contained in:
@@ -19,6 +19,7 @@ import sqlalchemy as sa
|
||||
from sqlalchemy.orm import sessionmaker, scoped_session
|
||||
from sqlalchemy.ext.declarative import declarative_base
|
||||
from enum import IntEnum, auto
|
||||
|
||||
from . import __version__
|
||||
from .util import (
|
||||
COIN,
|
||||
@@ -33,18 +34,15 @@ from .util import (
|
||||
toWIF,
|
||||
getKeyID,
|
||||
)
|
||||
|
||||
from .chainparams import (
|
||||
chainparams,
|
||||
Coins,
|
||||
)
|
||||
|
||||
from .messages_pb2 import (
|
||||
OfferMessage,
|
||||
BidMessage,
|
||||
BidAcceptMessage,
|
||||
)
|
||||
|
||||
import basicswap.config as cfg
|
||||
import basicswap.segwit_addr as segwit_addr
|
||||
|
||||
@@ -132,7 +130,7 @@ ABS_LOCK_TIME = 4
|
||||
SEQUENCE_LOCKTIME_GRANULARITY = 9 # 512 seconds
|
||||
SEQUENCE_LOCKTIME_TYPE_FLAG = (1 << 22)
|
||||
SEQUENCE_LOCKTIME_MASK = 0x0000ffff
|
||||
INITIATE_TX_TIMEOUT = 30 * 60
|
||||
INITIATE_TX_TIMEOUT = 40 * 60 # TODO: make variable per coin
|
||||
|
||||
|
||||
def getOfferState(state):
|
||||
|
||||
@@ -15,6 +15,7 @@ import urllib.parse
|
||||
from http.server import BaseHTTPRequestHandler, HTTPServer
|
||||
from jinja2 import Environment, FileSystemLoader
|
||||
|
||||
from . import __version__
|
||||
from .util import (
|
||||
COIN,
|
||||
format8,
|
||||
@@ -35,7 +36,7 @@ from .basicswap import (
|
||||
ABS_LOCK_TIME,
|
||||
)
|
||||
|
||||
file_loader = FileSystemLoader('templates')
|
||||
file_loader = FileSystemLoader('basicswap/templates')
|
||||
env = Environment(loader=file_loader)
|
||||
|
||||
|
||||
@@ -487,6 +488,7 @@ class HttpHandler(BaseHTTPRequestHandler):
|
||||
title=self.server.title,
|
||||
refresh=30,
|
||||
h2=self.server.title,
|
||||
version=__version__,
|
||||
summary=summary
|
||||
), 'UTF-8')
|
||||
|
||||
|
||||
16
basicswap/templates/active.html
Normal file
16
basicswap/templates/active.html
Normal file
@@ -0,0 +1,16 @@
|
||||
{% include 'header.html' %}
|
||||
|
||||
<h3>Active Swaps</h3>
|
||||
{% if refresh %}
|
||||
<p>Page Refresh: {{ refresh }} seconds</p>
|
||||
{% endif %}
|
||||
|
||||
<table>
|
||||
<tr><th>Bid ID</th><th>Offer ID</th><th>Bid Status</th></tr>
|
||||
{% for s in active_swaps %}
|
||||
<tr><td><a href=/bid/{{ s[0] }}>{{ s[0] }}</a></td><td><a href=/offer/{{ s[1] }}>{{ s[1] }}</a></td><td>{{ s[2] }}</td></tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
||||
<p><a href="/">home</a></p>
|
||||
</body></html>
|
||||
6
basicswap/templates/advance.html
Normal file
6
basicswap/templates/advance.html
Normal file
@@ -0,0 +1,6 @@
|
||||
{% include 'header.html' %}
|
||||
|
||||
<h3>Advance Bid {{ bid_id }}</h3>
|
||||
|
||||
<p><a href="/">home</a></p>
|
||||
</body></html>
|
||||
12
basicswap/templates/header.html
Normal file
12
basicswap/templates/header.html
Normal file
@@ -0,0 +1,12 @@
|
||||
<!DOCTYPE html><html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
{% if refresh %}
|
||||
<meta http-equiv="refresh" content="{{ refresh }}">
|
||||
{% endif %}
|
||||
<title>{{ title }}</title>
|
||||
</head>
|
||||
<body>
|
||||
{% if h2 %}
|
||||
<h2>{{ h2 }}</h2>
|
||||
{% endif %}
|
||||
23
basicswap/templates/index.html
Normal file
23
basicswap/templates/index.html
Normal file
@@ -0,0 +1,23 @@
|
||||
{% include 'header.html' %}
|
||||
|
||||
<p><a href="/wallets">View Wallets</a></p>
|
||||
|
||||
<p>
|
||||
{% if refresh %}
|
||||
Page Refresh: {{ refresh }} seconds<br/>
|
||||
{% endif %}
|
||||
Version: {{ version }}
|
||||
</p>
|
||||
<p>
|
||||
<a href="/active">Swaps in progress: {{ summary.num_swapping }}</a><br/>
|
||||
<a href="/offers">Network Offers: {{ summary.num_network_offers }}</a><br/>
|
||||
<a href="/sentoffers">Sent Offers: {{ summary.num_sent_offers }}</a><br/>
|
||||
<a href="/bids">Received Bids: {{ summary.num_recv_bids }}</a><br/>
|
||||
<a href="/sentbids">Sent Bids: {{ summary.num_sent_bids }}</a><br/>
|
||||
<a href="/watched">Watched Outputs: {{ summary.num_watched_outputs }}</a><br/>
|
||||
</p>
|
||||
|
||||
<p><a href="/newoffer">New Offer</a><br/></p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
25
basicswap/templates/watched.html
Normal file
25
basicswap/templates/watched.html
Normal file
@@ -0,0 +1,25 @@
|
||||
{% include 'header.html' %}
|
||||
|
||||
<h3>Watched Outputs</h3>
|
||||
{% if refresh %}
|
||||
<p>Page Refresh: {{ refresh }} seconds</p>
|
||||
{% endif %}
|
||||
|
||||
<p>Last Scanned</p>
|
||||
<table>
|
||||
<tr><th>Coin</th><th>height</th></tr>
|
||||
{% for ls in last_scanned %}
|
||||
<tr><td>{{ ls[0] }}</td><td>{{ ls[1] }}</td></tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
<br/>
|
||||
|
||||
<table>
|
||||
<tr><th>Bid ID</th><th>Chain</th><th>Txid</th><th>Index</th><th>Type</th></tr>
|
||||
{% for wo in watched_outputs %}
|
||||
<tr><td><a href=/bid/{{ wo[0] }}>{{ wo[0] }}</a></td><td>{{ wo[1] }}</td><td>{{ wo[2] }}</td><td>{{ wo[3] }}</td><td>{{ wo[4] }}</td></tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
||||
<p><a href="/">home</a></p>
|
||||
</body></html>
|
||||
Reference in New Issue
Block a user