Skip to content

Commit 352cc93

Browse files
authored
feat: support tariui (#5)
1 parent 828435f commit 352cc93

File tree

99 files changed

+3239
-278
lines changed

Some content is hidden

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

99 files changed

+3239
-278
lines changed

Cargo.lock

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

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[workspace]
2-
members = ["crates/lynx-core", "crates/lynx-proxy", "crates/lynx-cli"]
2+
members = ["crates/lynx-core", "crates/lynx-proxy/src-tauri", "crates/lynx-cli"]
33
resolver = "2"
44

55
[workspace.package]
File renamed without changes.
File renamed without changes.
File renamed without changes.

crates/lynx-proxy/Cargo.toml

-20
This file was deleted.
File renamed without changes.

ui/mock/__self_service_path__/utils/mockData.ts crates/lynx-proxy/mock/__self_service_path__/utils/mockData.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const mockData = (id?: number) => {
99
return Mock.mock({
1010
id: uid,
1111
uri:
12-
'@pick(["http","https"])://abc.com/ffff/@pick(["a","b","c"])/' +
12+
'@pick(["http","https"])://abc.com/ffff/@word(10)/@pick(["a","b","c"])/' +
1313
type.path +"?"+ "@word()=" + "@word()",
1414
traceId: '@guid',
1515
method: '@pick(["GET", "POST", "PUT", "DELETE"])',

ui/package.json crates/lynx-proxy/package.json

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"react": "^19.0.0",
3434
"react-dom": "^19.0.0",
3535
"react-redux": "^9.2.0",
36+
"react-split": "^2.0.14",
3637
"react-virtualized": "^9.22.6",
3738
"react18-json-view": "0.2.9-canary.9",
3839
"thememirror": "^2.0.1",
@@ -45,6 +46,7 @@
4546
"@rsbuild/core": "^1.1.8",
4647
"@rsbuild/plugin-react": "^1.0.7",
4748
"@tanstack/router-plugin": "^1.97.3",
49+
"@tauri-apps/cli": "^2.2.7",
4850
"@types/mockjs": "^1.0.10",
4951
"@types/node": "^22.10.8",
5052
"@types/pretty-time": "^1.1.5",

ui/pnpm-lock.yaml crates/lynx-proxy/pnpm-lock.yaml

+107
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Generated by Cargo
2+
# will have compiled files and executables
3+
/target/
4+
/gen/schemas
+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[package]
2+
name = "lynx-proxy"
3+
version.workspace = true
4+
authors.workspace = true
5+
description.workspace = true
6+
edition.workspace = true
7+
license.workspace = true
8+
documentation.workspace = true
9+
homepage.workspace = true
10+
repository.workspace = true
11+
publish = false
12+
rust-version = "1.77.2"
13+
14+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
15+
16+
[lib]
17+
name = "app_lib"
18+
crate-type = ["staticlib", "cdylib", "rlib"]
19+
20+
[build-dependencies]
21+
tauri-build = { version = "2.0.4", features = [] }
22+
23+
[dependencies]
24+
serde_json = "1.0"
25+
serde = { version = "1.0", features = ["derive"] }
26+
log = "0.4"
27+
tauri = { version = "2.2.4", features = [] }
28+
tauri-plugin-log = "2.0.0-rc"

crates/lynx-proxy/src-tauri/build.rs

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn main() {
2+
tauri_build::build()
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "../gen/schemas/desktop-schema.json",
3+
"identifier": "default",
4+
"description": "enables the default permissions",
5+
"windows": [
6+
"main"
7+
],
8+
"permissions": [
9+
"core:default"
10+
]
11+
}
10.8 KB
22.6 KB
2.17 KB
3.88 KB
271 KB
Binary file not shown.
36.8 KB
Binary file not shown.
48.8 KB
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#[cfg_attr(mobile, tauri::mobile_entry_point)]
2+
pub fn run() {
3+
tauri::Builder::default()
4+
.setup(|app| {
5+
if cfg!(debug_assertions) {
6+
app.handle().plugin(
7+
tauri_plugin_log::Builder::default()
8+
.level(log::LevelFilter::Info)
9+
.build(),
10+
)?;
11+
}
12+
Ok(())
13+
})
14+
.run(tauri::generate_context!())
15+
.expect("error while running tauri application");
16+
}
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
2+
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
3+
4+
fn main() {
5+
app_lib::run();
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
3+
"productName": "lynx-proxy",
4+
"version": "0.1.0",
5+
"identifier": "com.tauri.dev",
6+
"build": {
7+
"frontendDist": "../dist",
8+
"devUrl": "http://localhost:8080",
9+
"beforeDevCommand": "pnpm dev",
10+
"beforeBuildCommand": "pnpm build"
11+
},
12+
"app": {
13+
"windows": [
14+
{
15+
"title": "lynx-proxy",
16+
"width": 1000,
17+
"height": 800,
18+
"resizable": true,
19+
"fullscreen": false
20+
}
21+
],
22+
"security": {
23+
"csp": null
24+
}
25+
},
26+
"bundle": {
27+
"active": true,
28+
"targets": "all",
29+
"icon": [
30+
"icons/32x32.png",
31+
"icons/128x128.png",
32+
"icons/128x128@2x.png",
33+
"icons/icon.icns",
34+
"icons/icon.ico"
35+
]
36+
}
37+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

ui/src/main.css crates/lynx-proxy/src/main.css

+9
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
#root {
1111
display: flex;
1212
flex-direction: column;
13+
max-height: 100vh;
1314
height: 100vh;
15+
min-height: 600px;
16+
min-width: 800px;
1417
}
1518

1619
* {
@@ -19,3 +22,9 @@
1922
body {
2023
margin: 0;
2124
}
25+
26+
27+
.ant-table-tbody-virtual-scrollbar,.ant-tree-list-scrollbar{
28+
width: 4px !important;
29+
}
30+

crates/lynx-proxy/src/main.rs

-25
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

ui/src/routes/network/components/RequestTable/index.tsx crates/lynx-proxy/src/routes/network/components/RequestTable/index.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const columns: ColumnsType<IRequestModel> = [
3838
title: 'Path',
3939
key: 'uri',
4040
dataIndex: 'uri',
41-
ellipsis: { showTitle: true, },
41+
ellipsis: { showTitle: true },
4242
},
4343
];
4444
export const RequestTable: React.FC = () => {
@@ -64,7 +64,7 @@ export const RequestTable: React.FC = () => {
6464

6565
return (
6666
<div
67-
className="flex-1 bg-white flex flex-col relative h-full overflow-hidden"
67+
className="flex-1 bg-red flex flex-col relative h-full w-full overflow-hidden"
6868
ref={ref}
6969
>
7070
{!autoScroll && (
@@ -109,7 +109,7 @@ export const RequestTable: React.FC = () => {
109109
}
110110
}}
111111
virtual
112-
scroll={{ x: size?.width ?? 800, y: size?.height ?? 400 }}
112+
scroll={{ x: 800, y: size?.height ?? 400 }}
113113
pagination={false}
114114
dataSource={requestTable}
115115
/>

0 commit comments

Comments
 (0)