diff --git a/basicswap/http_server.py b/basicswap/http_server.py index f341594..214ec84 100644 --- a/basicswap/http_server.py +++ b/basicswap/http_server.py @@ -13,6 +13,8 @@ import threading import http.client import urllib.parse from http.server import BaseHTTPRequestHandler, HTTPServer +from jinja2 import Environment, FileSystemLoader + from .util import ( COIN, format8, @@ -33,6 +35,9 @@ from .basicswap import ( ABS_LOCK_TIME, ) +file_loader = FileSystemLoader('templates') +env = Environment(loader=file_loader) + def getCoinName(c): return chainparams[c]['name'].capitalize() @@ -484,23 +489,13 @@ class HttpHandler(BaseHTTPRequestHandler): swap_client = self.server.swap_client summary = swap_client.getSummary() - content = html_content_start(self.server.title, self.server.title, 30) \ - + '
' \ - + '' \
- + 'Page Refresh: 30 seconds
' \
- + 'Network: ' + str(summary['network']) + '
' \
- + 'Swaps in progress: ' + str(summary['num_swapping']) + '
' \
- + 'Network Offers: ' + str(summary['num_network_offers']) + '
' \
- + 'Sent Offers: ' + str(summary['num_sent_offers']) + '
' \
- + 'Received Bids: ' + str(summary['num_recv_bids']) + '
' \
- + 'Sent Bids: ' + str(summary['num_sent_bids']) + '
' \
- + 'Watched Outputs: ' + str(summary['num_watched_outputs']) + '
' \
- + '
' \
- + 'New Offer
' \
- + '