@arronqzy/vue-blueprint 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -3
- package/src/BlueprintNodeConfigSidebar.vue +58 -57
- package/src/components/BlueprintContextMenu.vue +5 -3
- package/src/components/BlueprintExecutionLogPanel.vue +29 -27
- package/src/components/BlueprintMetaDialog.vue +17 -11
- package/src/components/BlueprintNodeSwitchTaskDialog.vue +16 -8
- package/src/components/ClockNodeConfigPanel.vue +12 -14
- package/src/components/FetchNodeConfigPanel.vue +31 -29
- package/src/components/FetchUrlAutocomplete.vue +4 -1
- package/src/components/JsonNodeConfigPanel.vue +8 -9
- package/src/components/LogicNodeConfigPanel.vue +8 -9
- package/src/components/ViewElementMultiSelect.vue +5 -2
- package/src/composables/useBlueprintPageLifecycle.ts +27 -0
- package/src/fetch-config-task-store.ts +8 -2
- package/src/graph/document.ts +51 -14
- package/src/graph/node-summary.ts +32 -18
- package/src/index.ts +1 -1
- package/src/library/blueprint-io.ts +12 -3
- package/src/library/swagger-docs.ts +15 -5
- package/src/nodes/AndFlowNode.vue +8 -5
- package/src/nodes/BlueprintFlowNode.vue +5 -2
- package/src/nodes/BlueprintNodeCard.vue +5 -2
- package/src/nodes/BlueprintNodeShell.vue +5 -2
- package/src/nodes/ClockFlowNode.vue +6 -3
- package/src/nodes/FetchFlowNode.vue +5 -2
- package/src/nodes/JsonFlowNode.vue +5 -2
- package/src/nodes/LifecycleFlowNode.vue +6 -3
- package/src/nodes/LogicFlowNode.vue +5 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} from "@arronqzy/blueprint-dsl";
|
|
1
|
+
import { resolveFetchRequestUrl } from "@arronqzy/blueprint-dsl";
|
|
2
|
+
import type { TranslateFn } from "@arronqzy/i18n";
|
|
3
|
+
import { resolveLocale, tForLocale } from "@arronqzy/i18n";
|
|
5
4
|
|
|
6
5
|
import {
|
|
6
|
+
getLifecyclePhaseLabel,
|
|
7
7
|
resolveBlueprintConfigSource,
|
|
8
8
|
resolveNodeClockConfig,
|
|
9
9
|
resolveNodeFetchConfig,
|
|
@@ -19,21 +19,26 @@ function truncate(text: string, max: number): string {
|
|
|
19
19
|
return `${trimmed.slice(0, Math.max(0, max - 1))}…`;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
function defaultTranslate(): TranslateFn {
|
|
23
|
+
return tForLocale(resolveLocale());
|
|
24
|
+
}
|
|
25
|
+
|
|
22
26
|
/** 画布节点正文区展示的配置摘要 */
|
|
23
27
|
export function resolveBlueprintNodeSummary(
|
|
24
|
-
data: BlueprintFlowNodeData
|
|
28
|
+
data: BlueprintFlowNodeData,
|
|
29
|
+
t: TranslateFn = defaultTranslate()
|
|
25
30
|
): string | undefined {
|
|
26
31
|
const configSource = resolveBlueprintConfigSource(data);
|
|
27
32
|
|
|
28
33
|
switch (configSource) {
|
|
29
34
|
case "fetch": {
|
|
30
35
|
const config = resolveNodeFetchConfig(data);
|
|
31
|
-
if (!config.url?.trim()) return "
|
|
36
|
+
if (!config.url?.trim()) return t("blueprint.node.summaryNoUrl");
|
|
32
37
|
let url = config.url.trim();
|
|
33
38
|
try {
|
|
34
39
|
url = resolveFetchRequestUrl(config);
|
|
35
40
|
} catch {
|
|
36
|
-
/*
|
|
41
|
+
/* keep raw input */
|
|
37
42
|
}
|
|
38
43
|
const method = config.method ?? "GET";
|
|
39
44
|
return truncate(`${method} ${url}`, 44);
|
|
@@ -41,20 +46,26 @@ export function resolveBlueprintNodeSummary(
|
|
|
41
46
|
case "clock": {
|
|
42
47
|
const clock = resolveNodeClockConfig(data);
|
|
43
48
|
const parts = [
|
|
44
|
-
|
|
45
|
-
clock.intervalSeconds > 0
|
|
46
|
-
|
|
49
|
+
t("blueprint.node.summaryOutputCount", { count: clock.outputCount }),
|
|
50
|
+
clock.intervalSeconds > 0
|
|
51
|
+
? t("blueprint.node.summaryInterval", {
|
|
52
|
+
seconds: clock.intervalSeconds,
|
|
53
|
+
})
|
|
54
|
+
: null,
|
|
55
|
+
clock.emitImmediately
|
|
56
|
+
? t("blueprint.node.summaryEmitImmediate")
|
|
57
|
+
: t("blueprint.node.summaryEmitDelayed"),
|
|
47
58
|
].filter(Boolean);
|
|
48
59
|
return parts.join(" · ");
|
|
49
60
|
}
|
|
50
61
|
case "json": {
|
|
51
62
|
const json = resolveNodeJsonConfig(data).jsonString?.trim();
|
|
52
|
-
if (!json) return "
|
|
63
|
+
if (!json) return t("blueprint.node.summaryEmptyJson");
|
|
53
64
|
return truncate(json.replace(/\s+/g, " "), 44);
|
|
54
65
|
}
|
|
55
66
|
case "logic": {
|
|
56
67
|
const code = resolveNodeLogicConfig(data).sourceCode?.trim();
|
|
57
|
-
if (!code) return "
|
|
68
|
+
if (!code) return t("blueprint.node.summaryNoScript");
|
|
58
69
|
const firstLine =
|
|
59
70
|
code.split("\n").find((line) => line.trim())?.trim() ?? code;
|
|
60
71
|
return truncate(firstLine, 44);
|
|
@@ -66,22 +77,25 @@ export function resolveBlueprintNodeSummary(
|
|
|
66
77
|
if (data.libraryBlueprintId) {
|
|
67
78
|
return truncate(data.libraryBlueprintId, 44);
|
|
68
79
|
}
|
|
69
|
-
return "
|
|
80
|
+
return t("blueprint.node.summaryNoBlueprint");
|
|
70
81
|
}
|
|
71
82
|
case "lifecycle": {
|
|
72
83
|
const phase = data.lifecyclePhase ?? "mounted";
|
|
73
|
-
return
|
|
84
|
+
return getLifecyclePhaseLabel(t, phase);
|
|
74
85
|
}
|
|
75
86
|
case "view": {
|
|
76
87
|
const ids = resolveViewElementIds(data);
|
|
77
|
-
if (ids.length === 0) return "
|
|
88
|
+
if (ids.length === 0) return t("blueprint.node.summaryNoView");
|
|
78
89
|
if (ids.length === 1) {
|
|
79
|
-
return truncate(
|
|
90
|
+
return truncate(
|
|
91
|
+
t("blueprint.node.summaryViewOne", { id: ids[0] }),
|
|
92
|
+
44
|
|
93
|
+
);
|
|
80
94
|
}
|
|
81
|
-
return
|
|
95
|
+
return t("blueprint.node.summaryViewMany", { count: ids.length });
|
|
82
96
|
}
|
|
83
97
|
case "and":
|
|
84
|
-
return "
|
|
98
|
+
return t("blueprint.node.summaryAnd");
|
|
85
99
|
default:
|
|
86
100
|
return undefined;
|
|
87
101
|
}
|
package/src/index.ts
CHANGED
|
@@ -19,7 +19,7 @@ export { default as BlueprintNodeSwitchTaskDialog } from "./components/Blueprint
|
|
|
19
19
|
export type { BlueprintNodeSwitchTaskDialogProps } from "./components/BlueprintNodeSwitchTaskDialog.vue";
|
|
20
20
|
export type { ExecutionLogSettings } from "./library/execution-log-settings";
|
|
21
21
|
export type { ExecutionTraceEntry, ExecutionRunRecord } from "@arronqzy/blueprint-dsl";
|
|
22
|
-
export { resolveBlueprintConfigSource, resolveBlueprintNodeTypeLabel } from "./graph/document";
|
|
22
|
+
export { resolveBlueprintConfigSource, resolveBlueprintNodeTypeLabel, getBlueprintNodeTypeLabel, getLifecyclePhaseLabel, BLUEPRINT_CONFIG_TYPE_LABEL_KEYS, BLUEPRINT_LIFECYCLE_PHASE_KEYS } from "./graph/document";
|
|
23
23
|
export type { BlueprintConfigSource } from "./graph/document";
|
|
24
24
|
export * from "./library/blueprint-io";
|
|
25
25
|
export * from "./library/blueprint-library-db";
|
|
@@ -8,6 +8,15 @@ import {
|
|
|
8
8
|
type BlueprintLibrarySource,
|
|
9
9
|
type BlueprintMetaDraft,
|
|
10
10
|
} from "./types";
|
|
11
|
+
import { resolveLocale, tForLocale } from "@arronqzy/i18n";
|
|
12
|
+
|
|
13
|
+
function unnamedBlueprintName() {
|
|
14
|
+
return tForLocale(resolveLocale())("blueprint.dialog.unnamedBlueprint");
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function importedBlueprintName() {
|
|
18
|
+
return tForLocale(resolveLocale())("blueprint.dialog.importedBlueprint");
|
|
19
|
+
}
|
|
11
20
|
|
|
12
21
|
export function createLibraryBlueprintId() {
|
|
13
22
|
return createNodeId("lib_bp");
|
|
@@ -27,7 +36,7 @@ export function buildBlueprintExportPayload(
|
|
|
27
36
|
return {
|
|
28
37
|
kind: BLUEPRINT_EXPORT_KIND,
|
|
29
38
|
version: BLUEPRINT_EXPORT_VERSION,
|
|
30
|
-
name: meta.name.trim() ||
|
|
39
|
+
name: meta.name.trim() || unnamedBlueprintName(),
|
|
31
40
|
remark: meta.remark.trim() || undefined,
|
|
32
41
|
exportedAt: Date.now(),
|
|
33
42
|
document: {
|
|
@@ -51,7 +60,7 @@ export function parseBlueprintImportFile(raw: unknown): BlueprintExportPayload {
|
|
|
51
60
|
return {
|
|
52
61
|
kind: BLUEPRINT_EXPORT_KIND,
|
|
53
62
|
version: BLUEPRINT_EXPORT_VERSION,
|
|
54
|
-
name: typeof data.name === "string" ? data.name :
|
|
63
|
+
name: typeof data.name === "string" ? data.name : importedBlueprintName(),
|
|
55
64
|
remark: typeof data.remark === "string" ? data.remark : undefined,
|
|
56
65
|
exportedAt: typeof data.exportedAt === "number" ? data.exportedAt : Date.now(),
|
|
57
66
|
document: data.document,
|
|
@@ -81,7 +90,7 @@ export function buildLibraryRecord(args: {
|
|
|
81
90
|
createdAt?: number;
|
|
82
91
|
}): BlueprintLibraryRecord {
|
|
83
92
|
const now = Date.now();
|
|
84
|
-
const name = args.meta.name.trim() ||
|
|
93
|
+
const name = args.meta.name.trim() || unnamedBlueprintName();
|
|
85
94
|
return {
|
|
86
95
|
id: args.id ?? createLibraryBlueprintId(),
|
|
87
96
|
name,
|
|
@@ -2,14 +2,20 @@ import {
|
|
|
2
2
|
parseSwaggerDocument,
|
|
3
3
|
type ParsedSwaggerDocument,
|
|
4
4
|
} from "@arronqzy/blueprint-dsl";
|
|
5
|
+
import { resolveLocale, tForLocale } from "@arronqzy/i18n";
|
|
6
|
+
|
|
7
|
+
function t() {
|
|
8
|
+
return tForLocale(resolveLocale());
|
|
9
|
+
}
|
|
5
10
|
|
|
6
11
|
export async function loadSwaggerDocument(
|
|
7
12
|
docsUrl: string,
|
|
8
13
|
signal?: AbortSignal
|
|
9
14
|
): Promise<ParsedSwaggerDocument> {
|
|
15
|
+
const translate = t();
|
|
10
16
|
const trimmed = docsUrl.trim();
|
|
11
17
|
if (!trimmed) {
|
|
12
|
-
throw new Error("
|
|
18
|
+
throw new Error(translate("blueprint.config.enterSwaggerUrl"));
|
|
13
19
|
}
|
|
14
20
|
|
|
15
21
|
if (signal?.aborted) {
|
|
@@ -28,7 +34,9 @@ export async function loadSwaggerDocument(
|
|
|
28
34
|
throw new DOMException("Aborted", "AbortError");
|
|
29
35
|
}
|
|
30
36
|
throw new Error(
|
|
31
|
-
error instanceof Error
|
|
37
|
+
error instanceof Error
|
|
38
|
+
? error.message
|
|
39
|
+
: translate("blueprint.config.cannotFetchSwagger")
|
|
32
40
|
);
|
|
33
41
|
}
|
|
34
42
|
|
|
@@ -37,19 +45,21 @@ export async function loadSwaggerDocument(
|
|
|
37
45
|
}
|
|
38
46
|
|
|
39
47
|
if (!response.ok) {
|
|
40
|
-
throw new Error(
|
|
48
|
+
throw new Error(
|
|
49
|
+
translate("blueprint.config.swaggerHttpFailed", { status: response.status })
|
|
50
|
+
);
|
|
41
51
|
}
|
|
42
52
|
|
|
43
53
|
const contentType = response.headers.get("content-type") ?? "";
|
|
44
54
|
if (contentType.includes("text/html")) {
|
|
45
|
-
throw new Error("
|
|
55
|
+
throw new Error(translate("blueprint.config.swaggerHtmlReturned"));
|
|
46
56
|
}
|
|
47
57
|
|
|
48
58
|
let spec: unknown;
|
|
49
59
|
try {
|
|
50
60
|
spec = await response.json();
|
|
51
61
|
} catch {
|
|
52
|
-
throw new Error("
|
|
62
|
+
throw new Error(translate("blueprint.config.swaggerInvalidJson"));
|
|
53
63
|
}
|
|
54
64
|
|
|
55
65
|
return parseSwaggerDocument(spec, trimmed);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { useI18n } from "@arronqzy/i18n/vue";
|
|
2
3
|
import { Handle, Position, type NodeProps } from "@vue-flow/core";
|
|
3
4
|
import { resolveBlueprintNodeTypeLabel } from "../graph/document";
|
|
4
5
|
import { resolveBlueprintNodeSummary } from "../graph/node-summary";
|
|
@@ -8,6 +9,8 @@ import type { BlueprintFlowNodeData } from "../types";
|
|
|
8
9
|
import BlueprintNodeCard from "./BlueprintNodeCard.vue";
|
|
9
10
|
import { cn } from "../utils/cn";
|
|
10
11
|
|
|
12
|
+
const { t } = useI18n();
|
|
13
|
+
|
|
11
14
|
const props = defineProps<NodeProps<BlueprintFlowNodeData>>();
|
|
12
15
|
const onSelect = useBlueprintNodeSelect();
|
|
13
16
|
const nodeData = props.data;
|
|
@@ -30,7 +33,7 @@ const executionTone = resolveBlueprintNodeExecutionTone(nodeData);
|
|
|
30
33
|
id="inA"
|
|
31
34
|
class="bp-flow-handle bp-flow-handle--target"
|
|
32
35
|
:style="{ top: '35%' }"
|
|
33
|
-
title="
|
|
36
|
+
:title="t('blueprint.node.andInA')"
|
|
34
37
|
/>
|
|
35
38
|
<Handle
|
|
36
39
|
type="target"
|
|
@@ -38,13 +41,13 @@ const executionTone = resolveBlueprintNodeExecutionTone(nodeData);
|
|
|
38
41
|
id="inB"
|
|
39
42
|
class="bp-flow-handle bp-flow-handle--target"
|
|
40
43
|
:style="{ top: '65%' }"
|
|
41
|
-
title="
|
|
44
|
+
:title="t('blueprint.node.andInB')"
|
|
42
45
|
/>
|
|
43
46
|
<BlueprintNodeCard
|
|
44
47
|
:node-id="props.id"
|
|
45
48
|
:label="nodeData.label"
|
|
46
|
-
:meta="resolveBlueprintNodeTypeLabel(nodeData)"
|
|
47
|
-
:subtitle="resolveBlueprintNodeSummary(nodeData)"
|
|
49
|
+
:meta="resolveBlueprintNodeTypeLabel(nodeData, t)"
|
|
50
|
+
:subtitle="resolveBlueprintNodeSummary(nodeData, t)"
|
|
48
51
|
variant="and"
|
|
49
52
|
:selected="Boolean(nodeData.isSelected)"
|
|
50
53
|
@select="onSelect"
|
|
@@ -54,7 +57,7 @@ const executionTone = resolveBlueprintNodeExecutionTone(nodeData);
|
|
|
54
57
|
:position="Position.Right"
|
|
55
58
|
id="out"
|
|
56
59
|
class="bp-flow-handle bp-flow-handle--source"
|
|
57
|
-
title="
|
|
60
|
+
:title="t('blueprint.node.andOut')"
|
|
58
61
|
/>
|
|
59
62
|
</div>
|
|
60
63
|
</template>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { useI18n } from "@arronqzy/i18n/vue";
|
|
2
3
|
import type { NodeProps } from "@vue-flow/core";
|
|
3
4
|
import { resolveBlueprintNodeTypeLabel } from "../graph/document";
|
|
4
5
|
import { resolveBlueprintNodeSummary } from "../graph/node-summary";
|
|
@@ -7,6 +8,8 @@ import { resolveBlueprintNodeExecutionTone } from "../runtime/execution-overlay"
|
|
|
7
8
|
import type { BlueprintFlowNodeData } from "../types";
|
|
8
9
|
import BlueprintNodeShell from "./BlueprintNodeShell.vue";
|
|
9
10
|
|
|
11
|
+
const { t } = useI18n();
|
|
12
|
+
|
|
10
13
|
const props = defineProps<NodeProps<BlueprintFlowNodeData>>();
|
|
11
14
|
const onSelect = useBlueprintNodeSelect();
|
|
12
15
|
const nodeData = props.data;
|
|
@@ -16,8 +19,8 @@ const nodeData = props.data;
|
|
|
16
19
|
<BlueprintNodeShell
|
|
17
20
|
:node-id="props.id"
|
|
18
21
|
:label="nodeData.label"
|
|
19
|
-
:meta="resolveBlueprintNodeTypeLabel(nodeData)"
|
|
20
|
-
:subtitle="resolveBlueprintNodeSummary(nodeData)"
|
|
22
|
+
:meta="resolveBlueprintNodeTypeLabel(nodeData, t)"
|
|
23
|
+
:subtitle="resolveBlueprintNodeSummary(nodeData, t)"
|
|
21
24
|
variant="blueprint"
|
|
22
25
|
:selected="Boolean(nodeData.isSelected)"
|
|
23
26
|
:execution-tone="resolveBlueprintNodeExecutionTone(nodeData)"
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { useI18n } from "@arronqzy/i18n/vue";
|
|
2
3
|
import { cn } from "../utils/cn";
|
|
3
4
|
|
|
5
|
+
const { t } = useI18n();
|
|
6
|
+
|
|
4
7
|
export type BlueprintNodeCardProps = {
|
|
5
8
|
nodeId: string;
|
|
6
9
|
label: string;
|
|
@@ -80,7 +83,7 @@ const v = variantStyle[props.variant];
|
|
|
80
83
|
>
|
|
81
84
|
<div
|
|
82
85
|
class="bp-flow-drag-handle flex cursor-grab items-center gap-2 border-b border-border/50 px-2 py-1.5 bg-muted/25 text-muted-foreground active:cursor-grabbing"
|
|
83
|
-
title="
|
|
86
|
+
:title="t('blueprint.node.dragToMove')"
|
|
84
87
|
>
|
|
85
88
|
<div class="flex shrink-0 flex-col gap-[3px] opacity-35" aria-hidden="true">
|
|
86
89
|
<span class="flex gap-[3px]">
|
|
@@ -137,7 +140,7 @@ const v = variantStyle[props.variant];
|
|
|
137
140
|
v.badge
|
|
138
141
|
)
|
|
139
142
|
"
|
|
140
|
-
title="
|
|
143
|
+
:title="t('blueprint.node.signalSentCount')"
|
|
141
144
|
>
|
|
142
145
|
{{ progressLabel }}
|
|
143
146
|
</span>
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { useI18n } from "@arronqzy/i18n/vue";
|
|
2
3
|
import { Handle, Position } from "@vue-flow/core";
|
|
3
4
|
import BlueprintNodeCard, { type BlueprintNodeCardProps } from "./BlueprintNodeCard.vue";
|
|
4
5
|
import type { BlueprintNodeExecutionTone } from "../runtime/execution-overlay";
|
|
5
6
|
import { cn } from "../utils/cn";
|
|
6
7
|
|
|
8
|
+
const { t } = useI18n();
|
|
9
|
+
|
|
7
10
|
export type BlueprintNodeShellProps = BlueprintNodeCardProps & {
|
|
8
11
|
selected?: boolean;
|
|
9
12
|
executionTone?: BlueprintNodeExecutionTone | null;
|
|
@@ -46,7 +49,7 @@ const emit = defineEmits<{
|
|
|
46
49
|
:position="Position.Left"
|
|
47
50
|
id="in"
|
|
48
51
|
class="bp-flow-handle bp-flow-handle--target"
|
|
49
|
-
title="
|
|
52
|
+
:title="t('blueprint.node.signalIn')"
|
|
50
53
|
/>
|
|
51
54
|
<BlueprintNodeCard
|
|
52
55
|
:node-id="nodeId"
|
|
@@ -64,7 +67,7 @@ const emit = defineEmits<{
|
|
|
64
67
|
:position="Position.Right"
|
|
65
68
|
id="out"
|
|
66
69
|
class="bp-flow-handle bp-flow-handle--source"
|
|
67
|
-
title="
|
|
70
|
+
:title="t('blueprint.node.signalOut')"
|
|
68
71
|
/>
|
|
69
72
|
</div>
|
|
70
73
|
</template>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { useI18n } from "@arronqzy/i18n/vue";
|
|
2
3
|
import type { NodeProps } from "@vue-flow/core";
|
|
3
4
|
import { computed } from "vue";
|
|
4
5
|
import { resolveBlueprintNodeTypeLabel } from "../graph/document";
|
|
@@ -13,6 +14,8 @@ import type { BlueprintFlowNodeData } from "../types";
|
|
|
13
14
|
import BlueprintNodeShell from "./BlueprintNodeShell.vue";
|
|
14
15
|
import { cn } from "../utils/cn";
|
|
15
16
|
|
|
17
|
+
const { t } = useI18n();
|
|
18
|
+
|
|
16
19
|
const props = defineProps<NodeProps<BlueprintFlowNodeData>>();
|
|
17
20
|
const onSelect = useBlueprintNodeSelect();
|
|
18
21
|
const onAbortClock = useBlueprintClockAbort();
|
|
@@ -30,8 +33,8 @@ const progressLabel = computed(() => {
|
|
|
30
33
|
<BlueprintNodeShell
|
|
31
34
|
:node-id="props.id"
|
|
32
35
|
:label="nodeData.label"
|
|
33
|
-
:meta="resolveBlueprintNodeTypeLabel(nodeData)"
|
|
34
|
-
:subtitle="resolveBlueprintNodeSummary(nodeData)"
|
|
36
|
+
:meta="resolveBlueprintNodeTypeLabel(nodeData, t)"
|
|
37
|
+
:subtitle="resolveBlueprintNodeSummary(nodeData, t)"
|
|
35
38
|
:progress-label="progressLabel"
|
|
36
39
|
variant="clock"
|
|
37
40
|
:selected="Boolean(nodeData.isSelected)"
|
|
@@ -48,7 +51,7 @@ const progressLabel = computed(() => {
|
|
|
48
51
|
'hover:bg-rose-500/25 dark:text-rose-300'
|
|
49
52
|
)
|
|
50
53
|
"
|
|
51
|
-
title="
|
|
54
|
+
:title="t('blueprint.node.abortClock')"
|
|
52
55
|
@pointerdown.stop
|
|
53
56
|
@click.stop="onAbortClock(props.id)"
|
|
54
57
|
>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { useI18n } from "@arronqzy/i18n/vue";
|
|
2
3
|
import type { NodeProps } from "@vue-flow/core";
|
|
3
4
|
import { resolveBlueprintNodeTypeLabel } from "../graph/document";
|
|
4
5
|
import { resolveBlueprintNodeSummary } from "../graph/node-summary";
|
|
@@ -7,6 +8,8 @@ import { resolveBlueprintNodeExecutionTone } from "../runtime/execution-overlay"
|
|
|
7
8
|
import type { BlueprintFlowNodeData } from "../types";
|
|
8
9
|
import BlueprintNodeShell from "./BlueprintNodeShell.vue";
|
|
9
10
|
|
|
11
|
+
const { t } = useI18n();
|
|
12
|
+
|
|
10
13
|
const props = defineProps<NodeProps<BlueprintFlowNodeData>>();
|
|
11
14
|
const onSelect = useBlueprintNodeSelect();
|
|
12
15
|
const nodeData = props.data;
|
|
@@ -16,8 +19,8 @@ const nodeData = props.data;
|
|
|
16
19
|
<BlueprintNodeShell
|
|
17
20
|
:node-id="props.id"
|
|
18
21
|
:label="nodeData.label"
|
|
19
|
-
:meta="resolveBlueprintNodeTypeLabel(nodeData)"
|
|
20
|
-
:subtitle="resolveBlueprintNodeSummary(nodeData)"
|
|
22
|
+
:meta="resolveBlueprintNodeTypeLabel(nodeData, t)"
|
|
23
|
+
:subtitle="resolveBlueprintNodeSummary(nodeData, t)"
|
|
21
24
|
variant="fetch"
|
|
22
25
|
:selected="Boolean(nodeData.isSelected)"
|
|
23
26
|
:execution-tone="resolveBlueprintNodeExecutionTone(nodeData)"
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { useI18n } from "@arronqzy/i18n/vue";
|
|
2
3
|
import type { NodeProps } from "@vue-flow/core";
|
|
3
4
|
import { resolveBlueprintNodeTypeLabel } from "../graph/document";
|
|
4
5
|
import { resolveBlueprintNodeSummary } from "../graph/node-summary";
|
|
@@ -7,6 +8,8 @@ import { resolveBlueprintNodeExecutionTone } from "../runtime/execution-overlay"
|
|
|
7
8
|
import type { BlueprintFlowNodeData } from "../types";
|
|
8
9
|
import BlueprintNodeShell from "./BlueprintNodeShell.vue";
|
|
9
10
|
|
|
11
|
+
const { t } = useI18n();
|
|
12
|
+
|
|
10
13
|
const props = defineProps<NodeProps<BlueprintFlowNodeData>>();
|
|
11
14
|
const onSelect = useBlueprintNodeSelect();
|
|
12
15
|
const nodeData = props.data;
|
|
@@ -16,8 +19,8 @@ const nodeData = props.data;
|
|
|
16
19
|
<BlueprintNodeShell
|
|
17
20
|
:node-id="props.id"
|
|
18
21
|
:label="nodeData.label"
|
|
19
|
-
:meta="resolveBlueprintNodeTypeLabel(nodeData)"
|
|
20
|
-
:subtitle="resolveBlueprintNodeSummary(nodeData)"
|
|
22
|
+
:meta="resolveBlueprintNodeTypeLabel(nodeData, t)"
|
|
23
|
+
:subtitle="resolveBlueprintNodeSummary(nodeData, t)"
|
|
21
24
|
variant="json"
|
|
22
25
|
:selected="Boolean(nodeData.isSelected)"
|
|
23
26
|
:execution-tone="resolveBlueprintNodeExecutionTone(nodeData)"
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { useI18n } from "@arronqzy/i18n/vue";
|
|
2
3
|
import { Handle, Position, type NodeProps } from "@vue-flow/core";
|
|
3
4
|
import { resolveBlueprintNodeTypeLabel } from "../graph/document";
|
|
4
5
|
import { resolveBlueprintNodeSummary } from "../graph/node-summary";
|
|
@@ -8,6 +9,8 @@ import type { BlueprintFlowNodeData } from "../types";
|
|
|
8
9
|
import BlueprintNodeCard from "./BlueprintNodeCard.vue";
|
|
9
10
|
import { cn } from "../utils/cn";
|
|
10
11
|
|
|
12
|
+
const { t } = useI18n();
|
|
13
|
+
|
|
11
14
|
const props = defineProps<NodeProps<BlueprintFlowNodeData>>();
|
|
12
15
|
const onSelect = useBlueprintNodeSelect();
|
|
13
16
|
const nodeData = props.data;
|
|
@@ -27,8 +30,8 @@ const executionTone = resolveBlueprintNodeExecutionTone(nodeData);
|
|
|
27
30
|
<BlueprintNodeCard
|
|
28
31
|
:node-id="props.id"
|
|
29
32
|
:label="nodeData.label"
|
|
30
|
-
:meta="resolveBlueprintNodeTypeLabel(nodeData)"
|
|
31
|
-
:subtitle="resolveBlueprintNodeSummary(nodeData)"
|
|
33
|
+
:meta="resolveBlueprintNodeTypeLabel(nodeData, t)"
|
|
34
|
+
:subtitle="resolveBlueprintNodeSummary(nodeData, t)"
|
|
32
35
|
variant="lifecycle"
|
|
33
36
|
:selected="Boolean(nodeData.isSelected)"
|
|
34
37
|
hide-leading-dot
|
|
@@ -39,7 +42,7 @@ const executionTone = resolveBlueprintNodeExecutionTone(nodeData);
|
|
|
39
42
|
:position="Position.Right"
|
|
40
43
|
id="out"
|
|
41
44
|
class="bp-flow-handle bp-flow-handle--source"
|
|
42
|
-
title="
|
|
45
|
+
:title="t('blueprint.node.lifecycleOut')"
|
|
43
46
|
/>
|
|
44
47
|
</div>
|
|
45
48
|
</template>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { useI18n } from "@arronqzy/i18n/vue";
|
|
2
3
|
import type { NodeProps } from "@vue-flow/core";
|
|
3
4
|
import { resolveBlueprintNodeTypeLabel } from "../graph/document";
|
|
4
5
|
import { resolveBlueprintNodeSummary } from "../graph/node-summary";
|
|
@@ -7,6 +8,8 @@ import { resolveBlueprintNodeExecutionTone } from "../runtime/execution-overlay"
|
|
|
7
8
|
import type { BlueprintFlowNodeData } from "../types";
|
|
8
9
|
import BlueprintNodeShell from "./BlueprintNodeShell.vue";
|
|
9
10
|
|
|
11
|
+
const { t } = useI18n();
|
|
12
|
+
|
|
10
13
|
const props = defineProps<NodeProps<BlueprintFlowNodeData>>();
|
|
11
14
|
const onSelect = useBlueprintNodeSelect();
|
|
12
15
|
const nodeData = props.data;
|
|
@@ -16,8 +19,8 @@ const nodeData = props.data;
|
|
|
16
19
|
<BlueprintNodeShell
|
|
17
20
|
:node-id="props.id"
|
|
18
21
|
:label="nodeData.label"
|
|
19
|
-
:meta="resolveBlueprintNodeTypeLabel(nodeData)"
|
|
20
|
-
:subtitle="resolveBlueprintNodeSummary(nodeData)"
|
|
22
|
+
:meta="resolveBlueprintNodeTypeLabel(nodeData, t)"
|
|
23
|
+
:subtitle="resolveBlueprintNodeSummary(nodeData, t)"
|
|
21
24
|
variant="logic"
|
|
22
25
|
:selected="Boolean(nodeData.isSelected)"
|
|
23
26
|
:execution-tone="resolveBlueprintNodeExecutionTone(nodeData)"
|