Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 74 additions & 13 deletions ui/src/components/flows/Flows.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<ul class="header-actions-list">
<li>
<el-button v-if="canRead" :icon="Download" @click="exportFlowsAsStream()">
{{ t('export_csv') }}
{{ t('auditlog.export_csv') }}
</el-button>
</li>
<li>
Expand Down Expand Up @@ -230,26 +230,48 @@

<el-table-column columnKey="action" className="row-action" :label="t('actions')">
<template #default="scope">
<router-link
:to="{
name: 'flows/update',
params: {
namespace: scope.row.namespace,
id: scope.row.id,
},
}"
>
<Kicon :tooltip="t('details')" placement="left">
<TextSearch />
<div class="action-buttons">
<router-link
:to="{
name: 'flows/update',
params: {
namespace: scope.row.namespace,
id: scope.row.id,
},
}"
>
<Kicon :tooltip="t('details')" placement="left">
<TextSearch />
</Kicon>
</router-link>
<Kicon
:tooltip="t('execute')"
placement="left"
@click="openExecuteModal(scope.row)"
>
<Play />
</Kicon>
</router-link>
</div>
</template>
</el-table-column>
</template>
</SelectTable>
</template>
</DataTable>
</div>
<el-dialog v-model="showRunModal" destroyOnClose :appendToBody="true" width="70%">
<template #header>
<span v-if="selectedFlow">{{ selectedFlow.namespace }}.{{ selectedFlow.id }}</span>
</template>

<FlowRun v-if="showRunModal && executionsStore.flow" :redirect="false" />

<template #footer>
<el-button @click="showRunModal = false">
{{ t('close') }}
</el-button>
</template>
</el-dialog>
</section>
</template>

Expand All @@ -271,6 +293,7 @@
import TextBoxSearch from "vue-material-design-icons/TextBoxSearch.vue";
import FileDocumentCheckOutline from "vue-material-design-icons/FileDocumentCheckOutline.vue";
import FileDocumentRemoveOutline from "vue-material-design-icons/FileDocumentRemoveOutline.vue";
import Play from "vue-material-design-icons/Play.vue";

import Kicon from "../Kicon.vue";
import {Status} from "@kestra-io/ui-libs";
Expand All @@ -280,6 +303,7 @@
import DataTable from "../layout/DataTable.vue";
import BulkSelect from "../layout/BulkSelect.vue";
//@ts-expect-error no declaration file
import FlowRun from "./FlowRun.vue";
import SelectTable from "../layout/SelectTable.vue";
import KSFilter from "../filter/components/KSFilter.vue";
import MarkdownTooltip from "../layout/MarkdownTooltip.vue";
Expand Down Expand Up @@ -326,6 +350,9 @@
const latestExecutions = ref<any[]>([]);
const file = ref<HTMLInputElement | null>(null);

const showRunModal = ref(false);
const selectedFlow = ref<any | null>(null);

const optionalColumns = ref([
{
label: t("labels"),
Expand Down Expand Up @@ -645,6 +672,35 @@
}];
}

async function loadFlowDetailsToExecutionStore(row: any) {
try {
const response = await flowStore.findFlows({
filters: {
namespace: row.namespace,
id: row.id,
},
size: 1,
page: 1
});

const flow = response?.results?.[0];
if (flow) {
executionsStore.flow = flow;
return flow;
}
return null;
} catch (e) {
console.error("Failed to load flow:", e);
return null;
}
}

async function openExecuteModal(row: any) {
selectedFlow.value = row;
await loadFlowDetailsToExecutionStore(row);
showRunModal.value = true;
}

async function exportFlowsAsStream() {
await flowStore.exportFlowAsCSV(
route.query
Expand Down Expand Up @@ -689,4 +745,9 @@
align-items: flex-end;
}
}
.action-buttons {
display: flex;
align-items: center;
gap: 0.5rem;
}
</style>
Loading