full text search and UI button

This commit is contained in:
polv committed 2026-03-16 00:05:25 +07:00
1 parent afacdc0856
commit f0cafa450d
10 files changed
+189 -65

No files matched your search

+11 -3
View File
@@ -5,7 +5,8 @@ use std::{
};
use cjdic2_core::{
AppService, CJDicError, SqlParam, TokenizeSegment, YomitanRow, YomitanZipImportResult,
AppService, CJDicError, SqlParam, TokenizeSegment, YomitanDictEntry, YomitanRow,
YomitanZipImportResult,
};
use serde::{Deserialize, Serialize};
use tauri::{AppHandle, Emitter, Manager};
@@ -13,8 +14,15 @@ use tauri_plugin_http::reqwest::Client;
use tokio::io::AsyncWriteExt;
use zip::ZipArchive;
#[tauri::command]
pub async fn list_yomitan_dict(
state: tauri::State<'_, AppService>,
) -> Result<Vec<YomitanDictEntry>, CJDicError> {
state.list_yomitan_dict()
}
#[derive(Deserialize)]
pub struct YomitanDictEntry {
pub struct YomitanDownloadDictEntry {
url: String,
filepath: String,
}
@@ -22,7 +30,7 @@ pub struct YomitanDictEntry {
#[tauri::command]
pub async fn init_yomitan(
app: AppHandle,
dicts: Vec<YomitanDictEntry>,
dicts: Vec<YomitanDownloadDictEntry>,
lang: String,
state: tauri::State<'_, AppService>,
) -> Result<(), CJDicError> {
+1
View File
@@ -47,6 +47,7 @@ pub fn run() {
Ok(())
})
.invoke_handler(tauri::generate_handler![
list_yomitan_dict,
init_yomitan,
import_yomitan_dict,
remove_yomitan_dict,