Skip to content

Commit 746f493

Browse files
authored
Merge pull request #9 from CodeDead/feature/extra-features
feat: added theme toggle button, dependency upgrades, added ability t…
2 parents eba80c3 + 5b9bcad commit 746f493

File tree

19 files changed

+100
-24
lines changed

19 files changed

+100
-24
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# Advanced PortChecker
22

3-
![Advanced PortChecker](https://i.imgur.com/yoWDImn.png)
3+
![Advanced PortChecker](https://i.imgur.com/vdt1sXZ.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
[![Test](https://github.com/CodeDead/Advanced-PortChecker/actions/workflows/test.yml/badge.svg)](https://github.com/CodeDead/Advanced-PortChecker/actions/workflows/test.yml)
9+
[![Release](https://github.com/CodeDead/Advanced-PortChecker/actions/workflows/release.yml/badge.svg)](https://github.com/CodeDead/Advanced-PortChecker/actions/workflows/release.yml)
910

1011
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!
1112

src-tauri/Cargo.lock

Lines changed: 6 additions & 6 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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "advanced-portchecker"
33
version = "2.0.0"
4-
description = "A lightweight TCP port checker with an intuitive UI."
4+
description = "A lightweight TCP/IP port scanner with an intuitive UI."
55
authors = ["CodeDead <admin@codedead.com>"]
66
license = "GPL-3.0-only"
77
repository = "https://github.com/CodeDead/Advanced-PortChecker"

src-tauri/tauri.conf.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"icons/icon.ico"
3838
],
3939
"identifier": "com.codedead.advancedportchecker",
40-
"longDescription": "Advanced PortChecker is a TCP port checker that allows you to check if a port is open or not",
40+
"longDescription": "Advanced PortChecker is a TCP/IP port scanner that allows you to check if a port is open or not",
4141
"macOS": {
4242
"entitlements": null,
4343
"exceptionDomain": "",
@@ -46,7 +46,7 @@
4646
"signingIdentity": null
4747
},
4848
"resources": [],
49-
"shortDescription": "A TCP Port Checker",
49+
"shortDescription": "A TCP/IP Port scanner",
5050
"targets": "all",
5151
"windows": {
5252
"certificateThumbprint": null,

src/components/TopBar/index.jsx

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@ import ListItem from '@mui/material/ListItem';
1414
import ListItemButton from '@mui/material/ListItemButton';
1515
import ListItemIcon from '@mui/material/ListItemIcon';
1616
import ListItemText from '@mui/material/ListItemText';
17+
import Brightness5Icon from '@mui/icons-material/Brightness5';
18+
import Brightness7Icon from '@mui/icons-material/Brightness7';
1719
import TravelExploreIcon from '@mui/icons-material/TravelExplore';
1820
import SettingsIcon from '@mui/icons-material/Settings';
1921
import AttachMoneyIcon from '@mui/icons-material/AttachMoney';
2022
import InfoIcon from '@mui/icons-material/Info';
2123
import { useNavigate } from 'react-router-dom';
2224
import DrawerHeader from '../DrawerHeader';
2325
import { MainContext } from '../../contexts/MainContextProvider';
24-
import { openWebSite } from '../../reducers/MainReducer/Actions';
26+
import { openWebSite, setThemeType } from '../../reducers/MainReducer/Actions';
2527

2628
const drawerWidth = 240;
2729

@@ -82,7 +84,8 @@ const Drawer = styled(MuiDrawer, { shouldForwardProp: (prop) => prop !== 'open'
8284
);
8385

8486
const TopBar = () => {
85-
const [state] = useContext(MainContext);
87+
const [state, d1] = useContext(MainContext);
88+
const { themeType, themeToggle } = state;
8689

8790
const [open, setOpen] = useState(false);
8891

@@ -132,6 +135,13 @@ const TopBar = () => {
132135
handleDrawerClose();
133136
};
134137

138+
/**
139+
* Change the theme style
140+
*/
141+
const changeThemeStyle = () => {
142+
d1(setThemeType(themeType === 'dark' ? 'light' : 'dark'));
143+
};
144+
135145
return (
136146
<>
137147
<AppBar
@@ -161,6 +171,16 @@ const TopBar = () => {
161171
>
162172
{language.applicationName}
163173
</Typography>
174+
<div style={{ flexGrow: 1 }} />
175+
{themeToggle ? (
176+
<IconButton
177+
aria-label={language.theme}
178+
color="inherit"
179+
onClick={changeThemeStyle}
180+
>
181+
{themeType === 'dark' ? <Brightness5Icon /> : <Brightness7Icon />}
182+
</IconButton>
183+
) : null}
164184
</Toolbar>
165185
</AppBar>
166186
<Drawer variant="permanent" open={open}>

src/contexts/MainContextProvider/index.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const threads = localStorage.threads ? parseFloat(localStorage.threads) : 1;
1616
const timeout = localStorage.timeout ? parseFloat(localStorage.timeout) : 250;
1717
const noClosed = localStorage.noClosed ? (localStorage.noClosed === 'true') : false;
1818
const sort = localStorage.sort ? (localStorage.sort === 'true') : true;
19+
const themeToggle = localStorage.themeToggle ? (localStorage.themeToggle === 'true') : true;
1920

2021
const initState = {
2122
autoUpdate,
@@ -44,6 +45,7 @@ const initState = {
4445
noClosed,
4546
sort,
4647
scanResults: null,
48+
themeToggle,
4749
};
4850

4951
export const MainContext = createContext(initState);

src/languages/en_us.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,6 @@
8080
"exportType": "Export type",
8181
"export": "Export",
8282
"exportSuccessful": "Export successful",
83-
"runningLatestVersion": "You are running the latest version."
83+
"runningLatestVersion": "You are running the latest version.",
84+
"themeToggleInTopBar": "Toggle theme in top bar"
8485
}

src/languages/es_es.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,6 @@
8080
"exportType": "Tipo de exportación",
8181
"export": "Exportar",
8282
"exportSuccessful": "Exportación exitosa",
83-
"runningLatestVersion": "Estás ejecutando la última versión."
83+
"runningLatestVersion": "Estás ejecutando la última versión.",
84+
"themeToggleInTopBar": "Alternar tema en la barra superior"
8485
}

src/languages/fr_fr.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,6 @@
8080
"exportType": "Type d'exportation",
8181
"export": "Exporter",
8282
"exportSuccessful": "Exportation réussie",
83-
"runningLatestVersion": "Vous utilisez la dernière version."
83+
"runningLatestVersion": "Vous utilisez la dernière version.",
84+
"themeToggleInTopBar": "Basculer le thème dans la barre supérieure"
8485
}

src/languages/nl_nl.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,6 @@
8080
"exportType": "Export type",
8181
"export": "Exporteren",
8282
"exportSuccessful": "Exporteren succesvol",
83-
"runningLatestVersion": "U gebruikt de laatste versie."
83+
"runningLatestVersion": "U gebruikt de laatste versie.",
84+
"themeToggleInTopBar": "Thema toggle in de bovenste balk"
8485
}

0 commit comments

Comments
 (0)