aibox-custom-component-packages 0.0.13 → 0.0.15
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/es/SourcePublish.mjs +1 -1
- package/es/assets/SourcePublish.css +1 -1
- package/es/chunks/{SourcePublish.BhLjt18i.js → SourcePublish.Dk7O9GzI.js} +2 -6
- package/es/index.mjs +1 -1
- package/lib/SourcePublish.js +1 -1
- package/lib/assets/SourcePublish.css +1 -1
- package/lib/chunks/SourcePublish.OeB6i-Iu.js +1 -0
- package/lib/index.js +1 -1
- package/package.json +2 -2
- package/es/chunks/AddOrEditSupplierDialog.BKR0RsiJ.js +0 -721
- package/es/chunks/AddOrEditSupplierDialog.CjNRipPe.js +0 -721
- package/es/chunks/AddOrEditSupplierDialog.CnsquSx2.js +0 -721
- package/es/chunks/AiboxTable.CDqNvRfJ.js +0 -635
- package/es/chunks/AiboxTable.CrWMAX84.js +0 -635
- package/es/chunks/ApplicationTypeTag.Cbdi0D65.js +0 -47
- package/es/chunks/ApplicationTypeTag.Df4BZxds.js +0 -47
- package/es/chunks/AuthSection.DFfj5MtZ.js +0 -201
- package/es/chunks/AuthSection.DWD_FxtJ.js +0 -201
- package/es/chunks/AvailableRangePreview.Bz9QkkAM.js +0 -194
- package/es/chunks/AvailableRangePreview.WFzbRasx.js +0 -194
- package/es/chunks/AvailableRangeSetting.Bq_K1zar.js +0 -229
- package/es/chunks/AvailableRangeSetting.Cty5Cdmh.js +0 -229
- package/es/chunks/CodeView.CWuSIL_F.js +0 -148
- package/es/chunks/CodeView.Dhxe1PQP.js +0 -148
- package/es/chunks/CommonTagsList.DSPdgjc3.js +0 -156
- package/es/chunks/CommonTagsList.NbXVfvLW.js +0 -156
- package/es/chunks/CommonTagsList.qam_Fp76.js +0 -156
- package/es/chunks/CreateMcpForm.BBVVd2RN.js +0 -308
- package/es/chunks/CreateMcpForm.BWUyeP01.js +0 -308
- package/es/chunks/CreateMcpForm.C8YfDSEM.js +0 -308
- package/es/chunks/CreateMcpForm.DSE5jyiW.js +0 -308
- package/es/chunks/CustomSidebar.BSGAhmVY.js +0 -585
- package/es/chunks/DocSyncSelect.D-WIvZZN.js +0 -2290
- package/es/chunks/DocSyncSelect.Kk88o9gO.js +0 -2290
- package/es/chunks/FileDisplay.B5laA4uX.js +0 -1649
- package/es/chunks/FileDisplay.BCTNdpl9.js +0 -1649
- package/es/chunks/FileDisplay.CBNYrdsK.js +0 -1560
- package/es/chunks/FilePreview.B9u8ODHp.js +0 -123
- package/es/chunks/FileUploader.BaikPGWb.js +0 -216
- package/es/chunks/FileUploader.DD-lopf-.js +0 -216
- package/es/chunks/McpFormDialog.4HDExbTn.js +0 -297
- package/es/chunks/McpFormDialog.CgnC1I7i.js +0 -297
- package/es/chunks/McpFormDialog.D3txmoEF.js +0 -297
- package/es/chunks/McpFormDialog.DNzqqhaX.js +0 -297
- package/es/chunks/McpParamsSet.DlWx6E5S.js +0 -501
- package/es/chunks/McpParamsSet.Tlo_lPn-.js +0 -501
- package/es/chunks/MdEditor.B9-B9aiy.js +0 -163
- package/es/chunks/MdEditor.CeEo0P6j.js +0 -163
- package/es/chunks/MdEditor.DtL0Se7T.js +0 -163
- package/es/chunks/ParameterTable.BCdnj1gW.js +0 -2010
- package/es/chunks/ParameterTable.hUsxEU6F.js +0 -2010
- package/es/chunks/PublishRecord.9PLs9yUj.js +0 -133
- package/es/chunks/PublishRecord.C0841sJ-.js +0 -133
- package/es/chunks/PublishRecord.DEzC7hmP.js +0 -133
- package/es/chunks/SourcePublish.C97G36H2.js +0 -972
- package/es/chunks/SourcePublish.DkyY1KEk.js +0 -972
- package/es/chunks/SourcePublish.Dx-ltk9U.js +0 -956
- package/es/chunks/SourcePublish.FiswtYfr.js +0 -972
- package/es/chunks/SourcePublish.nfXmrVHm.js +0 -972
- package/es/chunks/config.BEZNFeRN.js +0 -35
- package/es/chunks/config.LzgBLhTz.js +0 -270
- package/es/chunks/config.MfNKPMiA.js +0 -35
- package/es/chunks/config.TaUlPTYL.js +0 -270
- package/es/chunks/config.l1J_qxeB.js +0 -270
- package/es/chunks/i18n.CIjLjyDK.js +0 -418
- package/es/chunks/i18n.CxsxtRq_.js +0 -418
- package/es/chunks/usePreview.agdxmOk8.js +0 -126
- package/lib/chunks/AddOrEditSupplierDialog.D0DSQZiS.js +0 -1
- package/lib/chunks/CommonTagsList.DbNcVId5.js +0 -1
- package/lib/chunks/CreateMcpForm.Cm9eHXWg.js +0 -1
- package/lib/chunks/CreateMcpForm.DNijYbgd.js +0 -1
- package/lib/chunks/CustomSidebar.Dojb1xoS.js +0 -1
- package/lib/chunks/FileDisplay.B4gn0Jhp.js +0 -59
- package/lib/chunks/FileDisplay.B7JWIcFg.js +0 -59
- package/lib/chunks/FileDisplay.DjtHza32.js +0 -59
- package/lib/chunks/FilePreview.b1Gine59.js +0 -1
- package/lib/chunks/McpFormDialog.BgNPOGB-.js +0 -6
- package/lib/chunks/McpFormDialog.CL2bInts.js +0 -6
- package/lib/chunks/McpFormDialog.DbhQIwYW.js +0 -6
- package/lib/chunks/MdEditor.rVQbuxCg.js +0 -1
- package/lib/chunks/PublishRecord.B7xYlRKJ.js +0 -5
- package/lib/chunks/SourcePublish.BBsNlnp4.js +0 -1
- package/lib/chunks/SourcePublish.C9JAqJcV.js +0 -1
- package/lib/chunks/SourcePublish.CpeV-UOG.js +0 -1
- package/lib/chunks/SourcePublish.K4tntn9l.js +0 -1
- package/lib/chunks/SourcePublish.tNsaCp3r.js +0 -1
- package/lib/chunks/config.CDNV0bUm.js +0 -1
- package/lib/chunks/usePreview.Dmhz8azZ.js +0 -1
|
@@ -1,308 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./withinstall.dLh4K-0g.js";
|
|
2
|
-
import { m as t } from "./i18n.CIjLjyDK.js";
|
|
3
|
-
import { t as n } from "./usePreview.CMMjOD_o.js";
|
|
4
|
-
import { t as r } from "./FilePreview.De4zHsfc.js";
|
|
5
|
-
import { t as i } from "./_plugin-vue_export-helper.Ct3qlEzt.js";
|
|
6
|
-
import { t as a } from "./FileUploader.BaikPGWb.js";
|
|
7
|
-
import { t as o } from "./RadioGroup.Czc1JtkN.js";
|
|
8
|
-
import { t as s } from "./AuthSection.DFfj5MtZ.js";
|
|
9
|
-
import { t as c } from "./MdEditor.CeEo0P6j.js";
|
|
10
|
-
import { createBlock as l, createCommentVNode as u, createElementVNode as d, createTextVNode as f, createVNode as p, openBlock as m, reactive as h, ref as g, toDisplayString as _, unref as v, watch as y, withCtx as b } from "vue";
|
|
11
|
-
import { ElForm as x, ElFormItem as S, ElIcon as C, ElInput as w, ElMessage as T, ElTooltip as E } from "element-plus";
|
|
12
|
-
import { IconTip as D } from "color-message-aibox-vue";
|
|
13
|
-
import '../assets/CreateMcpForm.css';//#region components/CreateMcpForm/config.js
|
|
14
|
-
var O = () => {
|
|
15
|
-
let { t: e } = t();
|
|
16
|
-
return {
|
|
17
|
-
rulesObj: {
|
|
18
|
-
name: [{
|
|
19
|
-
required: !0,
|
|
20
|
-
message: e("LIBRARY_CREATEMCPFORM.MCP_NAME_PLACEHOLDER"),
|
|
21
|
-
trigger: "blur"
|
|
22
|
-
}, {
|
|
23
|
-
max: 20,
|
|
24
|
-
message: e("LIBRARY_CREATEMCPFORM.MCP_NAME_MAX"),
|
|
25
|
-
trigger: "blur"
|
|
26
|
-
}],
|
|
27
|
-
description: [{
|
|
28
|
-
required: !0,
|
|
29
|
-
message: e("LIBRARY_CREATEMCPFORM.MCP_DESCRIPTION_REQUIRED"),
|
|
30
|
-
trigger: "blur"
|
|
31
|
-
}, {
|
|
32
|
-
max: 200,
|
|
33
|
-
message: e("LIBRARY_CREATEMCPFORM.MCP_DESCRIPTION_MAX"),
|
|
34
|
-
trigger: "blur"
|
|
35
|
-
}],
|
|
36
|
-
overview: [{
|
|
37
|
-
required: !0,
|
|
38
|
-
message: e("LIBRARY_CREATEMCPFORM.MCP_OVERVIEW_REQUIRED"),
|
|
39
|
-
trigger: "blur"
|
|
40
|
-
}],
|
|
41
|
-
address: [{
|
|
42
|
-
type: "url",
|
|
43
|
-
required: !0,
|
|
44
|
-
message: e("LIBRARY_CREATEMCPFORM.SERVICE_URL_INVALID"),
|
|
45
|
-
trigger: ["blur", "change"]
|
|
46
|
-
}],
|
|
47
|
-
communicationType: [{
|
|
48
|
-
required: !0,
|
|
49
|
-
message: e("LIBRARY_CREATEMCPFORM.TRANSFER_METHOD_REQUIRED"),
|
|
50
|
-
trigger: "change"
|
|
51
|
-
}],
|
|
52
|
-
applyLink: [{
|
|
53
|
-
type: "url",
|
|
54
|
-
message: e("LIBRARY_CREATEMCPFORM.DOCUMENTATION_URL_INVALID"),
|
|
55
|
-
trigger: ["blur", "change"]
|
|
56
|
-
}]
|
|
57
|
-
},
|
|
58
|
-
communicationTypeOpts: [{
|
|
59
|
-
label: "SSE",
|
|
60
|
-
value: "SSE"
|
|
61
|
-
}, {
|
|
62
|
-
label: "Streamable HTTP",
|
|
63
|
-
value: "HTTP"
|
|
64
|
-
}]
|
|
65
|
-
};
|
|
66
|
-
}, k = { class: "label-with-icon" }, A = { class: "label-with-icon" }, j = { class: "auth-section-wrapper" }, M = e(/* @__PURE__ */ i({
|
|
67
|
-
__name: "CreateMcpForm",
|
|
68
|
-
props: { showOverview: {
|
|
69
|
-
type: Boolean,
|
|
70
|
-
default: !1
|
|
71
|
-
} },
|
|
72
|
-
setup(e, { expose: i }) {
|
|
73
|
-
let M = e, { t: N } = t(), { previewImage: P } = n(), F = g(null), I = g(null), { rulesObj: L, communicationTypeOpts: R } = O(), z = h({
|
|
74
|
-
icon: "",
|
|
75
|
-
iconUrl: "",
|
|
76
|
-
name: "",
|
|
77
|
-
description: "",
|
|
78
|
-
overview: "",
|
|
79
|
-
communicationType: "HTTP",
|
|
80
|
-
address: "",
|
|
81
|
-
applyLink: ""
|
|
82
|
-
}), B = g(R), V = g({ auth: {
|
|
83
|
-
authType: "none",
|
|
84
|
-
keyType: "custom",
|
|
85
|
-
paramLocation: "header",
|
|
86
|
-
paramName: "",
|
|
87
|
-
paramValue: "",
|
|
88
|
-
token: ""
|
|
89
|
-
} }), H = g({ ...L }), U = () => {
|
|
90
|
-
M.showOverview ? H.value.overview = L.overview : delete H.value.overview;
|
|
91
|
-
};
|
|
92
|
-
y(() => M.showOverview, () => {
|
|
93
|
-
U();
|
|
94
|
-
}, { immediate: !0 });
|
|
95
|
-
let W = g([]), G = (e) => {
|
|
96
|
-
z.iconUrl = e.url, z.icon = e.bnid, W.value = [e];
|
|
97
|
-
}, K = () => {
|
|
98
|
-
z.iconUrl = "", z.icon = "", W.value = [];
|
|
99
|
-
}, q = (e) => {
|
|
100
|
-
P(e.url);
|
|
101
|
-
};
|
|
102
|
-
return i({
|
|
103
|
-
validate: async (e) => {
|
|
104
|
-
if (!F.value) return !1;
|
|
105
|
-
if (U(), I.value?.validateField) {
|
|
106
|
-
let t = I.value.validateField();
|
|
107
|
-
if (Object.keys(t).length > 0) return t.paramName ? T.error(N("LIBRARY_CREATEMCPFORM.PARAMETER_NAME_REQUIRED") || "请输入密钥参数名") : t.paramValue || t.token ? T.error(N("LIBRARY_CREATEMCPFORM.INPUT_API_KEY_REQUIRED") || "请输入密钥值") : T.error(N("LIBRARY_CREATEMCPFORM.MCP_AUTH_REQUIRED") || "请完善鉴权信息"), e?.(Error(N("LIBRARY_CREATEMCPFORM.MCP_AUTH_REQUIRED") || "请完善鉴权信息")), !1;
|
|
108
|
-
}
|
|
109
|
-
return F.value.validate(e);
|
|
110
|
-
},
|
|
111
|
-
getFormData: () => ({
|
|
112
|
-
name: z.name,
|
|
113
|
-
icon: z.icon,
|
|
114
|
-
description: z.description,
|
|
115
|
-
overview: M.showOverview ? z.overview : "",
|
|
116
|
-
address: z.address,
|
|
117
|
-
communicationType: z.communicationType,
|
|
118
|
-
authType: V.value.auth.authType === "none" ? 0 : 1,
|
|
119
|
-
authLocation: V.value.auth.paramLocation === "header" ? 0 : 1,
|
|
120
|
-
apiKeyName: V.value.auth.keyType === "bearer" ? "Authorization" : V.value.auth.paramName || "",
|
|
121
|
-
apiKeyValue: V.value.auth.keyType === "bearer" ? V.value.auth.token ? `Bearer ${V.value.auth.token}` : "" : V.value.auth.paramValue || "",
|
|
122
|
-
applyLink: z.applyLink || "",
|
|
123
|
-
headerPrefixType: 1
|
|
124
|
-
}),
|
|
125
|
-
setFormData: (e) => {
|
|
126
|
-
if (!e) return;
|
|
127
|
-
Object.assign(z, {
|
|
128
|
-
name: e.name || "",
|
|
129
|
-
description: e.description || "",
|
|
130
|
-
overview: e.overview || "",
|
|
131
|
-
icon: e.icon || "",
|
|
132
|
-
iconUrl: e.iconUrl || "",
|
|
133
|
-
communicationType: e.communicationType || "SSE",
|
|
134
|
-
address: e.address || "",
|
|
135
|
-
applyLink: e.applyLink || ""
|
|
136
|
-
});
|
|
137
|
-
let t = e.authType === 1 || e.authType === "1";
|
|
138
|
-
if (V.value.auth.authType = t ? "apiKey" : "none", V.value.auth.paramLocation = e.authLocation === 0 || e.authLocation === "0" ? "header" : "query", t) {
|
|
139
|
-
let t = !e.apiKeyName || e.apiKeyName === "Authorization";
|
|
140
|
-
if (V.value.auth.keyType = t ? "bearer" : "custom", t) {
|
|
141
|
-
V.value.auth.paramName = "", V.value.auth.paramValue = "";
|
|
142
|
-
let t = e.apiKeyValue || "";
|
|
143
|
-
V.value.auth.token = t.startsWith("Bearer ") ? t.substring(7) : t;
|
|
144
|
-
} else V.value.auth.paramName = e.apiKeyName || "", V.value.auth.paramValue = e.apiKeyValue || "", V.value.auth.token = "";
|
|
145
|
-
} else V.value.auth.keyType = "custom", V.value.auth.paramName = "", V.value.auth.paramValue = "", V.value.auth.token = "";
|
|
146
|
-
e.icon && e.icon !== "0" && e.iconUrl && (W.value = [{
|
|
147
|
-
bnid: e.icon,
|
|
148
|
-
url: e.iconUrl
|
|
149
|
-
}]);
|
|
150
|
-
}
|
|
151
|
-
}), (t, n) => (m(), l(v(x), {
|
|
152
|
-
ref_key: "ruleFormRef",
|
|
153
|
-
ref: F,
|
|
154
|
-
model: z,
|
|
155
|
-
rules: H.value,
|
|
156
|
-
"label-width": "auto",
|
|
157
|
-
"label-position": "top",
|
|
158
|
-
class: "scrollable-form"
|
|
159
|
-
}, {
|
|
160
|
-
default: b(() => [
|
|
161
|
-
p(v(S), {
|
|
162
|
-
class: "scrollable-form__item",
|
|
163
|
-
label: v(N)("LIBRARY_CREATEMCPFORM.MCP_ICON"),
|
|
164
|
-
prop: "icon"
|
|
165
|
-
}, {
|
|
166
|
-
label: b(() => [d("div", k, [d("span", null, _(v(N)("LIBRARY_CREATEMCPFORM.MCP_ICON")), 1), p(v(E), { placement: "top" }, {
|
|
167
|
-
content: b(() => [
|
|
168
|
-
f(_(v(N)("LIBRARY_CREATEMCPFORM.MCP_ICON_TIP")), 1),
|
|
169
|
-
n[7] ||= d("br", null, null, -1),
|
|
170
|
-
f(" " + _(v(N)("LIBRARY_CREATEMCPFORM.MCP_ICON_SIZE_TIP")), 1)
|
|
171
|
-
]),
|
|
172
|
-
default: b(() => [p(v(C), {
|
|
173
|
-
size: "14px",
|
|
174
|
-
color: "#999"
|
|
175
|
-
}, {
|
|
176
|
-
default: b(() => [p(v(D))]),
|
|
177
|
-
_: 1
|
|
178
|
-
})]),
|
|
179
|
-
_: 1
|
|
180
|
-
})])]),
|
|
181
|
-
default: b(() => [p(v(r), {
|
|
182
|
-
fileList: W.value,
|
|
183
|
-
previewType: "Card",
|
|
184
|
-
isCustom: !0,
|
|
185
|
-
onOnRemove: K,
|
|
186
|
-
onOnPreview: q
|
|
187
|
-
}, {
|
|
188
|
-
CardUploader: b(() => [W.value.length === 0 ? (m(), l(v(a), {
|
|
189
|
-
key: 0,
|
|
190
|
-
"upload-type": "Card",
|
|
191
|
-
onOnSuccess: G,
|
|
192
|
-
limitSize: 5,
|
|
193
|
-
acceptType: ".jpg,.png",
|
|
194
|
-
businessType: "mcp",
|
|
195
|
-
defaultUploadIcon: "mcp"
|
|
196
|
-
})) : u("", !0)]),
|
|
197
|
-
_: 1
|
|
198
|
-
}, 8, ["fileList"])]),
|
|
199
|
-
_: 1
|
|
200
|
-
}, 8, ["label"]),
|
|
201
|
-
p(v(S), {
|
|
202
|
-
class: "scrollable-form__item",
|
|
203
|
-
label: v(N)("LIBRARY_CREATEMCPFORM.MCP_NAME"),
|
|
204
|
-
prop: "name"
|
|
205
|
-
}, {
|
|
206
|
-
default: b(() => [p(v(w), {
|
|
207
|
-
modelValue: z.name,
|
|
208
|
-
"onUpdate:modelValue": n[0] ||= (e) => z.name = e,
|
|
209
|
-
placeholder: v(N)("LIBRARY_CREATEMCPFORM.MCP_NAME_REQUIRED"),
|
|
210
|
-
maxlength: "20",
|
|
211
|
-
"show-word-limit": ""
|
|
212
|
-
}, null, 8, ["modelValue", "placeholder"])]),
|
|
213
|
-
_: 1
|
|
214
|
-
}, 8, ["label"]),
|
|
215
|
-
p(v(S), {
|
|
216
|
-
class: "scrollable-form__item",
|
|
217
|
-
label: v(N)("LIBRARY_CREATEMCPFORM.MCP_DESCRIPTION"),
|
|
218
|
-
prop: "description"
|
|
219
|
-
}, {
|
|
220
|
-
default: b(() => [p(v(w), {
|
|
221
|
-
modelValue: z.description,
|
|
222
|
-
"onUpdate:modelValue": n[1] ||= (e) => z.description = e,
|
|
223
|
-
type: "textarea",
|
|
224
|
-
rows: 3,
|
|
225
|
-
placeholder: v(N)("LIBRARY_CREATEMCPFORM.MCP_DESCRIPTION_REQUIRED"),
|
|
226
|
-
maxlength: "200",
|
|
227
|
-
"show-word-limit": ""
|
|
228
|
-
}, null, 8, ["modelValue", "placeholder"])]),
|
|
229
|
-
_: 1
|
|
230
|
-
}, 8, ["label"]),
|
|
231
|
-
e.showOverview ? (m(), l(v(S), {
|
|
232
|
-
key: 0,
|
|
233
|
-
class: "scrollable-form__item",
|
|
234
|
-
label: v(N)("LIBRARY_CREATEMCPFORM.MCP_OVERVIEW"),
|
|
235
|
-
prop: "overview"
|
|
236
|
-
}, {
|
|
237
|
-
default: b(() => [p(v(c), {
|
|
238
|
-
modelValue: z.overview,
|
|
239
|
-
"onUpdate:modelValue": n[2] ||= (e) => z.overview = e,
|
|
240
|
-
height: "300px",
|
|
241
|
-
placeholder: v(N)("LIBRARY_CREATEMCPFORM.MCP_OVERVIEW_REQUIRED"),
|
|
242
|
-
businessType: "mcp"
|
|
243
|
-
}, null, 8, ["modelValue", "placeholder"])]),
|
|
244
|
-
_: 1
|
|
245
|
-
}, 8, ["label"])) : u("", !0),
|
|
246
|
-
p(v(S), {
|
|
247
|
-
class: "scrollable-form__item",
|
|
248
|
-
label: v(N)("LIBRARY_CREATEMCPFORM.TRANSFER_METHOD"),
|
|
249
|
-
prop: "communicationType"
|
|
250
|
-
}, {
|
|
251
|
-
default: b(() => [p(v(o), {
|
|
252
|
-
modelValue: z.communicationType,
|
|
253
|
-
"onUpdate:modelValue": n[3] ||= (e) => z.communicationType = e,
|
|
254
|
-
options: B.value,
|
|
255
|
-
layout: "vertical",
|
|
256
|
-
"class-name": "scrollable-form__item-radio"
|
|
257
|
-
}, null, 8, ["modelValue", "options"])]),
|
|
258
|
-
_: 1
|
|
259
|
-
}, 8, ["label"]),
|
|
260
|
-
p(v(S), {
|
|
261
|
-
class: "scrollable-form__item",
|
|
262
|
-
label: v(N)("LIBRARY_CREATEMCPFORM.SERVICE_URL"),
|
|
263
|
-
prop: "address"
|
|
264
|
-
}, {
|
|
265
|
-
default: b(() => [p(v(w), {
|
|
266
|
-
modelValue: z.address,
|
|
267
|
-
"onUpdate:modelValue": n[4] ||= (e) => z.address = e,
|
|
268
|
-
placeholder: v(N)("LIBRARY_CREATEMCPFORM.SERVICE_URL_REQUIRED")
|
|
269
|
-
}, null, 8, ["modelValue", "placeholder"])]),
|
|
270
|
-
_: 1
|
|
271
|
-
}, 8, ["label"]),
|
|
272
|
-
V.value.auth.authType === "apiKey" ? (m(), l(v(S), {
|
|
273
|
-
key: 1,
|
|
274
|
-
class: "scrollable-form__item",
|
|
275
|
-
prop: "applyLink"
|
|
276
|
-
}, {
|
|
277
|
-
label: b(() => [d("div", A, [d("span", null, _(v(N)("LIBRARY_CREATEMCPFORM.DOCUMENTATION_URL")), 1), p(v(E), { placement: "top" }, {
|
|
278
|
-
content: b(() => [f(_(v(N)("LIBRARY_CREATEMCPFORM.DOCUMENTATION_URL_TIP")), 1)]),
|
|
279
|
-
default: b(() => [p(v(C), {
|
|
280
|
-
size: "14px",
|
|
281
|
-
color: "#999"
|
|
282
|
-
}, {
|
|
283
|
-
default: b(() => [p(v(D))]),
|
|
284
|
-
_: 1
|
|
285
|
-
})]),
|
|
286
|
-
_: 1
|
|
287
|
-
})])]),
|
|
288
|
-
default: b(() => [p(v(w), {
|
|
289
|
-
modelValue: z.applyLink,
|
|
290
|
-
"onUpdate:modelValue": n[5] ||= (e) => z.applyLink = e,
|
|
291
|
-
placeholder: v(N)("LIBRARY_CREATEMCPFORM.DOCUMENTATION_URL_REQUIRED")
|
|
292
|
-
}, null, 8, ["modelValue", "placeholder"])]),
|
|
293
|
-
_: 1
|
|
294
|
-
})) : u("", !0),
|
|
295
|
-
d("div", j, [p(v(s), {
|
|
296
|
-
ref_key: "authSectionRef",
|
|
297
|
-
ref: I,
|
|
298
|
-
featData: V.value,
|
|
299
|
-
"onUpdate:featData": n[6] ||= (e) => V.value = e,
|
|
300
|
-
layout: "vertical"
|
|
301
|
-
}, null, 8, ["featData"])])
|
|
302
|
-
]),
|
|
303
|
-
_: 1
|
|
304
|
-
}, 8, ["model", "rules"]));
|
|
305
|
-
}
|
|
306
|
-
}, [["__scopeId", "data-v-b8579cd8"]]));
|
|
307
|
-
//#endregion
|
|
308
|
-
export { M as t };
|
|
@@ -1,308 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./withinstall.dLh4K-0g.js";
|
|
2
|
-
import { m as t } from "./i18n.CxsxtRq_.js";
|
|
3
|
-
import { t as n } from "./usePreview.CMMjOD_o.js";
|
|
4
|
-
import { t as r } from "./FilePreview.De4zHsfc.js";
|
|
5
|
-
import { t as i } from "./_plugin-vue_export-helper.Ct3qlEzt.js";
|
|
6
|
-
import { t as a } from "./FileUploader.DD-lopf-.js";
|
|
7
|
-
import { t as o } from "./RadioGroup.Czc1JtkN.js";
|
|
8
|
-
import { t as s } from "./AuthSection.DWD_FxtJ.js";
|
|
9
|
-
import { t as c } from "./MdEditor.DtL0Se7T.js";
|
|
10
|
-
import { createBlock as l, createCommentVNode as u, createElementVNode as d, createTextVNode as f, createVNode as p, openBlock as m, reactive as h, ref as g, toDisplayString as _, unref as v, watch as y, withCtx as b } from "vue";
|
|
11
|
-
import { ElForm as x, ElFormItem as S, ElIcon as C, ElInput as w, ElMessage as T, ElTooltip as E } from "element-plus";
|
|
12
|
-
import { IconTip as D } from "color-message-aibox-vue";
|
|
13
|
-
import '../assets/CreateMcpForm.css';//#region components/CreateMcpForm/config.js
|
|
14
|
-
var O = () => {
|
|
15
|
-
let { t: e } = t();
|
|
16
|
-
return {
|
|
17
|
-
rulesObj: {
|
|
18
|
-
name: [{
|
|
19
|
-
required: !0,
|
|
20
|
-
message: e("LIBRARY_CREATEMCPFORM.MCP_NAME_PLACEHOLDER"),
|
|
21
|
-
trigger: "blur"
|
|
22
|
-
}, {
|
|
23
|
-
max: 20,
|
|
24
|
-
message: e("LIBRARY_CREATEMCPFORM.MCP_NAME_MAX"),
|
|
25
|
-
trigger: "blur"
|
|
26
|
-
}],
|
|
27
|
-
description: [{
|
|
28
|
-
required: !0,
|
|
29
|
-
message: e("LIBRARY_CREATEMCPFORM.MCP_DESCRIPTION_REQUIRED"),
|
|
30
|
-
trigger: "blur"
|
|
31
|
-
}, {
|
|
32
|
-
max: 200,
|
|
33
|
-
message: e("LIBRARY_CREATEMCPFORM.MCP_DESCRIPTION_MAX"),
|
|
34
|
-
trigger: "blur"
|
|
35
|
-
}],
|
|
36
|
-
overview: [{
|
|
37
|
-
required: !0,
|
|
38
|
-
message: e("LIBRARY_CREATEMCPFORM.MCP_OVERVIEW_REQUIRED"),
|
|
39
|
-
trigger: "blur"
|
|
40
|
-
}],
|
|
41
|
-
address: [{
|
|
42
|
-
type: "url",
|
|
43
|
-
required: !0,
|
|
44
|
-
message: e("LIBRARY_CREATEMCPFORM.SERVICE_URL_INVALID"),
|
|
45
|
-
trigger: ["blur", "change"]
|
|
46
|
-
}],
|
|
47
|
-
communicationType: [{
|
|
48
|
-
required: !0,
|
|
49
|
-
message: e("LIBRARY_CREATEMCPFORM.TRANSFER_METHOD_REQUIRED"),
|
|
50
|
-
trigger: "change"
|
|
51
|
-
}],
|
|
52
|
-
applyLink: [{
|
|
53
|
-
type: "url",
|
|
54
|
-
message: e("LIBRARY_CREATEMCPFORM.DOCUMENTATION_URL_INVALID"),
|
|
55
|
-
trigger: ["blur", "change"]
|
|
56
|
-
}]
|
|
57
|
-
},
|
|
58
|
-
communicationTypeOpts: [{
|
|
59
|
-
label: "SSE",
|
|
60
|
-
value: "SSE"
|
|
61
|
-
}, {
|
|
62
|
-
label: "Streamable HTTP",
|
|
63
|
-
value: "HTTP"
|
|
64
|
-
}]
|
|
65
|
-
};
|
|
66
|
-
}, k = { class: "label-with-icon" }, A = { class: "label-with-icon" }, j = { class: "auth-section-wrapper" }, M = e(/* @__PURE__ */ i({
|
|
67
|
-
__name: "CreateMcpForm",
|
|
68
|
-
props: { showOverview: {
|
|
69
|
-
type: Boolean,
|
|
70
|
-
default: !1
|
|
71
|
-
} },
|
|
72
|
-
setup(e, { expose: i }) {
|
|
73
|
-
let M = e, { t: N } = t(), { previewImage: P } = n(), F = g(null), I = g(null), { rulesObj: L, communicationTypeOpts: R } = O(), z = h({
|
|
74
|
-
icon: "",
|
|
75
|
-
iconUrl: "",
|
|
76
|
-
name: "",
|
|
77
|
-
description: "",
|
|
78
|
-
overview: "",
|
|
79
|
-
communicationType: "HTTP",
|
|
80
|
-
address: "",
|
|
81
|
-
applyLink: ""
|
|
82
|
-
}), B = g(R), V = g({ auth: {
|
|
83
|
-
authType: "none",
|
|
84
|
-
keyType: "custom",
|
|
85
|
-
paramLocation: "header",
|
|
86
|
-
paramName: "",
|
|
87
|
-
paramValue: "",
|
|
88
|
-
token: ""
|
|
89
|
-
} }), H = g({ ...L }), U = () => {
|
|
90
|
-
M.showOverview ? H.value.overview = L.overview : delete H.value.overview;
|
|
91
|
-
};
|
|
92
|
-
y(() => M.showOverview, () => {
|
|
93
|
-
U();
|
|
94
|
-
}, { immediate: !0 });
|
|
95
|
-
let W = g([]), G = (e) => {
|
|
96
|
-
z.iconUrl = e.url, z.icon = e.bnid, W.value = [e];
|
|
97
|
-
}, K = () => {
|
|
98
|
-
z.iconUrl = "", z.icon = "", W.value = [];
|
|
99
|
-
}, q = (e) => {
|
|
100
|
-
P(e.url);
|
|
101
|
-
};
|
|
102
|
-
return i({
|
|
103
|
-
validate: async (e) => {
|
|
104
|
-
if (!F.value) return !1;
|
|
105
|
-
if (U(), I.value?.validateField) {
|
|
106
|
-
let t = I.value.validateField();
|
|
107
|
-
if (Object.keys(t).length > 0) return t.paramName ? T.error(N("LIBRARY_CREATEMCPFORM.PARAMETER_NAME_REQUIRED") || "请输入密钥参数名") : t.paramValue || t.token ? T.error(N("LIBRARY_CREATEMCPFORM.INPUT_API_KEY_REQUIRED") || "请输入密钥值") : T.error(N("LIBRARY_CREATEMCPFORM.MCP_AUTH_REQUIRED") || "请完善鉴权信息"), e?.(Error(N("LIBRARY_CREATEMCPFORM.MCP_AUTH_REQUIRED") || "请完善鉴权信息")), !1;
|
|
108
|
-
}
|
|
109
|
-
return F.value.validate(e);
|
|
110
|
-
},
|
|
111
|
-
getFormData: () => ({
|
|
112
|
-
name: z.name,
|
|
113
|
-
icon: z.icon,
|
|
114
|
-
description: z.description,
|
|
115
|
-
overview: M.showOverview ? z.overview : "",
|
|
116
|
-
address: z.address,
|
|
117
|
-
communicationType: z.communicationType,
|
|
118
|
-
authType: V.value.auth.authType === "none" ? 0 : 1,
|
|
119
|
-
authLocation: V.value.auth.paramLocation === "header" ? 0 : 1,
|
|
120
|
-
apiKeyName: V.value.auth.keyType === "bearer" ? "Authorization" : V.value.auth.paramName || "",
|
|
121
|
-
apiKeyValue: V.value.auth.keyType === "bearer" ? V.value.auth.token ? `Bearer ${V.value.auth.token}` : "" : V.value.auth.paramValue || "",
|
|
122
|
-
applyLink: z.applyLink || "",
|
|
123
|
-
headerPrefixType: 1
|
|
124
|
-
}),
|
|
125
|
-
setFormData: (e) => {
|
|
126
|
-
if (!e) return;
|
|
127
|
-
Object.assign(z, {
|
|
128
|
-
name: e.name || "",
|
|
129
|
-
description: e.description || "",
|
|
130
|
-
overview: e.overview || "",
|
|
131
|
-
icon: e.icon || "",
|
|
132
|
-
iconUrl: e.iconUrl || "",
|
|
133
|
-
communicationType: e.communicationType || "SSE",
|
|
134
|
-
address: e.address || "",
|
|
135
|
-
applyLink: e.applyLink || ""
|
|
136
|
-
});
|
|
137
|
-
let t = e.authType === 1 || e.authType === "1";
|
|
138
|
-
if (V.value.auth.authType = t ? "apiKey" : "none", V.value.auth.paramLocation = e.authLocation === 0 || e.authLocation === "0" ? "header" : "query", t) {
|
|
139
|
-
let t = !e.apiKeyName || e.apiKeyName === "Authorization";
|
|
140
|
-
if (V.value.auth.keyType = t ? "bearer" : "custom", t) {
|
|
141
|
-
V.value.auth.paramName = "", V.value.auth.paramValue = "";
|
|
142
|
-
let t = e.apiKeyValue || "";
|
|
143
|
-
V.value.auth.token = t.startsWith("Bearer ") ? t.substring(7) : t;
|
|
144
|
-
} else V.value.auth.paramName = e.apiKeyName || "", V.value.auth.paramValue = e.apiKeyValue || "", V.value.auth.token = "";
|
|
145
|
-
} else V.value.auth.keyType = "custom", V.value.auth.paramName = "", V.value.auth.paramValue = "", V.value.auth.token = "";
|
|
146
|
-
e.icon && e.icon !== "0" && e.iconUrl && (W.value = [{
|
|
147
|
-
bnid: e.icon,
|
|
148
|
-
url: e.iconUrl
|
|
149
|
-
}]);
|
|
150
|
-
}
|
|
151
|
-
}), (t, n) => (m(), l(v(x), {
|
|
152
|
-
ref_key: "ruleFormRef",
|
|
153
|
-
ref: F,
|
|
154
|
-
model: z,
|
|
155
|
-
rules: H.value,
|
|
156
|
-
"label-width": "auto",
|
|
157
|
-
"label-position": "top",
|
|
158
|
-
class: "scrollable-form"
|
|
159
|
-
}, {
|
|
160
|
-
default: b(() => [
|
|
161
|
-
p(v(S), {
|
|
162
|
-
class: "scrollable-form__item",
|
|
163
|
-
label: v(N)("LIBRARY_CREATEMCPFORM.MCP_ICON"),
|
|
164
|
-
prop: "icon"
|
|
165
|
-
}, {
|
|
166
|
-
label: b(() => [d("div", k, [d("span", null, _(v(N)("LIBRARY_CREATEMCPFORM.MCP_ICON")), 1), p(v(E), { placement: "top" }, {
|
|
167
|
-
content: b(() => [
|
|
168
|
-
f(_(v(N)("LIBRARY_CREATEMCPFORM.MCP_ICON_TIP")), 1),
|
|
169
|
-
n[7] ||= d("br", null, null, -1),
|
|
170
|
-
f(" " + _(v(N)("LIBRARY_CREATEMCPFORM.MCP_ICON_SIZE_TIP")), 1)
|
|
171
|
-
]),
|
|
172
|
-
default: b(() => [p(v(C), {
|
|
173
|
-
size: "14px",
|
|
174
|
-
color: "#999"
|
|
175
|
-
}, {
|
|
176
|
-
default: b(() => [p(v(D))]),
|
|
177
|
-
_: 1
|
|
178
|
-
})]),
|
|
179
|
-
_: 1
|
|
180
|
-
})])]),
|
|
181
|
-
default: b(() => [p(v(r), {
|
|
182
|
-
fileList: W.value,
|
|
183
|
-
previewType: "Card",
|
|
184
|
-
isCustom: !0,
|
|
185
|
-
onOnRemove: K,
|
|
186
|
-
onOnPreview: q
|
|
187
|
-
}, {
|
|
188
|
-
CardUploader: b(() => [W.value.length === 0 ? (m(), l(v(a), {
|
|
189
|
-
key: 0,
|
|
190
|
-
"upload-type": "Card",
|
|
191
|
-
onOnSuccess: G,
|
|
192
|
-
limitSize: 5,
|
|
193
|
-
acceptType: ".jpg,.png",
|
|
194
|
-
businessType: "mcp",
|
|
195
|
-
defaultUploadIcon: "mcp"
|
|
196
|
-
})) : u("", !0)]),
|
|
197
|
-
_: 1
|
|
198
|
-
}, 8, ["fileList"])]),
|
|
199
|
-
_: 1
|
|
200
|
-
}, 8, ["label"]),
|
|
201
|
-
p(v(S), {
|
|
202
|
-
class: "scrollable-form__item",
|
|
203
|
-
label: v(N)("LIBRARY_CREATEMCPFORM.MCP_NAME"),
|
|
204
|
-
prop: "name"
|
|
205
|
-
}, {
|
|
206
|
-
default: b(() => [p(v(w), {
|
|
207
|
-
modelValue: z.name,
|
|
208
|
-
"onUpdate:modelValue": n[0] ||= (e) => z.name = e,
|
|
209
|
-
placeholder: v(N)("LIBRARY_CREATEMCPFORM.MCP_NAME_REQUIRED"),
|
|
210
|
-
maxlength: "20",
|
|
211
|
-
"show-word-limit": ""
|
|
212
|
-
}, null, 8, ["modelValue", "placeholder"])]),
|
|
213
|
-
_: 1
|
|
214
|
-
}, 8, ["label"]),
|
|
215
|
-
p(v(S), {
|
|
216
|
-
class: "scrollable-form__item",
|
|
217
|
-
label: v(N)("LIBRARY_CREATEMCPFORM.MCP_DESCRIPTION"),
|
|
218
|
-
prop: "description"
|
|
219
|
-
}, {
|
|
220
|
-
default: b(() => [p(v(w), {
|
|
221
|
-
modelValue: z.description,
|
|
222
|
-
"onUpdate:modelValue": n[1] ||= (e) => z.description = e,
|
|
223
|
-
type: "textarea",
|
|
224
|
-
rows: 3,
|
|
225
|
-
placeholder: v(N)("LIBRARY_CREATEMCPFORM.MCP_DESCRIPTION_REQUIRED"),
|
|
226
|
-
maxlength: "200",
|
|
227
|
-
"show-word-limit": ""
|
|
228
|
-
}, null, 8, ["modelValue", "placeholder"])]),
|
|
229
|
-
_: 1
|
|
230
|
-
}, 8, ["label"]),
|
|
231
|
-
e.showOverview ? (m(), l(v(S), {
|
|
232
|
-
key: 0,
|
|
233
|
-
class: "scrollable-form__item",
|
|
234
|
-
label: v(N)("LIBRARY_CREATEMCPFORM.MCP_OVERVIEW"),
|
|
235
|
-
prop: "overview"
|
|
236
|
-
}, {
|
|
237
|
-
default: b(() => [p(v(c), {
|
|
238
|
-
modelValue: z.overview,
|
|
239
|
-
"onUpdate:modelValue": n[2] ||= (e) => z.overview = e,
|
|
240
|
-
height: "300px",
|
|
241
|
-
placeholder: v(N)("LIBRARY_CREATEMCPFORM.MCP_OVERVIEW_REQUIRED"),
|
|
242
|
-
businessType: "mcp"
|
|
243
|
-
}, null, 8, ["modelValue", "placeholder"])]),
|
|
244
|
-
_: 1
|
|
245
|
-
}, 8, ["label"])) : u("", !0),
|
|
246
|
-
p(v(S), {
|
|
247
|
-
class: "scrollable-form__item",
|
|
248
|
-
label: v(N)("LIBRARY_CREATEMCPFORM.TRANSFER_METHOD"),
|
|
249
|
-
prop: "communicationType"
|
|
250
|
-
}, {
|
|
251
|
-
default: b(() => [p(v(o), {
|
|
252
|
-
modelValue: z.communicationType,
|
|
253
|
-
"onUpdate:modelValue": n[3] ||= (e) => z.communicationType = e,
|
|
254
|
-
options: B.value,
|
|
255
|
-
layout: "vertical",
|
|
256
|
-
"class-name": "scrollable-form__item-radio"
|
|
257
|
-
}, null, 8, ["modelValue", "options"])]),
|
|
258
|
-
_: 1
|
|
259
|
-
}, 8, ["label"]),
|
|
260
|
-
p(v(S), {
|
|
261
|
-
class: "scrollable-form__item",
|
|
262
|
-
label: v(N)("LIBRARY_CREATEMCPFORM.SERVICE_URL"),
|
|
263
|
-
prop: "address"
|
|
264
|
-
}, {
|
|
265
|
-
default: b(() => [p(v(w), {
|
|
266
|
-
modelValue: z.address,
|
|
267
|
-
"onUpdate:modelValue": n[4] ||= (e) => z.address = e,
|
|
268
|
-
placeholder: v(N)("LIBRARY_CREATEMCPFORM.SERVICE_URL_REQUIRED")
|
|
269
|
-
}, null, 8, ["modelValue", "placeholder"])]),
|
|
270
|
-
_: 1
|
|
271
|
-
}, 8, ["label"]),
|
|
272
|
-
V.value.auth.authType === "apiKey" ? (m(), l(v(S), {
|
|
273
|
-
key: 1,
|
|
274
|
-
class: "scrollable-form__item",
|
|
275
|
-
prop: "applyLink"
|
|
276
|
-
}, {
|
|
277
|
-
label: b(() => [d("div", A, [d("span", null, _(v(N)("LIBRARY_CREATEMCPFORM.DOCUMENTATION_URL")), 1), p(v(E), { placement: "top" }, {
|
|
278
|
-
content: b(() => [f(_(v(N)("LIBRARY_CREATEMCPFORM.DOCUMENTATION_URL_TIP")), 1)]),
|
|
279
|
-
default: b(() => [p(v(C), {
|
|
280
|
-
size: "14px",
|
|
281
|
-
color: "#999"
|
|
282
|
-
}, {
|
|
283
|
-
default: b(() => [p(v(D))]),
|
|
284
|
-
_: 1
|
|
285
|
-
})]),
|
|
286
|
-
_: 1
|
|
287
|
-
})])]),
|
|
288
|
-
default: b(() => [p(v(w), {
|
|
289
|
-
modelValue: z.applyLink,
|
|
290
|
-
"onUpdate:modelValue": n[5] ||= (e) => z.applyLink = e,
|
|
291
|
-
placeholder: v(N)("LIBRARY_CREATEMCPFORM.DOCUMENTATION_URL_REQUIRED")
|
|
292
|
-
}, null, 8, ["modelValue", "placeholder"])]),
|
|
293
|
-
_: 1
|
|
294
|
-
})) : u("", !0),
|
|
295
|
-
d("div", j, [p(v(s), {
|
|
296
|
-
ref_key: "authSectionRef",
|
|
297
|
-
ref: I,
|
|
298
|
-
featData: V.value,
|
|
299
|
-
"onUpdate:featData": n[6] ||= (e) => V.value = e,
|
|
300
|
-
layout: "vertical"
|
|
301
|
-
}, null, 8, ["featData"])])
|
|
302
|
-
]),
|
|
303
|
-
_: 1
|
|
304
|
-
}, 8, ["model", "rules"]));
|
|
305
|
-
}
|
|
306
|
-
}, [["__scopeId", "data-v-b8579cd8"]]));
|
|
307
|
-
//#endregion
|
|
308
|
-
export { M as t };
|