-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tauri) initial configuration through quasar.conf.js (#16)
* feat(proton) configure webview from quasar provided config.json * feat(config) window config * feat(config) rename serverless to embeddedServer * feat(config) embedded server host and port config * feat(template) q-app inlines assets on output index.html * feat(proton) move server code to lib * fix(template) misc fixes
- Loading branch information
1 parent
824f808
commit 3b272ba
Showing
9 changed files
with
124 additions
and
51 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,3 +59,7 @@ typings/ | |
debug.log | ||
package-lock.json | ||
.vscode/settings.json | ||
|
||
# Quasar output | ||
bundle.json | ||
config.json |
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
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,74 @@ | ||
#[derive(Deserialize)] | ||
#[serde(tag = "window", rename_all = "camelCase")] | ||
pub struct WindowConfig { | ||
#[serde(default = "default_width")] | ||
pub width: i32, | ||
#[serde(default = "default_height")] | ||
pub height: i32, | ||
#[serde(default = "default_resizable")] | ||
pub resizable: bool, | ||
#[serde(default = "default_title")] | ||
pub title: String, | ||
} | ||
|
||
fn default_width() -> i32 { | ||
800 | ||
} | ||
|
||
fn default_height() -> i32 { | ||
600 | ||
} | ||
|
||
fn default_resizable() -> bool { | ||
true | ||
} | ||
|
||
fn default_title() -> String { | ||
"Quasar Tauri App".to_string() | ||
} | ||
|
||
fn default_window() -> WindowConfig { | ||
return WindowConfig { | ||
width: default_width(), | ||
height: default_height(), | ||
resizable: default_resizable(), | ||
title: default_title(), | ||
}; | ||
} | ||
|
||
#[derive(Deserialize)] | ||
#[serde(tag = "embeddedServer", rename_all = "camelCase")] | ||
pub struct EmbeddedServerConfig { | ||
#[serde(default = "default_host")] | ||
pub host: String, | ||
#[serde(default = "default_port")] | ||
pub port: String | ||
} | ||
|
||
fn default_host() -> String { | ||
"http://127.0.0.1".to_string() | ||
} | ||
|
||
fn default_port() -> String { | ||
"random".to_string() | ||
} | ||
|
||
fn default_embedded_server() -> EmbeddedServerConfig { | ||
EmbeddedServerConfig { | ||
host: default_host(), | ||
port: default_port() | ||
} | ||
} | ||
|
||
#[derive(Deserialize)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct Config { | ||
#[serde(default = "default_window")] | ||
pub window: WindowConfig, | ||
#[serde(default = "default_embedded_server")] | ||
pub embedded_server: EmbeddedServerConfig | ||
} | ||
|
||
pub fn get() -> Config { | ||
serde_json::from_str(include_str!("../../../config.json")).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
File renamed without changes.
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