mirror of
https://github.com/cwinfo/yggdrasil-map
synced 2025-06-26 16:19:24 +00:00
Initial commit.
This commit is contained in:
26
web/templates/base.html
Normal file
26
web/templates/base.html
Normal file
@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>fc00::/8</title>
|
||||
<script src="static/jquery-2.0.3.min.js"></script>
|
||||
<script src="static/jquery.autocomplete.min.js"></script>
|
||||
<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro|Droid+Sans|Duru+Sans|Quattrocento+Sans|Open+Sans' rel='stylesheet' type='text/css'>
|
||||
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.css" />
|
||||
<link href='static/style.css' rel='stylesheet' type='text/css'>
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<h1>fc00<span class="grey">::/8</span></h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="/network">Network</a></li>
|
||||
<li><a href="/world-map">World map</a></li>
|
||||
<li><a href="/tools">Tools</a></li>
|
||||
<li><tt>{{ ip }}</tt></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{% block content %}{% endblock %}
|
||||
</body>
|
||||
</html>
|
22
web/templates/network.html
Normal file
22
web/templates/network.html
Normal file
@ -0,0 +1,22 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<div id="general-info">
|
||||
Nodes: <span id="number-of-nodes">-</span><br>
|
||||
Links: <span id="number-of-connections">-</span><br>
|
||||
Updated <span id="update-time">-</span><br>
|
||||
</div>
|
||||
|
||||
<div id="sidebar">
|
||||
<div id="search-wrapper">
|
||||
<input id="search-box" class="tt" type="text" placeholder="Search nodes...">
|
||||
</div>
|
||||
<div id="node-info"></div>
|
||||
</div>
|
||||
|
||||
<div id="content-wrapper">
|
||||
<canvas id="map"></canvas>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" src="static/network.js"></script>
|
||||
{% endblock %}
|
9
web/templates/tools.html
Normal file
9
web/templates/tools.html
Normal file
@ -0,0 +1,9 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<div id="content-wrapper">
|
||||
<h2>Ping</h2>
|
||||
<input type="text" value="{{ ip }}">
|
||||
<h2>Traceroute</h2>
|
||||
</div>
|
||||
{% endblock %}
|
40
web/templates/world-map.html
Normal file
40
web/templates/world-map.html
Normal file
@ -0,0 +1,40 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div id="content-wrapper">
|
||||
<div id="map"></div>
|
||||
</div>
|
||||
|
||||
|
||||
<script src="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.js"></script>
|
||||
<script type="text/javascript">
|
||||
"use strict";
|
||||
|
||||
var nodes = {{ nodes|tojson|safe }}
|
||||
|
||||
var map = L.map('map').setView([0, 0], 2);
|
||||
|
||||
L.tileLayer('http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg', {
|
||||
subdomains: '1234',
|
||||
minZoom: 2,
|
||||
maxZoom: 7,
|
||||
noWrap: true
|
||||
}).addTo(map);
|
||||
|
||||
|
||||
for (var i = 0; i < nodes.length; ++i) {
|
||||
var node = nodes[i];
|
||||
|
||||
node.circle = L.circle([node.latitude, node.longitude], 5000, {
|
||||
// color: 'red',
|
||||
stroke: false,
|
||||
fillColor: 'red',
|
||||
fillOpacity: 1
|
||||
}).addTo(map);
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
Reference in New Issue
Block a user