Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #1739

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open

Dev #1739

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@
{{ t(`workflow.blocks.base.onError.toDo.${type}`) }}
</option>
</ui-select>
<ui-input
v-if="state.toDo === 'error'"
v-model="state.errorMessage"
:placeholder="t(`workflow.blocks.workflow-state.error.message`)"
:title="t(`workflow.blocks.workflow-state.error.message`)"
class="mt-1 ml-2 w-56"
/>
<div class="mt-4 flex items-center justify-between">
<label class="inline-flex">
<ui-switch v-model="state.insertData" />
Expand Down
1 change: 1 addition & 0 deletions src/components/newtab/workflow/edit/EditBlockSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ const defaultSettings = {
retryTimes: 1,
retryInterval: 2,
toDo: 'error',
errorMessage: '',
insertData: false,
dataToInsert: [],
},
Expand Down
19 changes: 19 additions & 0 deletions src/components/newtab/workflow/edit/EditWorkflowState.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,25 @@
>
Execpt for the current workflow
</ui-checkbox>
<!-- 停止当前工作流 是否抛出错误及自定义错误信息 -->
<template v-if="data.type === 'stop-current'">
<ui-checkbox
:model-value="data.throwError"
block
class="block-variable mt-4"
@change="updateData({ throwError: $event })"
>
{{ t(`workflow.blocks.workflow-state.error.throwError`) }}
</ui-checkbox>
<ui-input
v-if="data.throwError"
:model-value="data.errorMessage"
:placeholder="t(`workflow.blocks.workflow-state.error.message`)"
:title="t(`workflow.blocks.workflow-state.error.message`)"
class="mt-2 w-full"
@change="updateData({ errorMessage: $event })"
/>
</template>
<div
v-if="data.type === 'stop-specific'"
class="bg-input focus-within:bg-box-transparent-2 mt-4 rounded-lg transition"
Expand Down
2 changes: 2 additions & 0 deletions src/lib/dayjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import 'dayjs/locale/fr';
import 'dayjs/locale/it';
import 'dayjs/locale/uk';
import 'dayjs/locale/tr';
import 'dayjs/locale/es';
import 'dayjs/locale/ru';

dayjs.extend(relativeTime);

Expand Down
6 changes: 5 additions & 1 deletion src/locales/en/blocks.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@
"description": "Manage workflows states",
"actions": {
"stop": "Stop workflows"
},
"error": {
"throwError": "Throw error",
"message": "Error message"
}
},
"regex-variable": {
Expand Down Expand Up @@ -803,4 +807,4 @@
}
}
}
}
}
Loading