|
|
|
@ -1,18 +1,18 @@
|
|
|
|
<script setup lang="ts">
|
|
|
|
<script setup lang="ts">
|
|
|
|
import { computed, onMounted, onBeforeUnmount, ref, watch } from "vue";
|
|
|
|
import { computed, onMounted, onBeforeUnmount, ref, watch } from "vue";
|
|
|
|
import { kubeflowService } from "@/components/service/management/kubeflowService";
|
|
|
|
import { kubeflowService } from "@/components/service/management/KubeflowService";
|
|
|
|
|
|
|
|
|
|
|
|
type RunPayload = {
|
|
|
|
type RunPayload = {
|
|
|
|
display_name: string;
|
|
|
|
display_name: string;
|
|
|
|
description?: string;
|
|
|
|
description?: string;
|
|
|
|
pipeline_version_reference: { pipeline_id: string };
|
|
|
|
pipeline_version_reference: { pipeline_id: string };
|
|
|
|
runtime_config?: { parameters?: Record<string, any> };
|
|
|
|
// 필요 시 아래 두 개만 추가하세요
|
|
|
|
service_account?: string;
|
|
|
|
// runtime_config?: { parameters?: Record<string, any> };
|
|
|
|
|
|
|
|
// service_account?: string;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const props = defineProps<{
|
|
|
|
const props = defineProps<{
|
|
|
|
/** 테이블에서 선택된 파이프라인의 pipelineId */
|
|
|
|
pipelineId?: string | number | null; // 테이블에서 넘어온 pipelineId
|
|
|
|
pipelineId?: string | number | null;
|
|
|
|
|
|
|
|
}>();
|
|
|
|
}>();
|
|
|
|
|
|
|
|
|
|
|
|
const emit = defineEmits<{
|
|
|
|
const emit = defineEmits<{
|
|
|
|
@ -21,9 +21,9 @@ const emit = defineEmits<{
|
|
|
|
}>();
|
|
|
|
}>();
|
|
|
|
|
|
|
|
|
|
|
|
const form = ref({
|
|
|
|
const form = ref({
|
|
|
|
display_name: "", // ✅ 빈 값으로 시작
|
|
|
|
display_name: "",
|
|
|
|
description: "", // ✅ 빈 값으로 시작
|
|
|
|
description: "",
|
|
|
|
pipeline_id: "", // prop으로만 채움(읽기 전용)
|
|
|
|
pipeline_id: "",
|
|
|
|
});
|
|
|
|
});
|
|
|
|
const loading = ref(false);
|
|
|
|
const loading = ref(false);
|
|
|
|
const errorMsg = ref("");
|
|
|
|
const errorMsg = ref("");
|
|
|
|
@ -34,9 +34,7 @@ const isValid = computed(
|
|
|
|
|
|
|
|
|
|
|
|
function initForm() {
|
|
|
|
function initForm() {
|
|
|
|
form.value.pipeline_id = props.pipelineId ? String(props.pipelineId) : "";
|
|
|
|
form.value.pipeline_id = props.pipelineId ? String(props.pipelineId) : "";
|
|
|
|
// display_name/description은 비워둠
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(initForm);
|
|
|
|
onMounted(initForm);
|
|
|
|
watch(() => props.pipelineId, initForm);
|
|
|
|
watch(() => props.pipelineId, initForm);
|
|
|
|
|
|
|
|
|
|
|
|
@ -55,10 +53,11 @@ async function submitRun() {
|
|
|
|
|
|
|
|
|
|
|
|
const payload: RunPayload = {
|
|
|
|
const payload: RunPayload = {
|
|
|
|
display_name: form.value.display_name.trim(),
|
|
|
|
display_name: form.value.display_name.trim(),
|
|
|
|
description: form.value.description?.trim(),
|
|
|
|
// description은 값이 있으면만 넣음
|
|
|
|
|
|
|
|
...(form.value.description.trim() && {
|
|
|
|
|
|
|
|
description: form.value.description.trim(),
|
|
|
|
|
|
|
|
}),
|
|
|
|
pipeline_version_reference: { pipeline_id: form.value.pipeline_id.trim() },
|
|
|
|
pipeline_version_reference: { pipeline_id: form.value.pipeline_id.trim() },
|
|
|
|
runtime_config: { parameters: {} }, // 필요 시 파라미터 매핑
|
|
|
|
|
|
|
|
service_account: "pipeline-runner",
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
@ -68,12 +67,11 @@ async function submitRun() {
|
|
|
|
emit("close-modal");
|
|
|
|
emit("close-modal");
|
|
|
|
} catch (e: any) {
|
|
|
|
} catch (e: any) {
|
|
|
|
console.error("Run 생성 실패:", e);
|
|
|
|
console.error("Run 생성 실패:", e);
|
|
|
|
const msg =
|
|
|
|
errorMsg.value =
|
|
|
|
e?.response?.data?.message ||
|
|
|
|
e?.response?.data?.message ||
|
|
|
|
e?.response?.data?.error ||
|
|
|
|
e?.response?.data?.error ||
|
|
|
|
e?.message ||
|
|
|
|
e?.message ||
|
|
|
|
"Run 생성에 실패했습니다.";
|
|
|
|
"Run 생성에 실패했습니다.";
|
|
|
|
errorMsg.value = String(msg);
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
loading.value = false;
|
|
|
|
loading.value = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -91,48 +89,37 @@ async function submitRun() {
|
|
|
|
|
|
|
|
|
|
|
|
<v-card-text class="pa-6">
|
|
|
|
<v-card-text class="pa-6">
|
|
|
|
<v-form @submit.prevent="submitRun">
|
|
|
|
<v-form @submit.prevent="submitRun">
|
|
|
|
<!-- 제목 -->
|
|
|
|
|
|
|
|
<div class="mb-4">
|
|
|
|
<div class="mb-4">
|
|
|
|
<label class="text-subtitle-2 font-weight-medium mb-1 d-block">
|
|
|
|
<label class="text-subtitle-2 font-weight-medium mb-1 d-block">
|
|
|
|
Run Title (display_name)
|
|
|
|
Run Title (display_name)
|
|
|
|
</label>
|
|
|
|
</label>
|
|
|
|
<v-text-field
|
|
|
|
<v-text-field
|
|
|
|
v-model="form.display_name"
|
|
|
|
v-model="form.display_name"
|
|
|
|
variant="outlined"
|
|
|
|
|
|
|
|
:disabled="loading"
|
|
|
|
:disabled="loading"
|
|
|
|
density="comfortable"
|
|
|
|
hide-details
|
|
|
|
hide-details="auto"
|
|
|
|
|
|
|
|
persistent-hint
|
|
|
|
|
|
|
|
required
|
|
|
|
required
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 내용 -->
|
|
|
|
|
|
|
|
<div class="mb-4">
|
|
|
|
<div class="mb-4">
|
|
|
|
<label class="text-subtitle-2 font-weight-medium mb-1 d-block">
|
|
|
|
<label class="text-subtitle-2 font-weight-medium mb-1 d-block">
|
|
|
|
Run Description
|
|
|
|
Run Description
|
|
|
|
</label>
|
|
|
|
</label>
|
|
|
|
<v-textarea
|
|
|
|
<v-textarea
|
|
|
|
v-model="form.description"
|
|
|
|
v-model="form.description"
|
|
|
|
variant="outlined"
|
|
|
|
|
|
|
|
:disabled="loading"
|
|
|
|
:disabled="loading"
|
|
|
|
rows="3"
|
|
|
|
hide-details
|
|
|
|
density="comfortable"
|
|
|
|
|
|
|
|
hide-details="auto"
|
|
|
|
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- pipeline_id -->
|
|
|
|
|
|
|
|
<div class="mb-2">
|
|
|
|
<div class="mb-2">
|
|
|
|
<label class="text-subtitle-2 font-weight-medium mb-1 d-block">
|
|
|
|
<label class="text-subtitle-2 font-weight-medium mb-1 d-block">
|
|
|
|
pipeline_id
|
|
|
|
pipeline_id
|
|
|
|
</label>
|
|
|
|
</label>
|
|
|
|
<v-text-field
|
|
|
|
<v-text-field
|
|
|
|
v-model="form.pipeline_id"
|
|
|
|
v-model="form.pipeline_id"
|
|
|
|
variant="outlined"
|
|
|
|
|
|
|
|
:disabled="true"
|
|
|
|
:disabled="true"
|
|
|
|
density="comfortable"
|
|
|
|
hide-details
|
|
|
|
hide-details="auto"
|
|
|
|
|
|
|
|
required
|
|
|
|
required
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|