-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Added peers sorting on views (#302)
* Added peers sorting for Interface and Profile views * Use ip-address package to sort with IPv6 addresses only * Add RX/TX column and fix add-peer button title
- Loading branch information
Dmytro Bondar
authored
Sep 23, 2024
1 parent
6ffe1a9
commit 3196010
Showing
8 changed files
with
186 additions
and
15 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,9 +1,17 @@ | ||
a.disabled { | ||
pointer-events: none; | ||
cursor: default; | ||
color: #888888; | ||
pointer-events: none; | ||
cursor: default; | ||
color: #888888; | ||
} | ||
|
||
.text-wrap { | ||
overflow-break: anywhere; | ||
overflow-break: anywhere; | ||
} | ||
|
||
.asc::after { | ||
content: " ↑"; | ||
} | ||
|
||
.desc::after { | ||
content: " ↓"; | ||
} |
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,20 @@ | ||
import { Address4, Address6 } from "ip-address" | ||
|
||
export function ipToBigInt(ip) { | ||
// Check if it's an IPv4 address | ||
if (ip.includes(".")) { | ||
const addr = new Address4(ip) | ||
return addr.bigInteger() | ||
} | ||
|
||
// Otherwise, assume it's an IPv6 address | ||
const addr = new Address6(ip) | ||
return addr.bigInteger() | ||
} | ||
|
||
export function humanFileSize(size) { | ||
const sizes = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"] | ||
if (size === 0) return "0B" | ||
const i = parseInt(Math.floor(Math.log(size) / Math.log(1024))) | ||
return Math.round(size / Math.pow(1024, i), 2) + sizes[i] | ||
} |
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
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