feat: 更新创建数据集功能,添加活动数据集元数据管理
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
<script lang="ts">
|
||||
import { afterNavigate, goto } from '$app/navigation';
|
||||
import Close from '$lib/components/icons/Close.svelte';
|
||||
import { openedDatasetDir } from '$lib/stores/dataset';
|
||||
import { activeDatasetMeta, openedDatasetDir, updateActiveDatasetMeta } from '$lib/stores/dataset';
|
||||
import { currentActivate } from '$lib/stores/navigate';
|
||||
import type { DatasetMeta } from '$lib/types/meta';
|
||||
import { join } from '@tauri-apps/api/path';
|
||||
import { message, open } from '@tauri-apps/plugin-dialog';
|
||||
import { readDir, writeTextFile } from '@tauri-apps/plugin-fs';
|
||||
import { readDir } from '@tauri-apps/plugin-fs';
|
||||
import { isNil } from 'es-toolkit';
|
||||
|
||||
afterNavigate(() => {
|
||||
@@ -68,10 +67,9 @@ async function createDataset() {
|
||||
};
|
||||
|
||||
try {
|
||||
const metaPath = await join(storePath, 'meta.json');
|
||||
await writeTextFile(metaPath, JSON.stringify(datasetMeta, null, 2));
|
||||
|
||||
openedDatasetDir.set(storePath);
|
||||
activeDatasetMeta.set(datasetMeta);
|
||||
await updateActiveDatasetMeta(() => datasetMeta);
|
||||
|
||||
await goto('/dataset');
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user