MCPcopy Create free account
hub / github.com/bywwcnll/StreamPanel / handleExport

Function handleExport

devtools/modules/exportManager.js:230–264  ·  view source on GitHub ↗
(exportType)

Source from the content-addressed store, hash-verified

228}
229
230export function handleExport(exportType) {
231 switch (exportType) {
232 case 'current-json': {
233 const data = getCurrentConnectionExportData();
234 if (!data) {
235 alert('请先选择一个连接');
236 return;
237 }
238 const filename = `stream-${data.connection.id.substring(0, 8)}-${Date.now()}.json`;
239 exportToJSON(data, filename);
240 break;
241 }
242
243 case 'current-csv': {
244 exportCurrentToCSV();
245 break;
246 }
247
248 case 'all-json': {
249 const data = getAllConnectionsExportData();
250 if (!data) {
251 alert('没有连接数据可导出');
252 return;
253 }
254 const filename = `stream-all-${Date.now()}.json`;
255 exportToJSON(data, filename);
256 break;
257 }
258
259 case 'all-csv': {
260 exportAllToCSV();
261 break;
262 }
263 }
264}

Callers

nothing calls this directly

Calls 5

exportToJSONFunction · 0.70
exportCurrentToCSVFunction · 0.70
exportAllToCSVFunction · 0.70

Tested by

no test coverage detected