-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Amith Koujalgi
committed
Oct 19, 2023
1 parent
625c79a
commit 069db6a
Showing
8 changed files
with
444 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | ||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
<!--suppress ALL --> | ||
<html lang=""> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> | ||
<link rel="Icon" type="image/ico" href="#"/> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css"> | ||
|
||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" | ||
integrity="sha384-4bw+/aepP/YC94hEpVNVgiZdgIC5+VKNBQNGCHeKRQN+PtmoHDEXuppvnDJzQIu9" crossorigin="anonymous"> | ||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> | ||
|
||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" | ||
integrity="sha384-HwwvtgBNo3bZJJLYd8oVXjrBZt8cqVSpeBNS5n7C8IVInixGAoxmnlMuBnhbgrkm" | ||
crossorigin="anonymous"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.7.2/socket.io.js" | ||
integrity="sha512-zoJXRvW2gC8Z0Xo3lBbao5+AS3g6YWr5ztKqaicua11xHo+AvE1b0lT9ODgrHTmNUxeCw0Ry4BGRYZfXu70weg==" | ||
crossorigin="anonymous" referrerpolicy="no-referrer"></script> | ||
<script src="/ports/ports.js"></script> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css"> | ||
<link href="/style.css" rel="stylesheet"> | ||
<head> | ||
<title>Sys Stats: Ports</title> | ||
<link rel="icon" type="image/x-icon" href="/favicon.ico"> | ||
</head> | ||
|
||
<body> | ||
<div class="container-fluid"> | ||
<div class="row"> | ||
<div class="col-sm-auto bg-light sticky-top"> | ||
<div class="d-flex flex-sm-column flex-row flex-nowrap bg-light align-items-center sticky-top"> | ||
<a href="#" class="d-block p-3 link-dark text-decoration-none" title="" data-bs-toggle="tooltip" | ||
data-bs-placement="right" data-bs-original-title="Sys Stats" | ||
style="padding-top: 30px !important; padding-bottom: 30px !important;"> | ||
<i class="bi-clipboard-heart fs-1"></i> | ||
</a> | ||
<ul class="nav nav-pills nav-flush flex-sm-column flex-row flex-nowrap mb-auto mx-auto text-center justify-content-between w-100 px-3 align-items-center"> | ||
<li class="nav-item"> | ||
<a href="/" class="nav-link py-3 px-2" title="" data-bs-toggle="tooltip" | ||
data-bs-placement="right" data-bs-original-title="Processes"> | ||
<i class="bi-list-nested fs-1"></i> | ||
</a> | ||
</li> | ||
<li> | ||
<a href="#" class="nav-link py-3 px-2" title="" data-bs-toggle="tooltip" | ||
data-bs-placement="right" data-bs-original-title="Ports"> | ||
<i class="bi-wifi fs-1"></i> | ||
</a> | ||
</li> | ||
<li> | ||
<a href="/stats/" class="nav-link py-3 px-2" title="" data-bs-toggle="tooltip" | ||
data-bs-placement="right" data-bs-original-title="Resources"> | ||
<i class="bi-speedometer2 fs-1"></i> | ||
</a> | ||
</li> | ||
<li> | ||
<a href="#" class="nav-link py-3 px-2" title="" data-bs-toggle="tooltip" | ||
data-bs-placement="right" data-bs-original-title="Settings"> | ||
<i class="bi-gear-wide-connected fs-1"></i> | ||
</a> | ||
</li> | ||
<li> | ||
<a href="#" class="nav-link py-3 px-2" title="" data-bs-toggle="tooltip" | ||
data-bs-placement="right" data-bs-original-title="Help"> | ||
<i class="bi-info-lg fs-1"></i> | ||
</a> | ||
</li> | ||
<li> | ||
<a href="https://github.com/amithkoujalgi/sys-stats/issues" class="nav-link py-3 px-2" title="" | ||
data-bs-toggle="tooltip" | ||
data-bs-placement="right" data-bs-original-title="Report issues" target="_blank"> | ||
<i class="bi-exclamation-triangle fs-1"></i> | ||
</a> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
<div class="col-sm p-3 min-vh-100"> | ||
<div class="row"> | ||
<div class="col-md-6 d-flex align-items-center"> | ||
<h2>Sys Stats</h2> | ||
</div> | ||
<div class="col-md-6"> | ||
<a href="https://github.com/amithkoujalgi/sys-stats" class="nav-link py-3 px-2 gh-link" title="" | ||
data-bs-toggle="tooltip" | ||
data-bs-placement="right" data-bs-original-title="Project on GitHub" target="_blank"> | ||
<i class="bi-github fs-1"></i> | ||
</a> | ||
</div> | ||
</div> | ||
<h5>Ports</h5> | ||
<div class="input-group search-bar"> | ||
<input type="search" class="form-control rounded" | ||
placeholder="Search by PID or bind port or process name or command" | ||
aria-label="Search" | ||
aria-describedby="search-addon" id="proc-search"/> | ||
<button type="button" class="btn btn-outline-primary" id="proc-search-btn">Search</button> | ||
</div> | ||
<table class="port-list table w-auto small"></table> | ||
</div> | ||
</div> | ||
</div> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// noinspection JSUnresolvedReference | ||
|
||
|
||
let socket = io("ws://0.0.0.0:8070"); | ||
|
||
$(document).ready(function () { | ||
let url = window.location.href; | ||
|
||
$(function () { | ||
$('[data-bs-toggle="tooltip"]').tooltip(); | ||
}); | ||
|
||
console.log('Loaded socketio script'); | ||
socket.on('connect', () => { | ||
console.log('Connected to server!'); | ||
}); | ||
|
||
setInterval(function () { | ||
socket.emit('list_ports', {search_keyword: ''}); | ||
}, 1000); | ||
|
||
socket.on("port-list", data => { | ||
// console.log("prc: " + JSON.stringify(data)) | ||
let portsList = data; | ||
let tableBody = $('.port-list'); | ||
|
||
let rows = ""; | ||
for (let process of portsList) { | ||
let row = ` | ||
<tr> | ||
<td style="font-family: monospace">${process.pid}</td> | ||
<td style="font-family: monospace">${process.laddr.port}</td> | ||
<td style="font-family: monospace">${process.laddr.ip}</td> | ||
<td class="process-status-container" style="font-family: monospace">${process.process_owner}</td> | ||
<td style="font-family: monospace">${process.process_name}</td> | ||
<td style="font-family: monospace">${process.process_cmd}</td> | ||
</tr> | ||
`; | ||
rows = rows + row; | ||
} | ||
let head = ` | ||
<thead> | ||
<tr> | ||
<th scope="col">PID</th> | ||
<th scope="col">Bind Port</th> | ||
<th scope="col">Bind Host</th> | ||
<th scope="col">User</th> | ||
<th scope="col">Process</th> | ||
<th scope="col">Command</th> | ||
</tr> | ||
</thead> | ||
`; | ||
tableBody.html(head + "<tbody>" + rows + "</tbody>"); | ||
}); | ||
}); | ||
|
||
$(document).on('click', '#send', function () { | ||
console.log('clicked...') | ||
}); | ||
|
||
$(document).on('click', '.expandable-cell', function () { | ||
let $cell = $(this); | ||
let isExpanded = $cell.hasClass('expanded'); | ||
if (isExpanded) { | ||
$cell.removeClass('expanded'); | ||
} else { | ||
$cell.addClass('expanded'); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | ||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
<!--suppress ALL --> | ||
<html lang=""> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> | ||
<link rel="Icon" type="image/ico" href="#"/> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css"> | ||
|
||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" | ||
integrity="sha384-4bw+/aepP/YC94hEpVNVgiZdgIC5+VKNBQNGCHeKRQN+PtmoHDEXuppvnDJzQIu9" crossorigin="anonymous"> | ||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" | ||
integrity="sha384-HwwvtgBNo3bZJJLYd8oVXjrBZt8cqVSpeBNS5n7C8IVInixGAoxmnlMuBnhbgrkm" | ||
crossorigin="anonymous"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.7.2/socket.io.js" | ||
integrity="sha512-zoJXRvW2gC8Z0Xo3lBbao5+AS3g6YWr5ztKqaicua11xHo+AvE1b0lT9ODgrHTmNUxeCw0Ry4BGRYZfXu70weg==" | ||
crossorigin="anonymous" referrerpolicy="no-referrer"></script> | ||
<script src="https://cdn.plot.ly/plotly-2.26.0.min.js" charset="utf-8"></script> | ||
<script src="/stats/stats.js"></script> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css"> | ||
<link href="/style.css" rel="stylesheet"> | ||
<head> | ||
<title>Sys Stats: Stats</title> | ||
<link rel="icon" type="image/x-icon" href="/favicon.ico"> | ||
</head> | ||
|
||
<body> | ||
<div class="container-fluid"> | ||
<div class="row"> | ||
<div class="col-sm-auto bg-light sticky-top"> | ||
<div class="d-flex flex-sm-column flex-row flex-nowrap bg-light align-items-center sticky-top"> | ||
<a href="#" class="d-block p-3 link-dark text-decoration-none" title="" data-bs-toggle="tooltip" | ||
data-bs-placement="right" data-bs-original-title="Sys Stats" | ||
style="padding-top: 30px !important; padding-bottom: 30px !important;"> | ||
<i class="bi-clipboard-heart fs-1"></i> | ||
</a> | ||
<ul class="nav nav-pills nav-flush flex-sm-column flex-row flex-nowrap mb-auto mx-auto text-center justify-content-between w-100 px-3 align-items-center"> | ||
<li class="nav-item"> | ||
<a href="/" class="nav-link py-3 px-2" title="" data-bs-toggle="tooltip" | ||
data-bs-placement="right" data-bs-original-title="Processes"> | ||
<i class="bi-list-nested fs-1"></i> | ||
</a> | ||
</li> | ||
<li> | ||
<a href="/ports/" class="nav-link py-3 px-2" title="" data-bs-toggle="tooltip" | ||
data-bs-placement="right" data-bs-original-title="Ports"> | ||
<i class="bi-wifi fs-1"></i> | ||
</a> | ||
</li> | ||
<li> | ||
<a href="#" class="nav-link py-3 px-2" title="" data-bs-toggle="tooltip" | ||
data-bs-placement="right" data-bs-original-title="Resources"> | ||
<i class="bi-speedometer2 fs-1"></i> | ||
</a> | ||
</li> | ||
<li> | ||
<a href="#" class="nav-link py-3 px-2" title="" data-bs-toggle="tooltip" | ||
data-bs-placement="right" data-bs-original-title="Settings"> | ||
<i class="bi-gear-wide-connected fs-1"></i> | ||
</a> | ||
</li> | ||
<li> | ||
<a href="#" class="nav-link py-3 px-2" title="" data-bs-toggle="tooltip" | ||
data-bs-placement="right" data-bs-original-title="Help"> | ||
<i class="bi-info-lg fs-1"></i> | ||
</a> | ||
</li> | ||
<li> | ||
<a href="https://github.com/amithkoujalgi/sys-stats/issues" class="nav-link py-3 px-2" title="" | ||
data-bs-toggle="tooltip" | ||
data-bs-placement="right" data-bs-original-title="Report issues" target="_blank"> | ||
<i class="bi-exclamation-triangle fs-1"></i> | ||
</a> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
<div class="col-sm p-3 min-vh-100"> | ||
<div class="row"> | ||
<div class="col-md-6 d-flex align-items-center"> | ||
<h2>Sys Stats</h2> | ||
</div> | ||
<div class="col-md-6"> | ||
<a href="https://github.com/amithkoujalgi/sys-stats" class="nav-link py-3 px-2 gh-link" title="" | ||
data-bs-toggle="tooltip" | ||
data-bs-placement="right" data-bs-original-title="Project on GitHub" target="_blank"> | ||
<i class="bi-github fs-1"></i> | ||
</a> | ||
</div> | ||
</div> | ||
<h5>Resource Usage</h5> | ||
|
||
<div class="row"> | ||
<div class="col-md-6"> | ||
<div id="memory-usage-chart" style="justify-content: center; display: flex"></div> | ||
</div> | ||
<div class="col-md-6"> | ||
<div id="memory-usage-chart1" style="justify-content: center; display: flex"></div> | ||
</div> | ||
</div> | ||
|
||
<div> | ||
<h6>CPU Usage: Per Core</h6> | ||
<table class="cpu-list table"></table> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</body> | ||
|
||
</html> |
Oops, something went wrong.