Skip to content

Commit f548fb5

Browse files
committed
Fix build
1 parent ff18052 commit f548fb5

4 files changed

Lines changed: 29 additions & 15 deletions

File tree

new-ui/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"@tauri-apps/plugin-http": "^2.5.9",
2424
"@tauri-apps/plugin-log": "^2.8.0",
2525
"@uidotdev/usehooks": "^2.4.1",
26+
"byte-size": "^9.0.1",
2627
"chart.js": "^4.5.1",
2728
"clsx": "^2.1.1",
2829
"dayjs": "^1.11.20",
@@ -39,6 +40,7 @@
3940
},
4041
"devDependencies": {
4142
"@tanstack/devtools-vite": "^0.7.0",
43+
"@types/byte-size": "^8.1.2",
4244
"@types/node": "^25.8.0",
4345
"@types/react": "^19.2.14",
4446
"@types/react-dom": "^19.2.3",

new-ui/pnpm-lock.yaml

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

src-tauri/src/bin/defguard-client.rs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ use defguard_client::{
3333
LOG_FILENAME, VERSION,
3434
};
3535
use log::{Level, LevelFilter};
36-
use tauri::{AppHandle, Builder, Manager, RunEvent, WebviewUrl, WebviewWindowBuilder, WindowEvent};
36+
use tauri::{AppHandle, Builder, Manager, RunEvent, WebviewWindowBuilder, WindowEvent};
3737
use tauri_plugin_log::{Target, TargetKind};
3838

3939
#[macro_use]
@@ -348,24 +348,14 @@ fn main() {
348348
app.manage(state);
349349

350350
// Open new UI window.
351-
let new_url = if cfg!(defguard_client_dev) {
352-
WebviewUrl::External("http://localhost:5072".parse().unwrap())
353-
} else {
354-
WebviewUrl::App("new-ui/".into())
355-
};
356-
WebviewWindowBuilder::new(app, NEW_UI_WINDOW_ID, new_url)
351+
WebviewWindowBuilder::new(app, NEW_UI_WINDOW_ID, new_ui_url())
357352
.title("New UI")
358353
.inner_size(NEW_UI_WIDTH, NEW_UI_HEIGHT)
359354
.visible(false)
360355
.build()?;
361356

362357
// Open old UI window.
363-
let old_url = if cfg!(defguard_client_dev) {
364-
WebviewUrl::External("http://localhost:5071".parse().unwrap())
365-
} else {
366-
WebviewUrl::App("old-ui/index.html/".into())
367-
};
368-
WebviewWindowBuilder::new(app, OLD_UI_WINDOW_ID, old_url)
358+
WebviewWindowBuilder::new(app, OLD_UI_WINDOW_ID, old_ui_url())
369359
.title("Old UI")
370360
.inner_size(OLD_UI_WIDTH, OLD_UI_HEIGHT)
371361
.build()?;

src-tauri/src/window.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ pub const NEW_UI_HEIGHT: f64 = 675.0;
1212
pub const OLD_UI_WIDTH: f64 = 920.0;
1313
pub const OLD_UI_HEIGHT: f64 = 720.0;
1414

15-
fn new_ui_url() -> WebviewUrl {
15+
pub fn new_ui_url() -> WebviewUrl {
1616
if cfg!(defguard_client_dev) {
1717
WebviewUrl::External("http://localhost:5072".parse().unwrap())
1818
} else {
1919
WebviewUrl::App("new-ui/".into())
2020
}
2121
}
2222

23-
fn old_ui_url() -> WebviewUrl {
23+
pub fn old_ui_url() -> WebviewUrl {
2424
if cfg!(defguard_client_dev) {
2525
WebviewUrl::External("http://localhost:5071".parse().unwrap())
2626
} else {

0 commit comments

Comments
 (0)