Wire Tauri AppImage to native keyring
This commit is contained in:
@@ -0,0 +1 @@
|
||||
target/
|
||||
Generated
+4305
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,20 @@
|
||||
[package]
|
||||
name = "trixy-linux-client"
|
||||
version = "0.1.0"
|
||||
description = "Trixie Linux client"
|
||||
authors = ["ReaperOfVeriod"]
|
||||
license = "MIT"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
name = "trixy_linux_client_lib"
|
||||
crate-type = ["staticlib", "cdylib", "rlib"]
|
||||
|
||||
[build-dependencies]
|
||||
tauri-build = { version = "2", features = [] }
|
||||
|
||||
[dependencies]
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
tauri = { version = "2", features = [] }
|
||||
trixy-native = { path = "../native" }
|
||||
@@ -0,0 +1,3 @@
|
||||
fn main() {
|
||||
tauri_build::build()
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
{}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 5.7 KiB |
@@ -0,0 +1,5 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128">
|
||||
<rect width="128" height="128" rx="20" fill="#081018"/>
|
||||
<path d="M64 18 104 64 64 110 24 64Z" fill="none" stroke="#00b9f2" stroke-width="8"/>
|
||||
<path d="M64 36 88 64 64 92 40 64Z" fill="#182b3a" stroke="#00b9f2" stroke-width="4"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 305 B |
@@ -0,0 +1,65 @@
|
||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
||||
|
||||
use std::path::PathBuf;
|
||||
use trixy_native::{clear_session, default_settings_path, load_session, store_session, Settings};
|
||||
|
||||
fn error_message(error: std::io::Error) -> String {
|
||||
error.to_string()
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
fn load_client_settings() -> Result<Settings, String> {
|
||||
let path = default_settings_path();
|
||||
if !path.exists() {
|
||||
return Ok(Settings {
|
||||
server_address: "http://127.0.0.1:8787".to_string(),
|
||||
username: String::new(),
|
||||
});
|
||||
}
|
||||
Settings::load(path).map_err(error_message)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
fn save_client_settings(settings: Settings) -> Result<(), String> {
|
||||
if settings.server_address.trim().is_empty() || settings.username.trim().is_empty() {
|
||||
return Err("Server address and username are required.".to_string());
|
||||
}
|
||||
Settings::save(&settings, default_settings_path()).map_err(error_message)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
fn load_server_session(settings: Settings) -> Result<Option<String>, String> {
|
||||
load_session(&settings).map_err(error_message)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
fn store_server_session(settings: Settings, session: String) -> Result<(), String> {
|
||||
store_session(&settings, &session).map_err(error_message)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
fn clear_server_session(settings: Settings) -> Result<(), String> {
|
||||
clear_session(&settings).map_err(error_message)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
fn client_settings_path() -> String {
|
||||
PathBuf::from(default_settings_path())
|
||||
.to_string_lossy()
|
||||
.into_owned()
|
||||
}
|
||||
|
||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||
pub fn run() {
|
||||
tauri::Builder::default()
|
||||
.invoke_handler(tauri::generate_handler![
|
||||
load_client_settings,
|
||||
save_client_settings,
|
||||
load_server_session,
|
||||
store_server_session,
|
||||
clear_server_session,
|
||||
client_settings_path
|
||||
])
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running Trixie client");
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fn main() {
|
||||
trixy_linux_client_lib::run();
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"$schema": "https://schema.tauri.app/config/2",
|
||||
"productName": "Trixie",
|
||||
"version": "0.1.0",
|
||||
"identifier": "nl.reaperofveriod.trixie",
|
||||
"build": {
|
||||
"beforeDevCommand": "npm run dev -- --host 127.0.0.1",
|
||||
"devUrl": "http://127.0.0.1:5173",
|
||||
"beforeBuildCommand": "npm run build",
|
||||
"frontendDist": "../dist"
|
||||
},
|
||||
"app": {
|
||||
"windows": [
|
||||
{
|
||||
"title": "Trixie",
|
||||
"width": 1366,
|
||||
"height": 768,
|
||||
"minWidth": 1024,
|
||||
"minHeight": 640,
|
||||
"resizable": true
|
||||
}
|
||||
],
|
||||
"security": {
|
||||
"csp": "default-src 'self' http://127.0.0.1:8787 ws://127.0.0.1:8787 https://*.twitch.tv https://*.twitchcdn.net https://cdn.7tv.app; connect-src 'self' http: https: ws: wss:; img-src 'self' data: https:; frame-src https://player.twitch.tv; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline'"
|
||||
}
|
||||
},
|
||||
"bundle": {
|
||||
"active": true,
|
||||
"icon": ["icons/icon.png", "icons/icon.svg"],
|
||||
"targets": ["appimage"],
|
||||
"linux": {
|
||||
"deb": { "depends": [] }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user