diff --git a/src/components/service/management/MinioService.ts b/src/components/service/management/MinioService.ts new file mode 100644 index 0000000..e34f9e0 --- /dev/null +++ b/src/components/service/management/MinioService.ts @@ -0,0 +1,9 @@ +import { request } from "@/components/service/index"; +export const MinioService = { + download(objectName: string) { + return request.get("/api/minio/download", { + params: { objectName, type: "type2" }, + responseType: "blob", + }); + }, +}; diff --git a/src/components/templates/run/executions/ViewComponent.vue b/src/components/templates/run/executions/ViewComponent.vue index 9ff3235..0c98cb6 100644 --- a/src/components/templates/run/executions/ViewComponent.vue +++ b/src/components/templates/run/executions/ViewComponent.vue @@ -13,6 +13,7 @@ import { import Plotly from "plotly.js-dist-min"; import CompareRunsDialog from "@/components/atoms/organisms/CompareRunDialog.vue"; import DeploymentDialog from "@/components/atoms/organisms/DeploymentDialog.vue"; +import { MinioService } from "@/components/service/management/MinioService"; /* ========= Constants & Types ========= */ const AUTH_KEY = "external-auth"; const externalToken = computed(() => externalAuth.value?.token ?? ""); @@ -254,11 +255,17 @@ function buildArtifactUri(fullPath: string) { runs.value[0]?.info?.experiment_id || ""; const runId = runDetail.value?.info?.run_id || selectedRunId.value || ""; - return `/${expId}/${runId}/artifacts/${fullPath}`; + return `${expId}/${runId}/artifacts/${fullPath}`; } -function onClickArtifact(fullPath: string) { - const uri = buildArtifactUri(fullPath); - console.log("[MLflow Artifact URI]", uri); +async function onClickArtifact(fullPath: string) { + const objectName = buildArtifactUri(fullPath); // expId/runId/artifacts/... + try { + artifactsLoading.value = true; + const res = await MinioService.download(objectName); + // blob 다운로드 처리... + } finally { + artifactsLoading.value = false; + } } /* ========= Fetchers ========= */