let's do another build

This commit is contained in:
Michael Zhang 2023-06-15 00:51:28 -05:00
parent 84e5c926df
commit ae4cc8cfe6
9 changed files with 69 additions and 19 deletions

View file

@ -1,7 +1,7 @@
{
"name": "houhou",
"private": true,
"version": "0.1.0",
"version": "0.1.0-rc2",
"type": "module",
"scripts": {
"dev": "vite",

2
src-tauri/Cargo.lock generated
View file

@ -1635,7 +1635,7 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
[[package]]
name = "houhou"
version = "0.1.0"
version = "0.1.0-rc2"
dependencies = [
"anyhow",
"base64 0.21.2",

View file

@ -1,8 +1,8 @@
[package]
name = "houhou"
version = "0.1.0"
description = "A Tauri App"
authors = ["you"]
version = "0.1.0-rc2"
description = "Houhou SRS"
authors = ["Michael Zhang <mail@mzhang.io>"]
license = ""
repository = ""
edition = "2021"
@ -14,7 +14,7 @@ members = ["database-maker"]
tauri-build = { version = "1.3", features = [] }
[dependencies]
tauri = { version = "1.3", features = ["notification-all", "shell-open", "system-tray"] }
tauri = { version = "1.3", features = [ "app-all", "notification-all", "shell-open", "system-tray"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
dirs = "5.0.1"

View file

@ -1,3 +1,5 @@
pub mod query;
use std::{collections::HashMap, io::Read, path::PathBuf};
use base64::{engine::general_purpose, Engine as _};

View file

@ -0,0 +1 @@
pub struct KanjiQuery {}

View file

@ -88,6 +88,16 @@ async fn main() -> Result<()> {
_ => {}
})
.on_system_tray_event(|app, event| match event {
SystemTrayEvent::LeftClick {
tray_id,
position,
size,
..
} => {
if let Some(main_window) = app.get_window("main") {
main_window.show();
}
}
SystemTrayEvent::MenuItemClick { id, .. } => match id.as_str() {
"quit" => {
process::exit(0);

View file

@ -8,11 +8,16 @@
},
"package": {
"productName": "houhou",
"version": "0.1.0"
"version": "0.1.0-rc2"
},
"tauri": {
"allowlist": {
"all": false,
"app": {
"all": true,
"hide": true,
"show": true
},
"shell": {
"all": false,
"open": true

View file

@ -0,0 +1,4 @@
.main {
padding: 16px;
width: 100%;
}

View file

@ -1,6 +1,10 @@
import { invoke } from "@tauri-apps/api/tauri";
import useSWR from "swr";
import SelectOnClick from "../components/utils/SelectOnClick";
import styles from "./SettingsPane.module.scss";
import { Button, Table, Td, Tr } from "@chakra-ui/react";
import { getVersion } from "@tauri-apps/api/app";
import { useEffect, useState } from "react";
interface ApplicationInfo {
kanji_db_path: string;
@ -12,19 +16,43 @@ export function Component() {
invoke<ApplicationInfo>("application_info"),
);
const [version, setVersion] = useState("");
useEffect(() => {
getVersion().then((result) => setVersion(result));
}, []);
return (
<>
<ul>
<li>
Kanji DB path:
<SelectOnClick>{info?.kanji_db_path}</SelectOnClick>
</li>
<li>
SRS DB path:
<SelectOnClick>{info?.srs_db_path}</SelectOnClick>
</li>
</ul>
</>
<main className={styles.main}>
<Table>
<Tr>
<Td>Kanji DB Path</Td>
<Td>
<SelectOnClick>{info?.kanji_db_path}</SelectOnClick>
</Td>
</Tr>
<Tr>
<Td>SRS DB Path</Td>
<Td>
<SelectOnClick>{info?.srs_db_path}</SelectOnClick>
</Td>
</Tr>
<Tr>
<Td>Links</Td>
<Td>
<a href="https://git.mzhang.io/michael/houhou" target="_blank" rel="noopener">
<Button>Source Code</Button>
</a>
</Td>
</Tr>
<Tr>
<Td>Version</Td>
<Td>{version}</Td>
</Tr>
</Table>
</main>
);
}