(throwErr = false, initPath?: string)
| 296 | }; |
| 297 | |
| 298 | const getFileList = async (throwErr = false, initPath?: string) => { |
| 299 | const { execute } = getFileListApi(); |
| 300 | const thisTab = currentTabs.value.find((e) => e.key === activeTab.value); |
| 301 | |
| 302 | try { |
| 303 | clearSelected(); |
| 304 | let path; |
| 305 | if (initPath) { |
| 306 | path = initPath; |
| 307 | updateBreadcrumbs(initPath); |
| 308 | } else { |
| 309 | path = currentPath.value; |
| 310 | } |
| 311 | const res = await execute({ |
| 312 | params: { |
| 313 | daemonId: daemonId || "", |
| 314 | uuid: instanceId || "", |
| 315 | page: operationForm.value.current - 1, |
| 316 | page_size: operationForm.value.pageSize, |
| 317 | file_name: operationForm.value.name, |
| 318 | target: path |
| 319 | } |
| 320 | }); |
| 321 | dataSource.value = res.value?.items || []; |
| 322 | operationForm.value.total = res.value?.total || 0; |
| 323 | if (!thisTab) { |
| 324 | initDefaultTab(path); |
| 325 | } |
| 326 | } catch (error: any) { |
| 327 | // if (thisTab) { |
| 328 | // handleRemoveTab(thisTab.key); |
| 329 | // } else { |
| 330 | // initDefaultTab(); |
| 331 | // } |
| 332 | |
| 333 | if (throwErr) throw error; |
| 334 | return reportErrorMsg(error.message); |
| 335 | } |
| 336 | }; |
| 337 | |
| 338 | const reloadList = async () => { |
| 339 | await getFileList(); |
no test coverage detected