mirror of
https://github.com/kestra-io/kestra.git
synced 2025-12-26 05:00:31 -05:00
Compare commits
73 Commits
dependabot
...
v0.17.11
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9feac234f6 | ||
|
|
935212344c | ||
|
|
5d4c4dc214 | ||
|
|
a152354bcd | ||
|
|
08455bbdf0 | ||
|
|
64e9d8d43f | ||
|
|
dd1b435720 | ||
|
|
9fca8c9148 | ||
|
|
09d6e0f092 | ||
|
|
c3abfe08ad | ||
|
|
f2d5df082d | ||
|
|
16c15116fe | ||
|
|
f9f8d93ad7 | ||
|
|
c3b1ceb289 | ||
|
|
f9f33b96c8 | ||
|
|
658f847c48 | ||
|
|
dcec04e20e | ||
|
|
b38ec8a21b | ||
|
|
35d801cbc2 | ||
|
|
511a10a65c | ||
|
|
c5daebe4aa | ||
|
|
bb800948e5 | ||
|
|
65f921d456 | ||
|
|
ded21b0902 | ||
|
|
7b109baac2 | ||
|
|
c11fe3466f | ||
|
|
94c5b7a6e4 | ||
|
|
99ab5be8b9 | ||
|
|
aaa3a0ace0 | ||
|
|
acc5a24d9a | ||
|
|
892bb114ca | ||
|
|
30e4fe4e0b | ||
|
|
fcada08edd | ||
|
|
a2df125a62 | ||
|
|
9d9c5dc1d1 | ||
|
|
dbb1a8eaa5 | ||
|
|
1db6b57091 | ||
|
|
934ea201a5 | ||
|
|
5dcd5b5af8 | ||
|
|
000124f3dd | ||
|
|
c37f104446 | ||
|
|
3cfa48987f | ||
|
|
79c22ee22c | ||
|
|
d3a2fa13a5 | ||
|
|
20078f1e19 | ||
|
|
72b86d9edf | ||
|
|
59634133bc | ||
|
|
1e34a5528b | ||
|
|
4aa3bd3ef2 | ||
|
|
f6581de304 | ||
|
|
fd225d87b4 | ||
|
|
9bb3f576ee | ||
|
|
30cdb373cc | ||
|
|
59c7d6a567 | ||
|
|
9e4e5f891e | ||
|
|
ea3ba991d1 | ||
|
|
1024c77289 | ||
|
|
36b29d6065 | ||
|
|
1c8177e185 | ||
|
|
3dd5d6bb71 | ||
|
|
16a641693a | ||
|
|
efdb075155 | ||
|
|
a99d52a406 | ||
|
|
852edea36e | ||
|
|
defa426259 | ||
|
|
3aadcfd683 | ||
|
|
0f5d59103a | ||
|
|
50b9120434 | ||
|
|
896c761502 | ||
|
|
381d1b381f | ||
|
|
72a428a439 | ||
|
|
7447e61dbc | ||
|
|
45ffc3cc22 |
29
.github/workflows/docker.yml
vendored
29
.github/workflows/docker.yml
vendored
@@ -7,14 +7,7 @@ on:
|
|||||||
description: 'Retag latest Docker images'
|
description: 'Retag latest Docker images'
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
options:
|
default: "true"
|
||||||
- "true"
|
|
||||||
- "false"
|
|
||||||
skip-test:
|
|
||||||
description: 'Skip test'
|
|
||||||
required: false
|
|
||||||
type: string
|
|
||||||
default: "false"
|
|
||||||
options:
|
options:
|
||||||
- "true"
|
- "true"
|
||||||
- "false"
|
- "false"
|
||||||
@@ -125,6 +118,16 @@ jobs:
|
|||||||
packages: python3 python3-venv python-is-python3 python3-pip nodejs npm curl zip unzip
|
packages: python3 python3-venv python-is-python3 python3-pip nodejs npm curl zip unzip
|
||||||
python-libs: kestra
|
python-libs: kestra
|
||||||
steps:
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
# Vars
|
||||||
|
- name: Set image name
|
||||||
|
id: vars
|
||||||
|
run: |
|
||||||
|
TAG=${GITHUB_REF#refs/*/}
|
||||||
|
echo "tag=${TAG}" >> $GITHUB_OUTPUT
|
||||||
|
echo "plugins=${{ matrix.image.plugins }}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
# Download release
|
# Download release
|
||||||
- name: Download release
|
- name: Download release
|
||||||
uses: robinraju/release-downloader@v1.10
|
uses: robinraju/release-downloader@v1.10
|
||||||
@@ -137,14 +140,6 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cp build/executable/* docker/app/kestra && chmod +x docker/app/kestra
|
cp build/executable/* docker/app/kestra && chmod +x docker/app/kestra
|
||||||
|
|
||||||
# Vars
|
|
||||||
- name: Set image name
|
|
||||||
id: vars
|
|
||||||
run: |
|
|
||||||
TAG=${GITHUB_REF#refs/*/}
|
|
||||||
echo "tag=${TAG}" >> $GITHUB_OUTPUT
|
|
||||||
echo "plugins=${{ matrix.image.plugins }}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
# Docker setup
|
# Docker setup
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v3
|
||||||
@@ -179,7 +174,7 @@ jobs:
|
|||||||
- name: Retag to latest
|
- name: Retag to latest
|
||||||
if: github.event.inputs.retag-latest == 'true'
|
if: github.event.inputs.retag-latest == 'true'
|
||||||
run: |
|
run: |
|
||||||
regctl image copy ${{ format('kestra/kestra:{0}{1}', steps.vars.outputs.tag, matrix.image.name) }} ${{ format('kestra/kestra:latest{1}', matrix.image.name) }}
|
regctl image copy ${{ format('kestra/kestra:{0}{1}', steps.vars.outputs.tag, matrix.image.name) }} ${{ format('kestra/kestra:latest{0}', matrix.image.name) }}
|
||||||
|
|
||||||
end:
|
end:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
@@ -454,7 +454,7 @@ subprojects {
|
|||||||
}
|
}
|
||||||
|
|
||||||
maven.pom {
|
maven.pom {
|
||||||
description 'The modern, scalable orchestrator & scheduler open source platform'
|
description = 'The modern, scalable orchestrator & scheduler open source platform'
|
||||||
|
|
||||||
developers {
|
developers {
|
||||||
developer {
|
developer {
|
||||||
|
|||||||
@@ -37,6 +37,12 @@ public class ExecutorCommand extends AbstractServerCommand {
|
|||||||
@CommandLine.Option(names = {"--skip-flows"}, split=",", description = "a list of flow identifiers (tenant|namespace|flowId) to skip, separated by a coma; for troubleshooting purpose only")
|
@CommandLine.Option(names = {"--skip-flows"}, split=",", description = "a list of flow identifiers (tenant|namespace|flowId) to skip, separated by a coma; for troubleshooting purpose only")
|
||||||
private List<String> skipFlows = Collections.emptyList();
|
private List<String> skipFlows = Collections.emptyList();
|
||||||
|
|
||||||
|
@CommandLine.Option(names = {"--skip-namespaces"}, split=",", description = "a list of namespace identifiers (tenant|namespace) to skip, separated by a coma; for troubleshooting purpose only")
|
||||||
|
private List<String> skipNamespaces = Collections.emptyList();
|
||||||
|
|
||||||
|
@CommandLine.Option(names = {"--skip-tenants"}, split=",", description = "a list of tenants to skip, separated by a coma; for troubleshooting purpose only")
|
||||||
|
private List<String> skipTenants = Collections.emptyList();
|
||||||
|
|
||||||
@CommandLine.Option(names = {"--start-executors"}, split=",", description = "a list of Kafka Stream executors to start, separated by a command. Use it only with the Kafka queue, for debugging purpose.")
|
@CommandLine.Option(names = {"--start-executors"}, split=",", description = "a list of Kafka Stream executors to start, separated by a command. Use it only with the Kafka queue, for debugging purpose.")
|
||||||
private List<String> startExecutors = Collections.emptyList();
|
private List<String> startExecutors = Collections.emptyList();
|
||||||
|
|
||||||
@@ -54,6 +60,8 @@ public class ExecutorCommand extends AbstractServerCommand {
|
|||||||
public Integer call() throws Exception {
|
public Integer call() throws Exception {
|
||||||
this.skipExecutionService.setSkipExecutions(skipExecutions);
|
this.skipExecutionService.setSkipExecutions(skipExecutions);
|
||||||
this.skipExecutionService.setSkipFlows(skipFlows);
|
this.skipExecutionService.setSkipFlows(skipFlows);
|
||||||
|
this.skipExecutionService.setSkipNamespaces(skipNamespaces);
|
||||||
|
this.skipExecutionService.setSkipTenants(skipTenants);
|
||||||
|
|
||||||
this.startExecutorService.applyOptions(startExecutors, notStartExecutors);
|
this.startExecutorService.applyOptions(startExecutors, notStartExecutors);
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ public class LocalCommand extends StandAloneCommand {
|
|||||||
"kestra.queue.type", "h2",
|
"kestra.queue.type", "h2",
|
||||||
"kestra.storage.type", "local",
|
"kestra.storage.type", "local",
|
||||||
"kestra.storage.local.base-path", data.toString(),
|
"kestra.storage.local.base-path", data.toString(),
|
||||||
"datasources.h2.url", "jdbc:h2:file:" + data.resolve("database") + ";DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE;LOCK_TIMEOUT=30000",
|
"datasources.h2.url", "jdbc:h2:file:" + data.resolve("database") + ";TIME ZONE=UTC;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE;LOCK_TIMEOUT=30000",
|
||||||
"datasources.h2.username", "sa",
|
"datasources.h2.username", "sa",
|
||||||
"datasources.h2.password", "",
|
"datasources.h2.password", "",
|
||||||
"datasources.h2.driverClassName", "org.h2.Driver",
|
"datasources.h2.driverClassName", "org.h2.Driver",
|
||||||
|
|||||||
@@ -49,6 +49,12 @@ public class StandAloneCommand extends AbstractServerCommand {
|
|||||||
@CommandLine.Option(names = {"--skip-flows"}, split=",", description = "a list of flow identifiers (namespace.flowId) to skip, separated by a coma; for troubleshooting purpose only")
|
@CommandLine.Option(names = {"--skip-flows"}, split=",", description = "a list of flow identifiers (namespace.flowId) to skip, separated by a coma; for troubleshooting purpose only")
|
||||||
private List<String> skipFlows = Collections.emptyList();
|
private List<String> skipFlows = Collections.emptyList();
|
||||||
|
|
||||||
|
@CommandLine.Option(names = {"--skip-namespaces"}, split=",", description = "a list of namespace identifiers (tenant|namespace) to skip, separated by a coma; for troubleshooting purpose only")
|
||||||
|
private List<String> skipNamespaces = Collections.emptyList();
|
||||||
|
|
||||||
|
@CommandLine.Option(names = {"--skip-tenants"}, split=",", description = "a list of tenants to skip, separated by a coma; for troubleshooting purpose only")
|
||||||
|
private List<String> skipTenants = Collections.emptyList();
|
||||||
|
|
||||||
@CommandLine.Option(names = {"--no-tutorials"}, description = "Flag to disable auto-loading of tutorial flows.")
|
@CommandLine.Option(names = {"--no-tutorials"}, description = "Flag to disable auto-loading of tutorial flows.")
|
||||||
boolean tutorialsDisabled = false;
|
boolean tutorialsDisabled = false;
|
||||||
|
|
||||||
@@ -74,6 +80,8 @@ public class StandAloneCommand extends AbstractServerCommand {
|
|||||||
public Integer call() throws Exception {
|
public Integer call() throws Exception {
|
||||||
this.skipExecutionService.setSkipExecutions(skipExecutions);
|
this.skipExecutionService.setSkipExecutions(skipExecutions);
|
||||||
this.skipExecutionService.setSkipFlows(skipFlows);
|
this.skipExecutionService.setSkipFlows(skipFlows);
|
||||||
|
this.skipExecutionService.setSkipNamespaces(skipNamespaces);
|
||||||
|
this.skipExecutionService.setSkipTenants(skipTenants);
|
||||||
|
|
||||||
this.startExecutorService.applyOptions(startExecutors, notStartExecutors);
|
this.startExecutorService.applyOptions(startExecutors, notStartExecutors);
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,22 @@ import lombok.NoArgsConstructor;
|
|||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Kestra event for killing an execution. A {@link ExecutionKilled} can be in two states:
|
||||||
|
* <p>
|
||||||
|
* <pre>
|
||||||
|
* - {@link State#REQUESTED}: The event was requested either by an Executor or by an external request.
|
||||||
|
* - {@link State#EXECUTED}: The event was consumed and processed by the Executor.
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* A {@link ExecutionKilled} will always transit from {@link State#REQUESTED} to {@link State#EXECUTED}
|
||||||
|
* regardless of whether the associated execution exist or not to ensure that Workers will be notified for the tasks
|
||||||
|
* to be killed no matter what the circumstances.
|
||||||
|
* <p>
|
||||||
|
* IMPORTANT: A {@link ExecutionKilled} is considered to be a fire-and-forget event. As a result, we do not manage a
|
||||||
|
* COMPLETED state, i.e., the Executor will never wait for Workers to process an executed {@link ExecutionKilled}
|
||||||
|
* before considering an execution to be KILLED.
|
||||||
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@EqualsAndHashCode
|
@EqualsAndHashCode
|
||||||
|
|||||||
@@ -8,22 +8,6 @@ import jakarta.validation.constraints.NotNull;
|
|||||||
import lombok.*;
|
import lombok.*;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
/**
|
|
||||||
* The Kestra event for killing an execution. A {@link ExecutionKilledExecution} can be in two states:
|
|
||||||
* <p>
|
|
||||||
* <pre>
|
|
||||||
* - {@link State#REQUESTED}: The event was requested either by an Executor or by an external request.
|
|
||||||
* - {@link State#EXECUTED}: The event was consumed and processed by the Executor.
|
|
||||||
* </pre>
|
|
||||||
*
|
|
||||||
* A {@link ExecutionKilledExecution} will always transit from {@link State#REQUESTED} to {@link State#EXECUTED}
|
|
||||||
* regardless of whether the associated execution exist or not to ensure that Workers will be notified for the tasks
|
|
||||||
* to be killed no matter what the circumstances.
|
|
||||||
* <p>
|
|
||||||
* IMPORTANT: A {@link ExecutionKilledExecution} is considered to be a fire-and-forget event. As a result, we do not manage a
|
|
||||||
* COMPLETED state, i.e., the Executor will never wait for Workers to process an executed {@link ExecutionKilledExecution}
|
|
||||||
* before considering an execution to be KILLED.
|
|
||||||
*/
|
|
||||||
@Getter
|
@Getter
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@EqualsAndHashCode
|
@EqualsAndHashCode
|
||||||
@@ -47,8 +31,9 @@ public class ExecutionKilledExecution extends ExecutionKilled implements TenantI
|
|||||||
Boolean isOnKillCascade;
|
Boolean isOnKillCascade;
|
||||||
|
|
||||||
public boolean isEqual(WorkerTask workerTask) {
|
public boolean isEqual(WorkerTask workerTask) {
|
||||||
return (workerTask.getTaskRun().getTenantId() == null || (workerTask.getTaskRun().getTenantId() != null && workerTask.getTaskRun().getTenantId().equals(this.tenantId))) &&
|
String taskTenantId = workerTask.getTaskRun().getTenantId();
|
||||||
workerTask.getTaskRun().getExecutionId().equals(this.executionId);
|
String taskExecutionId = workerTask.getTaskRun().getExecutionId();
|
||||||
|
return (taskTenantId == null || taskTenantId.equals(this.tenantId)) && taskExecutionId.equals(this.executionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,18 +1,21 @@
|
|||||||
package io.kestra.core.models.flows.input;
|
package io.kestra.core.models.flows.input;
|
||||||
|
|
||||||
import io.kestra.core.models.flows.Input;
|
import io.kestra.core.models.flows.Input;
|
||||||
|
import jakarta.validation.ConstraintViolationException;
|
||||||
|
import lombok.Builder;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
|
||||||
import jakarta.validation.ConstraintViolationException;
|
|
||||||
|
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@Getter
|
@Getter
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class FileInput extends Input<URI> {
|
public class FileInput extends Input<URI> {
|
||||||
|
@Builder.Default
|
||||||
|
public String extension = ".upl";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void validate(URI input) throws ConstraintViolationException {
|
public void validate(URI input) throws ConstraintViolationException {
|
||||||
// no validation yet
|
// no validation yet
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ public class Trigger extends TriggerContext {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String flowUid() {
|
public String flowUid() {
|
||||||
return Flow.uid(this.getTenantId(), this.getNamespace(), this.getFlowId(), Optional.of(this.getFlowRevision()));
|
return Flow.uidWithoutRevision(this.getTenantId(), this.getNamespace(), this.getFlowId());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -90,7 +90,6 @@ public class Trigger extends TriggerContext {
|
|||||||
.tenantId(flow.getTenantId())
|
.tenantId(flow.getTenantId())
|
||||||
.namespace(flow.getNamespace())
|
.namespace(flow.getNamespace())
|
||||||
.flowId(flow.getId())
|
.flowId(flow.getId())
|
||||||
.flowRevision(flow.getRevision())
|
|
||||||
.triggerId(abstractTrigger.getId())
|
.triggerId(abstractTrigger.getId())
|
||||||
.stopAfter(abstractTrigger.getStopAfter())
|
.stopAfter(abstractTrigger.getStopAfter())
|
||||||
.build();
|
.build();
|
||||||
@@ -137,7 +136,6 @@ public class Trigger extends TriggerContext {
|
|||||||
.tenantId(execution.getTenantId())
|
.tenantId(execution.getTenantId())
|
||||||
.namespace(execution.getNamespace())
|
.namespace(execution.getNamespace())
|
||||||
.flowId(execution.getFlowId())
|
.flowId(execution.getFlowId())
|
||||||
.flowRevision(execution.getFlowRevision())
|
|
||||||
.triggerId(execution.getTrigger().getId())
|
.triggerId(execution.getTrigger().getId())
|
||||||
.date(trigger.getDate())
|
.date(trigger.getDate())
|
||||||
.nextExecutionDate(trigger.getNextExecutionDate())
|
.nextExecutionDate(trigger.getNextExecutionDate())
|
||||||
@@ -175,7 +173,6 @@ public class Trigger extends TriggerContext {
|
|||||||
.tenantId(flow.getTenantId())
|
.tenantId(flow.getTenantId())
|
||||||
.namespace(flow.getNamespace())
|
.namespace(flow.getNamespace())
|
||||||
.flowId(flow.getId())
|
.flowId(flow.getId())
|
||||||
.flowRevision(flow.getRevision())
|
|
||||||
.triggerId(abstractTrigger.getId())
|
.triggerId(abstractTrigger.getId())
|
||||||
.date(ZonedDateTime.now().truncatedTo(ChronoUnit.SECONDS))
|
.date(ZonedDateTime.now().truncatedTo(ChronoUnit.SECONDS))
|
||||||
.nextExecutionDate(nextDate)
|
.nextExecutionDate(nextDate)
|
||||||
@@ -225,7 +222,6 @@ public class Trigger extends TriggerContext {
|
|||||||
.tenantId(this.getTenantId())
|
.tenantId(this.getTenantId())
|
||||||
.namespace(this.getNamespace())
|
.namespace(this.getNamespace())
|
||||||
.flowId(this.getFlowId())
|
.flowId(this.getFlowId())
|
||||||
.flowRevision(this.getFlowRevision())
|
|
||||||
.triggerId(this.getTriggerId())
|
.triggerId(this.getTriggerId())
|
||||||
.date(this.getDate())
|
.date(this.getDate())
|
||||||
.nextExecutionDate(nextExecutionDate)
|
.nextExecutionDate(nextExecutionDate)
|
||||||
@@ -240,7 +236,6 @@ public class Trigger extends TriggerContext {
|
|||||||
.tenantId(this.getTenantId())
|
.tenantId(this.getTenantId())
|
||||||
.namespace(this.getNamespace())
|
.namespace(this.getNamespace())
|
||||||
.flowId(this.getFlowId())
|
.flowId(this.getFlowId())
|
||||||
.flowRevision(this.getFlowRevision())
|
|
||||||
.triggerId(this.getTriggerId())
|
.triggerId(this.getTriggerId())
|
||||||
.date(this.getDate())
|
.date(this.getDate())
|
||||||
.nextExecutionDate(this.getNextExecutionDate())
|
.nextExecutionDate(this.getNextExecutionDate())
|
||||||
@@ -301,7 +296,6 @@ public class Trigger extends TriggerContext {
|
|||||||
.tenantId(triggerContext.getTenantId())
|
.tenantId(triggerContext.getTenantId())
|
||||||
.namespace(triggerContext.getNamespace())
|
.namespace(triggerContext.getNamespace())
|
||||||
.flowId(triggerContext.getFlowId())
|
.flowId(triggerContext.getFlowId())
|
||||||
.flowRevision(triggerContext.getFlowRevision())
|
|
||||||
.triggerId(triggerContext.getTriggerId())
|
.triggerId(triggerContext.getTriggerId())
|
||||||
.date(triggerContext.getDate())
|
.date(triggerContext.getDate())
|
||||||
.backfill(triggerContext.getBackfill())
|
.backfill(triggerContext.getBackfill())
|
||||||
|
|||||||
@@ -29,9 +29,6 @@ public class TriggerContext {
|
|||||||
@NotNull
|
@NotNull
|
||||||
private String flowId;
|
private String flowId;
|
||||||
|
|
||||||
@NotNull
|
|
||||||
private Integer flowRevision;
|
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
private String triggerId;
|
private String triggerId;
|
||||||
|
|
||||||
@@ -53,7 +50,6 @@ public class TriggerContext {
|
|||||||
this.tenantId = b.tenantId;
|
this.tenantId = b.tenantId;
|
||||||
this.namespace = b.namespace;
|
this.namespace = b.namespace;
|
||||||
this.flowId = b.flowId;
|
this.flowId = b.flowId;
|
||||||
this.flowRevision = b.flowRevision;
|
|
||||||
this.triggerId = b.triggerId;
|
this.triggerId = b.triggerId;
|
||||||
this.date = b.date;
|
this.date = b.date;
|
||||||
this.nextExecutionDate = b.nextExecutionDate;
|
this.nextExecutionDate = b.nextExecutionDate;
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package io.kestra.core.models.triggers;
|
package io.kestra.core.models.triggers;
|
||||||
|
|
||||||
import io.kestra.core.exceptions.IllegalVariableEvaluationException;
|
|
||||||
import io.kestra.core.models.Label;
|
|
||||||
import io.kestra.core.models.conditions.ConditionContext;
|
import io.kestra.core.models.conditions.ConditionContext;
|
||||||
import io.kestra.core.models.executions.Execution;
|
import io.kestra.core.models.executions.Execution;
|
||||||
import io.kestra.core.models.executions.ExecutionTrigger;
|
import io.kestra.core.models.executions.ExecutionTrigger;
|
||||||
@@ -22,7 +20,7 @@ public abstract class TriggerService {
|
|||||||
ExecutionTrigger executionTrigger = ExecutionTrigger.of(trigger, variables);
|
ExecutionTrigger executionTrigger = ExecutionTrigger.of(trigger, variables);
|
||||||
RunContext runContext = conditionContext.getRunContext();
|
RunContext runContext = conditionContext.getRunContext();
|
||||||
|
|
||||||
return generateExecution(runContext.getTriggerExecutionId(), trigger, context, executionTrigger);
|
return generateExecution(runContext.getTriggerExecutionId(), trigger, context, executionTrigger, conditionContext.getFlow().getRevision());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Execution generateExecution(
|
public static Execution generateExecution(
|
||||||
@@ -34,30 +32,32 @@ public abstract class TriggerService {
|
|||||||
ExecutionTrigger executionTrigger = ExecutionTrigger.of(trigger, output);
|
ExecutionTrigger executionTrigger = ExecutionTrigger.of(trigger, output);
|
||||||
RunContext runContext = conditionContext.getRunContext();
|
RunContext runContext = conditionContext.getRunContext();
|
||||||
|
|
||||||
return generateExecution(runContext.getTriggerExecutionId(), trigger, context, executionTrigger);
|
return generateExecution(runContext.getTriggerExecutionId(), trigger, context, executionTrigger, conditionContext.getFlow().getRevision());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Execution generateRealtimeExecution(
|
public static Execution generateRealtimeExecution(
|
||||||
AbstractTrigger trigger,
|
AbstractTrigger trigger,
|
||||||
|
ConditionContext conditionContext,
|
||||||
TriggerContext context,
|
TriggerContext context,
|
||||||
Output output
|
Output output
|
||||||
) {
|
) {
|
||||||
ExecutionTrigger executionTrigger = ExecutionTrigger.of(trigger, output);
|
ExecutionTrigger executionTrigger = ExecutionTrigger.of(trigger, output);
|
||||||
|
|
||||||
return generateExecution(IdUtils.create(), trigger, context, executionTrigger);
|
return generateExecution(IdUtils.create(), trigger, context, executionTrigger, conditionContext.getFlow().getRevision());
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Execution generateExecution(
|
private static Execution generateExecution(
|
||||||
String id,
|
String id,
|
||||||
AbstractTrigger trigger,
|
AbstractTrigger trigger,
|
||||||
TriggerContext context,
|
TriggerContext context,
|
||||||
ExecutionTrigger executionTrigger
|
ExecutionTrigger executionTrigger,
|
||||||
|
Integer flowRevision
|
||||||
) {
|
) {
|
||||||
return Execution.builder()
|
return Execution.builder()
|
||||||
.id(id)
|
.id(id)
|
||||||
.namespace(context.getNamespace())
|
.namespace(context.getNamespace())
|
||||||
.flowId(context.getFlowId())
|
.flowId(context.getFlowId())
|
||||||
.flowRevision(context.getFlowRevision())
|
.flowRevision(flowRevision)
|
||||||
.state(new State())
|
.state(new State())
|
||||||
.trigger(executionTrigger)
|
.trigger(executionTrigger)
|
||||||
.labels(trigger.getLabels() == null ? null : trigger.getLabels())
|
.labels(trigger.getLabels() == null ? null : trigger.getLabels())
|
||||||
|
|||||||
@@ -35,6 +35,11 @@ public class Executor {
|
|||||||
private ExecutionResumed executionResumed;
|
private ExecutionResumed executionResumed;
|
||||||
private ExecutionResumed joinedExecutionResumed;
|
private ExecutionResumed joinedExecutionResumed;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The sequence id should be incremented each time the execution is persisted after mutation.
|
||||||
|
*/
|
||||||
|
private long seqId = 0L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of {@link ExecutionKilled} to be propagated part of the execution.
|
* List of {@link ExecutionKilled} to be propagated part of the execution.
|
||||||
*/
|
*/
|
||||||
@@ -45,6 +50,12 @@ public class Executor {
|
|||||||
this.offset = offset;
|
this.offset = offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Executor(Execution execution, Long offset, long seqId) {
|
||||||
|
this.execution = execution;
|
||||||
|
this.offset = offset;
|
||||||
|
this.seqId = seqId;
|
||||||
|
}
|
||||||
|
|
||||||
public Executor(WorkerTaskResult workerTaskResult) {
|
public Executor(WorkerTaskResult workerTaskResult) {
|
||||||
this.joinedWorkerTaskResult = workerTaskResult;
|
this.joinedWorkerTaskResult = workerTaskResult;
|
||||||
}
|
}
|
||||||
@@ -148,7 +159,18 @@ public class Executor {
|
|||||||
public Executor serialize() {
|
public Executor serialize() {
|
||||||
return new Executor(
|
return new Executor(
|
||||||
this.execution,
|
this.execution,
|
||||||
this.offset
|
this.offset,
|
||||||
|
this.seqId
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Increments and returns the execution sequence id.
|
||||||
|
*
|
||||||
|
* @return the sequence id.
|
||||||
|
*/
|
||||||
|
public long incrementAndGetSeqId() {
|
||||||
|
this.seqId++;
|
||||||
|
return seqId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package io.kestra.core.runners;
|
|||||||
|
|
||||||
import io.kestra.core.exceptions.IllegalVariableEvaluationException;
|
import io.kestra.core.exceptions.IllegalVariableEvaluationException;
|
||||||
import io.kestra.core.models.tasks.runners.PluginUtilsService;
|
import io.kestra.core.models.tasks.runners.PluginUtilsService;
|
||||||
|
import io.kestra.core.utils.IdUtils;
|
||||||
import io.kestra.core.utils.ListUtils;
|
import io.kestra.core.utils.ListUtils;
|
||||||
import org.apache.commons.io.IOUtils;
|
import org.apache.commons.io.IOUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@@ -44,17 +45,16 @@ public abstract class FilesService {
|
|||||||
file.getParentFile().mkdirs();
|
file.getParentFile().mkdirs();
|
||||||
}
|
}
|
||||||
|
|
||||||
var fileContent = runContext.render(input, additionalVars);
|
if (input == null) {
|
||||||
if (fileContent == null) {
|
|
||||||
file.createNewFile();
|
file.createNewFile();
|
||||||
} else {
|
} else {
|
||||||
if (fileContent.startsWith("kestra://")) {
|
if (input.startsWith("kestra://")) {
|
||||||
try (var is = runContext.storage().getFile(URI.create(fileContent));
|
try (var is = runContext.storage().getFile(URI.create(input));
|
||||||
var out = new FileOutputStream(file)) {
|
var out = new FileOutputStream(file)) {
|
||||||
IOUtils.copyLarge(is, out);
|
IOUtils.copyLarge(is, out);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Files.write(file.toPath(), fileContent.getBytes());
|
Files.write(file.toPath(), input.getBytes());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
@@ -85,10 +85,14 @@ public abstract class FilesService {
|
|||||||
.filter(path -> pathMatcher.matches(runContext.tempDir().relativize(path)))
|
.filter(path -> pathMatcher.matches(runContext.tempDir().relativize(path)))
|
||||||
.map(throwFunction(path -> new AbstractMap.SimpleEntry<>(
|
.map(throwFunction(path -> new AbstractMap.SimpleEntry<>(
|
||||||
runContext.tempDir().relativize(path).toString(),
|
runContext.tempDir().relativize(path).toString(),
|
||||||
runContext.storage().putFile(path.toFile())
|
runContext.storage().putFile(path.toFile(), resolveUniqueNameForFile(path))
|
||||||
)))
|
)))
|
||||||
.toList()
|
.toList()
|
||||||
.stream();
|
.stream();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static String resolveUniqueNameForFile(final Path path) {
|
||||||
|
return IdUtils.from(path.toString()) + "-" + path.toFile().getName();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import io.kestra.core.models.flows.Flow;
|
|||||||
import io.kestra.core.models.flows.Input;
|
import io.kestra.core.models.flows.Input;
|
||||||
import io.kestra.core.models.flows.Type;
|
import io.kestra.core.models.flows.Type;
|
||||||
import io.kestra.core.models.flows.input.ArrayInput;
|
import io.kestra.core.models.flows.input.ArrayInput;
|
||||||
|
import io.kestra.core.models.flows.input.FileInput;
|
||||||
import io.kestra.core.models.tasks.common.EncryptedString;
|
import io.kestra.core.models.tasks.common.EncryptedString;
|
||||||
import io.kestra.core.serializers.JacksonMapper;
|
import io.kestra.core.serializers.JacksonMapper;
|
||||||
import io.kestra.core.storages.StorageInterface;
|
import io.kestra.core.storages.StorageInterface;
|
||||||
@@ -85,7 +86,9 @@ public class FlowInputOutput {
|
|||||||
.subscribeOn(Schedulers.boundedElastic())
|
.subscribeOn(Schedulers.boundedElastic())
|
||||||
.map(throwFunction(input -> {
|
.map(throwFunction(input -> {
|
||||||
if (input instanceof CompletedFileUpload fileUpload) {
|
if (input instanceof CompletedFileUpload fileUpload) {
|
||||||
File tempFile = File.createTempFile(fileUpload.getFilename() + "_", ".upl");
|
String fileExtension = inputs.stream().filter(flowInput -> flowInput instanceof FileInput && flowInput.getId().equals(fileUpload.getFilename())).map(flowInput -> ((FileInput) flowInput).getExtension()).findFirst().orElse(".upl");
|
||||||
|
fileExtension = fileExtension.startsWith(".") ? fileExtension : "." + fileExtension;
|
||||||
|
File tempFile = File.createTempFile(fileUpload.getFilename() + "_", fileExtension);
|
||||||
try (var inputStream = fileUpload.getInputStream();
|
try (var inputStream = fileUpload.getInputStream();
|
||||||
var outputStream = new FileOutputStream(tempFile)) {
|
var outputStream = new FileOutputStream(tempFile)) {
|
||||||
long transferredBytes = inputStream.transferTo(outputStream);
|
long transferredBytes = inputStream.transferTo(outputStream);
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import io.kestra.core.services.FlowListenersInterface;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.function.BiConsumer;
|
import java.util.function.BiConsumer;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
@@ -98,13 +99,13 @@ public class FlowListeners implements FlowListenersInterface {
|
|||||||
private Optional<Flow> previous(Flow flow) {
|
private Optional<Flow> previous(Flow flow) {
|
||||||
return flows
|
return flows
|
||||||
.stream()
|
.stream()
|
||||||
.filter(r -> r.getNamespace().equals(flow.getNamespace()) && r.getId().equals(flow.getId()))
|
.filter(r -> Objects.equals(r.getTenantId(), flow.getTenantId()) && r.getNamespace().equals(flow.getNamespace()) && r.getId().equals(flow.getId()))
|
||||||
.findFirst();
|
.findFirst();
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean remove(Flow flow) {
|
private boolean remove(Flow flow) {
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
boolean remove = flows.removeIf(r -> r.getNamespace().equals(flow.getNamespace()) && r.getId().equals(flow.getId()));
|
boolean remove = flows.removeIf(r -> Objects.equals(r.getTenantId(), flow.getTenantId()) && r.getNamespace().equals(flow.getNamespace()) && r.getId().equals(flow.getId()));
|
||||||
if (!remove && flow.isDeleted()) {
|
if (!remove && flow.isDeleted()) {
|
||||||
log.warn("Can't remove flow {}.{}", flow.getNamespace(), flow.getId());
|
log.warn("Can't remove flow {}.{}", flow.getNamespace(), flow.getId());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public class NamespaceFilesService {
|
|||||||
private StorageInterface storageInterface;
|
private StorageInterface storageInterface;
|
||||||
|
|
||||||
public List<URI> inject(RunContext runContext, String tenantId, String namespace, Path basePath, NamespaceFiles namespaceFiles) throws Exception {
|
public List<URI> inject(RunContext runContext, String tenantId, String namespace, Path basePath, NamespaceFiles namespaceFiles) throws Exception {
|
||||||
if (!namespaceFiles.getEnabled()) {
|
if (!Boolean.TRUE.equals(namespaceFiles.getEnabled())) {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -339,7 +339,7 @@ public class RunContext {
|
|||||||
if (execution.getTaskRunList() != null) {
|
if (execution.getTaskRunList() != null) {
|
||||||
Map<String, Object> outputs = new HashMap<>(execution.outputs());
|
Map<String, Object> outputs = new HashMap<>(execution.outputs());
|
||||||
if (decryptVariables) {
|
if (decryptVariables) {
|
||||||
decryptOutputs(outputs);
|
outputs = decryptOutputs(outputs);
|
||||||
}
|
}
|
||||||
builder.put("outputs", outputs);
|
builder.put("outputs", outputs);
|
||||||
}
|
}
|
||||||
@@ -401,25 +401,37 @@ public class RunContext {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.runContextLogger != null) {
|
||||||
|
builder.put("addSecretConsumer", (Consumer<String>) s -> this.runContextLogger.usedSecret(s));
|
||||||
|
}
|
||||||
|
|
||||||
return builder.build();
|
return builder.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void decryptOutputs(Map<String, Object> outputs) {
|
private Map<String, Object> decryptOutputs(Map<String, Object> mapToDecrypt) {
|
||||||
for (var entry: outputs.entrySet()) {
|
if (mapToDecrypt == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, Object> decryptedMap = new HashMap<>();
|
||||||
|
for (var entry: mapToDecrypt.entrySet()) {
|
||||||
|
decryptedMap.put(entry.getKey(), entry.getValue());
|
||||||
if (entry.getValue() instanceof Map map) {
|
if (entry.getValue() instanceof Map map) {
|
||||||
// if some outputs are of type EncryptedString we decode them and replace the object
|
// if some value are of type EncryptedString we decode them and replace the object
|
||||||
if (EncryptedString.TYPE.equalsIgnoreCase((String)map.get("type"))) {
|
if (EncryptedString.TYPE.equalsIgnoreCase((String)map.get("type"))) {
|
||||||
try {
|
try {
|
||||||
String decoded = decrypt((String) map.get("value"));
|
String decoded = decrypt((String) map.get("value"));
|
||||||
outputs.put(entry.getKey(), decoded);
|
decryptedMap.put(entry.getKey(), decoded);
|
||||||
} catch (GeneralSecurityException e) {
|
} catch (GeneralSecurityException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
decryptOutputs((Map<String, Object>) map);
|
decryptedMap.put(entry.getKey(), decryptOutputs((Map<String, Object>) map));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return decryptedMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map<String, Object> variables(TaskRun taskRun) {
|
private Map<String, Object> variables(TaskRun taskRun) {
|
||||||
@@ -502,6 +514,8 @@ public class RunContext {
|
|||||||
runContext.runContextLogger = this.runContextLogger;
|
runContext.runContextLogger = this.runContextLogger;
|
||||||
runContext.tempBasedPath = this.tempBasedPath;
|
runContext.tempBasedPath = this.tempBasedPath;
|
||||||
runContext.temporaryDirectory = this.temporaryDirectory;
|
runContext.temporaryDirectory = this.temporaryDirectory;
|
||||||
|
runContext.pluginConfiguration = this.pluginConfiguration;
|
||||||
|
runContext.secretKey = this.secretKey;
|
||||||
|
|
||||||
return runContext;
|
return runContext;
|
||||||
}
|
}
|
||||||
@@ -583,6 +597,17 @@ public class RunContext {
|
|||||||
return newContext;
|
return newContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public RunContext forWorkingDirectoryTask(final Task task) {
|
||||||
|
Map<String, Object> decryptedVariables = new HashMap<>(this.variables);
|
||||||
|
if (this.variables.get("outputs") != null) {
|
||||||
|
decryptedVariables.put("outputs", decryptOutputs((Map<String, Object>) this.variables.get("outputs")));
|
||||||
|
}
|
||||||
|
|
||||||
|
RunContext newRunContext = this.clone(decryptedVariables);
|
||||||
|
newRunContext.initPluginConfiguration(applicationContext, task.getClass(), task.getType());
|
||||||
|
return newRunContext;
|
||||||
|
}
|
||||||
|
|
||||||
public RunContext forTaskRunner(TaskRunner taskRunner) {
|
public RunContext forTaskRunner(TaskRunner taskRunner) {
|
||||||
this.initPluginConfiguration(applicationContext, taskRunner.getClass(), taskRunner.getType());
|
this.initPluginConfiguration(applicationContext, taskRunner.getClass(), taskRunner.getType());
|
||||||
|
|
||||||
|
|||||||
@@ -285,7 +285,7 @@ public class Worker implements Service, Runnable, AutoCloseable {
|
|||||||
WorkerTask currentWorkerTask = workingDirectory.workerTask(
|
WorkerTask currentWorkerTask = workingDirectory.workerTask(
|
||||||
workerTask.getTaskRun(),
|
workerTask.getTaskRun(),
|
||||||
currentTask,
|
currentTask,
|
||||||
runContext
|
runContext.forWorkingDirectoryTask(currentTask)
|
||||||
);
|
);
|
||||||
|
|
||||||
// all tasks will be handled immediately by the worker
|
// all tasks will be handled immediately by the worker
|
||||||
|
|||||||
@@ -178,7 +178,6 @@ public abstract class AbstractScheduler implements Scheduler, Service {
|
|||||||
if (abstractTrigger instanceof WorkerTriggerInterface) {
|
if (abstractTrigger instanceof WorkerTriggerInterface) {
|
||||||
RunContext runContext = runContextFactory.of(flow, abstractTrigger);
|
RunContext runContext = runContextFactory.of(flow, abstractTrigger);
|
||||||
ConditionContext conditionContext = conditionService.conditionContext(runContext, flow, null);
|
ConditionContext conditionContext = conditionService.conditionContext(runContext, flow, null);
|
||||||
Trigger trigger = Trigger.of(flow, abstractTrigger);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
this.triggerState.update(flow, abstractTrigger, conditionContext);
|
this.triggerState.update(flow, abstractTrigger, conditionContext);
|
||||||
@@ -186,6 +185,7 @@ public abstract class AbstractScheduler implements Scheduler, Service {
|
|||||||
logError(conditionContext, flow, abstractTrigger, e);
|
logError(conditionContext, flow, abstractTrigger, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Trigger trigger = Trigger.of(flow, abstractTrigger);
|
||||||
this.executionKilledQueue.emit(ExecutionKilledTrigger
|
this.executionKilledQueue.emit(ExecutionKilledTrigger
|
||||||
.builder()
|
.builder()
|
||||||
.tenantId(trigger.getTenantId())
|
.tenantId(trigger.getTenantId())
|
||||||
@@ -255,7 +255,6 @@ public abstract class AbstractScheduler implements Scheduler, Service {
|
|||||||
.tenantId(flowAndTrigger.flow().getTenantId())
|
.tenantId(flowAndTrigger.flow().getTenantId())
|
||||||
.namespace(flowAndTrigger.flow().getNamespace())
|
.namespace(flowAndTrigger.flow().getNamespace())
|
||||||
.flowId(flowAndTrigger.flow().getId())
|
.flowId(flowAndTrigger.flow().getId())
|
||||||
.flowRevision(flowAndTrigger.flow().getRevision())
|
|
||||||
.triggerId(flowAndTrigger.trigger().getId())
|
.triggerId(flowAndTrigger.trigger().getId())
|
||||||
.date(now())
|
.date(now())
|
||||||
.nextExecutionDate(nextExecutionDate)
|
.nextExecutionDate(nextExecutionDate)
|
||||||
@@ -368,7 +367,7 @@ public abstract class AbstractScheduler implements Scheduler, Service {
|
|||||||
public List<FlowWithTriggers> schedulerTriggers() {
|
public List<FlowWithTriggers> schedulerTriggers() {
|
||||||
Map<String, Flow> flows = this.flowListeners.flows()
|
Map<String, Flow> flows = this.flowListeners.flows()
|
||||||
.stream()
|
.stream()
|
||||||
.collect(Collectors.toMap(Flow::uid, Function.identity()));
|
.collect(Collectors.toMap(Flow::uidWithoutRevision, Function.identity()));
|
||||||
|
|
||||||
return this.triggerState.findAllForAllTenants().stream()
|
return this.triggerState.findAllForAllTenants().stream()
|
||||||
.filter(trigger -> flows.containsKey(trigger.flowUid()))
|
.filter(trigger -> flows.containsKey(trigger.flowUid()))
|
||||||
@@ -526,7 +525,6 @@ public abstract class AbstractScheduler implements Scheduler, Service {
|
|||||||
.tenantId(f.getTriggerContext().getTenantId())
|
.tenantId(f.getTriggerContext().getTenantId())
|
||||||
.namespace(f.getTriggerContext().getNamespace())
|
.namespace(f.getTriggerContext().getNamespace())
|
||||||
.flowId(f.getTriggerContext().getFlowId())
|
.flowId(f.getTriggerContext().getFlowId())
|
||||||
.flowRevision(f.getTriggerContext().getFlowRevision())
|
|
||||||
.labels(f.getFlow().getLabels())
|
.labels(f.getFlow().getLabels())
|
||||||
.state(new State().withState(State.Type.FAILED))
|
.state(new State().withState(State.Type.FAILED))
|
||||||
.build();
|
.build();
|
||||||
@@ -849,7 +847,6 @@ public abstract class AbstractScheduler implements Scheduler, Service {
|
|||||||
.tenantId(f.getTriggerContext().getTenantId())
|
.tenantId(f.getTriggerContext().getTenantId())
|
||||||
.namespace(f.getTriggerContext().getNamespace())
|
.namespace(f.getTriggerContext().getNamespace())
|
||||||
.flowId(f.getTriggerContext().getFlowId())
|
.flowId(f.getTriggerContext().getFlowId())
|
||||||
.flowRevision(f.getTriggerContext().getFlowRevision())
|
|
||||||
.triggerId(f.getTriggerContext().getTriggerId())
|
.triggerId(f.getTriggerContext().getTriggerId())
|
||||||
.date(f.getTriggerContext().getNextExecutionDate())
|
.date(f.getTriggerContext().getNextExecutionDate())
|
||||||
.nextExecutionDate(f.getTriggerContext().getNextExecutionDate())
|
.nextExecutionDate(f.getTriggerContext().getNextExecutionDate())
|
||||||
|
|||||||
@@ -478,6 +478,7 @@ public class ExecutionService {
|
|||||||
.executionId(childExecution.getId())
|
.executionId(childExecution.getId())
|
||||||
.isOnKillCascade(true)
|
.isOnKillCascade(true)
|
||||||
.state(ExecutionKilled.State.REQUESTED) // Event will be reentrant in the Executor.
|
.state(ExecutionKilled.State.REQUESTED) // Event will be reentrant in the Executor.
|
||||||
|
.tenantId(tenantId)
|
||||||
.build()
|
.build()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,13 +12,23 @@ import java.util.List;
|
|||||||
public class SkipExecutionService {
|
public class SkipExecutionService {
|
||||||
private volatile List<String> skipExecutions = Collections.emptyList();
|
private volatile List<String> skipExecutions = Collections.emptyList();
|
||||||
private volatile List<FlowId> skipFlows = Collections.emptyList();
|
private volatile List<FlowId> skipFlows = Collections.emptyList();
|
||||||
|
private volatile List<NamespaceId> skipNamespaces = Collections.emptyList();
|
||||||
|
private volatile List<String> skipTenants = Collections.emptyList();
|
||||||
|
|
||||||
public synchronized void setSkipExecutions(List<String> skipExecutions) {
|
public synchronized void setSkipExecutions(List<String> skipExecutions) {
|
||||||
this.skipExecutions = skipExecutions;
|
this.skipExecutions = skipExecutions == null ? Collections.emptyList() : skipExecutions;
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void setSkipFlows(List<String> skipFlows) {
|
public synchronized void setSkipFlows(List<String> skipFlows) {
|
||||||
this.skipFlows = skipFlows == null ? Collections.emptyList() : skipFlows.stream().map(flow -> FlowId.from(flow)).toList();
|
this.skipFlows = skipFlows == null ? Collections.emptyList() : skipFlows.stream().map(FlowId::from).toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public synchronized void setSkipNamespaces(List<String> skipNamespaces) {
|
||||||
|
this.skipNamespaces = skipNamespaces == null ? Collections.emptyList() : skipNamespaces.stream().map(NamespaceId::from).toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public synchronized void setSkipTenants(List<String> skipTenants) {
|
||||||
|
this.skipTenants = skipTenants == null ? Collections.emptyList() : skipTenants;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -38,17 +48,30 @@ public class SkipExecutionService {
|
|||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
boolean skipExecution(String tenant, String namespace, String flow, String executionId) {
|
boolean skipExecution(String tenant, String namespace, String flow, String executionId) {
|
||||||
return skipExecutions.contains(executionId) ||
|
return (tenant != null && skipTenants.contains(tenant)) ||
|
||||||
skipFlows.contains(new FlowId(tenant, namespace, flow));
|
skipNamespaces.contains(new NamespaceId(tenant, namespace)) ||
|
||||||
|
skipFlows.contains(new FlowId(tenant, namespace, flow)) ||
|
||||||
|
(executionId != null && skipExecutions.contains(executionId));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String[] splitIdParts(String id) {
|
||||||
|
return id.split("\\|");
|
||||||
}
|
}
|
||||||
|
|
||||||
record FlowId(String tenant, String namespace, String flow) {
|
record FlowId(String tenant, String namespace, String flow) {
|
||||||
static FlowId from(String flowId) {
|
static FlowId from(String flowId) {
|
||||||
String[] parts = flowId.split("\\|");
|
String[] parts = SkipExecutionService.splitIdParts(flowId);
|
||||||
if (parts.length == 3) {
|
if (parts.length == 3) {
|
||||||
return new FlowId(parts[0], parts[1], parts[2]);
|
return new FlowId(parts[0], parts[1], parts[2]);
|
||||||
}
|
}
|
||||||
return new FlowId(null, parts[0], parts[1]);
|
return new FlowId(null, parts[0], parts[1]);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
record NamespaceId(String tenant, String namespace) {
|
||||||
|
static NamespaceId from(String namespaceId) {
|
||||||
|
String[] parts = SkipExecutionService.splitIdParts(namespaceId);
|
||||||
|
return new NamespaceId(parts[0], parts[1]);
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -152,7 +152,6 @@ abstract public class TestsUtils {
|
|||||||
.triggerId(trigger.getId())
|
.triggerId(trigger.getId())
|
||||||
.flowId(flow.getId())
|
.flowId(flow.getId())
|
||||||
.namespace(flow.getNamespace())
|
.namespace(flow.getNamespace())
|
||||||
.flowRevision(flow.getRevision())
|
|
||||||
.date(ZonedDateTime.now())
|
.date(ZonedDateTime.now())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
|||||||
@@ -270,7 +270,7 @@ public class WorkingDirectory extends Sequential implements NamespaceFilesInterf
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.namespaceFiles != null ) {
|
if (this.namespaceFiles != null && Boolean.TRUE.equals(this.namespaceFiles.getEnabled())) {
|
||||||
NamespaceFilesService namespaceFilesService = runContext.getApplicationContext().getBean(NamespaceFilesService.class);
|
NamespaceFilesService namespaceFilesService = runContext.getApplicationContext().getBean(NamespaceFilesService.class);
|
||||||
namespaceFilesService.inject(runContext, taskRun.getTenantId(), taskRun.getNamespace(), runContext.tempDir(), this.namespaceFiles);
|
namespaceFilesService.inject(runContext, taskRun.getTenantId(), taskRun.getNamespace(), runContext.tempDir(), this.namespaceFiles);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import java.net.URI;
|
|||||||
import java.security.GeneralSecurityException;
|
import java.security.GeneralSecurityException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.OptionalInt;
|
||||||
|
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@ToString
|
@ToString
|
||||||
@@ -122,6 +123,16 @@ public class Request extends AbstractHttp implements RunnableTask<Request.Output
|
|||||||
response = client
|
response = client
|
||||||
.toBlocking()
|
.toBlocking()
|
||||||
.exchange(request, Argument.STRING, Argument.STRING);
|
.exchange(request, Argument.STRING, Argument.STRING);
|
||||||
|
|
||||||
|
// check that the string is a valid Unicode string
|
||||||
|
if (response.getBody().isPresent()) {
|
||||||
|
OptionalInt illegalChar = response.body().chars().filter(c -> !Character.isDefined(c)).findFirst();
|
||||||
|
if (illegalChar.isPresent()) {
|
||||||
|
throw new IllegalArgumentException("Illegal unicode code point in request body: " + illegalChar.getAsInt() +
|
||||||
|
", the Request task only support valid Unicode strings as body.\n" +
|
||||||
|
"You can try using the Download task instead.");
|
||||||
|
}
|
||||||
|
}
|
||||||
} catch (HttpClientResponseException e) {
|
} catch (HttpClientResponseException e) {
|
||||||
if (!allowFailed) {
|
if (!allowFailed) {
|
||||||
throw e;
|
throw e;
|
||||||
|
|||||||
@@ -80,7 +80,6 @@ public class DeleteFiles extends Task implements RunnableTask<DeleteFiles.Output
|
|||||||
private String namespace;
|
private String namespace;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@NotEmpty
|
|
||||||
@Schema(
|
@Schema(
|
||||||
title = "A file or a list of files from the given namespace.",
|
title = "A file or a list of files from the given namespace.",
|
||||||
description = "String or a list of strings; each string can either be a regex glob pattern or a file path URI.",
|
description = "String or a list of strings; each string can either be a regex glob pattern or a file path URI.",
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import io.kestra.core.runners.RunContext;
|
|||||||
import io.kestra.core.services.FlowService;
|
import io.kestra.core.services.FlowService;
|
||||||
import io.kestra.core.utils.Rethrow;
|
import io.kestra.core.utils.Rethrow;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
@@ -84,7 +83,6 @@ public class DownloadFiles extends Task implements RunnableTask<DownloadFiles.Ou
|
|||||||
private String namespace;
|
private String namespace;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@NotEmpty
|
|
||||||
@Schema(
|
@Schema(
|
||||||
title = "A file or a list of files from the given namespace.",
|
title = "A file or a list of files from the given namespace.",
|
||||||
description = "String or a list of strings; each string can either be a regex glob pattern or a file path URI.",
|
description = "String or a list of strings; each string can either be a regex glob pattern or a file path URI.",
|
||||||
@@ -93,11 +91,19 @@ public class DownloadFiles extends Task implements RunnableTask<DownloadFiles.Ou
|
|||||||
@PluginProperty(dynamic = true)
|
@PluginProperty(dynamic = true)
|
||||||
private Object files;
|
private Object files;
|
||||||
|
|
||||||
|
@Schema(
|
||||||
|
title = "The folder where the downloaded files will be stored"
|
||||||
|
)
|
||||||
|
@PluginProperty(dynamic = true)
|
||||||
|
@Builder.Default
|
||||||
|
private String destination = "";
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Output run(RunContext runContext) throws Exception {
|
public Output run(RunContext runContext) throws Exception {
|
||||||
Logger logger = runContext.logger();
|
Logger logger = runContext.logger();
|
||||||
String renderedNamespace = runContext.render(namespace);
|
String renderedNamespace = runContext.render(namespace);
|
||||||
|
String renderedDestination = runContext.render(destination);
|
||||||
// Check if namespace is allowed
|
// Check if namespace is allowed
|
||||||
RunContext.FlowInfo flowInfo = runContext.flowInfo();
|
RunContext.FlowInfo flowInfo = runContext.flowInfo();
|
||||||
FlowService flowService = runContext.getApplicationContext().getBean(FlowService.class);
|
FlowService flowService = runContext.getApplicationContext().getBean(FlowService.class);
|
||||||
@@ -120,7 +126,7 @@ public class DownloadFiles extends Task implements RunnableTask<DownloadFiles.Ou
|
|||||||
namespaceFilesService.recursiveList(flowInfo.tenantId(), renderedNamespace, null).forEach(Rethrow.throwConsumer(uri -> {
|
namespaceFilesService.recursiveList(flowInfo.tenantId(), renderedNamespace, null).forEach(Rethrow.throwConsumer(uri -> {
|
||||||
if (patterns.stream().anyMatch(p -> p.matches(Path.of(uri.getPath())))) {
|
if (patterns.stream().anyMatch(p -> p.matches(Path.of(uri.getPath())))) {
|
||||||
try (InputStream inputStream = namespaceFilesService.content(flowInfo.tenantId(), renderedNamespace, uri)) {
|
try (InputStream inputStream = namespaceFilesService.content(flowInfo.tenantId(), renderedNamespace, uri)) {
|
||||||
downloaded.put(uri.getPath(), runContext.storage().putFile(inputStream, uri.getPath()));
|
downloaded.put(uri.getPath(), runContext.storage().putFile(inputStream, destination + uri.getPath()));
|
||||||
logger.debug(String.format("Downloaded %s", uri));
|
logger.debug(String.format("Downloaded %s", uri));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -138,10 +138,10 @@ public class UploadFiles extends Task implements RunnableTask<UploadFiles.Output
|
|||||||
});
|
});
|
||||||
|
|
||||||
// check for file in current tempDir that match regexs
|
// check for file in current tempDir that match regexs
|
||||||
List<PathMatcher> patterns = regexs.stream().map(reg -> FileSystems.getDefault().getPathMatcher("glob:" + reg)).toList();
|
List<PathMatcher> patterns = regexs.stream().map(reg -> FileSystems.getDefault().getPathMatcher("glob:" + runContext.tempDir().toString() + checkLeadingSlash(reg))).toList();
|
||||||
for (File file : Objects.requireNonNull(runContext.tempDir().toFile().listFiles())) {
|
for (File file : Objects.requireNonNull(listFilesRecursively(runContext.tempDir().toFile()))) {
|
||||||
if (patterns.stream().anyMatch(p -> p.matches(Path.of(file.toURI().getPath())))) {
|
if (patterns.stream().anyMatch(p -> p.matches(Path.of(file.toURI().getPath())))) {
|
||||||
String newFilePath = buildPath(renderedDestination, file.getName());
|
String newFilePath = buildPath(renderedDestination, file.getPath().replace(runContext.tempDir().toString(), ""));
|
||||||
storeNewFile(logger, runContext, storageInterface, flowInfo.tenantId(), newFilePath, new FileInputStream(file));
|
storeNewFile(logger, runContext, storageInterface, flowInfo.tenantId(), newFilePath, new FileInputStream(file));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -199,6 +199,24 @@ public class UploadFiles extends Task implements RunnableTask<UploadFiles.Output
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private List<File> listFilesRecursively(File directory) throws IOException {
|
||||||
|
List<File> files = new ArrayList<>();
|
||||||
|
if (directory == null || !directory.isDirectory()) {
|
||||||
|
return files; // Handle invalid directory or not a directory
|
||||||
|
}
|
||||||
|
|
||||||
|
for (File file : directory.listFiles()) {
|
||||||
|
if (file.isFile()) {
|
||||||
|
files.add(file);
|
||||||
|
} else {
|
||||||
|
// Recursively call for subdirectories
|
||||||
|
files.addAll(listFilesRecursively(file));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return files;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Builder
|
@Builder
|
||||||
@Getter
|
@Getter
|
||||||
public static class Output implements io.kestra.core.models.tasks.Output {
|
public static class Output implements io.kestra.core.models.tasks.Output {
|
||||||
|
|||||||
@@ -355,7 +355,7 @@ public class Schedule extends AbstractTrigger implements PollingTriggerInterface
|
|||||||
.tenantId(triggerContext.getTenantId())
|
.tenantId(triggerContext.getTenantId())
|
||||||
.namespace(triggerContext.getNamespace())
|
.namespace(triggerContext.getNamespace())
|
||||||
.flowId(triggerContext.getFlowId())
|
.flowId(triggerContext.getFlowId())
|
||||||
.flowRevision(triggerContext.getFlowRevision())
|
.flowRevision(conditionContext.getFlow().getRevision())
|
||||||
.labels(labels)
|
.labels(labels)
|
||||||
.state(new State().withState(State.Type.FAILED))
|
.state(new State().withState(State.Type.FAILED))
|
||||||
.build();
|
.build();
|
||||||
@@ -399,7 +399,7 @@ public class Schedule extends AbstractTrigger implements PollingTriggerInterface
|
|||||||
.tenantId(triggerContext.getTenantId())
|
.tenantId(triggerContext.getTenantId())
|
||||||
.namespace(triggerContext.getNamespace())
|
.namespace(triggerContext.getNamespace())
|
||||||
.flowId(triggerContext.getFlowId())
|
.flowId(triggerContext.getFlowId())
|
||||||
.flowRevision(triggerContext.getFlowRevision())
|
.flowRevision(conditionContext.getFlow().getRevision())
|
||||||
.labels(labels)
|
.labels(labels)
|
||||||
.state(new State())
|
.state(new State())
|
||||||
.trigger(executionTrigger)
|
.trigger(executionTrigger)
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ public abstract class AbstractTriggerRepositoryTest {
|
|||||||
return Trigger.builder()
|
return Trigger.builder()
|
||||||
.flowId(IdUtils.create())
|
.flowId(IdUtils.create())
|
||||||
.namespace(TEST_NAMESPACE)
|
.namespace(TEST_NAMESPACE)
|
||||||
.flowRevision(1)
|
|
||||||
.triggerId(IdUtils.create())
|
.triggerId(IdUtils.create())
|
||||||
.executionId(IdUtils.create())
|
.executionId(IdUtils.create())
|
||||||
.date(ZonedDateTime.now());
|
.date(ZonedDateTime.now());
|
||||||
|
|||||||
@@ -88,8 +88,7 @@ public class DeserializationIssuesCaseTest {
|
|||||||
"date": "2023-11-24T15:48:57.632881597Z",
|
"date": "2023-11-24T15:48:57.632881597Z",
|
||||||
"flowId": "http-trigger",
|
"flowId": "http-trigger",
|
||||||
"namespace": "dev",
|
"namespace": "dev",
|
||||||
"triggerId": "http",
|
"triggerId": "http"
|
||||||
"flowRevision": 3
|
|
||||||
},
|
},
|
||||||
"conditionContext": {
|
"conditionContext": {
|
||||||
"flow": {
|
"flow": {
|
||||||
|
|||||||
@@ -34,6 +34,13 @@ class FilesServiceTest {
|
|||||||
assertThat(content.get("file.txt"), is("Hello World"));
|
assertThat(content.get("file.txt"), is("Hello World"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void renderRawFile() throws Exception {
|
||||||
|
RunContext runContext = runContextFactory.of(Map.of("filename", "file.txt", "content", "Hello World"));
|
||||||
|
Map<String, String> content = FilesService.inputFiles(runContext, Map.of("{{filename}}", "{% raw %}{{content}}{% endraw %}"));
|
||||||
|
assertThat(content.get("file.txt"), is("{{content}}"));
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void outputFiles() throws Exception {
|
void outputFiles() throws Exception {
|
||||||
RunContext runContext = runContextFactory.of();
|
RunContext runContext = runContextFactory.of();
|
||||||
|
|||||||
@@ -104,6 +104,13 @@ abstract public class FlowListenersTest {
|
|||||||
assertThat(count.get(), is(2));
|
assertThat(count.get(), is(2));
|
||||||
assertThat(flowListenersService.flows().size(), is(2));
|
assertThat(flowListenersService.flows().size(), is(2));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Flow withTenant = first.toBuilder().tenantId("some-tenant").build();
|
||||||
|
flowRepository.create(withTenant, withTenant.generateSource(), pluginDefaultService.injectDefaults(withTenant));
|
||||||
|
wait(ref, () -> {
|
||||||
|
assertThat(count.get(), is(3));
|
||||||
|
assertThat(flowListenersService.flows().size(), is(3));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Ref {
|
public static class Ref {
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ abstract public class AbstractSchedulerTest {
|
|||||||
.id(IdUtils.create())
|
.id(IdUtils.create())
|
||||||
.namespace(context.getNamespace())
|
.namespace(context.getNamespace())
|
||||||
.flowId(context.getFlowId())
|
.flowId(context.getFlowId())
|
||||||
.flowRevision(context.getFlowRevision())
|
.flowRevision(conditionContext.getFlow().getRevision())
|
||||||
.state(new State())
|
.state(new State())
|
||||||
.trigger(ExecutionTrigger.builder()
|
.trigger(ExecutionTrigger.builder()
|
||||||
.id(this.getId())
|
.id(this.getId())
|
||||||
|
|||||||
@@ -65,7 +65,6 @@ class SchedulerConditionTest extends AbstractSchedulerTest {
|
|||||||
triggerState.create(Trigger.builder()
|
triggerState.create(Trigger.builder()
|
||||||
.namespace(flow.getNamespace())
|
.namespace(flow.getNamespace())
|
||||||
.flowId(flow.getId())
|
.flowId(flow.getId())
|
||||||
.flowRevision(flow.getRevision())
|
|
||||||
.triggerId("hourly")
|
.triggerId("hourly")
|
||||||
.date(ZonedDateTime.parse("2021-09-06T02:00:00+01:00[Europe/Paris]"))
|
.date(ZonedDateTime.parse("2021-09-06T02:00:00+01:00[Europe/Paris]"))
|
||||||
.build()
|
.build()
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ public abstract class SchedulerTriggerStateInterfaceTest {
|
|||||||
return Trigger.builder()
|
return Trigger.builder()
|
||||||
.flowId(IdUtils.create())
|
.flowId(IdUtils.create())
|
||||||
.namespace("io.kestra.unittest")
|
.namespace("io.kestra.unittest")
|
||||||
.flowRevision(1)
|
|
||||||
.triggerId(IdUtils.create())
|
.triggerId(IdUtils.create())
|
||||||
.executionId(IdUtils.create())
|
.executionId(IdUtils.create())
|
||||||
.date(ZonedDateTime.now());
|
.date(ZonedDateTime.now());
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import io.kestra.core.models.executions.Execution;
|
|||||||
import io.kestra.core.models.executions.TaskRun;
|
import io.kestra.core.models.executions.TaskRun;
|
||||||
import io.micronaut.test.extensions.junit5.annotation.MicronautTest;
|
import io.micronaut.test.extensions.junit5.annotation.MicronautTest;
|
||||||
import jakarta.inject.Inject;
|
import jakarta.inject.Inject;
|
||||||
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -16,6 +17,14 @@ class SkipExecutionServiceTest {
|
|||||||
@Inject
|
@Inject
|
||||||
private SkipExecutionService skipExecutionService;
|
private SkipExecutionService skipExecutionService;
|
||||||
|
|
||||||
|
@BeforeEach
|
||||||
|
void resetAll() {
|
||||||
|
skipExecutionService.setSkipExecutions(null);
|
||||||
|
skipExecutionService.setSkipFlows(null);
|
||||||
|
skipExecutionService.setSkipNamespaces(null);
|
||||||
|
skipExecutionService.setSkipTenants(null);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void skipExecutionByExecutionId() {
|
void skipExecutionByExecutionId() {
|
||||||
var executionToSkip = "aaabbbccc";
|
var executionToSkip = "aaabbbccc";
|
||||||
@@ -65,4 +74,25 @@ class SkipExecutionServiceTest {
|
|||||||
assertThat(skipExecutionService.skipExecution(null, "namespace", "not_skipped", "random"), is(false));
|
assertThat(skipExecutionService.skipExecution(null, "namespace", "not_skipped", "random"), is(false));
|
||||||
assertThat(skipExecutionService.skipExecution("tenant", "namespace", "not_skipped", "random"), is(false));
|
assertThat(skipExecutionService.skipExecution("tenant", "namespace", "not_skipped", "random"), is(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void skipExecutionByNamespace() {
|
||||||
|
skipExecutionService.setSkipNamespaces(List.of("tenant|namespace"));
|
||||||
|
|
||||||
|
assertThat(skipExecutionService.skipExecution("tenant", "namespace", "someFlow", "someExecution"), is(true));
|
||||||
|
assertThat(skipExecutionService.skipExecution(null, "namespace", "someFlow", "someExecution"), is(false));
|
||||||
|
assertThat(skipExecutionService.skipExecution("anotherTenant", "namespace", "someFlow", "someExecution"), is(false));
|
||||||
|
assertThat(skipExecutionService.skipExecution("tenant", "namespace", "anotherFlow", "anotherExecution"), is(true));
|
||||||
|
assertThat(skipExecutionService.skipExecution("tenant", "other.namespace", "someFlow", "someExecution"), is(false));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void skipExecutionByTenantId() {
|
||||||
|
skipExecutionService.setSkipTenants(List.of("tenant"));
|
||||||
|
|
||||||
|
assertThat(skipExecutionService.skipExecution("tenant", "namespace", "someFlow", "someExecution"), is(true));
|
||||||
|
assertThat(skipExecutionService.skipExecution("anotherTenant", "namespace", "someFlow", "someExecution"), is(false));
|
||||||
|
assertThat(skipExecutionService.skipExecution("tenant", "another.namespace", "someFlow", "someExecution"), is(true));
|
||||||
|
assertThat(skipExecutionService.skipExecution("anotherTenant", "another.namespace", "someFlow", "someExecution"), is(false));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -6,22 +6,23 @@ import io.kestra.core.models.executions.Execution;
|
|||||||
import io.kestra.core.models.executions.TaskRun;
|
import io.kestra.core.models.executions.TaskRun;
|
||||||
import io.kestra.core.models.flows.Flow;
|
import io.kestra.core.models.flows.Flow;
|
||||||
import io.kestra.core.models.flows.State;
|
import io.kestra.core.models.flows.State;
|
||||||
|
import io.kestra.core.models.tasks.common.EncryptedString;
|
||||||
import io.kestra.core.runners.AbstractMemoryRunnerTest;
|
import io.kestra.core.runners.AbstractMemoryRunnerTest;
|
||||||
|
import io.kestra.core.runners.RunContextFactory;
|
||||||
import io.kestra.core.runners.RunnerUtils;
|
import io.kestra.core.runners.RunnerUtils;
|
||||||
import io.kestra.core.storages.InternalStorage;
|
import io.kestra.core.storages.InternalStorage;
|
||||||
import io.kestra.core.storages.StorageContext;
|
import io.kestra.core.storages.StorageContext;
|
||||||
import io.kestra.core.storages.StorageInterface;
|
import io.kestra.core.storages.StorageInterface;
|
||||||
|
import io.kestra.core.utils.IdUtils;
|
||||||
import jakarta.inject.Inject;
|
import jakarta.inject.Inject;
|
||||||
import jakarta.inject.Singleton;
|
import jakarta.inject.Singleton;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junitpioneer.jupiter.RetryingTest;
|
import org.junitpioneer.jupiter.RetryingTest;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.nio.file.Files;
|
import java.security.GeneralSecurityException;
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -30,7 +31,6 @@ import java.util.concurrent.TimeoutException;
|
|||||||
|
|
||||||
import static org.hamcrest.MatcherAssert.assertThat;
|
import static org.hamcrest.MatcherAssert.assertThat;
|
||||||
import static org.hamcrest.Matchers.*;
|
import static org.hamcrest.Matchers.*;
|
||||||
import static org.hamcrest.io.FileMatchers.anExistingFile;
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
@@ -38,6 +38,9 @@ public class WorkingDirectoryTest extends AbstractMemoryRunnerTest {
|
|||||||
@Inject
|
@Inject
|
||||||
Suite suite;
|
Suite suite;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
RunContextFactory runContextFactory;
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void success() throws TimeoutException {
|
void success() throws TimeoutException {
|
||||||
suite.success(runnerUtils);
|
suite.success(runnerUtils);
|
||||||
@@ -83,6 +86,11 @@ public class WorkingDirectoryTest extends AbstractMemoryRunnerTest {
|
|||||||
suite.outputFiles(runnerUtils);
|
suite.outputFiles(runnerUtils);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void encryption() throws Exception {
|
||||||
|
suite.encryption(runnerUtils, runContextFactory);
|
||||||
|
}
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public static class Suite {
|
public static class Suite {
|
||||||
@Inject
|
@Inject
|
||||||
@@ -154,8 +162,15 @@ public class WorkingDirectoryTest extends AbstractMemoryRunnerTest {
|
|||||||
storageContext
|
storageContext
|
||||||
, storageInterface
|
, storageInterface
|
||||||
);
|
);
|
||||||
URI fileURI = URI.create("kestra:" + storageContext.getContextStorageURI() + "/input.txt");
|
|
||||||
assertThat(new String(storage.getFile(fileURI).readAllBytes()), is("Hello World"));
|
TaskRun taskRun = execution.getTaskRunList().get(1);
|
||||||
|
Map<String, Object> outputs = taskRun.getOutputs();
|
||||||
|
assertThat(outputs, hasKey("uris"));
|
||||||
|
|
||||||
|
URI uri = URI.create(((Map<String, String>) outputs.get("uris")).get("input.txt"));
|
||||||
|
|
||||||
|
assertTrue(uri.toString().endsWith("input.txt"));
|
||||||
|
assertThat(new String(storage.getFile(uri).readAllBytes()), is("Hello World"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -236,6 +251,18 @@ public class WorkingDirectoryTest extends AbstractMemoryRunnerTest {
|
|||||||
assertThat(execution.findTaskRunsByTaskId("t3").get(0).getOutputs().get("value"), is("third"));
|
assertThat(execution.findTaskRunsByTaskId("t3").get(0).getOutputs().get("value"), is("third"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void encryption(RunnerUtils runnerUtils, RunContextFactory runContextFactory) throws TimeoutException, GeneralSecurityException {
|
||||||
|
Execution execution = runnerUtils.runOne(null, "io.kestra.tests", "working-directory-taskrun-encrypted");
|
||||||
|
|
||||||
|
assertThat(execution.getTaskRunList(), hasSize(3));
|
||||||
|
Map<String, Object> encryptedString = (Map<String, Object>) execution.findTaskRunsByTaskId("encrypted").get(0).getOutputs().get("value");
|
||||||
|
assertThat(encryptedString.get("type"), is(EncryptedString.TYPE));
|
||||||
|
String encryptedValue = (String) encryptedString.get("value");
|
||||||
|
assertThat(encryptedValue, is(not("Hello World")));
|
||||||
|
assertThat(runContextFactory.of().decrypt(encryptedValue), is("Hello World"));
|
||||||
|
assertThat(execution.findTaskRunsByTaskId("decrypted").get(0).getOutputs().get("value"), is("Hello World"));
|
||||||
|
}
|
||||||
|
|
||||||
private void put(String path, String content) throws IOException {
|
private void put(String path, String content) throws IOException {
|
||||||
storageInterface.put(
|
storageInterface.put(
|
||||||
null,
|
null,
|
||||||
|
|||||||
@@ -65,7 +65,6 @@ class ScheduleTest {
|
|||||||
return TriggerContext.builder()
|
return TriggerContext.builder()
|
||||||
.namespace(flow.getNamespace())
|
.namespace(flow.getNamespace())
|
||||||
.flowId(flow.getNamespace())
|
.flowId(flow.getNamespace())
|
||||||
.flowRevision(flow.getRevision())
|
|
||||||
.triggerId(schedule.getId())
|
.triggerId(schedule.getId())
|
||||||
.date(date)
|
.date(date)
|
||||||
.build();
|
.build();
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
id: working-directory-taskrun-encrypted
|
||||||
|
namespace: io.kestra.tests
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- id: workingDir
|
||||||
|
type: io.kestra.plugin.core.flow.WorkingDirectory
|
||||||
|
tasks:
|
||||||
|
- id: encrypted
|
||||||
|
type: io.kestra.core.tasks.test.Encrypted
|
||||||
|
format: "Hello World"
|
||||||
|
- id: decrypted
|
||||||
|
type: io.kestra.plugin.core.debug.Return
|
||||||
|
format: "{{outputs.encrypted.value}}"
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
version=0.17.0
|
version=0.17.11
|
||||||
|
|
||||||
jacksonVersion=2.16.2
|
jacksonVersion=2.16.2
|
||||||
micronautVersion=4.4.3
|
micronautVersion=4.4.3
|
||||||
@@ -7,4 +7,4 @@ slf4jVersion=2.0.13
|
|||||||
|
|
||||||
org.gradle.parallel=true
|
org.gradle.parallel=true
|
||||||
org.gradle.caching=true
|
org.gradle.caching=true
|
||||||
org.gradle.priority=low
|
org.gradle.priority=low
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
datasources:
|
datasources:
|
||||||
h2:
|
h2:
|
||||||
url: jdbc:h2:mem:public;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
|
url: jdbc:h2:mem:public;TIME ZONE=UTC;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
|
||||||
username: sa
|
username: sa
|
||||||
password: ""
|
password: ""
|
||||||
driverClassName: org.h2.Driver
|
driverClassName: org.h2.Driver
|
||||||
|
|||||||
@@ -706,6 +706,7 @@ public class JdbcExecutor implements ExecutorInterface, Service {
|
|||||||
.executionId(killedExecution.getExecutionId())
|
.executionId(killedExecution.getExecutionId())
|
||||||
.isOnKillCascade(false)
|
.isOnKillCascade(false)
|
||||||
.state(ExecutionKilled.State.EXECUTED)
|
.state(ExecutionKilled.State.EXECUTED)
|
||||||
|
.tenantId(killedExecution.getTenantId())
|
||||||
.build()
|
.build()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -131,10 +131,10 @@ public class CommandsWrapper implements TaskCommands {
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public ScriptOutput run() throws Exception {
|
public ScriptOutput run() throws Exception {
|
||||||
List<String> filesToUpload = new ArrayList<>();
|
List<String> filesToUpload = new ArrayList<>();
|
||||||
if (this.namespaceFiles != null) {
|
String tenantId = ((Map<String, String>) runContext.getVariables().get("flow")).get("tenantId");
|
||||||
String tenantId = ((Map<String, String>) runContext.getVariables().get("flow")).get("tenantId");
|
String namespace = ((Map<String, String>) runContext.getVariables().get("flow")).get("namespace");
|
||||||
String namespace = ((Map<String, String>) runContext.getVariables().get("flow")).get("namespace");
|
|
||||||
|
|
||||||
|
if (this.namespaceFiles != null && Boolean.TRUE.equals(this.namespaceFiles.getEnabled())) {
|
||||||
NamespaceFilesService namespaceFilesService = runContext.getApplicationContext().getBean(NamespaceFilesService.class);
|
NamespaceFilesService namespaceFilesService = runContext.getApplicationContext().getBean(NamespaceFilesService.class);
|
||||||
List<URI> injectedFiles = namespaceFilesService.inject(
|
List<URI> injectedFiles = namespaceFilesService.inject(
|
||||||
runContext,
|
runContext,
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ public class LocalStorage implements StorageInterface {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {
|
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {
|
||||||
uris.add(URI.create(file.toString()));
|
uris.add(URI.create(file.toString().replace("\\", "/")));
|
||||||
return FileVisitResult.CONTINUE;
|
return FileVisitResult.CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,7 +90,7 @@ public class LocalStorage implements StorageInterface {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
URI fsPathUri = URI.create(fsPath.toString());
|
URI fsPathUri = URI.create(fsPath.toString().replace("\\", "/"));
|
||||||
return uris.stream().sorted(Comparator.reverseOrder())
|
return uris.stream().sorted(Comparator.reverseOrder())
|
||||||
.map(fsPathUri::relativize)
|
.map(fsPathUri::relativize)
|
||||||
.map(URI::getPath)
|
.map(URI::getPath)
|
||||||
@@ -115,7 +115,7 @@ public class LocalStorage implements StorageInterface {
|
|||||||
URI relative = URI.create(
|
URI relative = URI.create(
|
||||||
getPath(tenantId, null).relativize(
|
getPath(tenantId, null).relativize(
|
||||||
Path.of(file.toUri())
|
Path.of(file.toUri())
|
||||||
).toString()
|
).toString().replace("\\", "/")
|
||||||
);
|
);
|
||||||
return getAttributes(tenantId, relative);
|
return getAttributes(tenantId, relative);
|
||||||
}))
|
}))
|
||||||
|
|||||||
1884
ui/package-lock.json
generated
1884
ui/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -12,20 +12,20 @@
|
|||||||
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix"
|
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@kestra-io/ui-libs": "^0.0.47",
|
"@kestra-io/ui-libs": "^0.0.48",
|
||||||
"@vue-flow/background": "^1.3.0",
|
"@vue-flow/background": "^1.3.0",
|
||||||
"@vue-flow/controls": "^1.1.1",
|
"@vue-flow/controls": "^1.1.1",
|
||||||
"@vue-flow/core": "^1.33.6",
|
"@vue-flow/core": "^1.33.6",
|
||||||
"ansi-to-html": "^0.7.2",
|
"ansi-to-html": "^0.7.2",
|
||||||
"axios": "^1.6.8",
|
"axios": "^1.7.2",
|
||||||
"bootstrap": "^5.3.3",
|
"bootstrap": "^5.3.3",
|
||||||
"buffer": "^6.0.3",
|
"buffer": "^6.0.3",
|
||||||
"chart.js": "^4.4.2",
|
"chart.js": "^4.4.3",
|
||||||
"chartjs-chart-treemap": "^2.3.1",
|
"chartjs-chart-treemap": "^2.3.1",
|
||||||
"core-js": "^3.37.0",
|
"core-js": "^3.37.1",
|
||||||
"dagre": "^0.8.5",
|
"dagre": "^0.8.5",
|
||||||
"element-plus": "^2.7.2",
|
"element-plus": "^2.7.5",
|
||||||
"humanize-duration": "^3.32.0",
|
"humanize-duration": "^3.32.1",
|
||||||
"js-yaml": "^4.1.0",
|
"js-yaml": "^4.1.0",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"markdown-it": "^14.1.0",
|
"markdown-it": "^14.1.0",
|
||||||
@@ -40,45 +40,49 @@
|
|||||||
"moment-timezone": "^0.5.45",
|
"moment-timezone": "^0.5.45",
|
||||||
"node-modules-polyfill": "^0.1.4",
|
"node-modules-polyfill": "^0.1.4",
|
||||||
"nprogress": "^0.2.0",
|
"nprogress": "^0.2.0",
|
||||||
"posthog-js": "^1.130.2",
|
"posthog-js": "^1.138.2",
|
||||||
|
"cronstrue": "^2.50.0",
|
||||||
"throttle-debounce": "^5.0.0",
|
"throttle-debounce": "^5.0.0",
|
||||||
"vite-plugin-eslint": "^1.8.1",
|
"vite-plugin-eslint": "^1.8.1",
|
||||||
"vue": "^3.4.26",
|
"vue": "^3.4.27",
|
||||||
"vue-axios": "3.5.2",
|
"vue-axios": "3.5.2",
|
||||||
"vue-chartjs": "^5.3.1",
|
"vue-chartjs": "^5.3.1",
|
||||||
"vue-gtag": "^2.0.1",
|
"vue-gtag": "^2.0.1",
|
||||||
"vue-i18n": "^9.13.1",
|
"vue-i18n": "^9.13.1",
|
||||||
"vue-material-design-icons": "^5.3.0",
|
"vue-material-design-icons": "^5.3.0",
|
||||||
"vue-router": "^4.3.2",
|
"vue-router": "^4.3.2",
|
||||||
"vue-sidebar-menu": "^5.3.1",
|
"vue-sidebar-menu": "^5.4.0",
|
||||||
"vue-virtual-scroller": "^2.0.0-beta.8",
|
"vue-virtual-scroller": "^2.0.0-beta.8",
|
||||||
"vue3-popper": "^1.5.0",
|
"vue3-popper": "^1.5.0",
|
||||||
"vue3-tour": "github:kestra-io/vue3-tour",
|
"vue3-tour": "github:kestra-io/vue3-tour",
|
||||||
"vuex": "^4.1.0",
|
"vuex": "^4.1.0",
|
||||||
"xss": "^1.0.15",
|
"xss": "^1.0.15",
|
||||||
"yaml": "^2.4.2"
|
"yaml": "^2.4.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rushstack/eslint-patch": "^1.10.2",
|
"@rushstack/eslint-patch": "^1.10.3",
|
||||||
"@shikijs/markdown-it": "^1.4.0",
|
"@shikijs/markdown-it": "^1.6.3",
|
||||||
"@typescript-eslint/parser": "^7.8.0",
|
"@typescript-eslint/parser": "^7.12.0",
|
||||||
"@vitejs/plugin-vue": "^5.0.4",
|
"@vitejs/plugin-vue": "^5.0.5",
|
||||||
"@vue/eslint-config-prettier": "^9.0.0",
|
"@vue/eslint-config-prettier": "^9.0.0",
|
||||||
"@vue/test-utils": "^2.4.5",
|
"@vue/test-utils": "^2.4.6",
|
||||||
"decompress": "^4.2.1",
|
"decompress": "^4.2.1",
|
||||||
"eslint": "^8.57.0",
|
"eslint": "^8.57.0",
|
||||||
"eslint-plugin-vue": "^9.25.0",
|
"eslint-plugin-vue": "^9.26.0",
|
||||||
"jsdom": "^24.0.0",
|
"jsdom": "^24.1.0",
|
||||||
"monaco-editor": "^0.48.0",
|
"monaco-editor": "^0.49.0",
|
||||||
"monaco-yaml": "^5.1.1",
|
"monaco-yaml": "^5.2.0",
|
||||||
"prettier": "^3.2.5",
|
"prettier": "^3.3.1",
|
||||||
"rollup-plugin-copy": "^3.5.0",
|
"rollup-plugin-copy": "^3.5.0",
|
||||||
"rollup-plugin-visualizer": "^5.12.0",
|
"rollup-plugin-visualizer": "^5.12.0",
|
||||||
"sass": "^1.76.0",
|
"sass": "^1.77.4",
|
||||||
"typescript": "^5.4.5",
|
"typescript": "^5.4.5",
|
||||||
"vite": "^5.2.11",
|
|
||||||
"vite-plugin-rewrite-all": "1.0.1",
|
"vite-plugin-rewrite-all": "1.0.1",
|
||||||
"vitest": "^1.5.3"
|
"vite": "^5.2.13",
|
||||||
|
"vitest": "^1.6.0"
|
||||||
|
},
|
||||||
|
"optionalDependencies": {
|
||||||
|
"@rollup/rollup-linux-x64-gnu": "4.18.0"
|
||||||
},
|
},
|
||||||
"overrides": {
|
"overrides": {
|
||||||
"bootstrap": {
|
"bootstrap": {
|
||||||
|
|||||||
@@ -209,7 +209,7 @@
|
|||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
$route(to) {
|
$route(to) {
|
||||||
if (this.user && to.name === "home" && this.overallTotal === 0) {
|
if (to.name === "home" && this.overallTotal === 0) {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: "welcome",
|
name: "welcome",
|
||||||
params: {
|
params: {
|
||||||
|
|||||||
BIN
ui/src/assets/errors/kestra-error.png
Normal file
BIN
ui/src/assets/errors/kestra-error.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 73 KiB |
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 4.9 KiB |
@@ -1,6 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-tooltip :persistent="false" :focus-on-show="true" popper-class="ee-tooltip" :disabled="!disabled" :placement="placement">
|
<el-tooltip :visible="visible" :persistent="false" :focus-on-show="true" popper-class="ee-tooltip" :disabled="!disabled" :placement="placement">
|
||||||
<template #content v-if="link">
|
<template #content v-if="link">
|
||||||
|
<el-button circle class="ee-tooltip-close" @click="changeVisibility(false)">
|
||||||
|
<Close />
|
||||||
|
</el-button>
|
||||||
|
|
||||||
<p>{{ $t("ee-tooltip.features-blocked") }}</p>
|
<p>{{ $t("ee-tooltip.features-blocked") }}</p>
|
||||||
|
|
||||||
<a
|
<a
|
||||||
@@ -13,7 +17,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</template>
|
</template>
|
||||||
<template #default>
|
<template #default>
|
||||||
<span ref="slot-container">
|
<span ref="slot-container" class="cursor-pointer" @click="changeVisibility()">
|
||||||
<slot />
|
<slot />
|
||||||
<lock v-if="disabled" />
|
<lock v-if="disabled" />
|
||||||
</span>
|
</span>
|
||||||
@@ -22,10 +26,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import Close from "vue-material-design-icons/Close.vue";
|
||||||
import Lock from "vue-material-design-icons/Lock.vue";
|
import Lock from "vue-material-design-icons/Lock.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {Lock},
|
components: {Close, Lock},
|
||||||
props: {
|
props: {
|
||||||
top: {
|
top: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
@@ -48,6 +53,16 @@
|
|||||||
default: undefined
|
default: undefined
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
visible: false,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
changeVisibility(visible = true) {
|
||||||
|
this.visible = visible
|
||||||
|
}
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
link() {
|
link() {
|
||||||
|
|
||||||
@@ -83,5 +98,13 @@
|
|||||||
:deep(.material-design-icon) > .material-design-icon__svg {
|
:deep(.material-design-icon) > .material-design-icon__svg {
|
||||||
bottom: -0.125em;
|
bottom: -0.125em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ee-tooltip-close {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
border: none;
|
||||||
|
margin: 0.5rem;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,10 @@
|
|||||||
<p>
|
<p>
|
||||||
<span v-html="$t('errors.' + code + '.content')" />
|
<span v-html="$t('errors.' + code + '.content')" />
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<el-button tag="router-link" :to="{name: 'home'}" type="primary">
|
||||||
|
{{ $t("back_to_dashboard") }}
|
||||||
|
</el-button>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -42,19 +46,23 @@
|
|||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.errors {
|
.errors {
|
||||||
h2 {
|
margin-top: 10em;
|
||||||
margin-bottom: calc(var(--spacer) * 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
width: 100%;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
.img {
|
.img {
|
||||||
display: inline-block;
|
background: url("../../assets/errors/kestra-error.png") no-repeat center;
|
||||||
background: url("../../assets/errors/sorry.svg") no-repeat;
|
|
||||||
background-size: contain;
|
background-size: contain;
|
||||||
height: 300px;
|
|
||||||
width: 300px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
line-height: 30px;
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
line-height: 22px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -69,6 +69,14 @@
|
|||||||
if (oldValue.name === newValue.name && this.previousExecutionId !== this.$route.params.id) {
|
if (oldValue.name === newValue.name && this.previousExecutionId !== this.$route.params.id) {
|
||||||
this.follow()
|
this.follow()
|
||||||
}
|
}
|
||||||
|
// if we change the execution id, we need to close the sse
|
||||||
|
if (this.$route.params.id != this.execution.id) {
|
||||||
|
this.closeSSE();
|
||||||
|
window.removeEventListener("popstate", this.follow)
|
||||||
|
this.$store.commit("execution/setExecution", undefined);
|
||||||
|
this.$store.commit("flow/setFlow", undefined);
|
||||||
|
this.$store.commit("flow/setFlowGraph", undefined);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -91,13 +99,16 @@
|
|||||||
}
|
}
|
||||||
// sse.onerror doesnt return the details of the error
|
// sse.onerror doesnt return the details of the error
|
||||||
// but as our emitter can only throw an error on 404
|
// but as our emitter can only throw an error on 404
|
||||||
// we can safely assume that the error
|
// we can safely assume that the error is a 404
|
||||||
|
// if execution is not defined
|
||||||
this.sse.onerror = () => {
|
this.sse.onerror = () => {
|
||||||
this.$store.dispatch("core/showMessage", {
|
if (!this.execution) {
|
||||||
variant: "error",
|
this.$store.dispatch("core/showMessage", {
|
||||||
title: this.$t("error"),
|
variant: "error",
|
||||||
message: this.$t("errors.404.flow or execution"),
|
title: this.$t("error"),
|
||||||
});
|
message: this.$t("errors.404.flow or execution"),
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -425,6 +425,8 @@
|
|||||||
import {ElMessageBox, ElSwitch, ElFormItem, ElAlert} from "element-plus";
|
import {ElMessageBox, ElSwitch, ElFormItem, ElAlert} from "element-plus";
|
||||||
import {h, ref} from "vue";
|
import {h, ref} from "vue";
|
||||||
|
|
||||||
|
import {filterLabels} from "./utils"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [RouteContext, RestoreUrl, DataTableActions, SelectTableActions],
|
mixins: [RouteContext, RestoreUrl, DataTableActions, SelectTableActions],
|
||||||
components: {
|
components: {
|
||||||
@@ -809,6 +811,13 @@
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
setLabels() {
|
setLabels() {
|
||||||
|
const filtered = filterLabels(this.executionLabels)
|
||||||
|
|
||||||
|
if(filtered.error) {
|
||||||
|
this.$toast().error(this.$t("wrong labels"))
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.$toast().confirm(
|
this.$toast().confirm(
|
||||||
this.$t("bulk set labels", {"executionCount": this.queryBulkAction ? this.total : this.selection.length}),
|
this.$t("bulk set labels", {"executionCount": this.queryBulkAction ? this.total : this.selection.length}),
|
||||||
() => {
|
() => {
|
||||||
@@ -819,7 +828,7 @@
|
|||||||
sort: this.$route.query.sort || "state.startDate:desc",
|
sort: this.$route.query.sort || "state.startDate:desc",
|
||||||
state: this.$route.query.state ? [this.$route.query.state] : this.statuses
|
state: this.$route.query.state ? [this.$route.query.state] : this.statuses
|
||||||
}, false),
|
}, false),
|
||||||
data: this.executionLabels
|
data: filtered.labels
|
||||||
})
|
})
|
||||||
.then(r => {
|
.then(r => {
|
||||||
this.$toast().success(this.$t("Set labels done", {executionCount: r.data.count}));
|
this.$toast().success(this.$t("Set labels done", {executionCount: r.data.count}));
|
||||||
@@ -829,7 +838,7 @@
|
|||||||
return this.$store
|
return this.$store
|
||||||
.dispatch("execution/bulkSetLabels", {
|
.dispatch("execution/bulkSetLabels", {
|
||||||
executionsId: this.selection,
|
executionsId: this.selection,
|
||||||
executionLabels: this.executionLabels
|
executionLabels: filtered.labels
|
||||||
})
|
})
|
||||||
.then(r => {
|
.then(r => {
|
||||||
this.$toast().success(this.$t("Set labels done", {executionCount: r.data.count}));
|
this.$toast().success(this.$t("Set labels done", {executionCount: r.data.count}));
|
||||||
|
|||||||
@@ -53,6 +53,8 @@
|
|||||||
import LabelInput from "../../components/labels/LabelInput.vue";
|
import LabelInput from "../../components/labels/LabelInput.vue";
|
||||||
import State from "../../utils/state";
|
import State from "../../utils/state";
|
||||||
|
|
||||||
|
import {filterLabels} from "./utils"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {LabelInput,},
|
components: {LabelInput,},
|
||||||
props: {
|
props: {
|
||||||
@@ -71,9 +73,16 @@
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
setLabels() {
|
setLabels() {
|
||||||
|
const filtered = filterLabels(this.executionLabels)
|
||||||
|
|
||||||
|
if(filtered.error) {
|
||||||
|
this.$toast().error(this.$t("wrong labels"))
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.isOpen = false;
|
this.isOpen = false;
|
||||||
this.$store.dispatch("execution/setLabels", {
|
this.$store.dispatch("execution/setLabels", {
|
||||||
labels: this.executionLabels,
|
labels: filtered.labels,
|
||||||
executionId: this.execution.id
|
executionId: this.execution.id
|
||||||
}).then(response => {
|
}).then(response => {
|
||||||
this.$store.commit("execution/setExecution", response.data)
|
this.$store.commit("execution/setExecution", response.data)
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
:start-date="startDate"
|
:start-date="startDate"
|
||||||
:end-date="endDate"
|
:end-date="endDate"
|
||||||
@update:model-value="onAbsFilterChange"
|
@update:model-value="onAbsFilterChange"
|
||||||
|
class="w-auto"
|
||||||
/>
|
/>
|
||||||
<relative-date-select
|
<relative-date-select
|
||||||
v-if="selectedFilterType === filterType.RELATIVE"
|
v-if="selectedFilterType === filterType.RELATIVE"
|
||||||
|
|||||||
14
ui/src/components/executions/utils.ts
Normal file
14
ui/src/components/executions/utils.ts
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
interface Label {
|
||||||
|
key: string | null;
|
||||||
|
value: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface FilterResult {
|
||||||
|
labels: Label[];
|
||||||
|
error?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const filterLabels = (labels: Label[]): FilterResult => {
|
||||||
|
const invalid = labels.some(label => label.key === null || label.value === null);
|
||||||
|
return invalid ? {labels, error: true} : {labels};
|
||||||
|
};
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
if (this.$route.query.reset) {
|
if (this.$route.query.reset) {
|
||||||
localStorage.setItem("tourDoneOrSkip", undefined);
|
localStorage.setItem("tourDoneOrSkip", undefined);
|
||||||
this.$store.commit("core/setGuidedProperties", {tourStarted: false});
|
this.$store.commit("core/setGuidedProperties", {tourStarted: false});
|
||||||
this.$tours["guidedTour"].start();
|
this.$tours["guidedTour"]?.start();
|
||||||
}
|
}
|
||||||
this.setupFlow()
|
this.setupFlow()
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -67,7 +67,7 @@
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
stopTour() {
|
stopTour() {
|
||||||
this.$tours["guidedTour"].stop();
|
this.$tours["guidedTour"]?.stop();
|
||||||
this.$store.commit("core/setGuidedProperties", {tourStarted: false});
|
this.$store.commit("core/setGuidedProperties", {tourStarted: false});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -79,7 +79,7 @@
|
|||||||
if (!this.guidedProperties.tourStarted
|
if (!this.guidedProperties.tourStarted
|
||||||
&& localStorage.getItem("tourDoneOrSkip") !== "true"
|
&& localStorage.getItem("tourDoneOrSkip") !== "true"
|
||||||
&& this.total === 0) {
|
&& this.total === 0) {
|
||||||
this.$tours["guidedTour"].start();
|
this.$tours["guidedTour"]?.start();
|
||||||
}
|
}
|
||||||
}, 200)
|
}, 200)
|
||||||
window.addEventListener("popstate", () => {
|
window.addEventListener("popstate", () => {
|
||||||
|
|||||||
@@ -55,7 +55,7 @@
|
|||||||
handler: function (newValue) {
|
handler: function (newValue) {
|
||||||
if (newValue?.manuallyContinue) {
|
if (newValue?.manuallyContinue) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$tours["guidedTour"].nextStep();
|
this.$tours["guidedTour"]?.nextStep();
|
||||||
this.$store.commit("core/setGuidedProperties", {manuallyContinue: false});
|
this.$store.commit("core/setGuidedProperties", {manuallyContinue: false});
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
placement="left"
|
placement="left"
|
||||||
:persistent="true"
|
:persistent="true"
|
||||||
:title="`${$t('trigger details')}: ${trigger ? trigger.id : ''}`"
|
:title="`${$t('trigger details')}: ${trigger ? trigger.id : ''}`"
|
||||||
width=""
|
width="35em"
|
||||||
transition=""
|
transition=""
|
||||||
:hide-after="0"
|
:hide-after="0"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -91,12 +91,12 @@
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onClick() {
|
onClick() {
|
||||||
if (this.$tours["guidedTour"].isRunning.value) {
|
if (this.$tours["guidedTour"]?.isRunning?.value) {
|
||||||
this.$tours["guidedTour"].nextStep();
|
this.$tours["guidedTour"]?.nextStep();
|
||||||
this.$store.dispatch("api/events", {
|
this.$store.dispatch("api/events", {
|
||||||
type: "ONBOARDING",
|
type: "ONBOARDING",
|
||||||
onboarding: {
|
onboarding: {
|
||||||
step: this.$tours["guidedTour"].currentStep._value,
|
step: this.$tours["guidedTour"]?.currentStep?._value,
|
||||||
action: "next",
|
action: "next",
|
||||||
template: this.guidedProperties.template
|
template: this.guidedProperties.template
|
||||||
},
|
},
|
||||||
@@ -131,7 +131,7 @@
|
|||||||
},
|
},
|
||||||
beforeClose(done){
|
beforeClose(done){
|
||||||
if(this.guidedProperties.tourStarted) return;
|
if(this.guidedProperties.tourStarted) return;
|
||||||
|
|
||||||
this.reset();
|
this.reset();
|
||||||
done()
|
done()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,9 @@
|
|||||||
<template v-if="scope.row.key === 'description'">
|
<template v-if="scope.row.key === 'description'">
|
||||||
<markdown :source="scope.row.value" />
|
<markdown :source="scope.row.value" />
|
||||||
</template>
|
</template>
|
||||||
|
<template v-else-if="scope.row.key === 'cron'">
|
||||||
|
<cron :cron-expression="scope.row.value" />
|
||||||
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<var-value :value="scope.row.value" :execution="execution" />
|
<var-value :value="scope.row.value" :execution="execution" />
|
||||||
</template>
|
</template>
|
||||||
@@ -23,11 +26,13 @@
|
|||||||
import Utils from "../../utils/utils";
|
import Utils from "../../utils/utils";
|
||||||
import VarValue from "../executions/VarValue.vue";
|
import VarValue from "../executions/VarValue.vue";
|
||||||
import Markdown from "../layout/Markdown.vue";
|
import Markdown from "../layout/Markdown.vue";
|
||||||
|
import Cron from "../layout/Cron.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
VarValue,
|
VarValue,
|
||||||
Markdown
|
Markdown,
|
||||||
|
Cron
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
data: {
|
data: {
|
||||||
|
|||||||
@@ -185,9 +185,9 @@
|
|||||||
padding: calc(2 * var(--spacer)) $spacer !important;
|
padding: calc(2 * var(--spacer)) $spacer !important;
|
||||||
font-family: $font-family-monospace;
|
font-family: $font-family-monospace;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
white-space: pre;
|
white-space: normal;
|
||||||
border-top: 1px solid var(--bs-gray-300);
|
border-top: 1px solid var(--bs-gray-300);
|
||||||
text-wrap: initial;
|
text-wrap: wrap;
|
||||||
|
|
||||||
html.dark & {
|
html.dark & {
|
||||||
color: white;
|
color: white;
|
||||||
|
|||||||
@@ -188,6 +188,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
// Auth but no permission at all or no permission to load execution stats
|
||||||
|
if (this.user && (!this.user.hasAnyRole() || !this.user.hasAnyActionOnAnyNamespace(permission.EXECUTION, action.READ))) {
|
||||||
|
this.$router.push({name:"errors/403"});
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.load();
|
this.load();
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@@ -239,8 +244,10 @@
|
|||||||
return _merge(base, queryFilter)
|
return _merge(base, queryFilter)
|
||||||
},
|
},
|
||||||
load() {
|
load() {
|
||||||
this.loadStats();
|
if (this.user && this.user.hasAnyActionOnAnyNamespace(permission.EXECUTION, action.READ)) {
|
||||||
this.haveExecutions();
|
this.loadStats();
|
||||||
|
this.haveExecutions();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
haveExecutions() {
|
haveExecutions() {
|
||||||
let params = {
|
let params = {
|
||||||
|
|||||||
@@ -61,7 +61,6 @@
|
|||||||
<input
|
<input
|
||||||
ref="folderPicker"
|
ref="folderPicker"
|
||||||
type="file"
|
type="file"
|
||||||
multiple
|
|
||||||
webkitdirectory
|
webkitdirectory
|
||||||
mozdirectory
|
mozdirectory
|
||||||
msdirectory
|
msdirectory
|
||||||
@@ -77,7 +76,7 @@
|
|||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<el-dropdown-menu>
|
<el-dropdown-menu>
|
||||||
<el-dropdown-item @click="$refs.filePicker.click()">
|
<el-dropdown-item @click="$refs.filePicker.click()">
|
||||||
{{ $t("namespace files.import.file") }}
|
{{ $t("namespace files.import.files") }}
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
<el-dropdown-item
|
<el-dropdown-item
|
||||||
@click="$refs.folderPicker.click()"
|
@click="$refs.folderPicker.click()"
|
||||||
@@ -141,8 +140,8 @@
|
|||||||
</template>
|
</template>
|
||||||
<template #default="{data, node}">
|
<template #default="{data, node}">
|
||||||
<el-dropdown
|
<el-dropdown
|
||||||
:ref="`dropdown__${data.fileName}`"
|
:ref="`dropdown__${data.id}`"
|
||||||
@contextmenu.prevent.stop="toggleDropdown(`dropdown__${data.fileName}`)"
|
@contextmenu.prevent.stop="toggleDropdown(`dropdown__${data.id}`)"
|
||||||
trigger="contextmenu"
|
trigger="contextmenu"
|
||||||
class="w-100"
|
class="w-100"
|
||||||
>
|
>
|
||||||
@@ -385,7 +384,7 @@
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState({
|
...mapState({
|
||||||
flows: (state) => state.flow.flows,
|
flow: (state) => state.flow.flow,
|
||||||
explorerVisible: (state) => state.editor.explorerVisible,
|
explorerVisible: (state) => state.editor.explorerVisible,
|
||||||
}),
|
}),
|
||||||
folders() {
|
folders() {
|
||||||
@@ -765,17 +764,17 @@
|
|||||||
(function pushItemToFolder(basePath = "", array) {
|
(function pushItemToFolder(basePath = "", array) {
|
||||||
for (const item of array) {
|
for (const item of array) {
|
||||||
const folderPath = `${basePath}${item.fileName}`;
|
const folderPath = `${basePath}${item.fileName}`;
|
||||||
|
|
||||||
if (folderPath === SELF.dialog.folder && Array.isArray(item.children)) {
|
if (folderPath === SELF.dialog.folder && Array.isArray(item.children)) {
|
||||||
item.children = SELF.sorted([...item.children, NEW]);
|
item.children = SELF.sorted([...item.children, NEW]);
|
||||||
return true; // Return true if the folder is found and item is pushed
|
return true; // Return true if the folder is found and item is pushed
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Array.isArray(item.children) && pushItemToFolder(`${folderPath}/`, item.children)) {
|
if (Array.isArray(item.children) && pushItemToFolder(`${folderPath}/`, item.children)) {
|
||||||
return true; // Return true if the folder is found and item is pushed in recursive call
|
return true; // Return true if the folder is found and item is pushed in recursive call
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
})(undefined, this.items);
|
})(undefined, this.items);
|
||||||
}
|
}
|
||||||
@@ -883,9 +882,9 @@
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
flows: {
|
flow: {
|
||||||
handler(flow) {
|
handler(flow) {
|
||||||
if (flow && flow.length) {
|
if (flow) {
|
||||||
this.changeOpenedTabs({
|
this.changeOpenedTabs({
|
||||||
action: "open",
|
action: "open",
|
||||||
name: "Flow",
|
name: "Flow",
|
||||||
@@ -948,21 +947,21 @@
|
|||||||
.empty {
|
.empty {
|
||||||
position: relative;
|
position: relative;
|
||||||
top: 100px;
|
top: 100px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: white;
|
color: white;
|
||||||
|
|
||||||
html.light & {
|
html.light & {
|
||||||
color: $tertiary;
|
color: $tertiary;
|
||||||
}
|
}
|
||||||
|
|
||||||
& img {
|
& img {
|
||||||
margin-bottom: 2rem;
|
margin-bottom: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
& h3 {
|
& h3 {
|
||||||
font-size: var(--font-size-lg);
|
font-size: var(--font-size-lg);
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
margin-bottom: .5rem;
|
margin-bottom: .5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
& p {
|
& p {
|
||||||
|
|||||||
@@ -114,6 +114,8 @@
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const isCurrentTabFlow = computed(() => currentTab?.value?.extension === undefined)
|
||||||
|
|
||||||
const flowErrors = computed(() => {
|
const flowErrors = computed(() => {
|
||||||
const isFlow = currentTab?.value?.extension === undefined;
|
const isFlow = currentTab?.value?.extension === undefined;
|
||||||
|
|
||||||
@@ -466,7 +468,7 @@
|
|||||||
editorViewTypes.SOURCE_TOPOLOGY,
|
editorViewTypes.SOURCE_TOPOLOGY,
|
||||||
].includes(viewType.value)
|
].includes(viewType.value)
|
||||||
) {
|
) {
|
||||||
fetchGraph();
|
if(!value.constraints) fetchGraph();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (validationDomElement.value && editorDomElement.value?.$el?.offsetWidth) {
|
if (validationDomElement.value && editorDomElement.value?.$el?.offsetWidth) {
|
||||||
@@ -585,8 +587,10 @@
|
|||||||
timer.value = setTimeout(() => onEdit(event, isFlow), 500);
|
timer.value = setTimeout(() => onEdit(event, isFlow), 500);
|
||||||
};
|
};
|
||||||
|
|
||||||
const switchViewType = (event) => {
|
const switchViewType = (event, shouldPersist = true) => {
|
||||||
persistViewType(event);
|
if(shouldPersist) persistViewType(event)
|
||||||
|
else viewType.value = event
|
||||||
|
|
||||||
if (
|
if (
|
||||||
[editorViewTypes.TOPOLOGY, editorViewTypes.SOURCE_TOPOLOGY].includes(
|
[editorViewTypes.TOPOLOGY, editorViewTypes.SOURCE_TOPOLOGY].includes(
|
||||||
viewType.value
|
viewType.value
|
||||||
@@ -639,7 +643,6 @@
|
|||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
overrideFlow.value = true;
|
overrideFlow.value = true;
|
||||||
console.log("pop");
|
|
||||||
return true;
|
return true;
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
@@ -878,7 +881,13 @@
|
|||||||
return tab.name === currentTab.value.name;
|
return tab.name === currentTab.value.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(currentTab, () => {
|
watch(currentTab, (current, previous) => {
|
||||||
|
const isCurrentFlow = current?.name === "Flow";
|
||||||
|
const isPreviousFlow = previous?.name === "Flow";
|
||||||
|
|
||||||
|
if(isPreviousFlow) persistViewType(viewType.value);
|
||||||
|
switchViewType(isCurrentFlow ? loadViewType() : editorViewTypes.SOURCE, false)
|
||||||
|
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
const activeTabElement = tabsScrollRef.value.wrapRef.querySelector(".tab-active");
|
const activeTabElement = tabsScrollRef.value.wrapRef.querySelector(".tab-active");
|
||||||
const rightMostCurrentTabPixel = activeTabElement.offsetLeft + activeTabElement.clientWidth;
|
const rightMostCurrentTabPixel = activeTabElement.offsetLeft + activeTabElement.clientWidth;
|
||||||
@@ -989,7 +998,7 @@
|
|||||||
@save="save"
|
@save="save"
|
||||||
@execute="execute"
|
@execute="execute"
|
||||||
v-model="flowYaml"
|
v-model="flowYaml"
|
||||||
schema-type="flow"
|
:schema-type="isCurrentTabFlow? 'flow': undefined"
|
||||||
:lang="currentTab?.extension === undefined ? 'yaml' : undefined"
|
:lang="currentTab?.extension === undefined ? 'yaml' : undefined"
|
||||||
:extension="currentTab?.extension"
|
:extension="currentTab?.extension"
|
||||||
@update:model-value="editorUpdate"
|
@update:model-value="editorUpdate"
|
||||||
|
|||||||
@@ -39,18 +39,26 @@
|
|||||||
@update:model-value="onChange"
|
@update:model-value="onChange"
|
||||||
show-password
|
show-password
|
||||||
/>
|
/>
|
||||||
<el-input-number
|
<span v-if="input.type === 'INT'">
|
||||||
v-if="input.type === 'INT'"
|
<el-input-number
|
||||||
v-model="inputs[input.id]"
|
v-model="inputs[input.id]"
|
||||||
@update:model-value="onChange"
|
@update:model-value="onChange"
|
||||||
:step="1"
|
:min="input.min"
|
||||||
/>
|
:max="input.max && input.max >= (input.min || -Infinity) ? input.max : Infinity"
|
||||||
<el-input-number
|
:step="1"
|
||||||
v-if="input.type === 'FLOAT'"
|
/>
|
||||||
v-model="inputs[input.id]"
|
<div v-if="input.min || input.max" class="hint">{{ numberHint(input) }}</div>
|
||||||
@update:model-value="onChange"
|
</span>
|
||||||
:step="0.001"
|
<span v-if="input.type === 'FLOAT'">
|
||||||
/>
|
<el-input-number
|
||||||
|
v-model="inputs[input.id]"
|
||||||
|
@update:model-value="onChange"
|
||||||
|
:min="input.min"
|
||||||
|
:max="input.max && input.max >= (input.min || -Infinity) ? input.max : Infinity"
|
||||||
|
:step="0.001"
|
||||||
|
/>
|
||||||
|
<div v-if="input.min || input.max" class="hint">{{ numberHint(input) }}</div>
|
||||||
|
</span>
|
||||||
<el-radio-group
|
<el-radio-group
|
||||||
v-if="input.type === 'BOOLEAN'"
|
v-if="input.type === 'BOOLEAN'"
|
||||||
v-model="inputs[input.id]"
|
v-model="inputs[input.id]"
|
||||||
@@ -182,6 +190,18 @@
|
|||||||
this.inputs[input.id] = e.target.files[0];
|
this.inputs[input.id] = e.target.files[0];
|
||||||
this.onChange();
|
this.onChange();
|
||||||
},
|
},
|
||||||
|
numberHint(input){
|
||||||
|
const {min, max} = input;
|
||||||
|
|
||||||
|
if (min !== undefined && max !== undefined) {
|
||||||
|
if(min > max) return `Minimum value ${min} is larger than maximum value ${max}, so we've removed the upper limit.`;
|
||||||
|
return `Minimum value is ${min}, maximum value is ${max}.`;
|
||||||
|
} else if (min !== undefined) {
|
||||||
|
return `Minimum value is ${min}.`;
|
||||||
|
} else if (max !== undefined) {
|
||||||
|
return `Maximum value is ${max}.`;
|
||||||
|
} else return false;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
inputs: {
|
inputs: {
|
||||||
@@ -199,5 +219,8 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
.hint {
|
||||||
|
font-size: var(--font-size-xs);
|
||||||
|
color: var(--bs-gray-700);
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -16,6 +16,7 @@
|
|||||||
import JsonWorker from "monaco-editor/esm/vs/language/json/json.worker?worker";
|
import JsonWorker from "monaco-editor/esm/vs/language/json/json.worker?worker";
|
||||||
import {configureMonacoYaml} from "monaco-yaml";
|
import {configureMonacoYaml} from "monaco-yaml";
|
||||||
import {yamlSchemas} from "override/utils/yamlSchemas";
|
import {yamlSchemas} from "override/utils/yamlSchemas";
|
||||||
|
import {editorViewTypes} from "../../utils/constants";
|
||||||
import Utils from "../../utils/utils";
|
import Utils from "../../utils/utils";
|
||||||
import YamlUtils from "../../utils/yamlUtils";
|
import YamlUtils from "../../utils/yamlUtils";
|
||||||
import uniqBy from "lodash/uniqBy";
|
import uniqBy from "lodash/uniqBy";
|
||||||
@@ -56,7 +57,8 @@
|
|||||||
...mapState({
|
...mapState({
|
||||||
currentTab: (state) => state.editor.current,
|
currentTab: (state) => state.editor.current,
|
||||||
tabs: (state) => state.editor.tabs,
|
tabs: (state) => state.editor.tabs,
|
||||||
flow: (state) => state.flow.flow
|
flow: (state) => state.flow.flow,
|
||||||
|
view: (state) => state.editor.view
|
||||||
}),
|
}),
|
||||||
prefix() {
|
prefix() {
|
||||||
return this.schemaType ? `${this.schemaType}-` : "";
|
return this.schemaType ? `${this.schemaType}-` : "";
|
||||||
@@ -430,7 +432,8 @@
|
|||||||
id: subflowTask.flowId,
|
id: subflowTask.flowId,
|
||||||
revision: subflowTask.revision,
|
revision: subflowTask.revision,
|
||||||
source: false,
|
source: false,
|
||||||
store: false
|
store: false,
|
||||||
|
deleted: true
|
||||||
}
|
}
|
||||||
)).inputs?.map(input => input.id) ?? [];
|
)).inputs?.map(input => input.id) ?? [];
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@@ -631,6 +634,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
setTimeout(() => monaco.editor.remeasureFonts(), 1)
|
||||||
this.$emit("editorDidMount", this.editor);
|
this.$emit("editorDidMount", this.editor);
|
||||||
},
|
},
|
||||||
async changeTab(pathOrName, valueSupplier, useModelCache = true) {
|
async changeTab(pathOrName, valueSupplier, useModelCache = true) {
|
||||||
@@ -672,6 +677,8 @@
|
|||||||
this.editor.focus();
|
this.editor.focus();
|
||||||
},
|
},
|
||||||
destroy: function () {
|
destroy: function () {
|
||||||
|
if(this.view === editorViewTypes.TOPOLOGY) return;
|
||||||
|
|
||||||
this.subflowAutocompletionProvider?.dispose();
|
this.subflowAutocompletionProvider?.dispose();
|
||||||
this.pebbleAutocompletion?.dispose();
|
this.pebbleAutocompletion?.dispose();
|
||||||
this.nestedFieldAutocompletionProvider?.dispose();
|
this.nestedFieldAutocompletionProvider?.dispose();
|
||||||
|
|||||||
@@ -3,17 +3,17 @@
|
|||||||
<el-tooltip :content="$t('source')" transition="" :hide-after="0" :persistent="false" effect="light">
|
<el-tooltip :content="$t('source')" transition="" :hide-after="0" :persistent="false" effect="light">
|
||||||
<el-button :type="buttonType(editorViewTypes.SOURCE)" @click="switchView(editorViewTypes.SOURCE)" :icon="FileDocumentEditOutline" />
|
<el-button :type="buttonType(editorViewTypes.SOURCE)" @click="switchView(editorViewTypes.SOURCE)" :icon="FileDocumentEditOutline" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-tooltip :content="$t('source and doc')" transition="" :hide-after="0" :persistent="false" effect="light">
|
<el-tooltip :content="!isFlow ? $t('flow_only') : $t('source and doc')" transition="" :hide-after="0" :persistent="false" effect="light">
|
||||||
<el-button :type="buttonType(editorViewTypes.SOURCE_DOC)" @click="switchView(editorViewTypes.SOURCE_DOC)" :icon="BookOpenOutline" />
|
<el-button :disabled="!isFlow" :type="buttonType(editorViewTypes.SOURCE_DOC)" @click="switchView(editorViewTypes.SOURCE_DOC)" :icon="BookOpenOutline" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-tooltip :content="$t('source and topology')" transition="" :hide-after="0" :persistent="false" effect="light">
|
<el-tooltip :content="!isFlow ? $t('flow_only') : $t('source and topology')" transition="" :hide-after="0" :persistent="false" effect="light">
|
||||||
<el-button :type="buttonType(editorViewTypes.SOURCE_TOPOLOGY)" @click="switchView(editorViewTypes.SOURCE_TOPOLOGY)" :icon="FileTableOutline" />
|
<el-button :disabled="!isFlow" :type="buttonType(editorViewTypes.SOURCE_TOPOLOGY)" @click="switchView(editorViewTypes.SOURCE_TOPOLOGY)" :icon="FileTableOutline" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-tooltip :content="$t('topology')" transition="" :hide-after="0" :persistent="false" effect="light">
|
<el-tooltip :content="!isFlow ? $t('flow_only') : $t('topology')" transition="" :hide-after="0" :persistent="false" effect="light">
|
||||||
<el-button :type="buttonType(editorViewTypes.TOPOLOGY)" @click="switchView(editorViewTypes.TOPOLOGY)" :icon="FileTreeOutline" />
|
<el-button :disabled="!isFlow" :type="buttonType(editorViewTypes.TOPOLOGY)" @click="switchView(editorViewTypes.TOPOLOGY)" :icon="FileTreeOutline" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-tooltip :content="$t('source and blueprints')" transition="" :hide-after="0" :persistent="false" effect="light">
|
<el-tooltip :content="!isFlow ? $t('flow_only') : $t('source and blueprints')" transition="" :hide-after="0" :persistent="false" effect="light">
|
||||||
<el-button :type="buttonType(editorViewTypes.SOURCE_BLUEPRINTS)" @click="switchView(editorViewTypes.SOURCE_BLUEPRINTS)" :icon="BallotOutline" />
|
<el-button :disabled="!isFlow" :type="buttonType(editorViewTypes.SOURCE_BLUEPRINTS)" @click="switchView(editorViewTypes.SOURCE_BLUEPRINTS)" :icon="BallotOutline" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</el-button-group>
|
</el-button-group>
|
||||||
</template>
|
</template>
|
||||||
@@ -28,6 +28,8 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import {mapState, mapMutations} from "vuex";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
type: {
|
type: {
|
||||||
@@ -36,8 +38,19 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
emits: ["switch-view"],
|
emits: ["switch-view"],
|
||||||
|
computed: {
|
||||||
|
...mapState({
|
||||||
|
currentTab: (state) => state.editor.current
|
||||||
|
}),
|
||||||
|
isFlow(){
|
||||||
|
return this.currentTab?.name === "Flow"
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
...mapMutations("editor", ["changeView"]),
|
||||||
|
|
||||||
switchView(view) {
|
switchView(view) {
|
||||||
|
this.changeView(view)
|
||||||
this.$emit("switch-view", view)
|
this.$emit("switch-view", view)
|
||||||
},
|
},
|
||||||
buttonType(view) {
|
buttonType(view) {
|
||||||
|
|||||||
25
ui/src/components/layout/Cron.vue
Normal file
25
ui/src/components/layout/Cron.vue
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<template>
|
||||||
|
<span data-component="FILENAME_PLACEHOLDER">
|
||||||
|
{{ humanReadableCron }}
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import Utils from "../../utils/utils.js";
|
||||||
|
import cronstrue from "cronstrue";
|
||||||
|
import "cronstrue/locales/fr";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
cronExpression: {
|
||||||
|
type: String,
|
||||||
|
default: undefined
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
humanReadableCron() {
|
||||||
|
return cronstrue.toString(this.cronExpression, {locale: Utils.getLang()});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -48,9 +48,13 @@
|
|||||||
[]
|
[]
|
||||||
)
|
)
|
||||||
.forEach(label => {
|
.forEach(label => {
|
||||||
const split = label.split(":");
|
const separatorIndex = label.indexOf(":");
|
||||||
|
|
||||||
labels.set(split[0], split[1]);
|
if (separatorIndex === -1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
labels.set(label.slice(0, separatorIndex), label.slice(separatorIndex + 1));
|
||||||
})
|
})
|
||||||
|
|
||||||
return labels;
|
return labels;
|
||||||
|
|||||||
@@ -69,7 +69,7 @@
|
|||||||
<Slack class="align-middle" /> {{ $t("join community") }}
|
<Slack class="align-middle" /> {{ $t("join community") }}
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a
|
||||||
href="https://kestra.io/contact-us?utm_source=app&utm_content=top-nav-bar"
|
href="https://kestra.io/demo?utm_source=app&utm_content=top-nav-bar"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
class="d-flex gap-2 el-dropdown-menu__item"
|
class="d-flex gap-2 el-dropdown-menu__item"
|
||||||
>
|
>
|
||||||
@@ -147,7 +147,7 @@
|
|||||||
localStorage.setItem("tourDoneOrSkip", undefined);
|
localStorage.setItem("tourDoneOrSkip", undefined);
|
||||||
this.$store.commit("core/setGuidedProperties", {tourStarted: false});
|
this.$store.commit("core/setGuidedProperties", {tourStarted: false});
|
||||||
|
|
||||||
this.$tours["guidedTour"].start();
|
this.$tours["guidedTour"]?.start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -21,6 +21,8 @@
|
|||||||
<script>
|
<script>
|
||||||
import {mapState} from "vuex";
|
import {mapState} from "vuex";
|
||||||
import _uniqBy from "lodash/uniqBy";
|
import _uniqBy from "lodash/uniqBy";
|
||||||
|
import permission from "../../models/permission";
|
||||||
|
import action from "../../models/action";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
@@ -43,14 +45,17 @@
|
|||||||
},
|
},
|
||||||
emits: ["update:modelValue"],
|
emits: ["update:modelValue"],
|
||||||
created() {
|
created() {
|
||||||
this.$store
|
if (this.user && this.user.hasAnyActionOnAnyNamespace(permission.NAMESPACE, action.READ)) {
|
||||||
.dispatch("namespace/loadNamespacesForDatatype", {dataType: this.dataType})
|
this.$store
|
||||||
.then(() => {
|
.dispatch("namespace/loadNamespacesForDatatype", {dataType: this.dataType})
|
||||||
this.groupedNamespaces = this.groupNamespaces(this.datatypeNamespaces);
|
.then(() => {
|
||||||
});
|
this.groupedNamespaces = this.groupNamespaces(this.datatypeNamespaces);
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState("namespace", ["datatypeNamespaces"])
|
...mapState("namespace", ["datatypeNamespaces"]),
|
||||||
|
...mapState("auth", ["user"]),
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
import imageDoc from "../../assets/onboarding/onboarding-docs-dark.svg"
|
import imageDoc from "../../assets/onboarding/onboarding-docs-dark.svg"
|
||||||
import imageProduct from "../../assets/onboarding/onboarding-product-dark.svg"
|
import imageProduct from "../../assets/onboarding/onboarding-product-dark.svg"
|
||||||
import Markdown from "../layout/Markdown.vue";
|
import Markdown from "../layout/Markdown.vue";
|
||||||
|
import Utils from "../../utils/utils.js";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "OnboardingCard",
|
name: "OnboardingCard",
|
||||||
@@ -50,7 +51,7 @@
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
lang() {
|
lang() {
|
||||||
const lang = localStorage.getItem("lang") || "en";
|
const lang = Utils.getLang();
|
||||||
if (lang === "fr") {
|
if (lang === "fr") {
|
||||||
return "_fr"
|
return "_fr"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<Block :heading="$t('settings.blocks.configuration.label')">
|
<Block :heading="$t('settings.blocks.configuration.label')">
|
||||||
<template #content>
|
<template #content>
|
||||||
<Row>
|
<Row>
|
||||||
<Column :label="$t('settings.blocks.localization.fields.language')">
|
<Column :label="$t('settings.blocks.configuration.fields.language')">
|
||||||
<el-select :model-value="lang" @update:model-value="onLang">
|
<el-select :model-value="lang" @update:model-value="onLang">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in langOptions"
|
v-for="item in langOptions"
|
||||||
@@ -124,7 +124,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</Block>
|
</Block>
|
||||||
|
|
||||||
<Block :heading="$t('settings.blocks.localization.label')">
|
<Block :heading="$t('settings.blocks.localization.label')" :note="$t('settings.blocks.localization.note')">
|
||||||
<template #content>
|
<template #content>
|
||||||
<Row>
|
<Row>
|
||||||
<Column :label="$t('settings.blocks.localization.fields.time_zone')">
|
<Column :label="$t('settings.blocks.localization.fields.time_zone')">
|
||||||
@@ -246,7 +246,7 @@
|
|||||||
|
|
||||||
this.defaultNamespace = localStorage.getItem("defaultNamespace") || "";
|
this.defaultNamespace = localStorage.getItem("defaultNamespace") || "";
|
||||||
this.defaultLogLevel = localStorage.getItem("defaultLogLevel") || "INFO";
|
this.defaultLogLevel = localStorage.getItem("defaultLogLevel") || "INFO";
|
||||||
this.lang = localStorage.getItem("lang") || "en";
|
this.lang = Utils.getLang();
|
||||||
this.theme = localStorage.getItem("theme") || "light";
|
this.theme = localStorage.getItem("theme") || "light";
|
||||||
this.editorTheme = localStorage.getItem("editorTheme") || (darkTheme ? "dark" : "vs");
|
this.editorTheme = localStorage.getItem("editorTheme") || (darkTheme ? "dark" : "vs");
|
||||||
this.dateFormat = localStorage.getItem(DATE_FORMAT_STORAGE_KEY) || "llll";
|
this.dateFormat = localStorage.getItem(DATE_FORMAT_STORAGE_KEY) || "llll";
|
||||||
|
|||||||
@@ -1,14 +1,24 @@
|
|||||||
<template>
|
<template>
|
||||||
<section>
|
<section>
|
||||||
<h1 class="heading" v-text="heading" />
|
<h1 class="heading">
|
||||||
|
<el-popover v-if="note" :content="note" trigger="hover" :width="400" class="info">
|
||||||
|
<template #reference>
|
||||||
|
<InformationOutline />
|
||||||
|
</template>
|
||||||
|
</el-popover>
|
||||||
|
<span>{{ heading }}</span>
|
||||||
|
</h1>
|
||||||
<slot name="content" />
|
<slot name="content" />
|
||||||
<el-divider v-if="!last" />
|
<el-divider v-if="!last" />
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import InformationOutline from "vue-material-design-icons/InformationOutline.vue";
|
||||||
|
|
||||||
defineProps({
|
defineProps({
|
||||||
heading: {type: String, required: true},
|
heading: {type: String, required: true},
|
||||||
|
note: {type: String, default: undefined},
|
||||||
last: {type: Boolean, default: false},
|
last: {type: Boolean, default: false},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@@ -20,9 +30,16 @@ section {
|
|||||||
margin: calc($spacer * 2);
|
margin: calc($spacer * 2);
|
||||||
|
|
||||||
& > h1.heading {
|
& > h1.heading {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
margin-bottom: calc($spacer * 2);
|
margin-bottom: calc($spacer * 2);
|
||||||
font-size: calc($font-size-base * 1.5);
|
font-size: calc($font-size-base * 1.5);
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
|
|
||||||
|
& > span.el-tooltip__trigger {
|
||||||
|
cursor: pointer;
|
||||||
|
margin-right: calc($spacer / 2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -183,17 +183,17 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
save() {
|
save() {
|
||||||
if (this.$tours["guidedTour"].isRunning.value && !this.guidedProperties.saveFlow) {
|
if (this.$tours["guidedTour"]?.isRunning?.value && !this.guidedProperties.saveFlow) {
|
||||||
this.$store.dispatch("api/events", {
|
this.$store.dispatch("api/events", {
|
||||||
type: "ONBOARDING",
|
type: "ONBOARDING",
|
||||||
onboarding: {
|
onboarding: {
|
||||||
step: this.$tours["guidedTour"].currentStep._value,
|
step: this.$tours["guidedTour"]?.currentStep?._value,
|
||||||
action: "next",
|
action: "next",
|
||||||
template: this.guidedProperties.template
|
template: this.guidedProperties.template
|
||||||
},
|
},
|
||||||
page: pageFromRoute(this.$router.currentRoute.value)
|
page: pageFromRoute(this.$router.currentRoute.value)
|
||||||
});
|
});
|
||||||
this.$tours["guidedTour"].nextStep();
|
this.$tours["guidedTour"]?.nextStep();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
export default {
|
export default {
|
||||||
FLOW: "FLOW",
|
FLOW: "FLOW",
|
||||||
EXECUTION: "EXECUTION",
|
EXECUTION: "EXECUTION",
|
||||||
TEMPLATE: "TEMPLATE"
|
TEMPLATE: "TEMPLATE",
|
||||||
|
NAMESPACE: "NAMESPACE"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ export default [
|
|||||||
{name: "root", path: "/", redirect: {name: "home"}},
|
{name: "root", path: "/", redirect: {name: "home"}},
|
||||||
{name: "home", path: "/:tenant?/dashboard", component: Home},
|
{name: "home", path: "/:tenant?/dashboard", component: Home},
|
||||||
{name: "welcome", path: "/:tenant?/welcome", component: Welcome},
|
{name: "welcome", path: "/:tenant?/welcome", component: Welcome},
|
||||||
{name: "home", path: "/:tenant?/dashboard", component: Home},
|
|
||||||
|
|
||||||
//Flows
|
//Flows
|
||||||
{name: "flows/list", path: "/:tenant?/flows", component: Flows},
|
{name: "flows/list", path: "/:tenant?/flows", component: Flows},
|
||||||
|
|||||||
@@ -23,6 +23,10 @@ class Me {
|
|||||||
hasAnyActionOnAnyNamespace(permission, action) {
|
hasAnyActionOnAnyNamespace(permission, action) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hasAnyRole() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ export default {
|
|||||||
explorerWidth: 20,
|
explorerWidth: 20,
|
||||||
current: undefined,
|
current: undefined,
|
||||||
tabs: [],
|
tabs: [],
|
||||||
|
view: undefined,
|
||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
updateOnboarding(state) {
|
updateOnboarding(state) {
|
||||||
@@ -84,5 +85,12 @@ export default {
|
|||||||
state.tabs = [state.tabs[0]];
|
state.tabs = [state.tabs[0]];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
closeAllTabs(state) {
|
||||||
|
state.tabs = [];
|
||||||
|
state.current = undefined
|
||||||
|
},
|
||||||
|
changeView(state, view) {
|
||||||
|
state.view = view;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -205,7 +205,19 @@ export default {
|
|||||||
return this.$http.get(`${apiUrl(this)}/executions/${options.executionId}/file/preview`, {
|
return this.$http.get(`${apiUrl(this)}/executions/${options.executionId}/file/preview`, {
|
||||||
params: options
|
params: options
|
||||||
}).then(response => {
|
}).then(response => {
|
||||||
commit("setFilePreview", response.data)
|
let data = {...response.data}
|
||||||
|
|
||||||
|
// WORKAROUND, related to https://github.com/kestra-io/plugin-aws/issues/456
|
||||||
|
if(data.extension === "ion") {
|
||||||
|
const notObjects = data.content.some(e => typeof e !== "object");
|
||||||
|
|
||||||
|
if(notObjects) {
|
||||||
|
const content = data.content.length === 1 ? data.content[0] : data.content.join("\n");
|
||||||
|
data = {...data, type: "TEXT", content}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
commit("setFilePreview", data)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
setLabels(_, options) {
|
setLabels(_, options) {
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ export default {
|
|||||||
}).then(response => {
|
}).then(response => {
|
||||||
commit("setFlows", response.data.results)
|
commit("setFlows", response.data.results)
|
||||||
commit("setTotal", response.data.total)
|
commit("setTotal", response.data.total)
|
||||||
commit("setOverallTotal", response.data.total)
|
commit("setOverallTotal", response.data.results.filter(f => f.namespace !== "tutorial").length)
|
||||||
|
|
||||||
return response.data;
|
return response.data;
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
import Utils from "../utils/utils";
|
import Utils from "../utils/utils";
|
||||||
import {apiUrl} from "override/utils/route";
|
import {apiUrl} from "override/utils/route";
|
||||||
|
|
||||||
const BASE = (namespace) => `${apiUrl(this)}/namespaces/${namespace}`;
|
function base(namespace) {
|
||||||
|
return `${apiUrl(this)}/namespaces/${namespace}`;
|
||||||
|
}
|
||||||
const HEADERS = {headers: {"Content-Type": "multipart/form-data"}};
|
const HEADERS = {headers: {"Content-Type": "multipart/form-data"}};
|
||||||
|
|
||||||
const slashPrefix = (path) => (path.startsWith("/") ? path : `/${path}`);
|
const slashPrefix = (path) => (path.startsWith("/") ? path : `/${path}`);
|
||||||
@@ -15,13 +17,13 @@ export default {
|
|||||||
actions: {
|
actions: {
|
||||||
// Create a directory
|
// Create a directory
|
||||||
async createDirectory(_, payload) {
|
async createDirectory(_, payload) {
|
||||||
const URL = `${BASE(payload.namespace)}/files/directory?path=${slashPrefix(payload.path)}`;
|
const URL = `${base.call(this, payload.namespace)}/files/directory?path=${slashPrefix(payload.path)}`;
|
||||||
await this.$http.post(URL);
|
await this.$http.post(URL);
|
||||||
},
|
},
|
||||||
|
|
||||||
// List directory content
|
// List directory content
|
||||||
async readDirectory(_, payload) {
|
async readDirectory(_, payload) {
|
||||||
const URL = `${BASE(payload.namespace)}/files/directory${payload.path ? `?path=${slashPrefix(safePath(payload.path))}` : ""}`;
|
const URL = `${base.call(this, payload.namespace)}/files/directory${payload.path ? `?path=${slashPrefix(safePath(payload.path))}` : ""}`;
|
||||||
const request = await this.$http.get(URL);
|
const request = await this.$http.get(URL);
|
||||||
|
|
||||||
return request.data ?? [];
|
return request.data ?? [];
|
||||||
@@ -33,21 +35,21 @@ export default {
|
|||||||
const BLOB = new Blob([payload.content], {type: "text/plain"});
|
const BLOB = new Blob([payload.content], {type: "text/plain"});
|
||||||
DATA.append("fileContent", BLOB);
|
DATA.append("fileContent", BLOB);
|
||||||
|
|
||||||
const URL = `${BASE(payload.namespace)}/files?path=${slashPrefix(payload.path)}`;
|
const URL = `${base.call(this, payload.namespace)}/files?path=${slashPrefix(payload.path)}`;
|
||||||
await this.$http.post(URL, DATA, HEADERS);
|
await this.$http.post(URL, DATA, HEADERS);
|
||||||
},
|
},
|
||||||
|
|
||||||
// Get namespace file content
|
// Get namespace file content
|
||||||
async readFile(_, payload) {
|
async readFile(_, payload) {
|
||||||
const URL = `${BASE(payload.namespace)}/files?path=${slashPrefix(safePath(payload.path))}`;
|
const URL = `${base.call(this, payload.namespace)}/files?path=${slashPrefix(safePath(payload.path))}`;
|
||||||
const request = await this.$http.get(URL);
|
const request = await this.$http.get(URL, {transformResponse: response => response, responseType: "json"})
|
||||||
|
|
||||||
return request.data ?? [];
|
return request.data ?? [];
|
||||||
},
|
},
|
||||||
|
|
||||||
// Search for namespace files
|
// Search for namespace files
|
||||||
async searchFiles(_, payload) {
|
async searchFiles(_, payload) {
|
||||||
const URL = `${BASE(payload.namespace)}/files/search?q=${payload.query}`;
|
const URL = `${base.call(this, payload.namespace)}/files/search?q=${payload.query}`;
|
||||||
const request = await this.$http.get(URL);
|
const request = await this.$http.get(URL);
|
||||||
|
|
||||||
return request.data ?? [];
|
return request.data ?? [];
|
||||||
@@ -59,31 +61,31 @@ export default {
|
|||||||
const BLOB = new Blob([payload.content], {type: "text/plain"});
|
const BLOB = new Blob([payload.content], {type: "text/plain"});
|
||||||
DATA.append("fileContent", BLOB);
|
DATA.append("fileContent", BLOB);
|
||||||
|
|
||||||
const URL = `${BASE(payload.namespace)}/files?path=${slashPrefix(safePath(payload.path))}`;
|
const URL = `${base.call(this, payload.namespace)}/files?path=${slashPrefix(safePath(payload.path))}`;
|
||||||
await this.$http.post(URL, DATA, HEADERS);
|
await this.$http.post(URL, DATA, HEADERS);
|
||||||
},
|
},
|
||||||
|
|
||||||
// Move a file or directory
|
// Move a file or directory
|
||||||
async moveFileDirectory(_, payload) {
|
async moveFileDirectory(_, payload) {
|
||||||
const URL = `${BASE(payload.namespace)}/files?from=${slashPrefix(payload.old)}&to=${slashPrefix(payload.new)}`;
|
const URL = `${base.call(this, payload.namespace)}/files?from=${slashPrefix(payload.old)}&to=${slashPrefix(payload.new)}`;
|
||||||
await this.$http.put(URL);
|
await this.$http.put(URL);
|
||||||
},
|
},
|
||||||
|
|
||||||
// Rename a file or directory
|
// Rename a file or directory
|
||||||
async renameFileDirectory(_, payload) {
|
async renameFileDirectory(_, payload) {
|
||||||
const URL = `${BASE(payload.namespace)}/files?from=${slashPrefix(payload.old)}&to=${slashPrefix(payload.new)}`;
|
const URL = `${base.call(this, payload.namespace)}/files?from=${slashPrefix(payload.old)}&to=${slashPrefix(payload.new)}`;
|
||||||
await this.$http.put(URL);
|
await this.$http.put(URL);
|
||||||
},
|
},
|
||||||
|
|
||||||
// Delete a file or directory
|
// Delete a file or directory
|
||||||
async deleteFileDirectory(_, payload) {
|
async deleteFileDirectory(_, payload) {
|
||||||
const URL = `${BASE(payload.namespace)}/files?path=${slashPrefix(payload.path)}`;
|
const URL = `${base.call(this, payload.namespace)}/files?path=${slashPrefix(payload.path)}`;
|
||||||
await this.$http.delete(URL);
|
await this.$http.delete(URL);
|
||||||
},
|
},
|
||||||
|
|
||||||
// Export namespace files as a ZIP
|
// Export namespace files as a ZIP
|
||||||
async exportFileDirectory(_, payload) {
|
async exportFileDirectory(_, payload) {
|
||||||
const URL = `${BASE(payload.namespace)}/files/export`;
|
const URL = `${base.call(this, payload.namespace)}/files/export`;
|
||||||
const request = await this.$http.get(URL);
|
const request = await this.$http.get(URL);
|
||||||
|
|
||||||
const name = payload.namespace + "_files.zip";
|
const name = payload.namespace + "_files.zip";
|
||||||
|
|||||||
@@ -308,10 +308,19 @@
|
|||||||
"errors": {
|
"errors": {
|
||||||
"404": {
|
"404": {
|
||||||
"title": "Page not found",
|
"title": "Page not found",
|
||||||
"content": "The requested URL was not found on this server. <span class=\"text-muted\">That’s all we know.</span>",
|
"content": "The requested URL was not found on this server.<br />That’s all we know.",
|
||||||
"flow or execution": "The flow or execution you are looking for does not exist."
|
"flow or execution": "The flow or execution you are looking for does not exist."
|
||||||
|
},
|
||||||
|
"401": {
|
||||||
|
"title": "Unauthorized",
|
||||||
|
"content": "You need to be authenticated to access this page."
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"title": "Access denied",
|
||||||
|
"content": "You don't have the required permissions to access this page."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"back_to_dashboard": "Back to dashboard",
|
||||||
"copy logs": "Copy logs",
|
"copy logs": "Copy logs",
|
||||||
"download logs": "Download logs",
|
"download logs": "Download logs",
|
||||||
"delete logs": "Delete logs",
|
"delete logs": "Delete logs",
|
||||||
@@ -546,7 +555,7 @@
|
|||||||
"environment color setting": "Environment color",
|
"environment color setting": "Environment color",
|
||||||
"slack support": "Ask any question via Slack",
|
"slack support": "Ask any question via Slack",
|
||||||
"join community": "Join the Community",
|
"join community": "Join the Community",
|
||||||
"reach us": "Reach out to us",
|
"reach us": "Talk to us",
|
||||||
"new version": "New version {version} available!",
|
"new version": "New version {version} available!",
|
||||||
"error detected": "Error(s) detected",
|
"error detected": "Error(s) detected",
|
||||||
"warning detected": "Warning(s) detected",
|
"warning detected": "Warning(s) detected",
|
||||||
@@ -629,7 +638,7 @@
|
|||||||
},
|
},
|
||||||
"import": {
|
"import": {
|
||||||
"import": "Import",
|
"import": "Import",
|
||||||
"file": "Import file",
|
"files": "Import files",
|
||||||
"folder": "Import folder",
|
"folder": "Import folder",
|
||||||
"success": "File(s) successfully imported",
|
"success": "File(s) successfully imported",
|
||||||
"error": "Error(s) occurred while importing the file(s)"
|
"error": "Error(s) occurred while importing the file(s)"
|
||||||
@@ -709,6 +718,7 @@
|
|||||||
"configuration": {
|
"configuration": {
|
||||||
"label": "Main Configuration",
|
"label": "Main Configuration",
|
||||||
"fields": {
|
"fields": {
|
||||||
|
"language": "Language",
|
||||||
"default_namespace": "Default Namespace",
|
"default_namespace": "Default Namespace",
|
||||||
"log_level": "Default Log Level",
|
"log_level": "Default Log Level",
|
||||||
"log_display": "Default Log Display",
|
"log_display": "Default Log Display",
|
||||||
@@ -729,8 +739,8 @@
|
|||||||
},
|
},
|
||||||
"localization": {
|
"localization": {
|
||||||
"label": "Date and Time Settings",
|
"label": "Date and Time Settings",
|
||||||
|
"note": "Note that this setting is used for displaying date and time properties in the UI. To schedule your flows in a timezone different than UTC, make sure to set the timezone property on the Schedule trigger in your flow code or your plugin defaults.",
|
||||||
"fields": {
|
"fields": {
|
||||||
"language": "Language",
|
|
||||||
"time_zone": "Time Zone",
|
"time_zone": "Time Zone",
|
||||||
"date_format": "Date Format"
|
"date_format": "Date Format"
|
||||||
}
|
}
|
||||||
@@ -793,6 +803,7 @@
|
|||||||
"ee-tooltip": {
|
"ee-tooltip": {
|
||||||
"features-blocked": "This feature requires Enterprise Edition.",
|
"features-blocked": "This feature requires Enterprise Edition.",
|
||||||
"button": "Talk to us"
|
"button": "Talk to us"
|
||||||
}
|
},
|
||||||
|
"flow_only": "Only available on Flow tab."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -297,10 +297,19 @@
|
|||||||
"errors": {
|
"errors": {
|
||||||
"404": {
|
"404": {
|
||||||
"title": "Page introuvable",
|
"title": "Page introuvable",
|
||||||
"content": "L'URL demandé est introuvable sur ce serveur. <span class=\"text-muted\">C'est tout ce que nous savons.</span>",
|
"content": "L'URL demandée n'a pas été trouvée sur ce serveur.<br />C'est tout ce que nous savons.",
|
||||||
"flow or execution": "Le flow ou l'exécution demandé est introuvable."
|
"flow or execution": "Le flow ou l'exécution demandé est introuvable."
|
||||||
|
},
|
||||||
|
"401": {
|
||||||
|
"title": "Non authentifié",
|
||||||
|
"content": "Vous devez être authentifié pour accéder à cette page."
|
||||||
|
},
|
||||||
|
"403": {
|
||||||
|
"title": "Accès refusé",
|
||||||
|
"content": "Vous n'avez pas les permissions suffisantes pour accéder à cette page."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"back_to_dashboard": "Retour au tableau de bord",
|
||||||
"copy logs": "Copier les logs",
|
"copy logs": "Copier les logs",
|
||||||
"download logs": "Télécharger les logs",
|
"download logs": "Télécharger les logs",
|
||||||
"delete logs": "Supprimer les logs",
|
"delete logs": "Supprimer les logs",
|
||||||
@@ -601,7 +610,7 @@
|
|||||||
},
|
},
|
||||||
"import": {
|
"import": {
|
||||||
"import": "Importer",
|
"import": "Importer",
|
||||||
"file": "Importer un fichier",
|
"files": "Importer des fichiers",
|
||||||
"folder": "Importer un dossier",
|
"folder": "Importer un dossier",
|
||||||
"success": "Fichier(s) importé(s) avec succès",
|
"success": "Fichier(s) importé(s) avec succès",
|
||||||
"error": "Des erreurs se sont produites lors de l'importation du(des) fichier(s)"
|
"error": "Des erreurs se sont produites lors de l'importation du(des) fichier(s)"
|
||||||
@@ -681,6 +690,7 @@
|
|||||||
"configuration": {
|
"configuration": {
|
||||||
"label": "Configuration Principale",
|
"label": "Configuration Principale",
|
||||||
"fields": {
|
"fields": {
|
||||||
|
"language": "Langue",
|
||||||
"default_namespace": "Espace de noms par défaut",
|
"default_namespace": "Espace de noms par défaut",
|
||||||
"log_level": "Niveau d'affichage des journaux par défaut",
|
"log_level": "Niveau d'affichage des journaux par défaut",
|
||||||
"log_display": "Affichage des journaux par défaut",
|
"log_display": "Affichage des journaux par défaut",
|
||||||
@@ -701,8 +711,8 @@
|
|||||||
},
|
},
|
||||||
"localization": {
|
"localization": {
|
||||||
"label": "Paramètres de Date et d'Heure",
|
"label": "Paramètres de Date et d'Heure",
|
||||||
|
"note": "Remarque ce paramètre est utilisé pour afficher les propriétés de date et d'heure dans l'interface utilisateur. Pour planifier vos flux dans un fuseau horaire différent de l'UTC, assurez-vous de définir la propriété de fuseau horaire sur le déclencheur de planification dans le code de votre",
|
||||||
"fields": {
|
"fields": {
|
||||||
"language": "Langue",
|
|
||||||
"time_zone": "Fuseau Horaire",
|
"time_zone": "Fuseau Horaire",
|
||||||
"date_format": "Format de Date"
|
"date_format": "Format de Date"
|
||||||
}
|
}
|
||||||
@@ -765,6 +775,7 @@
|
|||||||
"ee-tooltip": {
|
"ee-tooltip": {
|
||||||
"features-blocked": "Cette fonctionnalité nécessite l'édition Enterprise.",
|
"features-blocked": "Cette fonctionnalité nécessite l'édition Enterprise.",
|
||||||
"button": "Contactez-nous"
|
"button": "Contactez-nous"
|
||||||
}
|
},
|
||||||
|
"flow_only": "Disponible uniquement sur l'onglet Flow."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -12,7 +12,7 @@ export default {
|
|||||||
return Utils.humanDuration(value, options);
|
return Utils.humanDuration(value, options);
|
||||||
},
|
},
|
||||||
humanizeNumber: (value) => {
|
humanizeNumber: (value) => {
|
||||||
return parseInt(value).toLocaleString(localStorage.getItem("lang") || "en")
|
return parseInt(value).toLocaleString(Utils.getLang());
|
||||||
},
|
},
|
||||||
cap: value => value ? value.toString().capitalize() : "",
|
cap: value => value ? value.toString().capitalize() : "",
|
||||||
lower: value => value ? value.toString().toLowerCase() : "",
|
lower: value => value ? value.toString().toLowerCase() : "",
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ import TaskSubflowNamespace from "../components/flows/tasks/TaskSubflowNamespace
|
|||||||
import TaskSubflowId from "../components/flows/tasks/TaskSubflowId.vue";
|
import TaskSubflowId from "../components/flows/tasks/TaskSubflowId.vue";
|
||||||
import TaskSubflowInputs from "../components/flows/tasks/TaskSubflowInputs.vue";
|
import TaskSubflowInputs from "../components/flows/tasks/TaskSubflowInputs.vue";
|
||||||
import LeftMenuLink from "../components/LeftMenuLink.vue";
|
import LeftMenuLink from "../components/LeftMenuLink.vue";
|
||||||
|
import Utils from "./utils";
|
||||||
|
|
||||||
export default (app, routes, stores, translations) => {
|
export default (app, routes, stores, translations) => {
|
||||||
// charts
|
// charts
|
||||||
@@ -101,7 +102,7 @@ export default (app, routes, stores, translations) => {
|
|||||||
|
|
||||||
|
|
||||||
// l18n
|
// l18n
|
||||||
let locale = localStorage.getItem("lang") || "en";
|
let locale = Utils.getLang();
|
||||||
|
|
||||||
let i18n = createI18n({
|
let i18n = createI18n({
|
||||||
locale: locale,
|
locale: locale,
|
||||||
|
|||||||
@@ -10,10 +10,12 @@ export default class Inputs {
|
|||||||
res = moment(res).toISOString()
|
res = moment(res).toISOString()
|
||||||
} else if (type === "DURATION" || type === "TIME") {
|
} else if (type === "DURATION" || type === "TIME") {
|
||||||
res = moment().startOf("day").add(res, "seconds").toString()
|
res = moment().startOf("day").add(res, "seconds").toString()
|
||||||
} else if (type === "JSON" || type === "ARRAY") {
|
} else if (type === "ARRAY") {
|
||||||
res = JSON.stringify(res).toString()
|
res = JSON.stringify(res).toString();
|
||||||
} else if (type === "BOOLEAN" && type === undefined){
|
} else if (type === "BOOLEAN" && type === undefined){
|
||||||
res = "undefined";
|
res = "undefined";
|
||||||
|
} else if (type === "STRING" && Array.isArray(res)){
|
||||||
|
res = res.toString();
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,9 +19,9 @@ export const inputsToFormDate = (submitor, inputsList, values) => {
|
|||||||
const inputValue = values[inputName];
|
const inputValue = values[inputName];
|
||||||
if (inputValue !== undefined) {
|
if (inputValue !== undefined) {
|
||||||
if (input.type === "DATETIME") {
|
if (input.type === "DATETIME") {
|
||||||
formData.append(inputName, submitor.$moment(inputValue).toISOString());
|
if(inputValue) formData.append(inputName, submitor.$moment(inputValue).toISOString());
|
||||||
} else if (input.type === "DATE") {
|
} else if (input.type === "DATE") {
|
||||||
formData.append(inputName, submitor.$moment(inputValue).format("YYYY-MM-DD"));
|
if(inputValue) formData.append(inputName, submitor.$moment(inputValue).format("YYYY-MM-DD"));
|
||||||
} else if (input.type === "TIME") {
|
} else if (input.type === "TIME") {
|
||||||
formData.append(inputName, submitor.$moment(inputValue).format("hh:mm:ss"));
|
formData.append(inputName, submitor.$moment(inputValue).format("hh:mm:ss"));
|
||||||
} else if (input.type === "DURATION") {
|
} else if (input.type === "DURATION") {
|
||||||
@@ -84,7 +84,7 @@ export const executeTask = (submitor, flow, values, options) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(options.nextStep) submitor.$tours["guidedTour"].nextStep();
|
if(options.nextStep) submitor.$tours["guidedTour"]?.nextStep();
|
||||||
|
|
||||||
return response.data;
|
return response.data;
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ export default class Utils {
|
|||||||
static humanDuration(value, options) {
|
static humanDuration(value, options) {
|
||||||
options = options || {maxDecimalPoints: 2};
|
options = options || {maxDecimalPoints: 2};
|
||||||
options.spacer = "";
|
options.spacer = "";
|
||||||
options.language = localStorage.getItem("lang") || "en";
|
options.language = Utils.getLang();
|
||||||
options.languages = humanizeDurationLanguages;
|
options.languages = humanizeDurationLanguages;
|
||||||
options.largest = 2;
|
options.largest = 2;
|
||||||
|
|
||||||
@@ -187,6 +187,10 @@ export default class Utils {
|
|||||||
return localStorage.getItem("theme") || "light";
|
return localStorage.getItem("theme") || "light";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static getLang() {
|
||||||
|
return localStorage.getItem("lang") || "en";
|
||||||
|
}
|
||||||
|
|
||||||
static splitFirst(str, separator){
|
static splitFirst(str, separator){
|
||||||
return str.split(separator).slice(1).join(separator);
|
return str.split(separator).slice(1).join(separator);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -274,7 +274,7 @@ public class FlowController {
|
|||||||
namespace,
|
namespace,
|
||||||
sources
|
sources
|
||||||
.stream()
|
.stream()
|
||||||
.map(flow -> FlowWithSource.of(yamlFlowParser.parse(flow, Flow.class), flow))
|
.map(flow -> FlowWithSource.of(yamlFlowParser.parse(flow, Flow.class), flow.trim()))
|
||||||
.toList(),
|
.toList(),
|
||||||
delete
|
delete
|
||||||
);
|
);
|
||||||
@@ -727,7 +727,7 @@ public class FlowController {
|
|||||||
if (fileName.endsWith(".yaml") || fileName.endsWith(".yml")) {
|
if (fileName.endsWith(".yaml") || fileName.endsWith(".yml")) {
|
||||||
List<String> sources = List.of(new String(fileUpload.getBytes()).split("---"));
|
List<String> sources = List.of(new String(fileUpload.getBytes()).split("---"));
|
||||||
for (String source : sources) {
|
for (String source : sources) {
|
||||||
this.importFlow(tenantId, source);
|
this.importFlow(tenantId, source.trim());
|
||||||
}
|
}
|
||||||
} else if (fileName.endsWith(".zip")) {
|
} else if (fileName.endsWith(".zip")) {
|
||||||
try (ZipInputStream archive = new ZipInputStream(fileUpload.getInputStream())) {
|
try (ZipInputStream archive = new ZipInputStream(fileUpload.getInputStream())) {
|
||||||
|
|||||||
@@ -138,17 +138,13 @@ public class PluginController {
|
|||||||
public MutableHttpResponse<Map<String, PluginIcon>> icons() {
|
public MutableHttpResponse<Map<String, PluginIcon>> icons() {
|
||||||
Map<String, PluginIcon> icons = pluginRegistry.plugins()
|
Map<String, PluginIcon> icons = pluginRegistry.plugins()
|
||||||
.stream()
|
.stream()
|
||||||
.flatMap(plugin -> Stream
|
.flatMap(plugin -> Stream.of(
|
||||||
.concat(
|
|
||||||
plugin.getTasks().stream(),
|
plugin.getTasks().stream(),
|
||||||
Stream.concat(
|
plugin.getTriggers().stream(),
|
||||||
Stream.concat(
|
plugin.getConditions().stream(),
|
||||||
plugin.getTriggers().stream(),
|
plugin.getTaskRunners().stream()
|
||||||
plugin.getConditions().stream()
|
|
||||||
),
|
|
||||||
plugin.getTaskRunners().stream()
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
.flatMap(i -> i)
|
||||||
.map(e -> new AbstractMap.SimpleEntry<>(
|
.map(e -> new AbstractMap.SimpleEntry<>(
|
||||||
e.getName(),
|
e.getName(),
|
||||||
new PluginIcon(
|
new PluginIcon(
|
||||||
@@ -160,6 +156,20 @@ public class PluginController {
|
|||||||
)
|
)
|
||||||
.filter(entry -> entry.getKey() != null)
|
.filter(entry -> entry.getKey() != null)
|
||||||
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (a1, a2) -> a1));
|
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (a1, a2) -> a1));
|
||||||
|
|
||||||
|
// add aliases
|
||||||
|
Map<String, PluginIcon> aliasIcons = pluginRegistry.plugins().stream()
|
||||||
|
.flatMap(plugin -> plugin.getAliases().values().stream().map(e -> new AbstractMap.SimpleEntry<>(
|
||||||
|
e.getKey(),
|
||||||
|
new PluginIcon(
|
||||||
|
e.getKey().substring(e.getKey().lastIndexOf('.') + 1),
|
||||||
|
plugin.icon(e.getValue()),
|
||||||
|
FlowableTask.class.isAssignableFrom(e.getValue())
|
||||||
|
))))
|
||||||
|
.filter(entry -> entry.getKey() != null)
|
||||||
|
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (a1, a2) -> a1));
|
||||||
|
icons.putAll(aliasIcons);
|
||||||
|
|
||||||
return HttpResponse.ok(icons).header(HttpHeaders.CACHE_CONTROL, CACHE_DIRECTIVE);
|
return HttpResponse.ok(icons).header(HttpHeaders.CACHE_CONTROL, CACHE_DIRECTIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -86,6 +86,8 @@ class PluginControllerTest {
|
|||||||
);
|
);
|
||||||
|
|
||||||
assertThat(list.entrySet().stream().filter(e -> e.getKey().equals(Log.class.getName())).findFirst().orElseThrow().getValue().getIcon(), is(notNullValue()));
|
assertThat(list.entrySet().stream().filter(e -> e.getKey().equals(Log.class.getName())).findFirst().orElseThrow().getValue().getIcon(), is(notNullValue()));
|
||||||
|
// test an alias
|
||||||
|
assertThat(list.entrySet().stream().filter(e -> e.getKey().equals("io.kestra.core.tasks.log.Log")).findFirst().orElseThrow().getValue().getIcon(), is(notNullValue()));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ kestra:
|
|||||||
cls: io.kestra.core.runners.ExecutionQueued
|
cls: io.kestra.core.runners.ExecutionQueued
|
||||||
datasources:
|
datasources:
|
||||||
h2:
|
h2:
|
||||||
url: jdbc:h2:mem:public;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
|
url: jdbc:h2:mem:public;TIME ZONE=UTC;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
|
||||||
username: sa
|
username: sa
|
||||||
password: ""
|
password: ""
|
||||||
driverClassName: org.h2.Driver
|
driverClassName: org.h2.Driver
|
||||||
|
|||||||
Reference in New Issue
Block a user