LookingGlas/templates/looking_glass.html

229 lines
No EOL
10 KiB
HTML

<!DOCTYPE html>
<html lang="nl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/png" href="/static/img/favicon.png">
<script src="/static/js/bootstrap.bundle.min.js"></script>
<script src="/static/js/vis-network.min.js"></script>
<link href="/static/css/bootstrap.min.css" rel="stylesheet">
<title>AS215085 Looking Glass</title>
<style>
body { background-color: #f8f9fa; }
.card { margin-bottom: 1.5rem; }
.output-console {
background-color: #212529; color: #f8f9fa; font-family: 'Courier New', Courier, monospace;
padding: 1rem; border-radius: 0.25rem; min-height: 400px;
white-space: pre-wrap; word-wrap: break-word; overflow-x: auto;
}
#mynetwork {
width: 100%; height: 600px; border: 1px solid #dee2e6; border-radius: .25rem;
}
.copy-btn { cursor: pointer; }
.speedtest-links a { margin-right: 10px; margin-bottom: 10px; }
.header-content {
position: relative;
z-index: 2;
}
header {
position: relative;
background: url('/static/img/background.webp') no-repeat center center;
background-size: cover;
color: white;
padding: 40px 20px;
text-align: center;
}
header::after {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
z-index: 1;
}
header h1, header p {
position: relative;
z-index: 2;
}
header h1 {
margin: 0;
font-size: 2.5em;
}
footer {
background-color: #2D2E43;
color: white;
text-align: center;
padding: 10px 0;
margin-top: 20px;
}
#form-error {
min-height: 1.5rem; /* Reserve space to prevent layout shift */
}
/* Styles for BGP raw output highlighting */
.asn-highlight { color: #5DADE2; }
.asn215085-highlight { color: #F9E79F; font-weight: bold; }
.best-line { color: #58D68D; font-weight: bold; }
/* --- Custom Styling for Buttons and Dropdowns --- */
.btn-custom {
background-color: #07AAF9;
border-color: #07AAF9;
color: white;
}
.btn-custom:hover {
background-color: #0698e0; /* Slightly darker blue for hover */
border-color: #0698e0;
color: white;
}
</style>
</head>
<body>
<header>
<div class="header-content">
<a href="/"> <img src="/static/img/as215085-logo.png" alt="AS215085 Logo" style="height: 120px; opacity: 1;!important"> </a>
<h2><b>AS215085 Looking Glass</b></h2>
<p><b>Proudly delivering the backbone for PixelHosting's services</b></p>
</div>
</header>
<nav class="navbar navbar-expand-lg navbar-light py-1" style="background-color: #07AAF9;">
<div class="container-fluid d-flex justify-content-center">
<div class="d-flex align-items-center">
<label for="main-location-selector" class="form-label mb-0 me-2 text-white"><b>Locatie:</b></label>
<select class="form-select form-select-sm w-auto" id="main-location-selector"></select>
</div>
</div>
</nav>
<div class="container my-5">
<div class="card">
<div class="card-header">Network</div>
<div class="card-body">
<div class="row align-items-center">
<div class="col-lg-6 mb-3 mb-lg-0">
<label class="form-label">Location</label>
<div class="input-group">
<input type="text" id="location-name-display" class="form-control" readonly>
<a id="map-link-btn" href="#" target="_blank" class="btn btn-outline-secondary">Map</a>
</div>
</div>
<div class="col-lg-6">
<label class="form-label">Facility</label>
<div class="input-group">
<input type="text" id="facility-name-display" class="form-control" readonly>
<a id="peeringdb-link-btn" href="#" target="_blank" class="btn btn-outline-secondary">PeeringDB</a>
</div>
</div>
</div>
<div class="row mt-4 align-items-center">
<div class="col-lg-2 col-md-6 mb-3 mb-lg-0">
<label class="form-label">Looking Glass IPv4</label>
<div class="input-group">
<input type="text" id="lg-ipv4" class="form-control" readonly>
<span class="input-group-text copy-btn" onclick="copyToClipboard('lg-ipv4')">Copy</span>
</div>
</div>
<div class="col-lg-4 col-md-6 mb-3 mb-lg-0">
<label class="form-label">Looking Glass IPv6</label>
<div class="input-group">
<input type="text" id="lg-ipv6" class="form-control" readonly>
<span class="input-group-text copy-btn" onclick="copyToClipboard('lg-ipv6')">Copy</span>
</div>
</div>
<div class="col-lg-2 col-md-6 mb-3 mb-md-0">
<label class="form-label">Your IPv4</label>
<div class="input-group">
<input type="text" id="client-ipv4" class="form-control" placeholder="Detecting..." readonly>
<span class="input-group-text copy-btn" onclick="copyToClipboard('client-ipv4')">Copy</span>
</div>
</div>
<div class="col-lg-4 col-md-6">
<label class="form-label">Your IPv6</label>
<div class="input-group">
<input type="text" id="client-ipv6" class="form-control" placeholder="Detecting..." readonly>
<span class="input-group-text copy-btn" onclick="copyToClipboard('client-ipv6')">Copy</span>
</div>
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-header">Looking Glass</div>
<div class="card-body">
<form id="lg-form">
<div class="row align-items-end">
<div class="col-md-6 mb-3">
<label for="target" class="form-label">Target IP address or host</label>
<input type="text" class="form-control" id="target" required>
</div>
<div class="col-md-4 mb-3">
<label for="method" class="form-label">Method</label>
<select class="form-select form-select-custom" id="method">
<option value="ping">Ping</option>
<option value="mtr">MTR</option>
<option value="traceroute">Traceroute</option>
<option value="bgp_raw">BGP Raw Lookup</option>
<option value="visualize">BGP Route Visualizer</option>
</select>
</div>
<div class="col-md-2 mb-3">
<button type="submit" id="execute-btn" class="btn btn-custom w-100">Execute</button>
</div>
</div>
<div id="form-error" class="text-danger fw-bold mt-2"></div>
</form>
</div>
</div>
<div class="card">
<div class="card-header">Output</div>
<div class="card-body">
<pre id="output-console" class="output-console">Output will appear here...</pre>
<div id="visualizer-container" style="display:none;">
<div id="mynetwork"></div>
<div id="visualizer-loader" style="display:none; text-align: center; padding: 20px;">Loading visualization...</div>
</div>
</div>
</div>
<div class="card">
<div class="card-header">Speedtest</div>
<div class="card-body">
<div class="row">
<div class="col-md-6">
<h5>iPerf3 Incoming</h5>
<div class="input-group mb-3">
<input type="text" id="iperf-in" class="form-control" readonly>
<span class="input-group-text copy-btn" onclick="copyToClipboard('iperf-in')">Copy</span>
</div>
</div>
<div class="col-md-6">
<h5>iPerf3 Outgoing</h5>
<div class="input-group mb-3">
<input type="text" id="iperf-out" class="form-control" readonly>
<span class="input-group-text copy-btn" onclick="copyToClipboard('iperf-out')">Copy</span>
</div>
</div>
</div>
<div class="mt-3">
<h5>Download Test Files</h5>
<div id="speedtest-links" class="speedtest-links d-flex flex-wrap justify-content-between gap-2">
</div>
</div>
</div>
</div>
</div>
<footer>
<p>&copy; 2020 - <span id="year"></span> AS215085 (PixelHosting). All rights reserved.</p>
<script> document.getElementById("year").textContent = new Date().getFullYear(); </script>
</footer>
<script src="/static/js/materialize.min.js"></script>
<script src="/static/js/looking_glass.js"></script>
</body>
</html>