forked from pljhonglu/ChatGPT-T
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
jianghonglu.neo
committed
Mar 23, 2023
1 parent
ca87447
commit 8ed5a77
Showing
14 changed files
with
202 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
pub mod gpt; | ||
pub mod download; | ||
pub mod download; | ||
pub mod window; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
use tauri::{Manager}; | ||
|
||
#[tauri::command] | ||
pub fn new_window(app: tauri::AppHandle, label: String, title: String, url: String){ | ||
let win = app.get_window(&label); | ||
|
||
if win.is_none() { | ||
tauri::async_runtime::spawn(async move { | ||
tauri::WindowBuilder::new(&app, label, tauri::WindowUrl::App(url.parse().unwrap())) | ||
.title(title) | ||
.inner_size(700.0, 550.0) | ||
.resizable(true) | ||
.build() | ||
.unwrap(); | ||
}); | ||
} else if let Some(v) = win { | ||
if !v.is_visible().unwrap() { | ||
v.show().unwrap(); | ||
} | ||
v.eval("window.location.reload()").unwrap(); | ||
v.set_focus().unwrap(); | ||
} | ||
} | ||
|
||
#[tauri::command] | ||
pub fn window_reload(app: tauri::AppHandle, label: &str) { | ||
app | ||
.app_handle() | ||
.get_window(label) | ||
.unwrap() | ||
.eval("window.location.reload()") | ||
.unwrap(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.