Pyng/templates/index.html

79 lines
3.0 KiB
HTML
Raw Permalink Normal View History

2023-06-21 21:15:51 +00:00
<!DOCTYPE HTML>
<html>
<link href="{{url_for('static', filename = 'style.css')}}" rel="stylesheet">
{{ fontawesome_css() }}
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js" integrity="sha512-bLT0Qm9VnAYZDflyKcBaQ2gg0hSYNQrJ8RilYldYQ1FxQYoCLtUjuuRuZo+fjqhx/qtq/1itJ0C2ejDxltZVFg==" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/3.0.4/socket.io.js" integrity="sha512-aMGMvNYu8Ue4G+fHa359jcPb1u+ytAF+P2SCb+PxrjCdO3n3ZTxJ30zuH39rimUggmTwmh2u7wvQsDTHESnmfQ==" crossorigin="anonymous"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
var socket = io();
socket.on('connect', function() {
socket.emit('my_event', {data: 'I\'m connected!'});
});
socket.on('scan_response', function(msg) {
$('#output').append('<br>' + $('<div/>').text(msg.data).html());
})
$('form#scanner').submit(function(event) {
document.getElementById("output").innerHTML = "";
socket.emit('scan_port', $('#Target').val());
return false;
});
socket.on('net_response', function(msg) {
$('#output').append('<tr><td>' + $('<div/>').text(msg.ip).html()+'</td><td>'+ $('<div/>').text(msg.mac).html()+'</td><td>'+ $('<div/>').text(msg.vendor).html()+'</td><td>'+ $('<div/>').text(msg.dns).html()+'</td></tr>');
})
$('form#network').submit(function(event) {
document.getElementById("output").innerHTML = "";
socket.emit('net_port', $('#Subnet').val());
return false;
});
2023-11-09 11:11:19 +00:00
const outputDiv = document.querySelector('#output');
const autreDiv = document.querySelector('#export_list');
if (outputDiv.innerHTML.trim() === '') {
autreDiv.style.display = 'none';
}
outputDiv.addEventListener('DOMSubtreeModified', function () {
if (outputDiv.innerHTML.trim() === '') {
autreDiv.style.display = 'none';
} else {
autreDiv.style.display = 'block';
}
});
2023-06-21 21:15:51 +00:00
});
</script>
</head>
<body>
<title>Pyng</title>
<div class="logout">
<ul>
{% for item in nav.top %}
<li class="{{ 'active' if item.is_active else '' }}">
<a href="{{ item.url }}">{{ item.label }}</a>
</li>
{% endfor %}
<li style="float:right;">
<a href="logout"><span class="fas fa-user" style="display: inline;"></span> Logout</a>
</li>
</ul>
</div>
<h1>Network Scan</h1>
<form id="network" method="POST" action="#">
<input type="text" id="Subnet" placeholder="192.168.0.0/24">
<input type="submit" value="Send">
</form>
<center>
2023-11-09 11:11:19 +00:00
<br><br><div id="export_list"><a href="./export">Export List</a></div>
<br><div id="output"></div>
2023-06-21 21:15:51 +00:00
</center>
</body>
</html>