-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui): initial work on the concurrency & sla panels
- Loading branch information
1 parent
c918276
commit 25132ad
Showing
7 changed files
with
209 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<template> | ||
<el-collapse v-model="isOpen" class="collapse"> | ||
<el-collapse-item | ||
:title="props.label" | ||
name="concurrency" | ||
class="mt-1 mb-3 wrapper" | ||
> | ||
<TaskBasic | ||
:model-value="props.modelValue" | ||
@update:model-value="(v) => emits('update:modelValue', v)" | ||
:schema | ||
/> | ||
</el-collapse-item> | ||
</el-collapse> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import {ref, onMounted} from "vue"; | ||
import TaskBasic from "../../../flows/tasks/TaskBasic.vue"; | ||
const emits = defineEmits(["update:modelValue"]); | ||
const props = defineProps({ | ||
modelValue: {type: Object, default: undefined}, | ||
label: {type: String, default: undefined}, | ||
}); | ||
const isOpen = ref<string[]>([]); | ||
onMounted(() => { | ||
if (props.modelValue?.limit) isOpen.value = ["concurrency"]; | ||
}); | ||
const schema = { | ||
type: "object", | ||
properties: { | ||
behavior: { | ||
type: "string", | ||
enum: ["QUEUE", "CANCEL", "FAIL"], | ||
default: "QUEUE", | ||
markdownDescription: "Default value is : `QUEUE`", | ||
}, | ||
limit: {type: "integer", exclusiveMinimum: 0}, | ||
}, | ||
required: ["limit"], | ||
}; | ||
</script> | ||
|
||
<style scoped lang="scss"> | ||
@import "../../styles/code.scss"; | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
<template> | ||
<el-collapse v-model="isOpen" class="collapse"> | ||
<el-collapse-item | ||
:title="props.label" | ||
name="sla" | ||
class="mt-1 mb-3 wrapper" | ||
> | ||
<el-button @click="ss" /> | ||
<!-- <OneOfContent | ||
:model-value="props.modelValue" | ||
@update:model-value="(v) => emits('update:modelValue', v)" | ||
:schema | ||
:definitions | ||
/> --> | ||
</el-collapse-item> | ||
</el-collapse> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import {h, ref, onMounted} from "vue"; | ||
import OneOfContent from "../../../flows/tasks/OneOfContent.vue"; | ||
const emits = defineEmits(["update:modelValue"]); | ||
const props = defineProps({ | ||
modelValue: {type: Object, default: undefined}, | ||
label: {type: String, default: undefined}, | ||
}); | ||
const isOpen = ref<string[]>([]); | ||
onMounted(() => { | ||
if (props.modelValue?.limit) isOpen.value = ["sla"]; | ||
}); | ||
const schema = { | ||
oneOf: [ | ||
{ | ||
$ref: "#/definitions/io.kestra.core.models.flows.sla.types.MaxDurationSLA-1", | ||
}, | ||
{ | ||
$ref: "#/definitions/io.kestra.core.models.flows.sla.types.ExecutionAssertionSLA-1", | ||
}, | ||
], | ||
}; | ||
const definitions = { | ||
"io.kestra.core.models.flows.sla.types.ExecutionAssertionSLA-1": { | ||
type: "object", | ||
properties: { | ||
assert: { | ||
type: "string", | ||
minLength: 1, | ||
}, | ||
behavior: { | ||
type: "string", | ||
enum: ["FAIL", "CANCEL", "NONE"], | ||
}, | ||
id: { | ||
type: "string", | ||
minLength: 1, | ||
}, | ||
labels: { | ||
oneOf: [ | ||
{ | ||
type: "array", | ||
items: {}, | ||
}, | ||
{ | ||
type: "object", | ||
}, | ||
], | ||
}, | ||
type: { | ||
type: "string", | ||
enum: ["MAX_DURATION", "EXECUTION_ASSERTION"], | ||
}, | ||
}, | ||
required: ["assert", "behavior", "id", "type"], | ||
}, | ||
"io.kestra.core.models.flows.sla.types.MaxDurationSLA-1": { | ||
type: "object", | ||
properties: { | ||
behavior: { | ||
type: "string", | ||
enum: ["FAIL", "CANCEL", "NONE"], | ||
}, | ||
duration: { | ||
type: "string", | ||
format: "duration", | ||
}, | ||
id: { | ||
type: "string", | ||
minLength: 1, | ||
}, | ||
labels: { | ||
oneOf: [ | ||
{ | ||
type: "array", | ||
items: {}, | ||
}, | ||
{ | ||
type: "object", | ||
}, | ||
], | ||
}, | ||
type: { | ||
type: "string", | ||
enum: ["MAX_DURATION", "EXECUTION_ASSERTION"], | ||
}, | ||
}, | ||
required: ["behavior", "duration", "id", "type"], | ||
}, | ||
}; | ||
import {useStore} from "vuex"; | ||
const store = useStore(); | ||
const ss = () => { | ||
store.commit("code/setPanel", { | ||
breadcrumb: { | ||
label: props.label, | ||
to: { | ||
name: "flows/list", | ||
}, | ||
}, | ||
panel: h(OneOfContent, { | ||
modelValue: props.modelValue, | ||
label: props.label, | ||
schema, | ||
definitions, | ||
"onUpdate:modelValue": emits("update:modelValue"), | ||
}), | ||
}); | ||
}; | ||
</script> | ||
|
||
<style scoped lang="scss"> | ||
@import "../../styles/code.scss"; | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters