@vef-framework-react/integration 2.10.0
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/LICENSE +201 -0
- package/dist/cjs/_internal/_rolldown/runtime.cjs +1 -0
- package/dist/cjs/api/crud-api.cjs +1 -0
- package/dist/cjs/api/index.cjs +1 -0
- package/dist/cjs/api/log-api.cjs +1 -0
- package/dist/cjs/api/ops-api.cjs +1 -0
- package/dist/cjs/api/query.cjs +1 -0
- package/dist/cjs/api/stats-api.cjs +1 -0
- package/dist/cjs/components/auth-params/index.cjs +1 -0
- package/dist/cjs/components/directory/index.cjs +1 -0
- package/dist/cjs/components/form-section/index.cjs +1 -0
- package/dist/cjs/components/format.cjs +1 -0
- package/dist/cjs/components/index.cjs +1 -0
- package/dist/cjs/components/json-view/index.cjs +1 -0
- package/dist/cjs/components/params-editor/index.cjs +1 -0
- package/dist/cjs/components/script-doc/completions.cjs +1 -0
- package/dist/cjs/components/script-doc/index.cjs +1 -0
- package/dist/cjs/components/status/colors.cjs +1 -0
- package/dist/cjs/components/status/index.cjs +1 -0
- package/dist/cjs/components/status/labels.cjs +1 -0
- package/dist/cjs/components/test-connection/index.cjs +1 -0
- package/dist/cjs/components/wire-trace/index.cjs +1 -0
- package/dist/cjs/index.cjs +1 -0
- package/dist/cjs/pages/adapter-page/columns.cjs +2 -0
- package/dist/cjs/pages/adapter-page/form.cjs +1 -0
- package/dist/cjs/pages/adapter-page/helpers.cjs +4 -0
- package/dist/cjs/pages/adapter-page/index.cjs +1 -0
- package/dist/cjs/pages/adapter-page/search.cjs +1 -0
- package/dist/cjs/pages/console-page/diagnostics.cjs +1 -0
- package/dist/cjs/pages/console-page/dry-run.cjs +1 -0
- package/dist/cjs/pages/console-page/index.cjs +1 -0
- package/dist/cjs/pages/console-page/log.cjs +1 -0
- package/dist/cjs/pages/console-page/stats.cjs +1 -0
- package/dist/cjs/pages/contract-page/columns.cjs +1 -0
- package/dist/cjs/pages/contract-page/form.cjs +1 -0
- package/dist/cjs/pages/contract-page/helpers.cjs +1 -0
- package/dist/cjs/pages/contract-page/index.cjs +1 -0
- package/dist/cjs/pages/contract-page/json-schema-completions.cjs +1 -0
- package/dist/cjs/pages/contract-page/model.cjs +1 -0
- package/dist/cjs/pages/contract-page/search.cjs +1 -0
- package/dist/cjs/pages/index.cjs +1 -0
- package/dist/cjs/pages/route-page/columns.cjs +1 -0
- package/dist/cjs/pages/route-page/form.cjs +1 -0
- package/dist/cjs/pages/route-page/helpers.cjs +1 -0
- package/dist/cjs/pages/route-page/index.cjs +1 -0
- package/dist/cjs/pages/route-page/search.cjs +1 -0
- package/dist/cjs/pages/system-page/columns.cjs +1 -0
- package/dist/cjs/pages/system-page/form.cjs +1 -0
- package/dist/cjs/pages/system-page/helpers.cjs +1 -0
- package/dist/cjs/pages/system-page/index.cjs +1 -0
- package/dist/cjs/pages/system-page/model.cjs +1 -0
- package/dist/cjs/pages/system-page/search.cjs +1 -0
- package/dist/cjs/permissions.cjs +1 -0
- package/dist/cjs/types/enums.cjs +1 -0
- package/dist/cjs/types/index.cjs +1 -0
- package/dist/es/api/crud-api.js +35 -0
- package/dist/es/api/index.js +7 -0
- package/dist/es/api/log-api.js +14 -0
- package/dist/es/api/ops-api.js +16 -0
- package/dist/es/api/query.js +13 -0
- package/dist/es/api/stats-api.js +11 -0
- package/dist/es/components/auth-params/index.js +198 -0
- package/dist/es/components/directory/index.js +35 -0
- package/dist/es/components/form-section/index.js +44 -0
- package/dist/es/components/format.js +8 -0
- package/dist/es/components/index.js +15 -0
- package/dist/es/components/json-view/index.js +15 -0
- package/dist/es/components/params-editor/index.js +61 -0
- package/dist/es/components/script-doc/completions.js +507 -0
- package/dist/es/components/script-doc/index.js +108 -0
- package/dist/es/components/status/colors.js +25 -0
- package/dist/es/components/status/index.js +35 -0
- package/dist/es/components/status/labels.js +46 -0
- package/dist/es/components/test-connection/index.js +156 -0
- package/dist/es/components/wire-trace/index.js +119 -0
- package/dist/es/index.js +27 -0
- package/dist/es/pages/adapter-page/columns.js +61 -0
- package/dist/es/pages/adapter-page/form.js +110 -0
- package/dist/es/pages/adapter-page/helpers.js +23 -0
- package/dist/es/pages/adapter-page/index.js +120 -0
- package/dist/es/pages/adapter-page/search.js +43 -0
- package/dist/es/pages/console-page/diagnostics.js +122 -0
- package/dist/es/pages/console-page/dry-run.js +327 -0
- package/dist/es/pages/console-page/index.js +64 -0
- package/dist/es/pages/console-page/log.js +219 -0
- package/dist/es/pages/console-page/stats.js +157 -0
- package/dist/es/pages/contract-page/columns.js +100 -0
- package/dist/es/pages/contract-page/form.js +123 -0
- package/dist/es/pages/contract-page/helpers.js +17 -0
- package/dist/es/pages/contract-page/index.js +116 -0
- package/dist/es/pages/contract-page/json-schema-completions.js +70 -0
- package/dist/es/pages/contract-page/model.js +47 -0
- package/dist/es/pages/contract-page/search.js +24 -0
- package/dist/es/pages/index.js +7 -0
- package/dist/es/pages/route-page/columns.js +47 -0
- package/dist/es/pages/route-page/form.js +68 -0
- package/dist/es/pages/route-page/helpers.js +20 -0
- package/dist/es/pages/route-page/index.js +119 -0
- package/dist/es/pages/route-page/search.js +27 -0
- package/dist/es/pages/system-page/columns.js +101 -0
- package/dist/es/pages/system-page/form.js +471 -0
- package/dist/es/pages/system-page/helpers.js +17 -0
- package/dist/es/pages/system-page/index.js +132 -0
- package/dist/es/pages/system-page/model.js +217 -0
- package/dist/es/pages/system-page/search.js +24 -0
- package/dist/es/permissions.js +37 -0
- package/dist/es/types/enums.js +39 -0
- package/dist/es/types/index.js +3 -0
- package/dist/types/api/crud-api.d.ts +42 -0
- package/dist/types/api/index.d.ts +5 -0
- package/dist/types/api/log-api.d.ts +10 -0
- package/dist/types/api/ops-api.d.ts +17 -0
- package/dist/types/api/query.d.ts +16 -0
- package/dist/types/api/stats-api.d.ts +12 -0
- package/dist/types/components/auth-params/index.d.ts +87 -0
- package/dist/types/components/directory/index.d.ts +30 -0
- package/dist/types/components/form-section/index.d.ts +22 -0
- package/dist/types/components/format.d.ts +4 -0
- package/dist/types/components/index.d.ts +13 -0
- package/dist/types/components/json-view/index.d.ts +9 -0
- package/dist/types/components/params-editor/index.d.ts +21 -0
- package/dist/types/components/script-doc/completions.d.ts +45 -0
- package/dist/types/components/script-doc/index.d.ts +19 -0
- package/dist/types/components/status/colors.d.ts +13 -0
- package/dist/types/components/status/index.d.ts +25 -0
- package/dist/types/components/status/labels.d.ts +17 -0
- package/dist/types/components/test-connection/index.d.ts +12 -0
- package/dist/types/components/wire-trace/index.d.ts +9 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/pages/adapter-page/columns.d.ts +7 -0
- package/dist/types/pages/adapter-page/form.d.ts +8 -0
- package/dist/types/pages/adapter-page/index.d.ts +5 -0
- package/dist/types/pages/adapter-page/props.d.ts +16 -0
- package/dist/types/pages/adapter-page/search.d.ts +4 -0
- package/dist/types/pages/console-page/diagnostics.d.ts +7 -0
- package/dist/types/pages/console-page/dry-run.d.ts +10 -0
- package/dist/types/pages/console-page/index.d.ts +21 -0
- package/dist/types/pages/console-page/log.d.ts +4 -0
- package/dist/types/pages/console-page/stats.d.ts +4 -0
- package/dist/types/pages/contract-page/columns.d.ts +3 -0
- package/dist/types/pages/contract-page/form.d.ts +8 -0
- package/dist/types/pages/contract-page/index.d.ts +5 -0
- package/dist/types/pages/contract-page/json-schema-completions.d.ts +6 -0
- package/dist/types/pages/contract-page/model.d.ts +28 -0
- package/dist/types/pages/contract-page/props.d.ts +16 -0
- package/dist/types/pages/contract-page/search.d.ts +4 -0
- package/dist/types/pages/index.d.ts +9 -0
- package/dist/types/pages/route-page/columns.d.ts +4 -0
- package/dist/types/pages/route-page/form.d.ts +4 -0
- package/dist/types/pages/route-page/index.d.ts +5 -0
- package/dist/types/pages/route-page/props.d.ts +16 -0
- package/dist/types/pages/route-page/search.d.ts +4 -0
- package/dist/types/pages/system-page/columns.d.ts +3 -0
- package/dist/types/pages/system-page/form.d.ts +9 -0
- package/dist/types/pages/system-page/index.d.ts +2 -0
- package/dist/types/pages/system-page/model.d.ts +87 -0
- package/dist/types/pages/system-page/props.d.ts +20 -0
- package/dist/types/pages/system-page/search.d.ts +4 -0
- package/dist/types/permissions.d.ts +49 -0
- package/dist/types/types/adapter.d.ts +36 -0
- package/dist/types/types/base.d.ts +14 -0
- package/dist/types/types/contract.d.ts +47 -0
- package/dist/types/types/diagnostics.d.ts +22 -0
- package/dist/types/types/enums.d.ts +43 -0
- package/dist/types/types/index.d.ts +11 -0
- package/dist/types/types/json.d.ts +10 -0
- package/dist/types/types/log.d.ts +46 -0
- package/dist/types/types/ops.d.ts +90 -0
- package/dist/types/types/route.d.ts +32 -0
- package/dist/types/types/stats.d.ts +23 -0
- package/dist/types/types/system.d.ts +117 -0
- package/package.json +66 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*! @vef-framework-react/integration v2.10.0 made by Venus | 2026-07-17T09:23:01.481Z */
|
|
2
|
+
import { DIRECTIONS as e } from "../../types/enums.js";
|
|
3
|
+
//#region src/components/status/labels.ts
|
|
4
|
+
var t = {
|
|
5
|
+
outbound: "出站",
|
|
6
|
+
inbound: "入站"
|
|
7
|
+
}, n = e.map((e) => ({
|
|
8
|
+
label: t[e],
|
|
9
|
+
value: e
|
|
10
|
+
})), r = {
|
|
11
|
+
input_invalid: "入参校验失败",
|
|
12
|
+
output_invalid: "出参校验失败",
|
|
13
|
+
upstream: "上游报错",
|
|
14
|
+
transport: "传输失败",
|
|
15
|
+
timeout: "超时",
|
|
16
|
+
canceled: "已取消",
|
|
17
|
+
script: "脚本错误",
|
|
18
|
+
config: "配置错误",
|
|
19
|
+
auth: "认证失败",
|
|
20
|
+
handler: "业务处理失败"
|
|
21
|
+
}, i = {
|
|
22
|
+
dangling_adapter: "悬空适配器",
|
|
23
|
+
wildcard_gap: "通配缺口",
|
|
24
|
+
disabled_system: "目标系统已停用",
|
|
25
|
+
disabled_contract: "目标契约已停用",
|
|
26
|
+
uncovered_contract: "契约未覆盖"
|
|
27
|
+
}, a = {
|
|
28
|
+
none: "无",
|
|
29
|
+
http_basic: "HTTP Basic",
|
|
30
|
+
bearer: "Bearer",
|
|
31
|
+
header: "自定义 Header",
|
|
32
|
+
query: "查询参数",
|
|
33
|
+
signature: "签名",
|
|
34
|
+
script: "脚本自定义"
|
|
35
|
+
}, o = {
|
|
36
|
+
none: "无(公开)",
|
|
37
|
+
ip: "IP 白名单",
|
|
38
|
+
http_basic: "HTTP Basic",
|
|
39
|
+
bearer: "Bearer",
|
|
40
|
+
header: "自定义 Header",
|
|
41
|
+
query: "查询参数",
|
|
42
|
+
signature: "签名",
|
|
43
|
+
script: "脚本自定义"
|
|
44
|
+
};
|
|
45
|
+
//#endregion
|
|
46
|
+
export { t as DIRECTION_LABELS, n as DIRECTION_OPTIONS, r as FAILURE_KIND_LABELS, o as INBOUND_AUTH_SCHEME_LABELS, a as OUTBOUND_AUTH_SCHEME_LABELS, i as ROUTE_FINDING_KIND_LABELS };
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/*! @vef-framework-react/integration v2.10.0 made by Venus | 2026-07-17T09:23:01.481Z */
|
|
2
|
+
import { useOpsApi as e } from "../../api/ops-api.js";
|
|
3
|
+
import { useMutation as t } from "@vef-framework-react/core";
|
|
4
|
+
import { useEffect as n, useState as r } from "react";
|
|
5
|
+
import { Button as i, Descriptions as a, Drawer as o, Empty as s, Flex as c, Icon as l, Input as u, Labeled as d, Stack as f, Tag as p, Text as m } from "@vef-framework-react/components";
|
|
6
|
+
import { jsx as h, jsxs as g } from "@emotion/react/jsx-runtime";
|
|
7
|
+
import { ActivityIcon as _ } from "lucide-react";
|
|
8
|
+
//#region src/components/test-connection/index.tsx
|
|
9
|
+
function v(e) {
|
|
10
|
+
return /* @__PURE__ */ h(p, {
|
|
11
|
+
color: e ? "success" : "error",
|
|
12
|
+
children: e ? "可达" : "不可达"
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
function y(e) {
|
|
16
|
+
let t = [{
|
|
17
|
+
key: "reachable",
|
|
18
|
+
label: "状态",
|
|
19
|
+
children: v(e.reachable)
|
|
20
|
+
}, {
|
|
21
|
+
key: "duration",
|
|
22
|
+
label: "耗时",
|
|
23
|
+
children: `${e.durationMs} ms`
|
|
24
|
+
}];
|
|
25
|
+
return e.status && t.push({
|
|
26
|
+
key: "status",
|
|
27
|
+
label: "HTTP 状态",
|
|
28
|
+
children: `${e.status} ${e.statusText ?? ""}`
|
|
29
|
+
}), e.error && t.push({
|
|
30
|
+
key: "error",
|
|
31
|
+
label: "错误",
|
|
32
|
+
children: /* @__PURE__ */ h(m, {
|
|
33
|
+
type: "danger",
|
|
34
|
+
children: e.error
|
|
35
|
+
})
|
|
36
|
+
}), t;
|
|
37
|
+
}
|
|
38
|
+
function b(e) {
|
|
39
|
+
let t = [{
|
|
40
|
+
key: "reachable",
|
|
41
|
+
label: "状态",
|
|
42
|
+
children: v(e.reachable)
|
|
43
|
+
}, {
|
|
44
|
+
key: "duration",
|
|
45
|
+
label: "耗时",
|
|
46
|
+
children: `${e.durationMs} ms`
|
|
47
|
+
}];
|
|
48
|
+
return e.version && t.push({
|
|
49
|
+
key: "version",
|
|
50
|
+
label: "版本",
|
|
51
|
+
children: e.version
|
|
52
|
+
}), e.error && t.push({
|
|
53
|
+
key: "error",
|
|
54
|
+
label: "错误",
|
|
55
|
+
children: /* @__PURE__ */ h(m, {
|
|
56
|
+
type: "danger",
|
|
57
|
+
children: e.error
|
|
58
|
+
})
|
|
59
|
+
}), t;
|
|
60
|
+
}
|
|
61
|
+
function x({ check: e }) {
|
|
62
|
+
return !e.http && !e.database ? /* @__PURE__ */ h(s, { description: "该系统未配置可探测的连接" }) : /* @__PURE__ */ g(f, {
|
|
63
|
+
gap: "middle",
|
|
64
|
+
children: [e.http ? /* @__PURE__ */ h(d, {
|
|
65
|
+
label: "HTTP 探测",
|
|
66
|
+
children: /* @__PURE__ */ h(a, {
|
|
67
|
+
bordered: !0,
|
|
68
|
+
column: 1,
|
|
69
|
+
items: y(e.http),
|
|
70
|
+
size: "small",
|
|
71
|
+
styles: { label: { width: 90 } }
|
|
72
|
+
})
|
|
73
|
+
}) : null, e.database ? /* @__PURE__ */ h(d, {
|
|
74
|
+
label: "数据库探测",
|
|
75
|
+
children: /* @__PURE__ */ h(a, {
|
|
76
|
+
bordered: !0,
|
|
77
|
+
column: 1,
|
|
78
|
+
items: b(e.database),
|
|
79
|
+
size: "small",
|
|
80
|
+
styles: { label: { width: 90 } }
|
|
81
|
+
})
|
|
82
|
+
}) : null]
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
function S({ open: a, system: p, onClose: v }) {
|
|
86
|
+
let { testConnection: y } = e(), { mutate: b, data: S, isPending: C, reset: w } = t({ mutationFn: y }), [T, E] = r("GET"), [D, O] = r("/"), k = p?.code ?? "", A = !!p?.baseUrl, j = !!p?.dataSource;
|
|
87
|
+
n(() => {
|
|
88
|
+
w(), E("GET"), O("/");
|
|
89
|
+
}, [k, w]);
|
|
90
|
+
let M = /* @__PURE__ */ h(i, {
|
|
91
|
+
disabled: !A && !j,
|
|
92
|
+
icon: /* @__PURE__ */ h(l, { component: _ }),
|
|
93
|
+
loading: C,
|
|
94
|
+
type: "primary",
|
|
95
|
+
onClick: () => b({
|
|
96
|
+
systemCode: k,
|
|
97
|
+
method: T,
|
|
98
|
+
path: D
|
|
99
|
+
}),
|
|
100
|
+
children: "开始探测"
|
|
101
|
+
});
|
|
102
|
+
return /* @__PURE__ */ h(o, {
|
|
103
|
+
open: a,
|
|
104
|
+
size: 640,
|
|
105
|
+
title: `测试连接 · ${k}`,
|
|
106
|
+
onClose: v,
|
|
107
|
+
children: /* @__PURE__ */ g(f, {
|
|
108
|
+
gap: "middle",
|
|
109
|
+
children: [A ? /* @__PURE__ */ g(c, {
|
|
110
|
+
align: "flex-end",
|
|
111
|
+
gap: "small",
|
|
112
|
+
children: [
|
|
113
|
+
/* @__PURE__ */ h(d, {
|
|
114
|
+
label: "探测方法",
|
|
115
|
+
children: /* @__PURE__ */ h(u, {
|
|
116
|
+
"aria-label": "探测方法",
|
|
117
|
+
placeholder: "GET",
|
|
118
|
+
style: { width: 100 },
|
|
119
|
+
value: T,
|
|
120
|
+
onChange: (e) => E(e.target.value)
|
|
121
|
+
})
|
|
122
|
+
}),
|
|
123
|
+
/* @__PURE__ */ h("div", {
|
|
124
|
+
style: {
|
|
125
|
+
flex: 1,
|
|
126
|
+
minWidth: 0
|
|
127
|
+
},
|
|
128
|
+
children: /* @__PURE__ */ h(d, {
|
|
129
|
+
label: "探测路径",
|
|
130
|
+
children: /* @__PURE__ */ h(u, {
|
|
131
|
+
"aria-label": "探测路径",
|
|
132
|
+
placeholder: "如 /health",
|
|
133
|
+
value: D,
|
|
134
|
+
onChange: (e) => O(e.target.value)
|
|
135
|
+
})
|
|
136
|
+
})
|
|
137
|
+
}),
|
|
138
|
+
M
|
|
139
|
+
]
|
|
140
|
+
}) : /* @__PURE__ */ g(c, {
|
|
141
|
+
align: "center",
|
|
142
|
+
gap: "small",
|
|
143
|
+
justify: "space-between",
|
|
144
|
+
children: [/* @__PURE__ */ h(m, {
|
|
145
|
+
type: "secondary",
|
|
146
|
+
children: j ? "该系统仅配置了直连数据源,将探测数据库连通性。" : "该系统未配置可探测的连接。"
|
|
147
|
+
}), M]
|
|
148
|
+
}), S ? /* @__PURE__ */ h(x, { check: S }) : /* @__PURE__ */ h(s, {
|
|
149
|
+
description: "开始探测后在此查看结果",
|
|
150
|
+
style: { padding: "32px 0" }
|
|
151
|
+
})]
|
|
152
|
+
})
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
//#endregion
|
|
156
|
+
export { S as TestConnectionDrawer };
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/*! @vef-framework-react/integration v2.10.0 made by Venus | 2026-07-17T09:23:01.481Z */
|
|
2
|
+
import { useMemo as e } from "react";
|
|
3
|
+
import { CodeEditor as t, Empty as n, Flex as r, Stack as i, Tag as a, Text as o, Timeline as s, globalCssVars as c } from "@vef-framework-react/components";
|
|
4
|
+
import { jsx as l, jsxs as u } from "@emotion/react/jsx-runtime";
|
|
5
|
+
import { css as d } from "@emotion/react";
|
|
6
|
+
//#region src/components/wire-trace/index.tsx
|
|
7
|
+
var f = /*#__PURE__*/ d({
|
|
8
|
+
margin: 0,
|
|
9
|
+
padding: c.spacingXs,
|
|
10
|
+
fontFamily: c.fontFamilyCode,
|
|
11
|
+
fontSize: c.fontSizeSm,
|
|
12
|
+
whiteSpace: "pre-wrap",
|
|
13
|
+
wordBreak: "break-all",
|
|
14
|
+
backgroundColor: c.colorFillQuaternary,
|
|
15
|
+
border: `1px solid ${c.colorBorderSecondary}`,
|
|
16
|
+
borderRadius: c.borderRadiusSm,
|
|
17
|
+
maxHeight: 240,
|
|
18
|
+
overflow: "auto"
|
|
19
|
+
}, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFRdUIiLCJmaWxlIjoiaW5kZXgudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHR5cGUgeyBUaW1lbGluZUl0ZW0gfSBmcm9tIFwiQHZlZi1mcmFtZXdvcmstcmVhY3QvY29tcG9uZW50c1wiO1xuXG5pbXBvcnQgdHlwZSB7IEh0dHBFeGNoYW5nZSB9IGZyb20gXCIuLi8uLi90eXBlc1wiO1xuXG5pbXBvcnQgeyBjc3MgfSBmcm9tIFwiQGVtb3Rpb24vcmVhY3RcIjtcbmltcG9ydCB7IENvZGVFZGl0b3IsIEVtcHR5LCBGbGV4LCBnbG9iYWxDc3NWYXJzLCBTdGFjaywgVGFnLCBUZXh0LCBUaW1lbGluZSB9IGZyb20gXCJAdmVmLWZyYW1ld29yay1yZWFjdC9jb21wb25lbnRzXCI7XG5pbXBvcnQgeyB1c2VNZW1vIH0gZnJvbSBcInJlYWN0XC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bmd0aCA9PT0gMCkge1xuICAgIHJldHVybiA8RW1wdHkgZGVzY3JpcHRpb249XCLohJrmnKzmnKrlj5HotbcgSFRUUCDosIPnlKhcIiAvPjtcbiAgfVxuXG4gIGNvbnN0IGl0ZW1zOiBUaW1lbGluZUl0ZW1bXSA9IGV4Y2hhbmdlcy5tYXAoKGV4Y2hhbmdlLCBpbmRleCkgPT4ge1xuICAgIHJldHVybiB7XG4gICAgICBrZXk6IFN0cmluZyhpbmRleCksXG4gICAgICBjb2xvcjogaXNFeGNoYW5nZUZhaWxlZChleGNoYW5nZSkgPyBcInJlZFwiIDogXCJncmVlblwiLFxuICAgICAgdGl0bGU6IDxFeGNoYW5nZVN1bW1hcnkgZXhjaGFuZ2U9e2V4Y2hhbmdlfSAvPixcbiAgICAgIGNvbnRlbnQ6IDxFeGNoYW5nZURldGFpbCBleGNoYW5nZT17ZXhjaGFuZ2V9IC8+XG4gICAgfTtcbiAgfSk7XG5cbiAgcmV0dXJuIDxUaW1lbGluZSBpdGVtcz17aXRlbXN9IG1vZGU9XCJsZWZ0XCIgLz47XG59XG4iXX0= */");
|
|
20
|
+
function p(e) {
|
|
21
|
+
try {
|
|
22
|
+
return {
|
|
23
|
+
language: "json",
|
|
24
|
+
content: JSON.stringify(JSON.parse(e), null, 2)
|
|
25
|
+
};
|
|
26
|
+
} catch {}
|
|
27
|
+
return e.trimStart().startsWith("<") ? {
|
|
28
|
+
language: "xml",
|
|
29
|
+
content: e
|
|
30
|
+
} : {
|
|
31
|
+
language: null,
|
|
32
|
+
content: e
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function m({ body: n, label: r }) {
|
|
36
|
+
let a = e(() => p(n), [n]);
|
|
37
|
+
return /* @__PURE__ */ u(i, {
|
|
38
|
+
gap: 2,
|
|
39
|
+
children: [/* @__PURE__ */ l(o, {
|
|
40
|
+
style: { fontSize: c.fontSizeSm },
|
|
41
|
+
type: "secondary",
|
|
42
|
+
children: r
|
|
43
|
+
}), a.language ? /* @__PURE__ */ l(t, {
|
|
44
|
+
readOnly: !0,
|
|
45
|
+
language: a.language,
|
|
46
|
+
maxHeight: 240,
|
|
47
|
+
size: "small",
|
|
48
|
+
value: a.content
|
|
49
|
+
}) : /* @__PURE__ */ l("pre", {
|
|
50
|
+
css: f,
|
|
51
|
+
children: a.content
|
|
52
|
+
})]
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function h(e) {
|
|
56
|
+
return !!e.error || e.status !== void 0 && e.status >= 400;
|
|
57
|
+
}
|
|
58
|
+
function g({ exchange: e }) {
|
|
59
|
+
return /* @__PURE__ */ u(r, {
|
|
60
|
+
align: "center",
|
|
61
|
+
gap: "small",
|
|
62
|
+
wrap: "wrap",
|
|
63
|
+
children: [
|
|
64
|
+
/* @__PURE__ */ l(a, { children: e.method }),
|
|
65
|
+
/* @__PURE__ */ l(o, {
|
|
66
|
+
code: !0,
|
|
67
|
+
style: { fontSize: c.fontSizeSm },
|
|
68
|
+
children: e.url
|
|
69
|
+
}),
|
|
70
|
+
e.status ? /* @__PURE__ */ l(a, {
|
|
71
|
+
color: h(e) ? "error" : "success",
|
|
72
|
+
children: e.status
|
|
73
|
+
}) : null,
|
|
74
|
+
/* @__PURE__ */ u(o, {
|
|
75
|
+
style: { fontSize: c.fontSizeSm },
|
|
76
|
+
type: "secondary",
|
|
77
|
+
children: [
|
|
78
|
+
e.durationMs,
|
|
79
|
+
" ",
|
|
80
|
+
"ms"
|
|
81
|
+
]
|
|
82
|
+
})
|
|
83
|
+
]
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
function _({ exchange: e }) {
|
|
87
|
+
return /* @__PURE__ */ u(i, {
|
|
88
|
+
gap: 4,
|
|
89
|
+
children: [
|
|
90
|
+
e.error ? /* @__PURE__ */ l(o, {
|
|
91
|
+
style: { fontSize: c.fontSizeSm },
|
|
92
|
+
type: "danger",
|
|
93
|
+
children: e.error
|
|
94
|
+
}) : null,
|
|
95
|
+
e.requestBody ? /* @__PURE__ */ l(m, {
|
|
96
|
+
body: e.requestBody,
|
|
97
|
+
label: "请求体"
|
|
98
|
+
}) : null,
|
|
99
|
+
e.responseBody ? /* @__PURE__ */ l(m, {
|
|
100
|
+
body: e.responseBody,
|
|
101
|
+
label: "响应体"
|
|
102
|
+
}) : null
|
|
103
|
+
]
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
function v({ trace: e }) {
|
|
107
|
+
let t = e ?? [];
|
|
108
|
+
return t.length === 0 ? /* @__PURE__ */ l(n, { description: "脚本未发起 HTTP 调用" }) : /* @__PURE__ */ l(s, {
|
|
109
|
+
items: t.map((e, t) => ({
|
|
110
|
+
key: String(t),
|
|
111
|
+
color: h(e) ? "red" : "green",
|
|
112
|
+
title: /* @__PURE__ */ l(g, { exchange: e }),
|
|
113
|
+
content: /* @__PURE__ */ l(_, { exchange: e })
|
|
114
|
+
})),
|
|
115
|
+
mode: "left"
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
//#endregion
|
|
119
|
+
export { v as WireTraceTimeline };
|
package/dist/es/index.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*! @vef-framework-react/integration v2.10.0 made by Venus | 2026-07-17T09:23:01.481Z */
|
|
2
|
+
import { API_PATH as e, splitQueryParams as t } from "./api/query.js";
|
|
3
|
+
import { createCrudApi as n, useAdapterApi as r, useContractApi as i, useRouteApi as a, useSystemApi as o } from "./api/crud-api.js";
|
|
4
|
+
import { useLogApi as s } from "./api/log-api.js";
|
|
5
|
+
import { useOpsApi as c } from "./api/ops-api.js";
|
|
6
|
+
import { useStatsApi as l } from "./api/stats-api.js";
|
|
7
|
+
import { ParamsEditor as u } from "./components/params-editor/index.js";
|
|
8
|
+
import { AuthParamsFields as d, pruneAuthParams as f, resolveAuthParamsSpec as p } from "./components/auth-params/index.js";
|
|
9
|
+
import { useContractDirectory as m, useSystemDirectory as h } from "./components/directory/index.js";
|
|
10
|
+
import { FormSection as g } from "./components/form-section/index.js";
|
|
11
|
+
import { formatTimestamp as _ } from "./components/format.js";
|
|
12
|
+
import { JsonView as v } from "./components/json-view/index.js";
|
|
13
|
+
import { ScriptDocLabel as y } from "./components/script-doc/index.js";
|
|
14
|
+
import { ENVELOPE_REQUEST_SCRIPT_DOC as b, ENVELOPE_RESPONSE_SCRIPT_DOC as x, INBOUND_AUTH_SCRIPT_DOC as S, OUTBOUND_AUTH_SCRIPT_DOC as C, adapterScriptDoc as w } from "./components/script-doc/completions.js";
|
|
15
|
+
import { DIRECTION_COLORS as T, FAILURE_KIND_COLORS as E, ROUTE_FINDING_SEVERITY as D } from "./components/status/colors.js";
|
|
16
|
+
import { DATA_SOURCE_MODES as O, DIRECTIONS as k, FAILURE_KINDS as A, INBOUND_AUTH_SCHEMES as j, MASKED_SECRET as M, OUTBOUND_AUTH_SCHEMES as N, ROUTE_FINDING_KINDS as P } from "./types/enums.js";
|
|
17
|
+
import { DIRECTION_LABELS as F, DIRECTION_OPTIONS as I, FAILURE_KIND_LABELS as L, INBOUND_AUTH_SCHEME_LABELS as R, OUTBOUND_AUTH_SCHEME_LABELS as z, ROUTE_FINDING_KIND_LABELS as B } from "./components/status/labels.js";
|
|
18
|
+
import { DirectionTag as V, EnabledTag as H, FailureKindTag as U, FindingKindTag as W } from "./components/status/index.js";
|
|
19
|
+
import { TestConnectionDrawer as G } from "./components/test-connection/index.js";
|
|
20
|
+
import { WireTraceTimeline as K } from "./components/wire-trace/index.js";
|
|
21
|
+
import { INTEGRATION_PERMISSIONS as q } from "./permissions.js";
|
|
22
|
+
import { IntegrationAdapterPage as J } from "./pages/adapter-page/index.js";
|
|
23
|
+
import { IntegrationConsolePage as Y } from "./pages/console-page/index.js";
|
|
24
|
+
import { IntegrationContractPage as X } from "./pages/contract-page/index.js";
|
|
25
|
+
import { IntegrationRoutePage as Z } from "./pages/route-page/index.js";
|
|
26
|
+
import { IntegrationSystemPage as Q } from "./pages/system-page/index.js";
|
|
27
|
+
export { e as API_PATH, d as AuthParamsFields, O as DATA_SOURCE_MODES, k as DIRECTIONS, T as DIRECTION_COLORS, F as DIRECTION_LABELS, I as DIRECTION_OPTIONS, V as DirectionTag, b as ENVELOPE_REQUEST_SCRIPT_DOC, x as ENVELOPE_RESPONSE_SCRIPT_DOC, H as EnabledTag, A as FAILURE_KINDS, E as FAILURE_KIND_COLORS, L as FAILURE_KIND_LABELS, U as FailureKindTag, W as FindingKindTag, g as FormSection, j as INBOUND_AUTH_SCHEMES, R as INBOUND_AUTH_SCHEME_LABELS, S as INBOUND_AUTH_SCRIPT_DOC, q as INTEGRATION_PERMISSIONS, J as IntegrationAdapterPage, Y as IntegrationConsolePage, X as IntegrationContractPage, Z as IntegrationRoutePage, Q as IntegrationSystemPage, v as JsonView, M as MASKED_SECRET, N as OUTBOUND_AUTH_SCHEMES, z as OUTBOUND_AUTH_SCHEME_LABELS, C as OUTBOUND_AUTH_SCRIPT_DOC, u as ParamsEditor, P as ROUTE_FINDING_KINDS, B as ROUTE_FINDING_KIND_LABELS, D as ROUTE_FINDING_SEVERITY, y as ScriptDocLabel, G as TestConnectionDrawer, K as WireTraceTimeline, w as adapterScriptDoc, n as createCrudApi, _ as formatTimestamp, f as pruneAuthParams, p as resolveAuthParamsSpec, t as splitQueryParams, r as useAdapterApi, i as useContractApi, m as useContractDirectory, s as useLogApi, c as useOpsApi, a as useRouteApi, l as useStatsApi, o as useSystemApi, h as useSystemDirectory };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/*! @vef-framework-react/integration v2.10.0 made by Venus | 2026-07-17T09:23:01.481Z */
|
|
2
|
+
import { DirectionTag as e, EnabledTag as t } from "../../components/status/index.js";
|
|
3
|
+
import { Text as n, globalCssVars as r } from "@vef-framework-react/components";
|
|
4
|
+
import { jsx as i } from "@emotion/react/jsx-runtime";
|
|
5
|
+
//#region src/pages/adapter-page/columns.tsx
|
|
6
|
+
function a(e) {
|
|
7
|
+
let t = e.split("\n").find((e) => e.trim()) ?? "";
|
|
8
|
+
return /* @__PURE__ */ i(n, {
|
|
9
|
+
code: !0,
|
|
10
|
+
ellipsis: { tooltip: e },
|
|
11
|
+
style: {
|
|
12
|
+
maxWidth: 280,
|
|
13
|
+
fontSize: r.fontSizeSm
|
|
14
|
+
},
|
|
15
|
+
children: t || "(空)"
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
function o(r, o) {
|
|
19
|
+
return [
|
|
20
|
+
{
|
|
21
|
+
title: "系统",
|
|
22
|
+
dataIndex: "systemId",
|
|
23
|
+
width: 160,
|
|
24
|
+
render: (e) => /* @__PURE__ */ i(n, { children: r.byId.get(e)?.name ?? e })
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
title: "契约",
|
|
28
|
+
dataIndex: "contractId",
|
|
29
|
+
width: 160,
|
|
30
|
+
render: (e) => /* @__PURE__ */ i(n, { children: o.byId.get(e)?.name ?? e })
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
title: "方向",
|
|
34
|
+
dataIndex: "direction",
|
|
35
|
+
width: 90,
|
|
36
|
+
align: "center",
|
|
37
|
+
render: (t) => /* @__PURE__ */ i(e, { direction: t })
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
title: "脚本",
|
|
41
|
+
dataIndex: "script",
|
|
42
|
+
render: a
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
title: "超时",
|
|
46
|
+
dataIndex: "timeoutMs",
|
|
47
|
+
width: 100,
|
|
48
|
+
align: "center",
|
|
49
|
+
render: (e) => e ? `${e} ms` : "继承"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
title: "状态",
|
|
53
|
+
dataIndex: "isEnabled",
|
|
54
|
+
width: 90,
|
|
55
|
+
align: "center",
|
|
56
|
+
render: (e) => /* @__PURE__ */ i(t, { enabled: e })
|
|
57
|
+
}
|
|
58
|
+
];
|
|
59
|
+
}
|
|
60
|
+
//#endregion
|
|
61
|
+
export { o as buildAdapterColumns };
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/*! @vef-framework-react/integration v2.10.0 made by Venus | 2026-07-17T09:23:01.481Z */
|
|
2
|
+
import { useContractDirectory as e, useSystemDirectory as t } from "../../components/directory/index.js";
|
|
3
|
+
import { ScriptDocLabel as n } from "../../components/script-doc/index.js";
|
|
4
|
+
import { adapterScriptDoc as r } from "../../components/script-doc/completions.js";
|
|
5
|
+
import { DIRECTION_OPTIONS as i } from "../../components/status/labels.js";
|
|
6
|
+
import { Grid as a, useFormContext as o } from "@vef-framework-react/components";
|
|
7
|
+
import { jsx as s, jsxs as c } from "@emotion/react/jsx-runtime";
|
|
8
|
+
import { z as l } from "@vef-framework-react/shared";
|
|
9
|
+
//#region src/pages/adapter-page/form.tsx
|
|
10
|
+
function u(e) {
|
|
11
|
+
return l.string(e).min(1, e);
|
|
12
|
+
}
|
|
13
|
+
var d = l.string("请输入脚本").min(1, "请输入脚本");
|
|
14
|
+
function f({ scene: l }) {
|
|
15
|
+
let f = o(), p = t(), m = e(), h = l === "create";
|
|
16
|
+
return /* @__PURE__ */ c(a, {
|
|
17
|
+
columnGap: "small",
|
|
18
|
+
children: [
|
|
19
|
+
/* @__PURE__ */ s(a.Item, {
|
|
20
|
+
span: 12,
|
|
21
|
+
children: /* @__PURE__ */ s(f.AppField, {
|
|
22
|
+
name: "systemId",
|
|
23
|
+
validators: { onChange: u("请选择所属系统") },
|
|
24
|
+
children: (e) => /* @__PURE__ */ s(e.Select, {
|
|
25
|
+
required: !0,
|
|
26
|
+
disabled: !h,
|
|
27
|
+
label: "所属系统",
|
|
28
|
+
loading: p.loading,
|
|
29
|
+
options: p.options,
|
|
30
|
+
placeholder: "适配器对接的外部系统"
|
|
31
|
+
})
|
|
32
|
+
})
|
|
33
|
+
}),
|
|
34
|
+
/* @__PURE__ */ s(a.Item, {
|
|
35
|
+
span: 12,
|
|
36
|
+
children: /* @__PURE__ */ s(f.AppField, {
|
|
37
|
+
name: "contractId",
|
|
38
|
+
validators: { onChange: u("请选择所属契约") },
|
|
39
|
+
children: (e) => /* @__PURE__ */ s(e.Select, {
|
|
40
|
+
required: !0,
|
|
41
|
+
disabled: !h,
|
|
42
|
+
label: "所属契约",
|
|
43
|
+
loading: m.loading,
|
|
44
|
+
options: m.options,
|
|
45
|
+
placeholder: "适配器实现的标准契约"
|
|
46
|
+
})
|
|
47
|
+
})
|
|
48
|
+
}),
|
|
49
|
+
/* @__PURE__ */ s(a.Item, {
|
|
50
|
+
span: 12,
|
|
51
|
+
children: /* @__PURE__ */ s(f.AppField, {
|
|
52
|
+
name: "direction",
|
|
53
|
+
children: (e) => /* @__PURE__ */ s(e.Radio, {
|
|
54
|
+
buttonStyle: "solid",
|
|
55
|
+
disabled: !h,
|
|
56
|
+
label: "方向",
|
|
57
|
+
options: i,
|
|
58
|
+
optionType: "button"
|
|
59
|
+
})
|
|
60
|
+
})
|
|
61
|
+
}),
|
|
62
|
+
/* @__PURE__ */ s(a.Item, {
|
|
63
|
+
span: 12,
|
|
64
|
+
children: /* @__PURE__ */ s(f.AppField, {
|
|
65
|
+
name: "timeoutMs",
|
|
66
|
+
children: (e) => /* @__PURE__ */ s(e.InputNumber, {
|
|
67
|
+
extra: "0 表示使用框架默认的运行超时",
|
|
68
|
+
label: "超时覆盖(ms)",
|
|
69
|
+
min: 0,
|
|
70
|
+
style: { width: "100%" }
|
|
71
|
+
})
|
|
72
|
+
})
|
|
73
|
+
}),
|
|
74
|
+
/* @__PURE__ */ s(a.Item, {
|
|
75
|
+
span: 24,
|
|
76
|
+
children: /* @__PURE__ */ s(f.Subscribe, {
|
|
77
|
+
selector: (e) => e.values.direction ?? "outbound",
|
|
78
|
+
children: (e) => /* @__PURE__ */ s(f.AppField, {
|
|
79
|
+
name: "script",
|
|
80
|
+
validators: { onChange: d },
|
|
81
|
+
children: (t) => /* @__PURE__ */ s(t.CodeEditor, {
|
|
82
|
+
required: !0,
|
|
83
|
+
showLineNumbers: !0,
|
|
84
|
+
completions: r(e).entries,
|
|
85
|
+
height: 420,
|
|
86
|
+
label: /* @__PURE__ */ s(n, {
|
|
87
|
+
doc: r(e),
|
|
88
|
+
label: "脚本"
|
|
89
|
+
}),
|
|
90
|
+
language: "javascript",
|
|
91
|
+
placeholder: "// 参照上方的绑定说明编写,return 即本次调用的返回值"
|
|
92
|
+
})
|
|
93
|
+
})
|
|
94
|
+
})
|
|
95
|
+
}),
|
|
96
|
+
/* @__PURE__ */ s(a.Item, {
|
|
97
|
+
span: 24,
|
|
98
|
+
children: /* @__PURE__ */ s(f.AppField, {
|
|
99
|
+
name: "isEnabled",
|
|
100
|
+
children: (e) => /* @__PURE__ */ s(e.Bool, {
|
|
101
|
+
label: "启用",
|
|
102
|
+
variant: "switch"
|
|
103
|
+
})
|
|
104
|
+
})
|
|
105
|
+
})
|
|
106
|
+
]
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
//#endregion
|
|
110
|
+
export { f as AdapterForm };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*! @vef-framework-react/integration v2.10.0 made by Venus | 2026-07-17T09:23:01.481Z */
|
|
2
|
+
import { createCrudKit as e } from "@vef-framework-react/components";
|
|
3
|
+
//#region src/pages/adapter-page/helpers.ts
|
|
4
|
+
var { OperationButtonGroup: t, ActionButtonGroup: n } = e();
|
|
5
|
+
function r(e) {
|
|
6
|
+
return {
|
|
7
|
+
id: e.id,
|
|
8
|
+
systemId: e.systemId,
|
|
9
|
+
contractId: e.contractId,
|
|
10
|
+
direction: e.direction,
|
|
11
|
+
script: e.script,
|
|
12
|
+
timeoutMs: e.timeoutMs,
|
|
13
|
+
isEnabled: e.isEnabled
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
var i = {
|
|
17
|
+
direction: "outbound",
|
|
18
|
+
script: "// 出站:把 input 译成对外部系统的调用并返回契约输出\n// 入站:用 dispatch(input) 交给业务处理器\nreturn input;\n",
|
|
19
|
+
timeoutMs: 0,
|
|
20
|
+
isEnabled: !0
|
|
21
|
+
};
|
|
22
|
+
//#endregion
|
|
23
|
+
export { i as ADAPTER_FORM_DEFAULTS, n as AdapterActionButtonGroup, t as AdapterOperationButtonGroup, r as adapterToParams };
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/*! @vef-framework-react/integration v2.10.0 made by Venus | 2026-07-17T09:23:01.481Z */
|
|
2
|
+
import { useAdapterApi as e } from "../../api/crud-api.js";
|
|
3
|
+
import { useContractDirectory as t, useSystemDirectory as n } from "../../components/directory/index.js";
|
|
4
|
+
import { INTEGRATION_PERMISSIONS as r } from "../../permissions.js";
|
|
5
|
+
import { buildAdapterColumns as i } from "./columns.js";
|
|
6
|
+
import { AdapterForm as a } from "./form.js";
|
|
7
|
+
import { ADAPTER_FORM_DEFAULTS as o, AdapterActionButtonGroup as s, AdapterOperationButtonGroup as c, adapterToParams as l } from "./helpers.js";
|
|
8
|
+
import { AdapterSearchFields as u } from "./search.js";
|
|
9
|
+
import { useMemo as d } from "react";
|
|
10
|
+
import { ActionButton as f, CrudPage as p, Icon as m, OperationButton as h, PermissionGate as g } from "@vef-framework-react/components";
|
|
11
|
+
import { Fragment as _, jsx as v, jsxs as y } from "@emotion/react/jsx-runtime";
|
|
12
|
+
import { EditIcon as b, PlusIcon as x, TrashIcon as S } from "lucide-react";
|
|
13
|
+
//#region src/pages/adapter-page/index.tsx
|
|
14
|
+
var C = {
|
|
15
|
+
xxs: "100vw",
|
|
16
|
+
md: "90vw",
|
|
17
|
+
xl: 960
|
|
18
|
+
};
|
|
19
|
+
function w({ permissions: w, columnStorageKey: T = "integration.adapter", title: E }) {
|
|
20
|
+
let D = e(), O = n(), k = t(), A = {
|
|
21
|
+
...r.adapter,
|
|
22
|
+
...w
|
|
23
|
+
}, j = d(() => i(O, k), [O, k]);
|
|
24
|
+
return /* @__PURE__ */ v(p, {
|
|
25
|
+
rowSelection: !0,
|
|
26
|
+
basicSearch: /* @__PURE__ */ v(u, {}),
|
|
27
|
+
columnSettings: { storageKey: T },
|
|
28
|
+
deleteManyMutationFn: D.removeMany,
|
|
29
|
+
deleteMutationFn: D.remove,
|
|
30
|
+
formLayout: { layout: "vertical" },
|
|
31
|
+
formMutationFns: {
|
|
32
|
+
create: D.create,
|
|
33
|
+
update: D.update
|
|
34
|
+
},
|
|
35
|
+
queryFn: D.findPage,
|
|
36
|
+
renderForm: (e) => /* @__PURE__ */ v(a, { scene: e }),
|
|
37
|
+
rowKey: "id",
|
|
38
|
+
sceneDefaultFormValues: { create: o },
|
|
39
|
+
tableColumns: j,
|
|
40
|
+
title: E,
|
|
41
|
+
operationColumn: {
|
|
42
|
+
width: 160,
|
|
43
|
+
render(e) {
|
|
44
|
+
return /* @__PURE__ */ v(c, {
|
|
45
|
+
selector: (e) => [
|
|
46
|
+
e.openForm,
|
|
47
|
+
e.delete,
|
|
48
|
+
e.refetchQuery
|
|
49
|
+
],
|
|
50
|
+
children: ([t, n, r]) => /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(h, {
|
|
51
|
+
color: "primary",
|
|
52
|
+
icon: /* @__PURE__ */ v(m, { component: b }),
|
|
53
|
+
requiredPermissions: A.update,
|
|
54
|
+
onClick: () => t({
|
|
55
|
+
scene: "update",
|
|
56
|
+
values: l(e),
|
|
57
|
+
title: "编辑适配器",
|
|
58
|
+
mode: "drawer",
|
|
59
|
+
width: C
|
|
60
|
+
}),
|
|
61
|
+
children: "编辑"
|
|
62
|
+
}), /* @__PURE__ */ v(h, {
|
|
63
|
+
confirmable: !0,
|
|
64
|
+
color: "danger",
|
|
65
|
+
confirmDescription: "确定删除该适配器?",
|
|
66
|
+
icon: /* @__PURE__ */ v(m, { component: S }),
|
|
67
|
+
requiredPermissions: A.delete,
|
|
68
|
+
onClick: async () => {
|
|
69
|
+
try {
|
|
70
|
+
await n(e), r();
|
|
71
|
+
} catch {}
|
|
72
|
+
},
|
|
73
|
+
children: "删除"
|
|
74
|
+
})] })
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
toolbarActions: /* @__PURE__ */ v(s, {
|
|
79
|
+
selector: (e) => [
|
|
80
|
+
e.openForm,
|
|
81
|
+
e.isQueryFetching,
|
|
82
|
+
e.selectedRows,
|
|
83
|
+
e.deleteMany,
|
|
84
|
+
e.refetchQuery
|
|
85
|
+
],
|
|
86
|
+
children: ([e, t, n, r, i]) => /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(g, {
|
|
87
|
+
requiredPermissions: A.create,
|
|
88
|
+
children: /* @__PURE__ */ v(f, {
|
|
89
|
+
icon: /* @__PURE__ */ v(m, { component: x }),
|
|
90
|
+
type: "primary",
|
|
91
|
+
onClick: () => e({
|
|
92
|
+
scene: "create",
|
|
93
|
+
title: "新增适配器",
|
|
94
|
+
mode: "drawer",
|
|
95
|
+
width: C
|
|
96
|
+
}),
|
|
97
|
+
children: "新增适配器"
|
|
98
|
+
})
|
|
99
|
+
}), /* @__PURE__ */ v(g, {
|
|
100
|
+
requiredPermissions: A.delete,
|
|
101
|
+
children: /* @__PURE__ */ v(f, {
|
|
102
|
+
confirmable: !0,
|
|
103
|
+
danger: !0,
|
|
104
|
+
confirmDescription: "确定批量删除选中的适配器?",
|
|
105
|
+
confirmMode: "dialog",
|
|
106
|
+
disabled: t || n.length === 0,
|
|
107
|
+
icon: /* @__PURE__ */ v(m, { component: S }),
|
|
108
|
+
onClick: async () => {
|
|
109
|
+
try {
|
|
110
|
+
await r(n), i();
|
|
111
|
+
} catch {}
|
|
112
|
+
},
|
|
113
|
+
children: "批量删除"
|
|
114
|
+
})
|
|
115
|
+
})] })
|
|
116
|
+
})
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
//#endregion
|
|
120
|
+
export { w as IntegrationAdapterPage };
|