diff --git a/p2pool/main.py b/p2pool/main.py
index 1dfc958b7..b03eee7d2 100644
--- a/p2pool/main.py
+++ b/p2pool/main.py
@@ -209,7 +209,7 @@ def upnp_thread():
wb = work.WorkerBridge(node, my_pubkey_hash, args.donation_percentage, merged_urls, args.worker_fee)
web_root = web.get_web_root(wb, datadir_path, bitcoind_warning_var)
caching_wb = worker_interface.CachingWorkerBridge(wb)
- worker_interface.WorkerInterface(caching_wb).attach_to(web_root, get_handler=lambda request: request.redirect('/static/'))
+ worker_interface.WorkerInterface(caching_wb).attach_to(web_root, get_handler=lambda request: request.redirect('./static/'))
web_serverfactory = server.Site(web_root)
diff --git a/web-static/graphs.html b/web-static/graphs.html
index 4e69f8333..a73cffcf0 100644
--- a/web-static/graphs.html
+++ b/web-static/graphs.html
@@ -26,7 +26,7 @@
-
+
Periods: Current:
@@ -366,27 +366,27 @@ Memory Usage
d3.select("#period_current").text(period);
var lowerperiod = period.toLowerCase();
plot_later(d3.select("#local"), "H/s", "H", [
- {"url": "/web/graph_data/local_hash_rate/last_" + lowerperiod, "color": "#0000FF", "label": "Total"},
- {"url": "/web/graph_data/local_dead_hash_rate/last_" + lowerperiod, "color": "#FF0000", "label": "Dead"}
+ {"url": "../web/graph_data/local_hash_rate/last_" + lowerperiod, "color": "#0000FF", "label": "Total"},
+ {"url": "../web/graph_data/local_dead_hash_rate/last_" + lowerperiod, "color": "#FF0000", "label": "Dead"}
]);
plot_later(d3.select("#local_shares"), "H/s", "H", [
- {"url": "/web/graph_data/local_share_hash_rate/last_" + lowerperiod, "color": "#0000FF", "label": "Total"},
- //{"url": getData("/web/graph_data/local_dead_share_hash_rate/last_" + lowerperiod, "color": "#FF0000", "label": "Dead"}
+ {"url": "../web/graph_data/local_share_hash_rate/last_" + lowerperiod, "color": "#0000FF", "label": "Total"},
+ //{"url": getData("../web/graph_data/local_dead_share_hash_rate/last_" + lowerperiod, "color": "#FF0000", "label": "Dead"}
]);
plot_later(d3.select("#payout"), currency_info.symbol, null, [
- {"url": "/web/graph_data/current_payout/last_" + lowerperiod, "color": "#0000FF"}
+ {"url": "../web/graph_data/current_payout/last_" + lowerperiod, "color": "#0000FF"}
]);
- d3.json("/web/graph_data/pool_rates/last_" + lowerperiod, function(data) {
+ d3.json("../web/graph_data/pool_rates/last_" + lowerperiod, function(data) {
plot(d3.select('#pool'), 'H/s', 'H', data_to_lines(data), true);
});
plot_later(d3.select("#peers"), "", null, [
- {"url": "/web/graph_data/outgoing_peers/last_" + lowerperiod, "color": "#FF0000", "label": "Outgoing"},
- {"url": "/web/graph_data/incoming_peers/last_" + lowerperiod, "color": "#0000FF", "label": "Incoming"}
+ {"url": "../web/graph_data/outgoing_peers/last_" + lowerperiod, "color": "#FF0000", "label": "Outgoing"},
+ {"url": "../web/graph_data/incoming_peers/last_" + lowerperiod, "color": "#0000FF", "label": "Incoming"}
], true);
- d3.json("/web/graph_data/miner_hash_rates/last_" + lowerperiod, function(data) {
- d3.json("/web/graph_data/miner_dead_hash_rates/last_" + lowerperiod, function(dead_data) {
- d3.json("/web/graph_data/current_payouts/last_" + lowerperiod, function(current_payouts) {
+ d3.json("../web/graph_data/miner_hash_rates/last_" + lowerperiod, function(data) {
+ d3.json("../web/graph_data/miner_dead_hash_rates/last_" + lowerperiod, function(dead_data) {
+ d3.json("../web/graph_data/current_payouts/last_" + lowerperiod, function(current_payouts) {
var users = {}; for(var i = 0; i < data.length; ++i) for(var u in data[i][1]) users[u] = null; for(var i = 0; i < dead_data.length; ++i) for(var u in dead_data[i][1]) users[u] = null;
var userlist = []; for(var u in users) userlist.push(u);
userlist.sort();
@@ -408,24 +408,24 @@ Memory Usage
});
});
- d3.json("/web/graph_data/desired_version_rates/last_" + lowerperiod, function(data) {
+ d3.json("../web/graph_data/desired_version_rates/last_" + lowerperiod, function(data) {
plot(d3.select('#desired_version_rates'), 'H/s', 'H', data_to_lines(data, function(line){ return parseInt(line.label) }), true);
});
- d3.json("/web/graph_data/traffic_rate/last_" + lowerperiod, function(data) {
+ d3.json("../web/graph_data/traffic_rate/last_" + lowerperiod, function(data) {
plot(d3.select('#traffic_rate'), 'B/s', 'B', data_to_lines(data, function(line){ return parseInt(line.label) }), true);
});
plot_later(d3.select("#getwork_latency"), "s", null, [
- {"url": "/web/graph_data/getwork_latency/last_" + lowerperiod, "color": "#FF0000", "label": "Getwork Latency"}
+ {"url": "../web/graph_data/getwork_latency/last_" + lowerperiod, "color": "#FF0000", "label": "Getwork Latency"}
], false);
plot_later(d3.select("#memory_usage"), "B", null, [
- {"url": "/web/graph_data/memory_usage/last_" + lowerperiod, "color": "#FF0000", "label": "Memory Usage"}
+ {"url": "../web/graph_data/memory_usage/last_" + lowerperiod, "color": "#FF0000", "label": "Memory Usage"}
], false);
}
- d3.json('/local_stats', function(local_stats) {
+ d3.json('../local_stats', function(local_stats) {
d3.select('#warnings').selectAll().data(local_stats.warnings).enter().append('p')
.text(function(w){ return 'Warning: ' + w })
.attr('style', 'color:red;border:1px solid red;padding:5px');
@@ -440,7 +440,7 @@ Memory Usage
if(period.length < 3) {
window.location.search = "Day";
} else {
- d3.json('/web/currency_info', function(currency_info) {
+ d3.json('../web/currency_info', function(currency_info) {
change_period(period, currency_info);
});
}
diff --git a/web-static/index.html b/web-static/index.html
index a0b3be1f3..a028e2f2f 100644
--- a/web-static/index.html
+++ b/web-static/index.html
@@ -11,7 +11,7 @@
function values(o){ res = []; for(var x in o) res.push(o[x]); return res; }
- d3.json('/local_stats', function(local_stats) {
+ d3.json('../local_stats', function(local_stats) {
d3.select('#peers_in').text(local_stats.peers.incoming);
d3.select('#peers_out').text(local_stats.peers.outgoing);
@@ -35,7 +35,7 @@
var time_to_share = local_stats.attempts_to_share/local;
d3.select('#time_to_share').text(d3.format('.3r')(time_to_share/3600) + " hours");
- d3.json('/global_stats', function(global_stats) {
+ d3.json('../global_stats', function(global_stats) {
d3.select('#pool_rate').text(d3.format('.3s')(global_stats.pool_hash_rate) + 'H/s');
d3.select('#pool_stale').text(d3.format('.2p')(global_stats.pool_stale_prop));
d3.select('#difficulty').text(d3.format('.3r')(global_stats.min_difficulty));
@@ -47,15 +47,15 @@
});
});
- d3.json('/web/version', function(version) {
+ d3.json('../web/version', function(version) {
d3.selectAll('#version').text(version);
});
- d3.json('/web/currency_info', function(currency_info) {
+ d3.json('../web/currency_info', function(currency_info) {
d3.selectAll('.symbol').text(currency_info.symbol);
- d3.json('/current_payouts', function(pays) {
- d3.json('/payout_addr', function(addr) {
+ d3.json('../current_payouts', function(pays) {
+ d3.json('../payout_addr', function(addr) {
d3.select('#payout_addr').text(addr).attr('href', currency_info.address_explorer_url_prefix + addr);
d3.select('#payout_amount').text(addr in pays ? pays[addr] : 0);
});
@@ -71,7 +71,7 @@
total_tr.append('td').text(d3.sum(arr, function(addr){return pays[addr]}).toFixed(8));
});
- d3.json('/recent_blocks', function(blocks) {
+ d3.json('../recent_blocks', function(blocks) {
var tr = d3.select('#blocks').selectAll().data(blocks).enter().append('tr');
tr.append('td').text(function(block){return new Date(1000*block.ts).toString()});
tr.append('td').text(function(block){return block.number});
@@ -80,7 +80,7 @@
});
});
- d3.json('/web/best_share_hash', function(c) {
+ d3.json('../web/best_share_hash', function(c) {
d3.select('#best_share').append('a').attr('href', 'share.html#' + c).text(c.substr(-8));
});
@@ -90,10 +90,10 @@
d3.select(id).selectAll().data(d).enter().append('span').text(' ').append('a').attr('href', function(c){return 'share.html#' + c}).text(function(c){return c.substr(-8)});
});
}
- fill('/web/verified_heads', '#verified_heads');
- fill('/web/heads', '#heads');
- fill('/web/verified_tails', '#verified_tails');
- fill('/web/tails', '#tails');
+ fill('../web/verified_heads', '#verified_heads');
+ fill('../web/heads', '#heads');
+ fill('../web/verified_tails', '#verified_tails');
+ fill('../web/tails', '#tails');
diff --git a/web-static/share.html b/web-static/share.html
index f4b861e1b..620a3b3f0 100644
--- a/web-static/share.html
+++ b/web-static/share.html
@@ -24,12 +24,12 @@
function reload(currency_info) {
var share_hash = document.location.hash.substr(1);
if(share_hash == current_hash) return;
- d3.json('/web/share/' + share_hash, function(share) {
+ d3.json('../web/share/' + share_hash, function(share) {
current_hash = share_hash;
var b = d3.select('body');
b.selectAll('*').remove();
var h1 = b.append('h1');
- h1.append('a').attr('href', '/static/').text('P2Pool');
+ h1.append('a').attr('href', '../static/').text('P2Pool');
h1.append('span').text(' > Share ');
h1.append('a').attr('href', '#' + share_hash).text(share_hash.substr(-8));
if(share == null) {
@@ -87,7 +87,7 @@
});
}
- d3.json('/web/currency_info', function(currency_info) {
+ d3.json('../web/currency_info', function(currency_info) {
reload(currency_info);
setInterval(function(){ reload(currency_info) }, 100);
});