MCPcopy Create free account
hub / github.com/aiprodcoder/MIXAPI / handleExport

Function handleExport

web/src/components/playground/ConfigManager.js:28–48  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

26 const fileInputRef = useRef(null);
27
28 const handleExport = () => {
29 try {
30 // 在导出前先保存当前配置,确保导出的是最新内容
31 const configWithTimestamp = {
32 ...currentConfig,
33 timestamp: new Date().toISOString(),
34 };
35 localStorage.setItem('playground_config', JSON.stringify(configWithTimestamp));
36
37 exportConfig(currentConfig, messages);
38 Toast.success({
39 content: t('配置已导出到下载文件夹'),
40 duration: 3,
41 });
42 } catch (error) {
43 Toast.error({
44 content: t('导出配置失败: ') + error.message,
45 duration: 3,
46 });
47 }
48 };
49
50 const handleImportClick = () => {
51 fileInputRef.current?.click();

Callers

nothing calls this directly

Calls 2

exportConfigFunction · 0.90
tFunction · 0.50

Tested by

no test coverage detected