Skip to content

Commit 63a5a36

Browse files
committed
feat: Show tool/application source and revamp node menu enable toggle
1 parent 7241c06 commit 63a5a36

5 files changed

Lines changed: 73 additions & 24 deletions

File tree

ui/src/components/app-icon/icons/application.ts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -762,4 +762,50 @@ export default {
762762
])
763763
},
764764
},
765+
'app-rename': {
766+
iconReader: () => {
767+
return h('i', [
768+
h(
769+
'svg',
770+
{
771+
style: { height: '100%', width: '100%' },
772+
viewBox: '0 0 16 16',
773+
version: '1.1',
774+
xmlns: 'http://www.w3.org/2000/svg',
775+
},
776+
[
777+
h('path', {
778+
d: 'M5.35396 11.2488H7.62464L14.3787 4.49454C14.6107 4.26247 14.6112 3.88637 14.3798 3.65369L12.3341 1.59729C12.1016 1.36479 11.7247 1.36479 11.4922 1.59729L11.0723 2.01716L11.074 2.01881L4.75861 8.38274V10.6534C4.75861 10.9822 5.02516 11.2488 5.35396 11.2488ZM11.8943 2.84344L13.1 4.05546L12.0797 5.07672L10.8803 3.8773L11.8943 2.84344ZM11.2381 5.91907L7.12247 10.0387H7.12065L5.96867 8.88492L10.0465 4.7274L11.2381 5.91907Z',
779+
fill: 'currentColor',
780+
}),
781+
h('path', {
782+
d: 'M8.76309 2.31594H2.44336C2.07802 2.31594 1.78186 2.6121 1.78186 2.97744V13.5614C1.78186 13.9267 2.07802 14.2229 2.44336 14.2229H13.0273C13.3927 14.2229 13.6888 13.9267 13.6888 13.5614V7.16134L12.3575 8.50066V12.8981H3.1131V3.64074H7.46236L8.76309 2.31594Z',
783+
fill: 'currentColor',
784+
}),
785+
],
786+
),
787+
])
788+
},
789+
},
790+
'app-active': {
791+
iconReader: () => {
792+
return h('i', [
793+
h(
794+
'svg',
795+
{
796+
style: { height: '100%', width: '100%' },
797+
viewBox: '0 0 16 16',
798+
version: '1.1',
799+
xmlns: 'http://www.w3.org/2000/svg',
800+
},
801+
[
802+
h('path', {
803+
d: 'M7.99996 14C11.3137 14 14 11.3137 14 8.00002C14 4.68631 11.3137 2.00002 7.99996 2.00002C4.68625 2.00002 1.99996 4.68631 1.99996 8.00002C1.99996 11.3137 4.68625 14 7.99996 14ZM7.99996 15.3334C3.94987 15.3334 0.666626 12.0501 0.666626 8.00002C0.666626 3.94993 3.94987 0.666687 7.99996 0.666687C12.05 0.666687 15.3333 3.94993 15.3333 8.00002C15.3333 12.0501 12.05 15.3334 7.99996 15.3334ZM7.22663 9.51999L10.7622 5.98445C10.8923 5.85428 11.1034 5.85428 11.2336 5.98445L11.705 6.45586C11.8351 6.58603 11.8351 6.79709 11.705 6.92726L7.46233 11.1699C7.33216 11.3001 7.1211 11.3001 6.99093 11.1699L4.55065 8.72962C4.42047 8.59945 4.42047 8.38839 4.55065 8.25822L5.02205 7.78681C5.15223 7.65664 5.36328 7.65664 5.49346 7.78681L7.22663 9.51999Z',
804+
fill: 'currentColor',
805+
}),
806+
],
807+
),
808+
])
809+
},
810+
},
765811
}

ui/src/locales/lang/en-US/common.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export default {
6969
label: 'Status',
7070
enable: 'Enable',
7171
disable: 'Disable',
72+
enableStatus: 'Enable status',
7273
enabled: 'Enabled',
7374
disabled: 'Disabled',
7475
enableSuccess: 'Successful',

ui/src/locales/lang/zh-CN/common.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ export default {
7171
label: '状态',
7272
enable: '启用',
7373
disable: '禁用',
74+
enableStatus: '启用状态',
7475
enabled: '已启用',
7576
disabled: '已禁用',
7677
enableSuccess: '启用成功',

ui/src/locales/lang/zh-Hant/common.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export default {
6969
label: '狀態',
7070
enable: '啟用',
7171
disable: '停用',
72+
enableStatus: '啟用狀態',
7273
enabled: '已啟用',
7374
disabled: '已停用',
7475
enableSuccess: '啟用成功',

ui/src/workflow/common/NodeContainer.vue

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,15 @@
6363
<AppIcon iconName="app-more" class="color-secondary"></AppIcon>
6464
</el-button>
6565
<template #dropdown>
66-
<el-dropdown-menu style="min-width: 80px">
67-
<el-dropdown-item @click="renameNode" class="p-8">{{
68-
$t('common.rename')
69-
}}</el-dropdown-item>
70-
<el-dropdown-item @click="copyNode" class="p-8">{{
71-
$t('common.copy')
72-
}}</el-dropdown-item>
66+
<el-dropdown-menu style="min-width: 144px">
67+
<el-dropdown-item @click="renameNode" class="p-8">
68+
<AppIcon iconName="app-rename" class="color-secondary"></AppIcon>
69+
{{ $t('common.rename') }}</el-dropdown-item
70+
>
71+
<el-dropdown-item @click="copyNode" class="p-8">
72+
<AppIcon iconName="app-copy" class="color-secondary"></AppIcon>
73+
{{ $t('common.copy') }}</el-dropdown-item
74+
>
7375
<template
7476
v-if="
7577
!(
@@ -80,17 +82,16 @@
8082
)
8183
"
8284
>
83-
<el-dropdown-item v-if="nodeDisabled" @click="enable()" class="p-8">{{
84-
$t('common.status.enable')
85-
}}</el-dropdown-item>
86-
<el-dropdown-item v-else @click="disable()" class="p-8">{{
87-
$t('common.status.disable')
88-
}}</el-dropdown-item></template
89-
>
85+
<div class="flex-between p-8" @click.stop>
86+
<AppIcon iconName="app-active" class="color-secondary"></AppIcon>
87+
<span class="mr-16">{{ $t('common.status.enableStatus') }}</span>
88+
<el-switch v-model="nodeEnabled" size="small" /></div
89+
></template>
9090

91-
<el-dropdown-item @click="deleteNode" class="border-t p-8">{{
92-
$t('common.delete')
93-
}}</el-dropdown-item>
91+
<el-dropdown-item @click="deleteNode" class="border-t p-8">
92+
<AppIcon iconName="app-delete" class="color-secondary"></AppIcon>
93+
{{ $t('common.delete') }}</el-dropdown-item
94+
>
9495
<div v-if="sourceName" class="border-t p-8" @click.stop>
9596
<div class="color-secondary font-small">{{ $t('common.source') }}</div>
9697
<div class="lighter mt-4 break-all">{{ sourceName }}</div>
@@ -269,13 +270,6 @@ const dropdownMenuStyle = computed(() => {
269270
: '0px',
270271
}
271272
})
272-
const disable = () => {
273-
nodeDisabled.value = true
274-
}
275-
const enable = () => {
276-
nodeDisabled.value = false
277-
}
278-
279273
const nodeDisabled = computed({
280274
get: () => {
281275
return props.nodeModel.properties.disabled || false
@@ -284,6 +278,12 @@ const nodeDisabled = computed({
284278
set(props.nodeModel.properties, 'disabled', v)
285279
},
286280
})
281+
const nodeEnabled = computed({
282+
get: () => !nodeDisabled.value,
283+
set: (v: boolean) => {
284+
nodeDisabled.value = !v
285+
},
286+
})
287287
const titleFormRef = ref()
288288
const nodeNameDialogVisible = ref<boolean>(false)
289289
const form = ref<any>({

0 commit comments

Comments
 (0)