|
3 | 3 | ⚠️ Node Slots Error
|
4 | 4 | </div>
|
5 | 5 | <div v-else class="lg-node-slots flex justify-between">
|
6 |
| - <div v-if="nodeInfo?.inputs?.length" class="flex flex-col"> |
| 6 | + <div v-if="filteredInputs.length" class="flex flex-col"> |
7 | 7 | <div
|
8 |
| - v-for="(input, index) in nodeInfo.inputs" |
| 8 | + v-for="(input, index) in filteredInputs" |
9 | 9 | :key="`input-${index}`"
|
10 | 10 | class="text-xs text-gray-300"
|
11 | 11 | >
|
12 | 12 | {{ getInputName(input, index) }}
|
13 | 13 | </div>
|
14 | 14 | </div>
|
15 | 15 |
|
16 |
| - <div v-if="nodeInfo?.outputs?.length" class="flex flex-col ml-auto"> |
| 16 | + <div v-if="filteredOutputs.length" class="flex flex-col ml-auto"> |
17 | 17 | <div
|
18 |
| - v-for="(output, index) in nodeInfo.outputs" |
| 18 | + v-for="(output, index) in filteredOutputs" |
19 | 19 | :key="`output-${index}`"
|
20 | 20 | class="text-xs text-gray-300 text-right"
|
21 | 21 | >
|
@@ -48,6 +48,23 @@ const props = defineProps<NodeSlotsProps>()
|
48 | 48 |
|
49 | 49 | const nodeInfo = computed(() => props.nodeData || props.node)
|
50 | 50 |
|
| 51 | +// Filter out input slots that have corresponding widgets |
| 52 | +const filteredInputs = computed(() => { |
| 53 | + if (!nodeInfo.value?.inputs) return [] |
| 54 | +
|
| 55 | + return nodeInfo.value.inputs.filter((input) => { |
| 56 | + // Check if this slot has a widget property (indicating it has a corresponding widget) |
| 57 | + if (isSlotObject(input) && 'widget' in input && input.widget) { |
| 58 | + // This slot has a widget, so we should not display it separately |
| 59 | + return false |
| 60 | + } |
| 61 | + return true |
| 62 | + }) |
| 63 | +}) |
| 64 | +
|
| 65 | +// Outputs don't have widgets, so we don't need to filter them |
| 66 | +const filteredOutputs = computed(() => nodeInfo.value?.outputs || []) |
| 67 | +
|
51 | 68 | const getInputName = (input: unknown, index: number): string => {
|
52 | 69 | if (isSlotObject(input) && input.name) {
|
53 | 70 | return input.name
|
|
0 commit comments