Merge remote-tracking branch 'gy/main' into patch-1

This commit is contained in:
GyulyVGC
2025-09-25 12:01:57 +02:00
20 changed files with 398 additions and 349 deletions

View File

@@ -666,7 +666,8 @@
"avatar_url": "https://avatars.githubusercontent.com/u/72492241?v=4",
"profile": "https://github.com/aguacero7",
"contributions": [
"translation"
"translation",
"code"
]
},
{
@@ -794,6 +795,15 @@
"contributions": [
"translation"
]
},
{
"login": "InfraWhisperer",
"name": "Raghav Potluri",
"avatar_url": "https://avatars.githubusercontent.com/u/208207531?v=4",
"profile": "https://github.com/InfraWhisperer",
"contributions": [
"platform"
]
}
],
"contributorsPerLine": 7,

View File

@@ -3,6 +3,12 @@ # Changelog
All Sniffnet releases with the relative changes are documented in this file.
## [UNRELEASED]
- Improve update checks using `semver` ([#891](https://github.com/GyulyVGC/sniffnet/pull/891))
- Updated Spanish translation to v1.4 ([#955](https://github.com/GyulyVGC/sniffnet/pull/955))
- Fix AppImage error with `libpcap` dependency ([#971](https://github.com/GyulyVGC/sniffnet/pull/971))
- Fix Sniffnet wrapper script on macOS to use a relative path to the executable ([#948](https://github.com/GyulyVGC/sniffnet/pull/948) — fixes [#898](https://github.com/GyulyVGC/sniffnet/issues/898))
## [1.4.1] - 2025-09-13
- Enhanced traffic filtering capabilities: Berkeley Packet Filter ([#937](https://github.com/GyulyVGC/sniffnet/pull/937) — fixes [#810](https://github.com/GyulyVGC/sniffnet/issues/810))
- Added support for `Linux SLL` link type, enabling to monitor the `any` interface on Linux ([#945](https://github.com/GyulyVGC/sniffnet/pull/945))
- Added _bits_ data representation ([#936](https://github.com/GyulyVGC/sniffnet/pull/936) — fixes [#506](https://github.com/GyulyVGC/sniffnet/issues/506))

View File

@@ -10,7 +10,7 @@
<td align="center" valign="top" width="14.28%"><a href="https://ads.fund"><img src="https://avatars.githubusercontent.com/u/202042116?v=4?s=100" width="100px;" alt="ADS Fund"/><br /><sub><b>ADS Fund</b></sub></a><br /><a href="#financial-ADS-Fund" title="Financial">💵</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/abdullahdevrel"><img src="https://avatars.githubusercontent.com/u/111275753?v=4?s=100" width="100px;" alt="Abdullah"/><br /><sub><b>Abdullah</b></sub></a><br /><a href="#ideas-abdullahdevrel" title="Ideas, Planning, & Feedback">🤔</a> <a href="#content-abdullahdevrel" title="Content">🖋</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/nitefood"><img src="https://avatars.githubusercontent.com/u/24555810?v=4?s=100" width="100px;" alt="Adriano"/><br /><sub><b>Adriano</b></sub></a><br /><a href="#ideas-nitefood" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/aguacero7"><img src="https://avatars.githubusercontent.com/u/72492241?v=4?s=100" width="100px;" alt="Aguacero 🌧️"/><br /><sub><b>Aguacero 🌧️</b></sub></a><br /><a href="#translation-aguacero7" title="Translation">🌍</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/aguacero7"><img src="https://avatars.githubusercontent.com/u/72492241?v=4?s=100" width="100px;" alt="Aguacero 🌧️"/><br /><sub><b>Aguacero 🌧️</b></sub></a><br /><a href="#translation-aguacero7" title="Translation">🌍</a> <a href="https://github.com/GyulyVGC/sniffnet/commits?author=aguacero7" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://tahinli.com"><img src="https://avatars.githubusercontent.com/u/96421894?v=4?s=100" width="100px;" alt="Ahmet Kaan GÜMÜŞ"/><br /><sub><b>Ahmet Kaan GÜMÜŞ</b></sub></a><br /><a href="#translation-Tahinli" title="Translation">🌍</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/dutyrok"><img src="https://avatars.githubusercontent.com/u/68692503?v=4?s=100" width="100px;" alt="Alexandr Shashkin"/><br /><sub><b>Alexandr Shashkin</b></sub></a><br /><a href="https://github.com/GyulyVGC/sniffnet/issues?q=author%3Adutyrok" title="Bug reports">🐛</a></td>
</tr>
@@ -79,41 +79,42 @@
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Quetzal-coalt"><img src="https://avatars.githubusercontent.com/u/62941885?v=4?s=100" width="100px;" alt="Quetzal-coalt"/><br /><sub><b>Quetzal-coalt</b></sub></a><br /><a href="#translation-Quetzal-coalt" title="Translation">🌍</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/InfraWhisperer"><img src="https://avatars.githubusercontent.com/u/208207531?v=4?s=100" width="100px;" alt="Raghav Potluri"/><br /><sub><b>Raghav Potluri</b></sub></a><br /><a href="#platform-InfraWhisperer" title="Packaging/porting to new platform">📦</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://www.signl4.com"><img src="https://avatars.githubusercontent.com/u/43244104?v=4?s=100" width="100px;" alt="Ron"/><br /><sub><b>Ron</b></sub></a><br /><a href="#ideas-rons4" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/msaf94"><img src="https://avatars.githubusercontent.com/u/27451267?v=4?s=100" width="100px;" alt="Safaraliev Maxim"/><br /><sub><b>Safaraliev Maxim</b></sub></a><br /><a href="#translation-msaf94" title="Translation">🌍</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://shawnyeager.com"><img src="https://avatars.githubusercontent.com/u/980297?v=4?s=100" width="100px;" alt="Shawn Yeager"/><br /><sub><b>Shawn Yeager</b></sub></a><br /><a href="#financial-shawnyeager" title="Financial">💵</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://signpath.io"><img src="https://avatars.githubusercontent.com/u/34448643?v=4?s=100" width="100px;" alt="SignPath GmbH"/><br /><sub><b>SignPath GmbH</b></sub></a><br /><a href="#platform-SignPath" title="Packaging/porting to new platform">📦</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/4r7if3x"><img src="https://avatars.githubusercontent.com/u/8606282?v=4?s=100" width="100px;" alt="The Artifex"/><br /><sub><b>The Artifex</b></sub></a><br /><a href="#translation-4r7if3x" title="Translation">🌍</a> <a href="#platform-4r7if3x" title="Packaging/porting to new platform">📦</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/HUNG-rushb"><img src="https://avatars.githubusercontent.com/u/57101685?v=4?s=100" width="100px;" alt="Trịnh Duy Hưng"/><br /><sub><b>Trịnh Duy Hưng</b></sub></a><br /><a href="#translation-HUNG-rushb" title="Translation">🌍</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/HUNG-rushb"><img src="https://avatars.githubusercontent.com/u/57101685?v=4?s=100" width="100px;" alt="Trịnh Duy Hưng"/><br /><sub><b>Trịnh Duy Hưng</b></sub></a><br /><a href="#translation-HUNG-rushb" title="Translation">🌍</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/TyseEX"><img src="https://avatars.githubusercontent.com/u/102823177?v=4?s=100" width="100px;" alt="TyseEX"/><br /><sub><b>TyseEX</b></sub></a><br /><a href="https://github.com/GyulyVGC/sniffnet/issues?q=author%3ATyseEX" title="Bug reports">🐛</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://index45.com"><img src="https://avatars.githubusercontent.com/u/79985743?v=4?s=100" width="100px;" alt="Victor Nilsson"/><br /><sub><b>Victor Nilsson</b></sub></a><br /><a href="#translation-vcrn" title="Translation">🌍</a> <a href="https://github.com/GyulyVGC/sniffnet/commits?author=vcrn" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/wangzishi"><img src="https://avatars.githubusercontent.com/u/8288105?v=4?s=100" width="100px;" alt="Wang Zishi"/><br /><sub><b>Wang Zishi</b></sub></a><br /><a href="#translation-wangzishi" title="Translation">🌍</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Kapelianovych"><img src="https://avatars.githubusercontent.com/u/28602579?v=4?s=100" width="100px;" alt="Yevhen"/><br /><sub><b>Yevhen</b></sub></a><br /><a href="#translation-Kapelianovych" title="Translation">🌍</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/vanharen07"><img src="https://avatars.githubusercontent.com/u/91621548?v=4?s=100" width="100px;" alt="Ylva"/><br /><sub><b>Ylva</b></sub></a><br /><a href="#translation-vanharen07" title="Translation">🌍</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://www.backbox.org"><img src="https://avatars.githubusercontent.com/u/2687905?v=4?s=100" width="100px;" alt="ZEROF"/><br /><sub><b>ZEROF</b></sub></a><br /><a href="#financial-ZEROF" title="Financial">💵</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://bit.ly/cBWeb"><img src="https://avatars.githubusercontent.com/u/28985171?v=4?s=100" width="100px;" alt="ZeroDot1"/><br /><sub><b>ZeroDot1</b></sub></a><br /><a href="#design-ZeroDot1" title="Design">🎨</a> <a href="#a11y-ZeroDot1" title="Accessibility">️️️️♿️</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="http://bit.ly/cBWeb"><img src="https://avatars.githubusercontent.com/u/28985171?v=4?s=100" width="100px;" alt="ZeroDot1"/><br /><sub><b>ZeroDot1</b></sub></a><br /><a href="#design-ZeroDot1" title="Design">🎨</a> <a href="#a11y-ZeroDot1" title="Accessibility">️️️️♿️</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/clr-cera"><img src="https://avatars.githubusercontent.com/u/93736542?v=4?s=100" width="100px;" alt="clr"/><br /><sub><b>clr</b></sub></a><br /><a href="https://github.com/GyulyVGC/sniffnet/commits?author=clr-cera" title="Documentation">📖</a> <a href="#translation-clr-cera" title="Translation">🌍</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/ervinpopescu"><img src="https://avatars.githubusercontent.com/u/84532402?v=4?s=100" width="100px;" alt="ervinpopescu"/><br /><sub><b>ervinpopescu</b></sub></a><br /><a href="#translation-ervinpopescu" title="Translation">🌍</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/glitsj16"><img src="https://avatars.githubusercontent.com/u/959378?v=4?s=100" width="100px;" alt="glitsj16"/><br /><sub><b>glitsj16</b></sub></a><br /><a href="#platform-glitsj16" title="Packaging/porting to new platform">📦</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/guilherme-demarchi"><img src="https://avatars.githubusercontent.com/u/196574579?v=4?s=100" width="100px;" alt="guilherme-demarchi"/><br /><sub><b>guilherme-demarchi</b></sub></a><br /><a href="#translation-guilherme-demarchi" title="Translation">🌍</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/hirotake111"><img src="https://avatars.githubusercontent.com/u/6666092?v=4?s=100" width="100px;" alt="hirotake111"/><br /><sub><b>hirotake111</b></sub></a><br /><a href="#translation-hirotake111" title="Translation">🌍</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/islameehassan"><img src="https://avatars.githubusercontent.com/u/98806155?v=4?s=100" width="100px;" alt="islameehassan"/><br /><sub><b>islameehassan</b></sub></a><br /><a href="https://github.com/GyulyVGC/sniffnet/commits?author=islameehassan" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/louis-ym4"><img src="https://avatars.githubusercontent.com/u/200361621?v=4?s=100" width="100px;" alt="louis-ym4"/><br /><sub><b>louis-ym4</b></sub></a><br /><a href="#design-louis-ym4" title="Design">🎨</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/louis-ym4"><img src="https://avatars.githubusercontent.com/u/200361621?v=4?s=100" width="100px;" alt="louis-ym4"/><br /><sub><b>louis-ym4</b></sub></a><br /><a href="#design-louis-ym4" title="Design">🎨</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/luca3s"><img src="https://avatars.githubusercontent.com/u/41015240?v=4?s=100" width="100px;" alt="luca3s"/><br /><sub><b>luca3s</b></sub></a><br /><a href="#translation-luca3s" title="Translation">🌍</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://piapark.me"><img src="https://avatars.githubusercontent.com/u/76558220?v=4?s=100" width="100px;" alt="pia"/><br /><sub><b>pia</b></sub></a><br /><a href="#translation-rkdud007" title="Translation">🌍</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/0323pin"><img src="https://avatars.githubusercontent.com/u/90570748?v=4?s=100" width="100px;" alt="pin"/><br /><sub><b>pin</b></sub></a><br /><a href="#platform-0323pin" title="Packaging/porting to new platform">📦</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/shu-kitamura"><img src="https://avatars.githubusercontent.com/u/171437458?v=4?s=100" width="100px;" alt="shu-kitamura"/><br /><sub><b>shu-kitamura</b></sub></a><br /><a href="https://github.com/GyulyVGC/sniffnet/commits?author=shu-kitamura" title="Code">💻</a> <a href="#translation-shu-kitamura" title="Translation">🌍</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/starccy"><img src="https://avatars.githubusercontent.com/u/17541742?v=4?s=100" width="100px;" alt="starccy"/><br /><sub><b>starccy</b></sub></a><br /><a href="https://github.com/GyulyVGC/sniffnet/commits?author=starccy" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/0x0177b11f"><img src="https://avatars.githubusercontent.com/u/2305166?v=4?s=100" width="100px;" alt="tiansheng li"/><br /><sub><b>tiansheng li</b></sub></a><br /><a href="#financial-0x0177b11f" title="Financial">💵</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/vtiinanen"><img src="https://avatars.githubusercontent.com/u/49340148?v=4?s=100" width="100px;" alt="vtiinanen"/><br /><sub><b>vtiinanen</b></sub></a><br /><a href="#translation-vtiinanen" title="Translation">🌍</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/vtiinanen"><img src="https://avatars.githubusercontent.com/u/49340148?v=4?s=100" width="100px;" alt="vtiinanen"/><br /><sub><b>vtiinanen</b></sub></a><br /><a href="#translation-vtiinanen" title="Translation">🌍</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://catchts.com"><img src="https://avatars.githubusercontent.com/u/16646733?v=4?s=100" width="100px;" alt="yossarian"/><br /><sub><b>yossarian</b></sub></a><br /><a href="#translation-captain-yossarian" title="Translation">🌍</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/cxw620"><img src="https://avatars.githubusercontent.com/u/70561268?v=4?s=100" width="100px;" alt="陈寒彤"/><br /><sub><b>陈寒彤</b></sub></a><br /><a href="#translation-cxw620" title="Translation">🌍</a></td>
</tr>

618
Cargo.lock generated
View File

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
[package]
name = "sniffnet"
version = "1.4.0"
version = "1.4.1"
authors = ["Giuliano Bellini <gyulyvgc99@gmail.com>"]
edition = "2024"
description = "Application to comfortably monitor your network traffic"
@@ -39,24 +39,25 @@ strip = true
[dependencies]
pcap = "2.3.0"
etherparse = "0.19.0"
chrono = { version = "0.4.41", default-features = false, features = ["clock"] }
chrono = { version = "0.4.42", default-features = false, features = ["clock"] }
plotters = { version = "0.3.7", default-features = false, features = ["area_series", "line_series"] }
iced = { version = "0.13.1", features = ["tokio", "svg", "advanced", "lazy", "image"] }
plotters-iced = "0.11.0"
maxminddb = "0.26.0"
confy = "1.0.0"
serde = { version = "1.0.219", default-features = false, features = ["derive"] }
serde = { version = "1.0.225", default-features = false, features = ["derive"] }
rodio = { version = "0.21.1", default-features = false, features = ["mp3", "playback"] }
dns-lookup = "3.0.0"
toml = "0.9.5"
ctrlc = { version = "3.4.7", features = ["termination"] }
toml = "0.9.7"
ctrlc = { version = "3.5.0", features = ["termination"] }
rfd = "0.15.4"
phf = "0.13.1"
phf_shared = "0.13.1"
splines = "5.0.0"
clap = { version = "4.5.46", features = ["derive"] }
clap = { version = "4.5.47", features = ["derive"] }
tokio = { version = "1.47.1", features = ["macros"] }
async-channel = "2.5.0"
semver = "1.0.27"
[target.'cfg(windows)'.dependencies]
gag = "1.0.0"

View File

@@ -12,7 +12,7 @@
Cross-platform. Intuitive. Reliable.
Translated in:<br>
🇨🇳 🇩🇪 🇫🇷 🇷🇺 🇵🇹 🇪🇦 🇮🇹 🇵🇱 [+&nbsp;14&nbsp;more&nbsp;languages](https://github.com/GyulyVGC/sniffnet/issues/60)
🇨🇳 🇩🇪 🇫🇷 🇷🇺 🇵🇹 🇪🇦 🇮🇹 🇵🇱 [+&nbsp;15&nbsp;more&nbsp;languages](https://github.com/GyulyVGC/sniffnet/issues/60)
</div>
<p>
@@ -81,6 +81,7 @@ ## Download
<picture><img alt="Linux" title="Linux" height="85px" src="https://raw.githubusercontent.com/GyulyVGC/sniffnet/main/resources/repository/badges/linux.svg"/></picture>
</td>
<td>
AppImage: <a href="https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_LinuxAppImage_amd64.AppImage">amd64</a> | <a href="https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_LinuxAppImage_arm64.AppImage">arm64</a> | <a href="https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_LinuxAppImage_i386.AppImage">i386</a> | <a href="https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_LinuxAppImage_armhf.AppImage">armhf</a> <br>
DEB: <a href="https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_LinuxDEB_amd64.deb">amd64</a> | <a href="https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_LinuxDEB_arm64.deb">arm64</a> | <a href="https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_LinuxDEB_i386.deb">i386</a> | <a href="https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_LinuxDEB_armhf.deb">armhf</a> <br>
RPM: <a href="https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_LinuxRPM_x86_64.rpm">x86_64</a> | <a href="https://github.com/GyulyVGC/sniffnet/releases/latest/download/Sniffnet_LinuxRPM_aarch64.rpm">aarch64</a>
</td>

View File

Binary file not shown.

View File

Binary file not shown.

View File

@@ -593,7 +593,6 @@ z

View File

Binary file not shown.

View File

Binary file not shown.

View File

@@ -1,9 +1,9 @@
app: Sniffnet
ingredients:
dist: bookworm
dist: buster
packages:
- libpcap0.8
sources:
- deb https://deb.debian.org/debian stable main
- deb https://archive.debian.org/debian buster main
debs:
- /target/REPLACE_TAG

View File

@@ -1,2 +1,4 @@
#!/usr/bin/env zsh
osascript -e 'do shell script "/*/Sniffnet.app/Contents/MacOS/sniffnet >/dev/null 2>&1 &" with prompt "Comfortably monitor your Internet traffic." with administrator privileges'
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd -P)"
SNIFFNET_PATH="$SCRIPT_DIR/sniffnet"
osascript -e "do shell script \"'$SNIFFNET_PATH' >/dev/null 2>&1 &\" with prompt \"Comfortably monitor your Internet traffic.\" with administrator privileges"

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 157 KiB

After

Width:  |  Height:  |  Size: 160 KiB

View File

@@ -27,16 +27,21 @@ pub fn footer<'a>(
font: Font,
font_footer: Font,
newer_release_available: Option<bool>,
pulse: u8,
dots_pulse: &(String, u8),
) -> Container<'a, Message, StyleType> {
if thumbnail {
return thumbnail_footer();
}
let release_details_row =
get_release_details(language, font, font_footer, newer_release_available);
let release_details_row = get_release_details(
language,
font,
font_footer,
newer_release_available,
&dots_pulse.0,
);
let heart_size = match pulse {
let heart_size = match dots_pulse.1 {
1 => 17.0,
2 => 20.0,
_ => 14.0,
@@ -203,6 +208,7 @@ fn get_release_details<'a>(
font: Font,
font_footer: Font,
newer_release_available: Option<bool>,
dots: &str,
) -> Row<'a, Message, StyleType> {
let mut ret_val = Row::new()
.align_y(Alignment::Center)
@@ -216,11 +222,15 @@ fn get_release_details<'a>(
if let Some(boolean_response) = newer_release_available {
if boolean_response {
// a newer release is available on GitHub
let icon_size = match dots.len() {
2 => 16.0,
3 => 18.0,
_ => 14.0,
};
let button = button(
Icon::Update
.to_text()
.class(TextType::Danger)
.size(18)
.size(icon_size)
.align_x(Alignment::Center)
.align_y(Alignment::Center)
.line_height(LineHeight::Relative(0.8)),

View File

@@ -583,7 +583,7 @@ pub fn view(&self) -> Element<'_, Message, StyleType> {
font,
font_headers,
self.newer_release_available,
self.dots_pulse.1,
&self.dots_pulse,
);
let content: Element<Message, StyleType> =

View File

@@ -165,6 +165,8 @@ fn test_data_info() {
assert_eq!(data_info_1.outgoing_data(DataRepr::Bytes), 1400);
assert_eq!(data_info_1.outgoing_data(DataRepr::Bits), 11200);
// sleep a little to have a different final_instant
std::thread::sleep(std::time::Duration::from_millis(10));
let mut data_info_2 = DataInfo::new_with_first_packet(100, TrafficDirection::Outgoing);
// 0, 1, 0, 100
data_info_2.add_packets(19, 300, TrafficDirection::Outgoing);

View File

@@ -16,6 +16,7 @@ pub fn reserved_address_translation(language: Language, info: &str) -> String {
Language::ZH_TW => format!("保留的網路位址 ({info})"),
Language::FR => format!("Adresse réservée ({info})"),
Language::NL => format!("Gereserveerd adres ({info})"),
Language::ES => format!("Dirección reservada ({info})"),
Language::RO => format!("Adresă rezervată ({info})"),
Language::DE => format!("Reservierte Adresse ({info})"),
Language::UZ => format!("Rezervlangan manzil ({info})"),
@@ -34,6 +35,7 @@ pub fn share_feedback_translation(language: Language) -> &'static str {
Language::ZH_TW => "分享您的意見回饋",
Language::FR => "Partagez vos commentaires",
Language::NL => "Deel uw feedback",
Language::ES => "Comparte tus comentarios",
Language::RO => "Împărtășiți feedback-ul dvs",
Language::DE => "Feedback geben",
Language::UZ => "Fikr-mulohazalaringizni ulashing",
@@ -58,6 +60,7 @@ pub fn share_feedback_translation(language: Language) -> &'static str {
// Language::EL => "Εξαιρούμενα",
// Language::RO => "Excluși",
// Language::ID => "Kecuali",
// Language::ES => "Excluidos",
// _ => "Excluded",
// }
// }
@@ -76,6 +79,7 @@ pub fn capture_file_translation(language: Language) -> &'static str {
Language::RO => "Fișierul de captură",
Language::ZH_TW => "擷取文件",
Language::ID => "File tangkapan",
Language::ES => "Archivo de captura",
_ => "Capture file",
}
}
@@ -88,6 +92,7 @@ pub fn select_capture_translation(language: Language) -> &'static str {
Language::JA => "キャプチャファイルを選択",
Language::ZH => "选择捕获文件",
Language::NL => "Selecteer capture bestand",
Language::ES => "Seleccionar archivo de captura",
Language::RO => "Selectează fișierul de captură",
Language::DE => "Aufzeichnungsdatei auswählen",
Language::UZ => "Tahlil faylini tanlang",
@@ -131,6 +136,11 @@ pub fn reading_from_pcap_translation<'a>(language: Language, file: &str) -> Text
{file_name_translation}: {file}\n\n\
Weet je zeker dat het geselecteerde bestand niet leeg is?"
),
Language::ES => format!(
"Leyendo paquetes desde el archivo...\n\n\
{file_name_translation}: {file}\n\n\
¿Seguro que el archivo seleccionado no está vacío?"
),
Language::RO => format!(
"Citirea pachetelor din fișier...\n\n\
{file_name_translation}: {file}\n\n\
@@ -177,6 +187,7 @@ pub fn data_exceeded_translation(language: Language) -> &'static str {
Language::JA => "データの閾値を超えました",
Language::ZH | Language::ZH_TW => "已超出数据阈值",
Language::NL => "Gegevenslimiet overschreden",
Language::ES => "Umbral de datos superado",
Language::RO => "Limita de date depășită",
Language::DE => "Datenschwelle überschritten",
Language::UZ => "Ma'lumotlar chegarasidan oshib ketdi",
@@ -194,6 +205,7 @@ pub fn bits_exceeded_translation(language: Language) -> &'static str {
Language::JA => "ビットの閾値を超えました",
Language::ZH => "已超出比特阈值",
Language::NL => "Bits limiet overschreden",
Language::ES => "Umbral de bits superado",
Language::RO => "Limita de biți depășită",
Language::DE => "Bitschwelle überschritten",
Language::UZ => "Bitlar chegarasidan oshib ketdi",
@@ -206,9 +218,13 @@ pub fn bits_exceeded_translation(language: Language) -> &'static str {
pub fn bits_translation(language: Language) -> &'static str {
match language {
Language::EN | Language::IT | Language::NL | Language::DE | Language::FR | Language::ID => {
"bits"
}
Language::EN
| Language::IT
| Language::NL
| Language::DE
| Language::FR
| Language::ID
| Language::ES => "bits",
Language::JA => "ビット",
Language::ZH => "比特",
Language::UZ => "bitlar",
@@ -223,7 +239,7 @@ pub fn bits_translation(language: Language) -> &'static str {
pub fn pause_translation(language: Language) -> &'static str {
match language {
Language::EN | Language::DE | Language::FR => "Pause",
Language::IT => "Pausa",
Language::IT | Language::ES => "Pausa",
Language::JA => "一時停止",
Language::ZH => "暂停",
Language::NL => "Pauzeren",
@@ -245,6 +261,7 @@ pub fn resume_translation(language: Language) -> &'static str {
Language::JA => "再開",
Language::ZH => "恢复",
Language::NL => "Hervatten",
Language::ES => "Reanudar",
Language::RO => "Continuă",
Language::DE => "Fortsetzen",
Language::UZ => "Davom ettirish",

View File

@@ -133,6 +133,7 @@ pub fn is_up_to_date(self) -> bool {
| Language::RO
| Language::ZH_TW
| Language::ID
| Language::ES
)
}
}

View File

@@ -1,5 +1,6 @@
use crate::SNIFFNET_LOWERCASE;
use crate::utils::formatted_strings::APP_VERSION;
use semver::Version;
use serde::Deserialize;
use std::time::Duration;
@@ -48,23 +49,13 @@ async fn is_newer_release_available(max_retries: u8, seconds_between_retries: u8
.name;
latest_version = latest_version.trim().to_string();
// release name sample: v1.1.2
// TODO: support versions with numbers of more than 1 digit
let latest_version_as_bytes = latest_version.as_bytes();
if latest_version.len() == 6
&& latest_version.starts_with('v')
&& char::from(latest_version_as_bytes[1]).is_numeric()
&& char::from(latest_version_as_bytes[2]).eq(&'.')
&& char::from(latest_version_as_bytes[3]).is_numeric()
&& char::from(latest_version_as_bytes[4]).eq(&'.')
&& char::from(latest_version_as_bytes[5]).is_numeric()
// release name sample: v1.2.3
let stripped = latest_version.trim_start_matches('v');
if let (Ok(latest_semver), Ok(current_semver)) =
(Version::parse(stripped), Version::parse(APP_VERSION))
{
latest_version.remove(0);
return if latest_version.gt(&APP_VERSION.to_string()) {
Some(true)
} else {
Some(false)
};
return Some(latest_semver > current_semver);
}
}
let retries_left = max_retries - 1;