Compare commits
2 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1feca4d720 | ||
|
|
ca183c07aa |
6 changed files with 524 additions and 545 deletions
12
package.json
12
package.json
|
|
@ -16,14 +16,14 @@
|
||||||
"@radix-ui/react-separator": "^1.0.3",
|
"@radix-ui/react-separator": "^1.0.3",
|
||||||
"@radix-ui/react-slot": "^1.0.2",
|
"@radix-ui/react-slot": "^1.0.2",
|
||||||
"@radix-ui/react-tooltip": "^1.0.7",
|
"@radix-ui/react-tooltip": "^1.0.7",
|
||||||
"@tanstack/react-table": "^8.12.0",
|
"@tanstack/react-table": "^8.13.2",
|
||||||
"@tauri-apps/api": "2.0.0-beta.1",
|
"@tauri-apps/api": "2.0.0-beta.1",
|
||||||
"@tauri-apps/plugin-dialog": "2.0.0-beta.0",
|
"@tauri-apps/plugin-dialog": "2.0.0-beta.0",
|
||||||
"@tauri-apps/plugin-fs": "github:tauri-apps/tauri-plugin-fs#v2",
|
"@tauri-apps/plugin-fs": "github:tauri-apps/tauri-plugin-fs#v2",
|
||||||
"@tauri-apps/plugin-shell": "github:tauri-apps/tauri-plugin-shell#v2",
|
"@tauri-apps/plugin-shell": "github:tauri-apps/tauri-plugin-shell#v2",
|
||||||
"class-variance-authority": "^0.7.0",
|
"class-variance-authority": "^0.7.0",
|
||||||
"lucide-react": "^0.334.0",
|
"lucide-react": "^0.334.0",
|
||||||
"magika": "^0.2.5",
|
"magika": "^0.2.8",
|
||||||
"next": "14.1.0",
|
"next": "14.1.0",
|
||||||
"next-themes": "^0.2.1",
|
"next-themes": "^0.2.1",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
|
|
@ -34,10 +34,10 @@
|
||||||
"@release-it/bumper": "^6.0.1",
|
"@release-it/bumper": "^6.0.1",
|
||||||
"@release-it/conventional-changelog": "^8.0.1",
|
"@release-it/conventional-changelog": "^8.0.1",
|
||||||
"@tauri-apps/cli": "2.0.0-beta.1",
|
"@tauri-apps/cli": "2.0.0-beta.1",
|
||||||
"@types/node": "^20.11.20",
|
"@types/node": "^20.11.24",
|
||||||
"@types/react": "^18.2.59",
|
"@types/react": "^18.2.63",
|
||||||
"@types/react-dom": "^18.2.19",
|
"@types/react-dom": "^18.2.20",
|
||||||
"autoprefixer": "^10.4.17",
|
"autoprefixer": "^10.4.18",
|
||||||
"clsx": "^2.1.0",
|
"clsx": "^2.1.0",
|
||||||
"eslint": "^8.57.0",
|
"eslint": "^8.57.0",
|
||||||
"eslint-config-next": "14.1.0",
|
"eslint-config-next": "14.1.0",
|
||||||
|
|
|
||||||
680
pnpm-lock.yaml
generated
680
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load diff
349
src-tauri/Cargo.lock
generated
349
src-tauri/Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -1,11 +1,9 @@
|
||||||
use tauri_plugin_shell;
|
|
||||||
|
|
||||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||||
pub fn run() {
|
pub fn run() {
|
||||||
tauri::Builder::default()
|
tauri::Builder::default()
|
||||||
.plugin(tauri_plugin_shell::init())
|
.plugin(tauri_plugin_shell::init())
|
||||||
.plugin(tauri_plugin_fs::init())
|
.plugin(tauri_plugin_fs::init())
|
||||||
.plugin(tauri_plugin_dialog::init())
|
.plugin(tauri_plugin_dialog::init())
|
||||||
.run(tauri::generate_context!())
|
.run(tauri::generate_context!())
|
||||||
.expect("error while running tauri application");
|
.expect("error while running tauri application");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,5 +2,5 @@
|
||||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
app_lib::run();
|
app_lib::run();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,10 @@
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { Loader } from "@/components/ui/loader";
|
import { Loader } from "@/components/ui/loader";
|
||||||
|
|
||||||
//@ts-ignore
|
|
||||||
import { Magika } from "magika";
|
import { Magika } from "magika";
|
||||||
import { listen } from "@tauri-apps/api/event";
|
import { listen } from "@tauri-apps/api/event";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { readFile } from "@tauri-apps/plugin-fs";
|
import { readFile } from "@tauri-apps/plugin-fs";
|
||||||
//@ts-ignore
|
|
||||||
import { open } from "@tauri-apps/plugin-dialog";
|
import { open } from "@tauri-apps/plugin-dialog";
|
||||||
import { columns } from "@/components/DT/columns";
|
import { columns } from "@/components/DT/columns";
|
||||||
import { DataTable } from "@/components/DT/data-table";
|
import { DataTable } from "@/components/DT/data-table";
|
||||||
|
|
@ -40,9 +38,13 @@ const MagikaProcess = () => {
|
||||||
const fileBytes = await readFile(filepath);
|
const fileBytes = await readFile(filepath);
|
||||||
const magika = new Magika();
|
const magika = new Magika();
|
||||||
await magika.load({});
|
await magika.load({});
|
||||||
const prediction = await magika.identifyBytes(fileBytes);
|
const result = await magika.identifyBytes(
|
||||||
prediction.path = filepath;
|
new Uint16Array(fileBytes.buffer)
|
||||||
return prediction;
|
);
|
||||||
|
return {
|
||||||
|
path: filepath,
|
||||||
|
result: result,
|
||||||
|
};
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(
|
console.error(
|
||||||
`Error while getting prediction for ${filepath}: ${e}`
|
`Error while getting prediction for ${filepath}: ${e}`
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue