feat(depot): initial work for depot

This commit is contained in:
2023-12-15 09:15:30 +07:00
parent 591373fd52
commit ba93bdbb91
14 changed files with 902 additions and 489 deletions

29
src/app/depot/index.tsx Normal file
View File

@@ -0,0 +1,29 @@
import { configDir, resolveResource } from '@tauri-apps/api/path';
import { Command } from '@tauri-apps/plugin-shell';
export function DepotScreen() {
const launch = async () => {
const configPath = await resolveResource('resources/config.toml');
const dataPath = await configDir();
const command = Command.sidecar('bin/depot', ['-c', configPath, '-d', dataPath]);
const process = await command.spawn();
process.pid;
};
return (
<div className="flex flex-col items-center justify-center">
<div className="flex flex-col items-center gap-4 py-10">
<h1 className="text-center text-lg font-semibold">Depot</h1>
<button
type="button"
onClick={() => launch()}
className="h-9 w-max rounded-lg bg-blue-500 px-2 text-white"
>
Launch
</button>
</div>
</div>
);
}