diff --git a/elebox-cli/src/category_cmd.rs b/elebox-cli/src/category_cmd.rs index b006d02..e75ee49 100644 --- a/elebox-cli/src/category_cmd.rs +++ b/elebox-cli/src/category_cmd.rs @@ -76,7 +76,7 @@ pub fn category_cmd(db: &dyn elebox_core::Database, cmd: &CategoryCommand) { // }; } Some(CategorySubCommand::Export(args)) => { - let _ = manager.export_csv(&args.path); + let _ = manager.export(&args.path); } None => { println!("List part category"); diff --git a/elebox-cli/src/main.rs b/elebox-cli/src/main.rs index 073e391..3127e68 100644 --- a/elebox-cli/src/main.rs +++ b/elebox-cli/src/main.rs @@ -53,9 +53,9 @@ fn main() { EntityType::Init => db.init(), EntityType::Part(cmd) => part_cmd(&db, cmd), EntityType::Category(cmd) => category_cmd(&db, cmd), - EntityType::Export(args) => elebox_core::export_csv(&db, &args.path), + EntityType::Export(args) => elebox_core::export(&db, &args.path), EntityType::Import(args) => { - let _ = elebox_core::import_csv(&args.path); + let _ = elebox_core::import(&args.path); } }; } diff --git a/elebox-cli/src/part_cmd.rs b/elebox-cli/src/part_cmd.rs index 5dc137d..b8d2d0b 100644 --- a/elebox-cli/src/part_cmd.rs +++ b/elebox-cli/src/part_cmd.rs @@ -116,10 +116,10 @@ pub fn part_cmd(db: &dyn elebox_core::Database, cmd: &PartCommand) { } } PartSubCommand::Export(args) => { - let _ = manager.export_csv(&args.path); + let _ = manager.export(&args.path); } PartSubCommand::Import(args) => { - let _ = manager.import_csv(&args.path); + let _ = manager.import(&args.path); } }, None => { diff --git a/elebox-core/Cargo.toml b/elebox-core/Cargo.toml index b6f8dbd..b0c96a8 100644 --- a/elebox-core/Cargo.toml +++ b/elebox-core/Cargo.toml @@ -11,8 +11,9 @@ edition = "2021" jammdb = "0.11.0" serde = { version = "1.0", features = ["derive"] } rmp-serde = "1.1.2" -uuid = { version = "1.5.0", features = ["v4", "fast-rng", "macro-diagnostics"] } +uuid = { version = "1.5.0", features = ["v7", "fast-rng", "macro-diagnostics"] } csv = "1.3.0" +serde_yaml = "0.9.34" [profile.release] lto = true diff --git a/elebox-core/src/backup.rs b/elebox-core/src/backup.rs new file mode 100644 index 0000000..b1379db --- /dev/null +++ b/elebox-core/src/backup.rs @@ -0,0 +1,50 @@ +use crate::{ + CategoryManager, Database, JammDatabase, ManufacturerManager, PackageManager, PartManager, +}; +use std::path::PathBuf; + +pub fn export(db: &dyn Database, path: &str) { + let filename_part = format!("{}{}", path, "elebox_export_parts.yaml"); + let _ = PartManager::new(db).export(&filename_part); + + let filename_cat = format!("{}{}", path, "elebox_export_categories.yaml"); + let _ = CategoryManager::new(db).export(&filename_cat); + + let filename_pkg = format!("{}{}", path, "elebox_export_packages.yaml"); + let _ = PackageManager::new(db).export(&filename_pkg); + + let filename_mfr = format!("{}{}", path, "elebox_export_mfrs.yaml"); + let _ = ManufacturerManager::new(db).export(&filename_mfr); +} + +pub fn import(path: &str) -> Result<(), String> { + let db_path = format!("{}{}", path, "import_elebox.db"); + let db = JammDatabase::new(&db_path); + db.init(); + + let filename_mfr = format!("{}{}", path, "elebox_export_mfrs.yaml"); + let res = ManufacturerManager::new(&db).import(&filename_mfr); + if res.is_err() { + return Err("Part".to_string()); + } + + let filename_pkg = format!("{}{}", path, "elebox_export_packages.yaml"); + let res = PackageManager::new(&db).import(&filename_pkg); + if res.is_err() { + return Err("Part".to_string()); + } + + let filename_cat = format!("{}{}", path, "elebox_export_categories.yaml"); + let res = CategoryManager::new(&db).import(&filename_cat); + if res.is_err() { + return Err("Part".to_string()); + } + + let filename_part = format!("{}{}", path, "elebox_export_parts.yaml"); + let res = PartManager::new(&db).import(&filename_part); + if res.is_err() { + return Err("Part".to_string()); + } + + Ok(()) +} diff --git a/elebox-core/src/category.rs b/elebox-core/src/category.rs index 8b02b8b..751c810 100644 --- a/elebox-core/src/category.rs +++ b/elebox-core/src/category.rs @@ -1,4 +1,4 @@ -use crate::{csv::*, db::*, errors::EleboxError}; +use crate::{csv::*, db::*, errors::EleboxError, yaml::*}; use serde::{Deserialize, Serialize}; use std::{collections::HashMap, fmt::Debug}; @@ -87,6 +87,13 @@ impl<'a> CategoryManager<'a> { )); } + if ori_name != &new_category.name && self.db.get_category_id(&new_category.name).is_some() { + return Err(EleboxError::AlreadyExists( + "Category".to_string(), + new_category.name.clone(), + )); + } + // Normalize let mut cat = Category { name: new_category.name.clone(), @@ -158,26 +165,36 @@ impl<'a> CategoryManager<'a> { Ok(()) } - pub fn export_csv(&self, filename: &str) -> Result<(), ()> { + pub fn export(&self, filename: &str) -> Result<(), ()> { let cats = self.list(); - let res = write_csv(filename, cats, None); + let res = write_yaml(filename, cats); return res; } - pub fn import_csv(&self, filename: &str) -> Result<(), ()> { - let res_parts = read_csv(filename, None); + pub fn import(&self, filename: &str) -> Result<(), ()> { + let res_parts = read_yaml(filename); if res_parts.is_err() { return Err(()); } let cats: Vec = res_parts.unwrap(); - for cat in cats { - let _ = self.add(&cat); + for cat in &cats { + self.add_recursion(cat, &cats); } Ok(()) } + fn add_recursion(&self, category: &Category, cats: &[Category]) -> Result<(), EleboxError> { + if let Some(parent_name) = &category.parent { + if let Some(parent_cat) = cats.iter().find(|c| c.name == *parent_name) { + self.add_recursion(parent_cat, cats); + } + } + + self.add(category) + } + fn to_node(&self, name: String, map: &HashMap>) -> TreeNode { let mut children = vec![]; diff --git a/elebox-core/src/lib.rs b/elebox-core/src/lib.rs index 54c2bf3..864c048 100644 --- a/elebox-core/src/lib.rs +++ b/elebox-core/src/lib.rs @@ -1,3 +1,4 @@ +mod backup; mod category; mod csv; mod db; @@ -6,6 +7,7 @@ mod errors; mod manufacturer; mod package; mod part; +mod yaml; pub use category::*; pub use db::CustomField; @@ -17,50 +19,6 @@ pub use manufacturer::*; pub use package::*; pub use part::*; +pub use backup::export; +pub use backup::import; pub use default_db::create_default_db; - -pub fn export_csv(db: &dyn Database, path: &str) { - let filename_part = format!("{}{}", path, "elebox_export_parts.tsv"); - let _ = PartManager::new(db).export_csv(&filename_part); - - let filename_cat = format!("{}{}", path, "elebox_export_categories.tsv"); - let _ = CategoryManager::new(db).export_csv(&filename_cat); - - let filename_pkg = format!("{}{}", path, "elebox_export_packages.tsv"); - let _ = PackageManager::new(db).export_csv(&filename_pkg); - - let filename_mfr = format!("{}{}", path, "elebox_export_mfrs.tsv"); - let _ = ManufacturerManager::new(db).export_csv(&filename_mfr); -} - -pub fn import_csv(path: &str) -> Result<(), String> { - let db_path = format!("{}{}", path, "import_elebox.db"); - let db = JammDatabase::new(&db_path); - db.init(); - - let filename_mfr = format!("{}{}", path, "elebox_export_mfrs.tsv"); - let res = ManufacturerManager::new(&db).import_csv(&filename_mfr); - if res.is_err() { - return Err("Part".to_string()); - } - - let filename_pkg = format!("{}{}", path, "elebox_export_packages.tsv"); - let res = PackageManager::new(&db).import_csv(&filename_pkg); - if res.is_err() { - return Err("Part".to_string()); - } - - let filename_cat = format!("{}{}", path, "elebox_export_categories.tsv"); - let res = CategoryManager::new(&db).import_csv(&filename_cat); - if res.is_err() { - return Err("Part".to_string()); - } - - let filename_part = format!("{}{}", path, "elebox_export_parts.tsv"); - let res = PartManager::new(&db).import_csv(&filename_part); - if res.is_err() { - return Err("Part".to_string()); - } - - Ok(()) -} diff --git a/elebox-core/src/manufacturer.rs b/elebox-core/src/manufacturer.rs index 289e75a..8b69eb2 100644 --- a/elebox-core/src/manufacturer.rs +++ b/elebox-core/src/manufacturer.rs @@ -1,4 +1,4 @@ -use crate::{csv::*, db::*, errors::EleboxError}; +use crate::{csv::*, db::*, errors::EleboxError, yaml::*}; use serde::{Deserialize, Serialize}; use std::fmt::Debug; @@ -73,6 +73,13 @@ impl<'a> ManufacturerManager<'a> { )); } + if ori_name != &new_mfr.name && self.db.get_mfr_id(&new_mfr.name).is_some() { + return Err(EleboxError::AlreadyExists( + "Mfr".to_string(), + new_mfr.name.clone(), + )); + } + let db_mfr = self.to_db_mfr(new_mfr)?; self.db.update_mfr(ori_name, &db_mfr); Ok(()) @@ -108,14 +115,14 @@ impl<'a> ManufacturerManager<'a> { .collect() } - pub fn export_csv(&self, filename: &str) -> Result<(), ()> { + pub fn export(&self, filename: &str) -> Result<(), ()> { let mfrs = self.list(); - let res = write_csv(filename, mfrs, None); + let res = write_yaml(filename, mfrs); return res; } - pub fn import_csv(&self, filename: &str) -> Result<(), ()> { - let res_parts = read_csv(filename, None); + pub fn import(&self, filename: &str) -> Result<(), ()> { + let res_parts = read_yaml(filename); if res_parts.is_err() { return Err(()); } diff --git a/elebox-core/src/package.rs b/elebox-core/src/package.rs index 7a60696..387787f 100644 --- a/elebox-core/src/package.rs +++ b/elebox-core/src/package.rs @@ -1,4 +1,4 @@ -use crate::{csv::*, db::*, errors::EleboxError}; +use crate::{csv::*, db::*, errors::EleboxError, yaml::*}; use serde::{Deserialize, Serialize}; use std::fmt::Debug; @@ -82,6 +82,13 @@ impl<'a> PackageManager<'a> { )); } + if ori_name != &new_package.name && self.db.get_package_id(&new_package.name).is_some() { + return Err(EleboxError::AlreadyExists( + "Package".to_string(), + new_package.name.clone(), + )); + } + let db_pkg = self.to_db_package(new_package)?; self.db.update_package(ori_name, &db_pkg); Ok(()) @@ -124,14 +131,14 @@ impl<'a> PackageManager<'a> { .collect() } - pub fn export_csv(&self, filename: &str) -> Result<(), ()> { + pub fn export(&self, filename: &str) -> Result<(), ()> { let pkgs = self.list(); - let res = write_csv(filename, pkgs, None); + let res = write_yaml(filename, pkgs); return res; } - pub fn import_csv(&self, filename: &str) -> Result<(), ()> { - let res_parts = read_csv(filename, None); + pub fn import(&self, filename: &str) -> Result<(), ()> { + let res_parts = read_yaml(filename); if res_parts.is_err() { return Err(()); } diff --git a/elebox-core/src/part.rs b/elebox-core/src/part.rs index 6d2ca78..ffa092a 100644 --- a/elebox-core/src/part.rs +++ b/elebox-core/src/part.rs @@ -1,4 +1,4 @@ -use crate::{csv::*, db::*, errors::EleboxError}; +use crate::{csv::*, db::*, errors::EleboxError, yaml::*}; use serde::{Deserialize, Serialize}; use std::fmt::{format, Debug}; @@ -127,6 +127,13 @@ impl<'a> PartManager<'a> { )); } + if ori_name != &new_part.name && self.db.get_part_id(&new_part.name).is_some() { + return Err(EleboxError::AlreadyExists( + "Part".to_string(), + new_part.name.clone(), + )); + } + let db_part = self.to_db_part(new_part)?; self.db.update_part(ori_name, &db_part); Ok(()) @@ -224,21 +231,24 @@ impl<'a> PartManager<'a> { .collect() } - pub fn export_csv(&self, filename: &str) -> Result<(), ()> { + pub fn export(&self, filename: &str) -> Result<(), ()> { let parts = self.list(); - let res = write_csv(filename, parts, None); + let res = write_yaml(filename, parts); return res; } - pub fn import_csv(&self, filename: &str) -> Result<(), ()> { - let res_parts = read_csv(filename, None); + pub fn import(&self, filename: &str) -> Result<(), ()> { + let res_parts = read_yaml(filename); + if res_parts.is_err() { return Err(()); } let parts: Vec = res_parts.unwrap(); for part in parts { - let _ = self.add(&part); + if let Err(e) = self.add(&part) { + panic!("{}", e.to_string()) + } } Ok(()) diff --git a/elebox-core/src/yaml.rs b/elebox-core/src/yaml.rs new file mode 100644 index 0000000..834005f --- /dev/null +++ b/elebox-core/src/yaml.rs @@ -0,0 +1,24 @@ +use std::fs::{self, File}; + +use csv::{ReaderBuilder, WriterBuilder}; +use serde::{Deserialize, Serialize}; + +use serde_yaml; + +pub fn write_yaml(filename: &str, items: Vec) -> Result<(), ()> +where + T: Serialize, +{ + let contents = serde_yaml::to_string(&items).unwrap(); + fs::write(filename, contents); + Ok(()) +} + +pub fn read_yaml(filename: &str) -> Result, ()> +where + T: for<'a> Deserialize<'a>, +{ + let content = fs::read_to_string(filename).unwrap(); + let items: Vec = serde_yaml::from_str(&content).unwrap(); + Ok(items) +} diff --git a/elebox-tauri/package.json b/elebox-tauri/package.json index a131835..5367c59 100644 --- a/elebox-tauri/package.json +++ b/elebox-tauri/package.json @@ -1,7 +1,7 @@ { "name": "elebox", "private": true, - "version": "1.0.0-beta.2", + "version": "1.0.0-beta.3", "type": "module", "scripts": { "tauri dev": "tauri dev", diff --git a/elebox-tauri/src-tauri/Cargo.toml b/elebox-tauri/src-tauri/Cargo.toml index 48de272..ddd89eb 100644 --- a/elebox-tauri/src-tauri/Cargo.toml +++ b/elebox-tauri/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "elebox" -version = "1.0.0-beta.2" +version = "1.0.0-beta.3" license = "MIT OR Apache-2.0" description = "Lightweight personal electronic parts inventory management tool" repository = "https://github.com/ziteh/elebox" diff --git a/elebox-tauri/src-tauri/src/main.rs b/elebox-tauri/src-tauri/src/main.rs index 00b831d..94eaec9 100644 --- a/elebox-tauri/src-tauri/src/main.rs +++ b/elebox-tauri/src-tauri/src/main.rs @@ -5,7 +5,7 @@ use dirs; use elebox_core::{ Category, CustomField, Manufacturer, Package, PackageType, Part, Supplier, TreeNode, }; -use std::{sync::Mutex, task::ready}; +use std::{path::Path, sync::Mutex, task::ready}; use tauri::Manager; macro_rules! GET { @@ -214,6 +214,14 @@ fn get_db_path(path: tauri::State) -> String { GET!(path).to_string() } +#[tauri::command(rename_all = "snake_case")] +fn get_default_db_path() -> String { + if let Ok(path) = get_default_path() { + return path; + } + return "".to_string(); +} + #[tauri::command(rename_all = "snake_case")] fn set_db_path(path: tauri::State, new_path: &str) { update_db_path(path, new_path); @@ -224,21 +232,25 @@ fn set_db_path(path: tauri::State, new_path: &str) { fn export_csv(path: tauri::State, csv_path: &str) { let p = GET!(path); let db = elebox_core::JammDatabase::new(&p); - elebox_core::export_csv(&db, csv_path); + elebox_core::export(&db, csv_path); } #[tauri::command(rename_all = "snake_case")] fn import_csv(csv_path: &str) -> Result<(), String> { - elebox_core::import_csv(csv_path) + elebox_core::import(csv_path) } fn main() { - let db_path = match get_default_path() { + let mut db_path = match get_default_path() { Ok(path) => path, Err(err) => panic!("{}", err), }; - init_db(&db_path); + if Path::new(&db_path).exists() { + init_db(&db_path); + } else { + db_path = "".to_string(); + } tauri::Builder::default() .setup(|app| { @@ -278,6 +290,7 @@ fn main() { update_mfr, del_mfr, get_db_path, + get_default_db_path, set_db_path, export_csv, import_csv, diff --git a/elebox-tauri/src/components/CategoryField.vue b/elebox-tauri/src/components/CategoryField.vue index 36fe31e..696ae18 100644 --- a/elebox-tauri/src/components/CategoryField.vue +++ b/elebox-tauri/src/components/CategoryField.vue @@ -6,14 +6,30 @@ const props = defineProps<{ origin_name?: string }>(); const category = ref({ name: "", parent: "", alias: "" }); let categories = reactive([]); +const snackbar = ref(false); +const snackbar_msg = ref(""); +const rules = ref({ + required: (v: any) => !!v || "Required", + duplicate: (v: any) => + !categories.some((cat) => cat.name === v) || "Already exists", +}); + async function add() { if (category.value === undefined) { console.warn("undefined"); return; } - await Db.add(category.value); - await list(); + await Db.add(category.value) + .then(() => { + snackbar.value = true; + snackbar_msg.value = "Success"; + list(); + }) + .catch((e) => { + snackbar.value = true; + snackbar_msg.value = e; + }); } async function update() { @@ -35,6 +51,14 @@ async function list() { data.splice(0, 0, { name: "" }); // Root Object.assign(categories, data); + // The parent category cannot be itself + if (props.origin_name) { + const index = categories.findIndex((s) => s.name === props.origin_name); + if (index !== -1) { + categories.splice(index, 1); + } + } + console.debug(`get categories: ${categories.length}`); } @@ -61,7 +85,7 @@ onMounted(() => { variant="outlined" v-model="category.name" placeholder="MCU" - :rules="[(v: any) => !!v || 'Required']" + :rules="[rules.required, rules.duplicate]" required > @@ -92,4 +116,12 @@ onMounted(() => { + + {{ snackbar_msg }} + + diff --git a/elebox-tauri/src/components/CategoryList.vue b/elebox-tauri/src/components/CategoryList.vue index d972255..7ab1d32 100644 --- a/elebox-tauri/src/components/CategoryList.vue +++ b/elebox-tauri/src/components/CategoryList.vue @@ -2,6 +2,7 @@ import { onMounted, reactive, ref } from "vue"; import { DbCategory as Db } from "../db_cmd_category"; import ItemEditButton from "./ItemEditButton.vue"; +import ItemDeleteButton from "./ItemDeleteButton.vue"; const search = ref(""); const headers = ref([ @@ -18,7 +19,7 @@ async function list() { Object.assign(categories, data); } -async function remove(name: string) { +async function deleteItem(name: string) { await Db.remove(name); } @@ -41,12 +42,7 @@ onMounted(list); diff --git a/elebox-tauri/src/components/ItemDeleteButton.vue b/elebox-tauri/src/components/ItemDeleteButton.vue new file mode 100644 index 0000000..d7f9132 --- /dev/null +++ b/elebox-tauri/src/components/ItemDeleteButton.vue @@ -0,0 +1,56 @@ + + + diff --git a/elebox-tauri/src/components/ManufacturerField.vue b/elebox-tauri/src/components/ManufacturerField.vue index b809513..a88753e 100644 --- a/elebox-tauri/src/components/ManufacturerField.vue +++ b/elebox-tauri/src/components/ManufacturerField.vue @@ -1,9 +1,18 @@ @@ -43,7 +67,7 @@ onMounted(() => { variant="outlined" v-model="mfr.name" placeholder="Texas Instruments" - :rules="[(v: any) => !!v || 'Required']" + :rules="[rules.required, rules.duplicate]" required > @@ -74,4 +98,12 @@ onMounted(() => { + + {{ snackbar_msg }} + + diff --git a/elebox-tauri/src/components/ManufacturerList.vue b/elebox-tauri/src/components/ManufacturerList.vue index 948ecb5..3fc6d35 100644 --- a/elebox-tauri/src/components/ManufacturerList.vue +++ b/elebox-tauri/src/components/ManufacturerList.vue @@ -2,6 +2,7 @@ import { onMounted, reactive, ref } from "vue"; import { DbManufacturer as Db } from "../db_cmd_manufacturer"; import ItemEditButton from "./ItemEditButton.vue"; +import ItemDeleteButton from "./ItemDeleteButton.vue"; const search = ref(""); const headers = ref([ @@ -17,7 +18,7 @@ async function list() { Object.assign(mfrs, data); } -async function remove(name: string) { +async function deleteItem(name: string) { await Db.remove(name); } @@ -49,12 +50,7 @@ onMounted(list); :path_name="'update_manufacturer'" :item_name="item.name" /> - + diff --git a/elebox-tauri/src/components/NewDatabase.vue b/elebox-tauri/src/components/NewDatabase.vue new file mode 100644 index 0000000..edfbc06 --- /dev/null +++ b/elebox-tauri/src/components/NewDatabase.vue @@ -0,0 +1,71 @@ + + + diff --git a/elebox-tauri/src/components/PackageField.vue b/elebox-tauri/src/components/PackageField.vue index bb63d2e..459007f 100644 --- a/elebox-tauri/src/components/PackageField.vue +++ b/elebox-tauri/src/components/PackageField.vue @@ -1,11 +1,20 @@ @@ -78,7 +102,7 @@ onMounted(() => { variant="outlined" v-model.trim="pkg.name" placeholder="SOT-23" - :rules="[(v: any) => !!v || 'Required']" + :rules="[rules.required, rules.duplicate]" required > @@ -101,4 +125,12 @@ onMounted(() => { + + {{ snackbar_msg }} + + diff --git a/elebox-tauri/src/components/PackageList.vue b/elebox-tauri/src/components/PackageList.vue index a9b092b..0670539 100644 --- a/elebox-tauri/src/components/PackageList.vue +++ b/elebox-tauri/src/components/PackageList.vue @@ -2,6 +2,7 @@ import { onMounted, reactive, ref } from "vue"; import { DbPackage as Db } from "../db_cmd_package"; import ItemEditButton from "./ItemEditButton.vue"; +import ItemDeleteButton from "./ItemDeleteButton.vue"; const search = ref(""); const headers = ref([ @@ -18,7 +19,7 @@ async function list() { Object.assign(pkgs, data); } -async function remove(name: string) { +async function deleteItem(name: string) { await Db.remove(name); } @@ -44,12 +45,7 @@ onMounted(list); diff --git a/elebox-tauri/src/components/PartCustomField.vue b/elebox-tauri/src/components/PartCustomField.vue index 7018368..9589c58 100644 --- a/elebox-tauri/src/components/PartCustomField.vue +++ b/elebox-tauri/src/components/PartCustomField.vue @@ -1,20 +1,21 @@ + + diff --git a/elebox-tauri/src/components/PartSupplier.vue b/elebox-tauri/src/components/PartSupplier.vue index cad6f4c..1f2a0da 100644 --- a/elebox-tauri/src/components/PartSupplier.vue +++ b/elebox-tauri/src/components/PartSupplier.vue @@ -1,20 +1,38 @@ diff --git a/elebox-tauri/src/views/PartDetail.vue b/elebox-tauri/src/views/PartDetail.vue index 6cfeaba..561a35c 100644 --- a/elebox-tauri/src/views/PartDetail.vue +++ b/elebox-tauri/src/views/PartDetail.vue @@ -3,6 +3,7 @@ import { onMounted, ref } from "vue"; import { useRoute, useRouter } from "vue-router"; import { DbPart } from "../db_cmd_part"; import ItemEditButton from "../components/ItemEditButton.vue"; +import ItemDeleteButton from "../components/ItemDeleteButton.vue"; const router = useRouter(); const route = useRoute(); @@ -44,46 +45,7 @@ onMounted(() => { - - - - - + diff --git a/elebox-tauri/src/views/Settings.vue b/elebox-tauri/src/views/Settings.vue index 15c491a..8da1b19 100644 --- a/elebox-tauri/src/views/Settings.vue +++ b/elebox-tauri/src/views/Settings.vue @@ -6,12 +6,12 @@ import DbPath from "../components/DbPath.vue"; const csv_path = ref(""); async function export_csv() { - await invoke("export_csv", { csvPath: csv_path.value }); + await invoke("export_csv", { csv_path: csv_path.value }); console.debug(`Export path: ${csv_path.value}`); } async function import_csv() { - await invoke("import_csv", { csvPath: csv_path.value }); + await invoke("import_csv", { csv_path: csv_path.value }); console.debug(`Import path: ${csv_path.value}`); } @@ -44,7 +44,7 @@ async function import_csv() { Version - 1.0.0-beta.2 + 1.0.0-beta.3