Skip to content

Commit d7e860e

Browse files
refactor: new ui with chakra ui v3 (#338)
* chore(deps): update dependency @chakra-ui/react to v3 * WIP: new layout * adjusts * refactor: new ui with chakra ui v3 * refactor: new ui with chakra ui v3 * refactor: new ui with chakra ui v3 * refactor: new ui with chakra ui v3 * refactor: new ui with chakra ui v3 * fix: toast and cross platform theme * fix: toast and cross platform theme * fix: toast and cross platform theme * fix: toast and cross platform theme * refactor: new ui with chakra ui v3 * refactor: new ui with chakra ui v3 * refactor: new ui with chakra ui v3 * refactor: new ui with chakra ui v3 * refactor: new ui with chakra ui v3 * refactor: new ui with chakra ui v3 * refactor: new ui with chakra ui v3 --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
1 parent c65c2d8 commit d7e860e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+7531
-3352
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ target*/*
2727
target*
2828
frontend/dist/*
2929
!frontend/dist/.gitkeep
30+
package-lock.json

Cargo.lock

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/kftray-portforward/src/client.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ async fn create_rustls_https_connector(
349349
Ok(client)
350350
}
351351

352-
async fn create_insecure_http_client<'a>(
352+
async fn create_insecure_http_client(
353353
config: &Config,
354354
) -> Result<Client, Box<dyn std::error::Error + Send + Sync>> {
355355
let http_connector = HttpConnector::new();
@@ -458,7 +458,7 @@ pub async fn get_services_with_annotation(
458458
let annotations = service.metadata.annotations.clone()?;
459459
if annotations
460460
.get("kftray.app/enabled")
461-
.map_or(false, |v| v == "true")
461+
.is_some_and(|v| v == "true")
462462
{
463463
let ports = extract_ports_from_service(&service);
464464
let annotations_hashmap: HashMap<String, String> =

crates/kftray-portforward/src/core.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -533,10 +533,7 @@ pub async fn stop_port_forward(config_id: String) -> Result<CustomResponse, Stri
533533

534534
match kftray_commons::config::get_configs().await {
535535
Ok(configs) => {
536-
if let Some(config) = configs
537-
.iter()
538-
.find(|c| c.id.map_or(false, |id| id == config_id_parsed))
539-
{
536+
if let Some(config) = configs.iter().find(|c| c.id == Some(config_id_parsed)) {
540537
if config.domain_enabled.unwrap_or_default() {
541538
let hostfile_comment = format!(
542539
"kftray custom host for {} - {}",

crates/kftray-server/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "kftray-server"
3-
version = "0.14.9"
3+
version = "0.15.0"
44
description = "KFtray Server is a Rust application that relays UDP/TCP traffic to an upstream server"
55
authors = [
66
"Henrique Cavarsan <hencavarsan@gmail.com>",

crates/kftray-tauri/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "kftray-tauri"
3-
version = "0.14.9"
3+
version = "0.15.0"
44
description = "A cross-platform system tray app for Kubernetes port-forward management"
55
authors = ["Henrique Cavarsan <hencavarsan@gmail.com>"]
66
license = "MIT"

crates/kftray-tauri/tauri.conf.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"package": {
1010
"productName": "kftray",
11-
"version": "0.14.9"
11+
"version": "0.15.0"
1212
},
1313
"tauri": {
1414
"allowlist": {

crates/kftui/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "kftui"
3-
version = "0.14.9"
3+
version = "0.15.0"
44
description = "KFtray TUI is a Rust application that manage multiple kubectl port forward configurations"
55
authors = [
66
"Henrique Cavarsan <hencavarsan@gmail.com>",
@@ -67,4 +67,4 @@ built = "0.7.5"
6767

6868

6969
[build-dependencies]
70-
built = "0.7"
70+
built = "0.7"

docs/kftray/INSTALL.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,22 @@ Linux Note: due to GTK limitations, it is necessary to install and enable the GN
3232
Download the latest release directly from GitHub:
3333

3434
<div align="left">
35-
<a href="https://github.com/hcavarsan/kftray/releases/latest/download/kftray_0.14.9_universal.dmg">
35+
<a href="https://github.com/hcavarsan/kftray/releases/latest/download/kftray_0.15.0_universal.dmg">
3636
<img src="https://img.shields.io/badge/macOS-Universal-grey.svg?style=for-the-badge&logo=apple" alt="Download for macOS" />
3737
</a>
38-
<a href="https://github.com/hcavarsan/kftray/releases/latest/download/kftray_0.14.9_arm64-setup.exe">
38+
<a href="https://github.com/hcavarsan/kftray/releases/latest/download/kftray_0.15.0_arm64-setup.exe">
3939
<img src="https://img.shields.io/badge/Windows-ARM64-grey.svg?style=for-the-badge&logo=windows" alt="Download for Windows ARM64" />
4040
</a>
41-
<a href="https://github.com/hcavarsan/kftray/releases/latest/download/kftray_0.14.9_x64-setup.exe">
41+
<a href="https://github.com/hcavarsan/kftray/releases/latest/download/kftray_0.15.0_x64-setup.exe">
4242
<img src="https://img.shields.io/badge/Windows-x64-grey.svg?style=for-the-badge&logo=windows" alt="Download for Windows x64" />
4343
</a>
44-
<a href="https://github.com/hcavarsan/kftray/releases/latest/download/kftray_0.14.9_x86-setup.exe">
44+
<a href="https://github.com/hcavarsan/kftray/releases/latest/download/kftray_0.15.0_x86-setup.exe">
4545
<img src="https://img.shields.io/badge/Windows-x86-grey.svg?style=for-the-badge&logo=windows" alt="Download for Windows x86" />
4646
</a>
47-
<a href="https://github.com/hcavarsan/kftray/releases/latest/download/kftray_0.14.9_amd64.AppImage">
47+
<a href="https://github.com/hcavarsan/kftray/releases/latest/download/kftray_0.15.0_amd64.AppImage">
4848
<img src="https://img.shields.io/badge/Linux-x64-grey.svg?style=for-the-badge&logo=linux" alt="Download for Linux AMD64" />
4949
</a>
50-
<a href="https://github.com/hcavarsan/kftray/releases/latest/download/kftray_0.14.9_aarch64.AppImage">
50+
<a href="https://github.com/hcavarsan/kftray/releases/latest/download/kftray_0.15.0_aarch64.AppImage">
5151
<img src="https://img.shields.io/badge/Linux-ARM64-grey.svg?style=for-the-badge&logo=linux" alt="Download for Linux ARM64" />
5252
</a>
5353
</div>

frontend/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
tsconfig.tsbuildinfo
2+
package-lock.json

frontend/eslint.config.mjs

+3
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ export default [{
149149

150150
rules: {
151151
"react/prop-types": "off",
152+
"react/display-name": "off",
153+
"@typescript-eslint/no-empty-object-type": "off",
154+
"@typescript-eslint/no-explicit-any": "off",
152155

153156
"@typescript-eslint/no-unused-vars": ["warn", {
154157
argsIgnorePattern: "^_",

frontend/package.json

+13-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kftray/ui",
3-
"version": "0.14.9",
3+
"version": "0.15.0",
44
"private": true,
55
"type": "module",
66
"scripts": {
@@ -14,14 +14,17 @@
1414
"taze:minor": "taze minor -w"
1515
},
1616
"dependencies": {
17-
"@chakra-ui/icons": "^2.1.1",
18-
"@chakra-ui/react": "^2.8.2",
19-
"@emotion/styled": "^11.13.0",
17+
"@chakra-ui/react": "^3.1.1",
18+
"@chakra-ui/theme-tools": "^2.2.7",
19+
"@emotion/react": "^11.13.3",
2020
"@fortawesome/fontawesome-svg-core": "^6.6.0",
2121
"@fortawesome/free-solid-svg-icons": "^6.6.0",
2222
"@fortawesome/react-fontawesome": "^0.2.2",
2323
"@vitejs/plugin-react-swc": "^3.7.0",
24-
"framer-motion": "^11.9.0",
24+
"lodash": "^4.17",
25+
"@types/lodash": "^4.17",
26+
"lucide-react": "^0.456.0",
27+
"next-themes": "^0.4.3",
2528
"react": "^18.3.1",
2629
"react-dom": "^18.3.1",
2730
"react-icons": "^5.3.0",
@@ -35,9 +38,9 @@
3538
"@types/node": "^22.7.4",
3639
"@types/react": "^18.3.10",
3740
"@types/react-dom": "^18.3.0",
38-
"@typescript-eslint/eslint-plugin": "^8.7.0",
39-
"@typescript-eslint/parser": "^8.7.0",
40-
"@typescript-eslint/typescript-estree": "^8.11.0",
41+
"@typescript-eslint/eslint-plugin": "^8.14.0",
42+
"@typescript-eslint/parser": "^8.14.0",
43+
"@typescript-eslint/typescript-estree": "^8.14.0",
4144
"core-js": "^3.38.1",
4245
"eslint": "^9.11.1",
4346
"eslint-config-prettier": "^9.1.0",
@@ -50,6 +53,7 @@
5053
"react-query": "^3.39.3",
5154
"react-refresh": "^0.14.2",
5255
"typescript": "5.6.3",
53-
"vite": "^5.4.8"
56+
"vite": "^5.4.11",
57+
"vite-tsconfig-paths": "^5.1.2"
5458
}
5559
}

frontend/src/App.tsx

+2-11
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
11
import React from 'react'
22

3-
import { ChakraProvider } from '@chakra-ui/react'
4-
5-
import theme from './assets/theme'
6-
import Main from './components/Main'
7-
8-
import './assets/style.css'
3+
import Main from '@/components/Main'
94

105
const App: React.FC = () => {
11-
return (
12-
<ChakraProvider theme={theme}>
13-
<Main />
14-
</ChakraProvider>
15-
)
6+
return <Main />
167
}
178

189
export default App

frontend/src/assets/style.css

-49
This file was deleted.

frontend/src/assets/theme.ts

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import { createSystem, defineConfig } from '@chakra-ui/react'
2+
3+
const config = defineConfig({
4+
cssVarsRoot: ':where(:root, :host)',
5+
cssVarsPrefix: 'ck',
6+
theme: {
7+
semanticTokens: {
8+
colors: {
9+
'bg.app': { value: '#161616' },
10+
'bg.subtle': { value: '#1A1A1A' },
11+
'bg.button': { value: 'rgba(255, 255, 255, 0.05)' },
12+
'bg.buttonHover': { value: 'rgba(255, 255, 255, 0.1)' },
13+
14+
'border.default': { value: 'rgba(255, 255, 255, 0.08)' },
15+
'border.subtle': { value: 'rgba(255, 255, 255, 0.04)' },
16+
17+
'text.primary': { value: 'rgba(255, 255, 255, 0.92)' },
18+
'text.secondary': { value: 'rgba(255, 255, 255, 0.64)' },
19+
'text.disabled': { value: 'rgba(255, 255, 255, 0.32)' },
20+
},
21+
},
22+
recipes: {
23+
Button: {
24+
base: {
25+
color: 'text.primary',
26+
bg: 'bg.button',
27+
borderColor: 'border.default',
28+
_hover: {
29+
bg: 'bg.buttonHover',
30+
},
31+
_disabled: {
32+
opacity: 0.4,
33+
color: 'text.disabled',
34+
cursor: 'not-allowed',
35+
_hover: {
36+
bg: 'bg.button',
37+
},
38+
},
39+
},
40+
variants: {
41+
ghost: {
42+
true: {
43+
bg: 'bg.button',
44+
color: 'text.primary',
45+
_hover: {
46+
bg: 'bg.buttonHover',
47+
},
48+
},
49+
},
50+
},
51+
},
52+
},
53+
},
54+
})
55+
56+
export const system = createSystem(config)

frontend/src/assets/theme.tsx

-42
This file was deleted.

0 commit comments

Comments
 (0)