(exportType)
| 228 | } |
| 229 | |
| 230 | export 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 | } |
nothing calls this directly
no test coverage detected