Skip to content

Commit 65060e9

Browse files
committed
feat: added ability to export data, added ability to clear results, refactoring, updated README, dependency upgrades
1 parent fd67caa commit 65060e9

13 files changed

Lines changed: 431 additions & 89 deletions

File tree

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5050
with:
5151
tagName: ${{ github.ref_name }}
52-
releaseName: 'Advanced PassGen v__VERSION__'
52+
releaseName: 'Advanced PortChecker v__VERSION__'
5353
releaseBody: 'See the assets to download and install this version.'
5454
releaseDraft: true
5555
prerelease: false

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
run: yarn
1616

1717
- name: Run ESLint
18-
run: yarn run eslint . --ext .ts,.tsx,.js,.jsx
18+
run: yarn run eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0
1919

2020
test-tauri:
2121
strategy:

README.md

Lines changed: 73 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,85 @@
11
# Advanced PortChecker
22

3-
![Advanced PassGen](https://i.imgur.com/YazhCxS.png)
3+
![Advanced PortChecker](https://i.imgur.com/yoWDImn.png)
44

55
![GitHub](https://img.shields.io/badge/language-JavaScript+Rust-green)
66
![GitHub](https://img.shields.io/github/license/CodeDead/Advanced-PortChecker)
77
![GitHub release (latest by date)](https://img.shields.io/github/v/release/CodeDead/Advanced-PortChecker)
88

9-
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
9+
Advanced PortChecker is a free and open-source application that can help you check if ports are open or closed on a certain host. You can check multiple ports at once and export the results in plain text, CSV or JSON format!
1010

11-
Currently, two official plugins are available:
11+
## Building
1212

13-
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
14-
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
13+
Advanced PortChecker uses tauri to build the desktop application. You can find more information about Tauri [here](https://tauri.app/v1/guides/).
14+
15+
For more information about building using `vite`, please read the `Vite` documentation [here](https://vitejs.dev/guide/build.html).
16+
17+
### Development
18+
19+
You can start a development preview by running the `yarn tdev` command:
20+
```shell
21+
yarn tdev
22+
```
23+
24+
### Windows
25+
26+
#### Installer
27+
28+
You can create an executable installer by running the `yarn tbuild` command on a Windows host:
29+
```shell
30+
yarn tbuild
31+
```
32+
33+
### Linux
34+
35+
#### deb
36+
37+
You can create a .deb file, by running the `yarn tbuild` command on a Linux host:
38+
```shell
39+
yarn tbuild
40+
```
41+
42+
#### AppImage
43+
44+
You can create an [AppImage](https://appimage.github.io/) by executing the `yarn tbuild` command on a Linux host:
45+
```shell
46+
yarn tbuild
47+
```
48+
49+
### macOS
50+
51+
#### dmg
52+
53+
You can create a macOS build by running the `yarn tbuild` command on a macOS host:
54+
```shell
55+
yarn tbuild
56+
```
57+
58+
#### Archive
59+
60+
You can create a macOS build by running the `yarn tbuild` command on a macOS host:
61+
```shell
62+
yarn tbuild
63+
```
64+
65+
## Credits
66+
67+
### Tauri
68+
69+
This project uses [Tauri](https://tauri.app/) to create a cross-platform application.
70+
71+
### ReactJS
72+
73+
This project uses [React](https://reactjs.org/) to create the user interface.
74+
75+
### Theme
76+
77+
The theme used in this application is [MUI](https://mui.com/).
78+
79+
### Images
80+
81+
The application icon (and derivatives) are provided by [RemixIcon](https://remixicon.com/).
82+
All other images were provided by [MUI](https://mui.com/material-ui/material-icons/).
1583

1684
## About
1785

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
"@emotion/react": "^11.11.3",
1616
"@emotion/styled": "^11.11.0",
1717
"@fontsource/roboto": "^5.0.8",
18-
"@mui/icons-material": "^5.15.5",
19-
"@mui/material": "^5.15.5",
18+
"@mui/icons-material": "^5.15.6",
19+
"@mui/material": "^5.15.6",
2020
"@mui/x-data-grid": "^6.19.1",
2121
"@tauri-apps/api": "^1.5.3",
2222
"react": "^18.2.0",

src-tauri/Cargo.lock

Lines changed: 96 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ tauri-build = { version = "1.5.1", features = [] }
1717
[dependencies]
1818
serde_json = "1.0"
1919
serde = { version = "1.0", features = ["derive"] }
20-
tauri = { version = "1.5.4", features = ["os-all"] }
20+
tauri = { version = "1.5.4", features = [ "dialog-save", "dialog-open", "os-all"] }
2121
open = "5.0.1"
22-
chrono = "0.4.31"
22+
chrono = "0.4.32"
2323

2424
[features]
2525
# this feature is used for production builds or when `devPath` points to the filesystem and the built-in dev server is disabled.

src-tauri/src/main.rs

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ use std::net::{IpAddr, Shutdown, TcpStream, ToSocketAddrs};
66
use std::ops::Deref;
77
use std::sync::atomic::{AtomicBool, Ordering};
88
use std::sync::{Arc, Mutex};
9-
use std::thread;
109
use std::thread::available_parallelism;
1110
use std::time::Duration;
11+
use std::{fs, thread};
1212

1313
mod result;
1414

@@ -31,12 +31,32 @@ fn main() {
3131
open_website,
3232
scan_port_range,
3333
cancel_scan,
34-
get_number_of_threads
34+
get_number_of_threads,
35+
save_string_to_disk
3536
])
3637
.run(tauri::generate_context!())
3738
.expect("error while running tauri application");
3839
}
3940

41+
/// Save a string to disk
42+
///
43+
/// # Arguments
44+
///
45+
/// * `content` - The content that needs to be saved
46+
/// * `path` - The path where the content needs to be saved
47+
///
48+
/// # Returns
49+
///
50+
/// * `Ok(())` - If the content was saved successfully
51+
/// * `Err(String)` - If the content could not be saved
52+
#[tauri::command]
53+
fn save_string_to_disk(content: &str, path: &str) -> Result<(), String> {
54+
match fs::write(path, content) {
55+
Ok(_) => Ok(()),
56+
Err(e) => Err(e.to_string()),
57+
}
58+
}
59+
4060
/// Get the number of threads that can be used for port scanning
4161
///
4262
/// # Returns

src-tauri/tauri.conf.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
"tauri": {
1414
"allowlist": {
1515
"all": false,
16+
"dialog": {
17+
"save": true,
18+
"open": true
19+
},
1620
"os": {
1721
"all": true
1822
}
@@ -33,7 +37,7 @@
3337
"icons/icon.ico"
3438
],
3539
"identifier": "com.codedead.advancedportchecker",
36-
"longDescription": "",
40+
"longDescription": "Advanced PortChecker is a TCP port checker that allows you to check if a port is open or not",
3741
"macOS": {
3842
"entitlements": null,
3943
"exceptionDomain": "",
@@ -42,7 +46,7 @@
4246
"signingIdentity": null
4347
},
4448
"resources": [],
45-
"shortDescription": "",
49+
"shortDescription": "A TCP Port Checker",
4650
"targets": "all",
4751
"windows": {
4852
"certificateThumbprint": null,

0 commit comments

Comments
 (0)