Stuff
This commit is contained in:
parent
ce3a2850ce
commit
d7d6a32334
6 changed files with 72 additions and 35 deletions
38
src-tauri/Cargo.lock
generated
38
src-tauri/Cargo.lock
generated
|
@ -2,6 +2,25 @@
|
||||||
# It is not intended for manual editing.
|
# It is not intended for manual editing.
|
||||||
version = 4
|
version = 4
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "NEIN"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"chrono",
|
||||||
|
"curl",
|
||||||
|
"openssl",
|
||||||
|
"rand 0.8.5",
|
||||||
|
"ring-compat",
|
||||||
|
"rusqlite",
|
||||||
|
"serde",
|
||||||
|
"serde_json",
|
||||||
|
"tauri",
|
||||||
|
"tauri-build",
|
||||||
|
"tauri-plugin-fs",
|
||||||
|
"tauri-plugin-opener",
|
||||||
|
"tokio",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "addr2line"
|
name = "addr2line"
|
||||||
version = "0.24.2"
|
version = "0.24.2"
|
||||||
|
@ -304,25 +323,6 @@ dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "bkbh"
|
|
||||||
version = "0.1.0"
|
|
||||||
dependencies = [
|
|
||||||
"chrono",
|
|
||||||
"curl",
|
|
||||||
"openssl",
|
|
||||||
"rand 0.8.5",
|
|
||||||
"ring-compat",
|
|
||||||
"rusqlite",
|
|
||||||
"serde",
|
|
||||||
"serde_json",
|
|
||||||
"tauri",
|
|
||||||
"tauri-build",
|
|
||||||
"tauri-plugin-fs",
|
|
||||||
"tauri-plugin-opener",
|
|
||||||
"tokio",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "block"
|
name = "block"
|
||||||
version = "0.1.6"
|
version = "0.1.6"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "bkbh"
|
name = "NEIN"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
description = "A Tauri App"
|
description = "Buchhaltung für „Darmstadt sagt Nein zur Bezahlkarte!“"
|
||||||
authors = ["Bianca Fürstenau"]
|
authors = ["Bianca Fürstenau"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
|
|
|
@ -101,13 +101,15 @@ async fn push_key(id: &u64, key: &SigningKey) -> Result<(), ()> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn push_db(id: &u64, db: &Connection) -> Result<(), ()> {
|
fn push_db(id: &u64, db: &Connection, app: tauri::AppHandle) -> Result<(), ()> {
|
||||||
let file = format!("{:016X}.sqlite", id);
|
let filename = format!("{:016X}.sqlite", id);
|
||||||
db.backup(DatabaseName::Main, "tmp.sqlite", None)
|
let path = app.path().resolve(&filename, tauri::path::BaseDirectory::Temp)
|
||||||
.map_err(|e| println!("{:?}", e))?;
|
.map_err(|e| println!("{:?}", e))?;
|
||||||
let buf = std::fs::read("tmp.sqlite")
|
db.backup(DatabaseName::Main, &path, None)
|
||||||
.map_err(|e| println!("{:?}", e))?;
|
.map_err(|e| println!("{:?}", e))?;
|
||||||
let mut client = put_client(&file, buf.as_ref())?;
|
let buf = std::fs::read(&path)
|
||||||
|
.map_err(|e| println!("{:?}", e))?;
|
||||||
|
let mut client = put_client(&filename, buf.as_ref())?;
|
||||||
let perf = client.perform()
|
let perf = client.perform()
|
||||||
.map_err(|e| println!("{:?}", e))?;
|
.map_err(|e| println!("{:?}", e))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
|
@ -115,10 +117,11 @@ fn push_db(id: &u64, db: &Connection) -> Result<(), ()> {
|
||||||
|
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
pub async fn push_data(
|
pub async fn push_data(
|
||||||
|
app: tauri::AppHandle,
|
||||||
state: State<'_, Mutex<AppState>>,
|
state: State<'_, Mutex<AppState>>,
|
||||||
) -> Result<(), ()> {
|
) -> Result<(), ()> {
|
||||||
let state = state.lock().await;
|
let state = state.lock().await;
|
||||||
push_key(&state.id, &state.key).await?;
|
push_key(&state.id, &state.key).await?;
|
||||||
push_db(&state.id, &state.db);
|
push_db(&state.id, &state.db, app);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
BIN
src/assets/hessen_sagt_nein.otf
Normal file
BIN
src/assets/hessen_sagt_nein.otf
Normal file
Binary file not shown.
|
@ -9,7 +9,8 @@
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<main class="container">
|
<main class="v-container">
|
||||||
|
<div class="h-container">
|
||||||
<form class="column" id="aldi-form">
|
<form class="column" id="aldi-form">
|
||||||
<button type="submit">
|
<button type="submit">
|
||||||
<img
|
<img
|
||||||
|
@ -64,19 +65,32 @@
|
||||||
/>
|
/>
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
</main>
|
</div>
|
||||||
<p id="cnt-msg"></p>
|
<div class="h-container">
|
||||||
<main class="container">
|
<form class="column" id="storno-form">
|
||||||
<form class="column" id="push-form">
|
<button type="submit" id="storno-button">
|
||||||
|
Storno
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
<form class="column" id="tara-form">
|
||||||
<button type="submit">
|
<button type="submit">
|
||||||
|
Tara
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<p id="cnt-msg"></p>
|
||||||
|
<div class="h-container">
|
||||||
|
<form class="column" id="push-form">
|
||||||
|
<button type="submit" class="shout">
|
||||||
↑
|
↑
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
<form class="column" id="pull-form">
|
<form class="column" id="pull-form">
|
||||||
<button type="submit">
|
<button type="submit" class="shout">
|
||||||
↓
|
↓
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
</div>
|
||||||
</main>
|
</main>
|
||||||
<p id="pull-msg"></p>
|
<p id="pull-msg"></p>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
|
@font-face {
|
||||||
|
font-family: hessenSagtNein;
|
||||||
|
src: url(assets/hessen_sagt_nein.otf);
|
||||||
|
}
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
|
font-family: Noto Sans, sans-serif;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
line-height: 24px;
|
line-height: 24px;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
@ -14,7 +19,7 @@
|
||||||
-webkit-text-size-adjust: 100%;
|
-webkit-text-size-adjust: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.container {
|
.h-container {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
@ -24,6 +29,16 @@
|
||||||
gap: 3mm;
|
gap: 3mm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.v-container {
|
||||||
|
margin: auto;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-around;
|
||||||
|
text-align: center;
|
||||||
|
gap: 3mm;
|
||||||
|
}
|
||||||
|
|
||||||
.logo {
|
.logo {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
padding: 0em 0em;
|
padding: 0em 0em;
|
||||||
|
@ -76,6 +91,11 @@ button {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.shout {
|
||||||
|
font-size: 1.2cm;
|
||||||
|
font-family: hessenSagtNein;
|
||||||
|
}
|
||||||
|
|
||||||
button:hover {
|
button:hover {
|
||||||
border-color: #396cd8;
|
border-color: #396cd8;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue