@fefeding/aicmd 1.0.26 → 1.0.27

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.
Files changed (77) hide show
  1. package/README.md +58 -5
  2. package/README.zh.md +64 -5
  3. package/dist/public/.vite/manifest.json +133 -13
  4. package/dist/public/ai-settings.css +1868 -0
  5. package/dist/public/ai-settings.js +7579 -0
  6. package/dist/public/bootstrap-icons.woff +0 -0
  7. package/dist/public/bootstrap-icons.woff2 +0 -0
  8. package/dist/public/bootstrap.css +1 -1
  9. package/dist/public/bootstrap.js +60 -119
  10. package/dist/public/connection-editor.css +5 -0
  11. package/dist/public/connection-editor.js +712 -0
  12. package/dist/public/connection.js +118 -0
  13. package/dist/public/index.css +0 -381
  14. package/dist/public/index.js +186 -5467
  15. package/dist/public/rdp_client_bg.wasm +0 -0
  16. package/dist/public/selection-copy.css +494 -0
  17. package/dist/public/selection-copy.js +5501 -0
  18. package/dist/public/src/term.html +17 -0
  19. package/dist/public/src/vscode-edit.html +21 -0
  20. package/dist/public/src/vscode-term.html +24 -0
  21. package/dist/public/term.css +14 -0
  22. package/dist/public/term.js +333 -0
  23. package/dist/public/views.css +111 -1515
  24. package/dist/public/views.js +233 -7476
  25. package/dist/public/vscode-clipboard.js +658 -0
  26. package/dist/public/vscode-edit.js +91 -0
  27. package/dist/public/vscode-term.js +116 -0
  28. package/dist/public/vue.js +360 -195
  29. package/dist/public/xterm.js +1647 -10
  30. package/dist/public/zmodem.js +2726 -0
  31. package/dist/server/index.d.ts +12 -2
  32. package/dist/server/index.d.ts.map +1 -1
  33. package/dist/server/index.js +14 -1
  34. package/dist/server/index.js.map +1 -1
  35. package/dist/server/index.ts +14 -1
  36. package/dist/server/model/connection.entity.d.ts +10 -2
  37. package/dist/server/model/connection.entity.d.ts.map +1 -1
  38. package/dist/server/model/connection.entity.js +9 -1
  39. package/dist/server/model/connection.entity.js.map +1 -1
  40. package/dist/server/model/connection.entity.ts +11 -2
  41. package/dist/server/service/ai.service.d.ts +15 -0
  42. package/dist/server/service/ai.service.d.ts.map +1 -1
  43. package/dist/server/service/ai.service.js +38 -6
  44. package/dist/server/service/ai.service.js.map +1 -1
  45. package/dist/server/service/ai.service.ts +43 -6
  46. package/dist/server/service/rdp-tunnel.service.d.ts +22 -0
  47. package/dist/server/service/rdp-tunnel.service.d.ts.map +1 -0
  48. package/dist/server/service/rdp-tunnel.service.js +464 -0
  49. package/dist/server/service/rdp-tunnel.service.js.map +1 -0
  50. package/dist/server/service/rdp-tunnel.service.ts +428 -0
  51. package/dist/server/service/rdp.service.d.ts +64 -0
  52. package/dist/server/service/rdp.service.d.ts.map +1 -0
  53. package/dist/server/service/rdp.service.js +324 -0
  54. package/dist/server/service/rdp.service.js.map +1 -0
  55. package/dist/server/service/rdp.service.ts +324 -0
  56. package/dist/server/service/ssh.service.d.ts +57 -1
  57. package/dist/server/service/ssh.service.d.ts.map +1 -1
  58. package/dist/server/service/ssh.service.js +457 -107
  59. package/dist/server/service/ssh.service.js.map +1 -1
  60. package/dist/server/service/ssh.service.ts +452 -105
  61. package/dist/server/utils/ansi.d.ts +20 -0
  62. package/dist/server/utils/ansi.d.ts.map +1 -0
  63. package/dist/server/utils/ansi.js +39 -0
  64. package/dist/server/utils/ansi.js.map +1 -0
  65. package/dist/server/utils/ansi.ts +34 -0
  66. package/dist/server/utils/rdp-ws.d.ts +15 -0
  67. package/dist/server/utils/rdp-ws.d.ts.map +1 -0
  68. package/dist/server/utils/rdp-ws.js +28 -0
  69. package/dist/server/utils/rdp-ws.js.map +1 -0
  70. package/dist/server/utils/rdp-ws.ts +32 -0
  71. package/dist/view/index.html +9 -7
  72. package/electron/main.js +118 -3
  73. package/electron/preload.js +4 -0
  74. package/package.json +32 -31
  75. package/public/aicmd.png +0 -0
  76. package/server.js +132 -12
  77. package/dist/public/rolldown-runtime.js +0 -41
@@ -0,0 +1,712 @@
1
+ import { m as __esmMin } from "./vscode-clipboard.js";
2
+ import { C as createBlock, E as createTextVNode, H as withCtx, L as openBlock, N as nextTick, O as defineComponent, Q as ref, S as createBaseVNode, T as createElementBlock, U as withDirectives, V as watch, Z as reactive, _ as vShow, at as toDisplayString, c as useI18n, f as vModelCheckbox, g as vModelText, h as vModelSelect, l as init_vue_runtime_esm_bundler, m as vModelRadio, rt as normalizeClass, s as init_vue_i18n, tt as unref, w as createCommentVNode, x as computed, y as withModifiers } from "./vue.js";
3
+ import { D as init_toast, O as toast, c as init_modal, f as _plugin_vue_export_helper_default, l as modal_default, p as init__plugin_vue_export_helper } from "./selection-copy.js";
4
+ import { n as init_connection, t as ConnectionService } from "./connection.js";
5
+ // src/components/connection-editor/index.vue?vue&type=script&setup=true&lang.ts
6
+ var _hoisted_1, _hoisted_2, _hoisted_3, _hoisted_4, _hoisted_5, _hoisted_6, _hoisted_7, _hoisted_8, _hoisted_9, _hoisted_10, _hoisted_11, _hoisted_12, _hoisted_13, _hoisted_14, _hoisted_15, _hoisted_16, _hoisted_17, _hoisted_18, _hoisted_19, _hoisted_20, _hoisted_21, _hoisted_22, _hoisted_23, _hoisted_24, _hoisted_25, _hoisted_26, _hoisted_27, _hoisted_28, _hoisted_29, _hoisted_30, _hoisted_31, _hoisted_32, _hoisted_33, _hoisted_34, _hoisted_35, _hoisted_36, _hoisted_37, _hoisted_38, _hoisted_39, _hoisted_40, _hoisted_41, _hoisted_42, _hoisted_43, _hoisted_44, _hoisted_45, _hoisted_46, _hoisted_47, _hoisted_48, _hoisted_49, _hoisted_50, _hoisted_51, _hoisted_52, _hoisted_53, _hoisted_54, _hoisted_55, _hoisted_56, _hoisted_57, _hoisted_58, _hoisted_59, _hoisted_60, _hoisted_61, _hoisted_62, _hoisted_63, _hoisted_64, _hoisted_65, _hoisted_66, _hoisted_67, _hoisted_68, _hoisted_69, _hoisted_70, _hoisted_71, _hoisted_72, _hoisted_73, _hoisted_74, _hoisted_75, _hoisted_76, _hoisted_77, _hoisted_78, _hoisted_79, _hoisted_80, _hoisted_81, _hoisted_82, _hoisted_83, _hoisted_84, _hoisted_85, _hoisted_86, _hoisted_87, _hoisted_88, _hoisted_89, _hoisted_90, _hoisted_91, _hoisted_92, _hoisted_93, _hoisted_94, _hoisted_95, _hoisted_96, index_vue_vue_type_script_setup_true_lang_default;
7
+ var init_index_vue_vue_type_script_setup_true_lang = __esmMin((() => {
8
+ init_vue_runtime_esm_bundler();
9
+ init_vue_i18n();
10
+ init_modal();
11
+ init_connection();
12
+ init_toast();
13
+ _hoisted_1 = { class: "mb-3" };
14
+ _hoisted_2 = { class: "form-label fw-bold" };
15
+ _hoisted_3 = ["placeholder"];
16
+ _hoisted_4 = { class: "mb-3" };
17
+ _hoisted_5 = { class: "form-label fw-bold" };
18
+ _hoisted_6 = {
19
+ class: "btn-group w-100",
20
+ role: "group"
21
+ };
22
+ _hoisted_7 = {
23
+ class: "btn btn-outline-primary",
24
+ for: "type-ssh"
25
+ };
26
+ _hoisted_8 = {
27
+ class: "btn btn-outline-primary",
28
+ for: "type-rdp"
29
+ };
30
+ _hoisted_9 = { class: "row mb-3" };
31
+ _hoisted_10 = { class: "col-8" };
32
+ _hoisted_11 = { class: "form-label fw-bold" };
33
+ _hoisted_12 = ["placeholder", "required"];
34
+ _hoisted_13 = { class: "col-4" };
35
+ _hoisted_14 = { class: "form-label fw-bold" };
36
+ _hoisted_15 = {
37
+ key: 0,
38
+ class: "mb-3"
39
+ };
40
+ _hoisted_16 = { class: "form-label fw-bold" };
41
+ _hoisted_17 = { value: "auto" };
42
+ _hoisted_18 = { value: "linux" };
43
+ _hoisted_19 = { value: "macos" };
44
+ _hoisted_20 = { value: "windows" };
45
+ _hoisted_21 = { class: "form-text text-muted d-block" };
46
+ _hoisted_22 = { class: "mb-3" };
47
+ _hoisted_23 = { class: "form-label fw-bold" };
48
+ _hoisted_24 = ["placeholder", "required"];
49
+ _hoisted_25 = {
50
+ key: 1,
51
+ class: "mb-3 p-3 border rounded"
52
+ };
53
+ _hoisted_26 = { class: "fw-bold mb-2" };
54
+ _hoisted_27 = { class: "row g-2" };
55
+ _hoisted_28 = { class: "col-md-6" };
56
+ _hoisted_29 = { class: "form-label" };
57
+ _hoisted_30 = ["placeholder"];
58
+ _hoisted_31 = { class: "col-md-3" };
59
+ _hoisted_32 = { class: "form-label" };
60
+ _hoisted_33 = { class: "col-md-3" };
61
+ _hoisted_34 = { class: "form-label" };
62
+ _hoisted_35 = { class: "form-text text-muted d-block mt-2" };
63
+ _hoisted_36 = {
64
+ key: 2,
65
+ class: "mb-3"
66
+ };
67
+ _hoisted_37 = { class: "form-label fw-bold" };
68
+ _hoisted_38 = {
69
+ class: "btn-group w-100",
70
+ role: "group"
71
+ };
72
+ _hoisted_39 = {
73
+ class: "btn btn-outline-primary",
74
+ for: "auth-auto"
75
+ };
76
+ _hoisted_40 = {
77
+ class: "btn btn-outline-primary",
78
+ for: "auth-password"
79
+ };
80
+ _hoisted_41 = {
81
+ class: "btn btn-outline-primary",
82
+ for: "auth-key"
83
+ };
84
+ _hoisted_42 = {
85
+ key: 0,
86
+ class: "form-text text-muted"
87
+ };
88
+ _hoisted_43 = {
89
+ key: 3,
90
+ class: "mb-3"
91
+ };
92
+ _hoisted_44 = { class: "form-label fw-bold" };
93
+ _hoisted_45 = ["placeholder"];
94
+ _hoisted_46 = {
95
+ key: 4,
96
+ class: "mb-3"
97
+ };
98
+ _hoisted_47 = { class: "form-label fw-bold" };
99
+ _hoisted_48 = ["placeholder"];
100
+ _hoisted_49 = { class: "mt-2" };
101
+ _hoisted_50 = { class: "form-label" };
102
+ _hoisted_51 = ["placeholder"];
103
+ _hoisted_52 = { class: "mt-2" };
104
+ _hoisted_53 = {
105
+ key: 5,
106
+ class: "card mb-3"
107
+ };
108
+ _hoisted_54 = { class: "card-body" };
109
+ _hoisted_55 = { class: "form-check mb-2" };
110
+ _hoisted_56 = {
111
+ class: "form-check-label",
112
+ for: "forwardAgent"
113
+ };
114
+ _hoisted_57 = { class: "form-text text-muted d-block" };
115
+ _hoisted_58 = ["placeholder"];
116
+ _hoisted_59 = { class: "form-text text-muted mt-1 d-block" };
117
+ _hoisted_60 = {
118
+ key: 6,
119
+ class: "card mb-3"
120
+ };
121
+ _hoisted_61 = { class: "card-body" };
122
+ _hoisted_62 = { class: "form-check mb-2" };
123
+ _hoisted_63 = {
124
+ class: "form-check-label",
125
+ for: "keepaliveEnabled"
126
+ };
127
+ _hoisted_64 = { class: "form-text text-muted d-block" };
128
+ _hoisted_65 = {
129
+ key: 0,
130
+ class: "row mb-2"
131
+ };
132
+ _hoisted_66 = { class: "col-6" };
133
+ _hoisted_67 = { class: "form-label" };
134
+ _hoisted_68 = ["placeholder"];
135
+ _hoisted_69 = { class: "form-text text-muted" };
136
+ _hoisted_70 = { class: "col-6" };
137
+ _hoisted_71 = { class: "form-label" };
138
+ _hoisted_72 = ["placeholder"];
139
+ _hoisted_73 = { class: "form-text text-muted" };
140
+ _hoisted_74 = {
141
+ key: 7,
142
+ class: "card mb-3"
143
+ };
144
+ _hoisted_75 = { class: "card-body" };
145
+ _hoisted_76 = { class: "row mb-2" };
146
+ _hoisted_77 = { class: "col-6" };
147
+ _hoisted_78 = { class: "form-label" };
148
+ _hoisted_79 = { class: "col-6" };
149
+ _hoisted_80 = { class: "form-label" };
150
+ _hoisted_81 = { value: "block" };
151
+ _hoisted_82 = { value: "underline" };
152
+ _hoisted_83 = { value: "bar" };
153
+ _hoisted_84 = { class: "row mb-2" };
154
+ _hoisted_85 = { class: "col-6" };
155
+ _hoisted_86 = { class: "form-label" };
156
+ _hoisted_87 = { value: "dark" };
157
+ _hoisted_88 = { value: "light" };
158
+ _hoisted_89 = { class: "col-6" };
159
+ _hoisted_90 = { class: "form-label" };
160
+ _hoisted_91 = { class: "d-flex justify-content-between" };
161
+ _hoisted_92 = ["disabled"];
162
+ _hoisted_93 = {
163
+ key: 0,
164
+ class: "spinner-border spinner-border-sm me-1"
165
+ };
166
+ _hoisted_94 = {
167
+ key: 1,
168
+ class: "bi bi-plug me-1"
169
+ };
170
+ _hoisted_95 = ["disabled"];
171
+ _hoisted_96 = {
172
+ key: 0,
173
+ class: "spinner-border spinner-border-sm me-1"
174
+ };
175
+ index_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
176
+ __name: "index",
177
+ props: { embedded: {
178
+ type: Boolean,
179
+ default: false
180
+ } },
181
+ emits: ["saved", "close"],
182
+ setup(__props, { expose: __expose, emit: __emit }) {
183
+ const { t } = useI18n();
184
+ const props = __props;
185
+ const connectionModal = ref();
186
+ const editingConnection = ref(null);
187
+ const showTerminalConfig = ref(false);
188
+ const showStartupScript = ref(false);
189
+ const showKeepaliveConfig = ref(false);
190
+ const testing = ref(false);
191
+ const saving = ref(false);
192
+ const keepaliveEnabled = ref(true);
193
+ const keepaliveInterval = ref(1e4);
194
+ const keepaliveCountMax = ref(3);
195
+ const defaultForm = () => ({
196
+ name: "",
197
+ type: "ssh",
198
+ host: "",
199
+ port: 22,
200
+ username: "root",
201
+ platform: "auto",
202
+ authType: "auto",
203
+ password: "",
204
+ privateKey: "",
205
+ passphrase: "",
206
+ startupScript: "",
207
+ forwardAgent: false,
208
+ terminal: {
209
+ cols: 80,
210
+ rows: 24,
211
+ fontSize: 14,
212
+ fontFamily: "Menlo, Monaco, \"Courier New\", monospace",
213
+ theme: "dark",
214
+ cursorStyle: "block"
215
+ },
216
+ options: {},
217
+ enabled: true
218
+ });
219
+ const form = reactive(defaultForm());
220
+ let skipTypeWatch = false;
221
+ watch(() => form.type, (newType, oldType) => {
222
+ if (skipTypeWatch || newType === oldType) return;
223
+ if (newType === "rdp") {
224
+ if (form.port === 22) form.port = 3389;
225
+ if (form.username === "root") form.username = "";
226
+ form.authType = "password";
227
+ } else if (newType === "ssh") {
228
+ if (form.port === 3389) form.port = 22;
229
+ if (form.username === "") form.username = "root";
230
+ if (form.authType === "password" && !form.password) form.authType = "auto";
231
+ }
232
+ });
233
+ const isRdp = computed(() => form.type === "rdp");
234
+ const rdpOptions = reactive({
235
+ domain: "",
236
+ width: 1280,
237
+ height: 800
238
+ });
239
+ const connectionService = new ConnectionService();
240
+ function open(connection) {
241
+ skipTypeWatch = true;
242
+ if (connection) {
243
+ editingConnection.value = connection.id;
244
+ Object.assign(form, defaultForm(), connection);
245
+ if (!form.platform) form.platform = "auto";
246
+ showStartupScript.value = !!connection.startupScript || !!connection.forwardAgent;
247
+ if (connection.options?.keepaliveInterval !== void 0) keepaliveInterval.value = connection.options.keepaliveInterval;
248
+ else keepaliveInterval.value = 1e4;
249
+ if (connection.options?.keepaliveCountMax !== void 0) keepaliveCountMax.value = connection.options.keepaliveCountMax;
250
+ else keepaliveCountMax.value = 3;
251
+ keepaliveEnabled.value = connection.options?.keepaliveInterval !== void 0 || connection.options?.keepaliveCountMax !== void 0;
252
+ showKeepaliveConfig.value = keepaliveEnabled.value;
253
+ const rOpts = connection.options?.rdp || {};
254
+ rdpOptions.domain = rOpts.domain || "";
255
+ rdpOptions.width = rOpts.width || 1280;
256
+ rdpOptions.height = rOpts.height || 800;
257
+ if (connection.type === "rdp" && !connection.port) form.port = 3389;
258
+ } else {
259
+ editingConnection.value = null;
260
+ Object.assign(form, defaultForm());
261
+ showStartupScript.value = false;
262
+ showKeepaliveConfig.value = false;
263
+ keepaliveEnabled.value = true;
264
+ keepaliveInterval.value = 1e4;
265
+ keepaliveCountMax.value = 3;
266
+ rdpOptions.domain = "";
267
+ rdpOptions.width = 1280;
268
+ rdpOptions.height = 800;
269
+ }
270
+ nextTick(() => {
271
+ skipTypeWatch = false;
272
+ });
273
+ if (!props.embedded) connectionModal.value?.show();
274
+ }
275
+ function close() {
276
+ if (!props.embedded) connectionModal.value?.hide();
277
+ }
278
+ function cancel() {
279
+ if (props.embedded) {
280
+ emit("close");
281
+ return;
282
+ }
283
+ connectionModal.value?.hide();
284
+ }
285
+ function handleModalClose() {
286
+ editingConnection.value = null;
287
+ }
288
+ async function saveConnection() {
289
+ if (!form.name) {
290
+ toast.warning(t("connection.nameRequired"));
291
+ return;
292
+ }
293
+ if (!form.host || !form.username) {
294
+ toast.warning(t("connection.hostUsernameRequired"));
295
+ return;
296
+ }
297
+ saving.value = true;
298
+ try {
299
+ if (form.type === "rdp") {
300
+ form.port = form.port || 3389;
301
+ form.authType = "password";
302
+ form.options = {
303
+ ...form.options,
304
+ rdp: { ...rdpOptions }
305
+ };
306
+ }
307
+ if (keepaliveEnabled.value) form.options = {
308
+ ...form.options,
309
+ keepaliveInterval: keepaliveInterval.value,
310
+ keepaliveCountMax: keepaliveCountMax.value
311
+ };
312
+ else form.options = {
313
+ ...form.options,
314
+ keepaliveInterval: 0,
315
+ keepaliveCountMax: 0
316
+ };
317
+ if (editingConnection.value) await connectionService.updateConnection(editingConnection.value, { ...form });
318
+ else await connectionService.addConnection({ ...form });
319
+ toast.success(t("connection.saveSuccess"));
320
+ close();
321
+ emit("saved");
322
+ } catch (e) {
323
+ toast.error(e.message || t("connection.saveFailed"));
324
+ } finally {
325
+ saving.value = false;
326
+ }
327
+ }
328
+ async function testConn() {
329
+ if (!form.host || !form.username) {
330
+ toast.warning(t("connection.hostUsernameTestRequired"));
331
+ return;
332
+ }
333
+ testing.value = true;
334
+ try {
335
+ if (await connectionService.testConnection({ ...form })) toast.success(t("connection.testSuccess"));
336
+ else toast.error(t("connection.testFailed"));
337
+ } catch (e) {
338
+ toast.error(e.message || t("connection.testError"));
339
+ } finally {
340
+ testing.value = false;
341
+ }
342
+ }
343
+ async function loadPrivateKey() {
344
+ const chooser = document.createElement("input");
345
+ chooser.type = "file";
346
+ chooser.accept = ".pem,.key,.pub,.rsa";
347
+ chooser.style.display = "none";
348
+ chooser.addEventListener("change", async () => {
349
+ if (chooser.files?.length) try {
350
+ const text = await chooser.files[0].text();
351
+ form.privateKey = text;
352
+ toast.success(t("connection.privateKeyLoaded"));
353
+ } catch (e) {
354
+ toast.error(e.message || t("connection.privateKeyLoadFailed"));
355
+ }
356
+ });
357
+ document.body.appendChild(chooser);
358
+ chooser.click();
359
+ setTimeout(() => {
360
+ if (chooser.parentNode) document.body.removeChild(chooser);
361
+ }, 0);
362
+ }
363
+ const emit = __emit;
364
+ __expose({
365
+ open,
366
+ close
367
+ });
368
+ return (_ctx, _cache) => {
369
+ return openBlock(), createBlock(modal_default, {
370
+ ref_key: "connectionModal",
371
+ ref: connectionModal,
372
+ title: editingConnection.value ? unref(t)("connection.editTitle") : unref(t)("connection.addTitle"),
373
+ closeButton: {
374
+ text: unref(t)("common.cancel"),
375
+ show: false
376
+ },
377
+ confirmButton: {
378
+ text: "",
379
+ show: false
380
+ },
381
+ dialogStyle: {
382
+ maxWidth: "700px",
383
+ width: "100%"
384
+ },
385
+ embedded: __props.embedded,
386
+ onOnClose: handleModalClose
387
+ }, {
388
+ default: withCtx(() => [createBaseVNode("form", {
389
+ onSubmit: withModifiers(saveConnection, ["prevent"]),
390
+ class: "connection-form"
391
+ }, [
392
+ createBaseVNode("div", _hoisted_1, [createBaseVNode("label", _hoisted_2, [
393
+ _cache[28] || (_cache[28] = createBaseVNode("i", { class: "bi bi-tag me-1" }, null, -1)),
394
+ createTextVNode(toDisplayString(unref(t)("connection.name")) + " ", 1),
395
+ _cache[29] || (_cache[29] = createBaseVNode("span", { class: "text-danger" }, "*", -1))
396
+ ]), withDirectives(createBaseVNode("input", {
397
+ type: "text",
398
+ class: "form-control",
399
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => form.name = $event),
400
+ placeholder: unref(t)("connection.namePlaceholder"),
401
+ required: ""
402
+ }, null, 8, _hoisted_3), [[vModelText, form.name]])]),
403
+ createBaseVNode("div", _hoisted_4, [createBaseVNode("label", _hoisted_5, [_cache[30] || (_cache[30] = createBaseVNode("i", { class: "bi bi-diagram-3 me-1" }, null, -1)), createTextVNode(toDisplayString(unref(t)("connection.connType")), 1)]), createBaseVNode("div", _hoisted_6, [
404
+ withDirectives(createBaseVNode("input", {
405
+ type: "radio",
406
+ class: "btn-check",
407
+ name: "connType",
408
+ id: "type-ssh",
409
+ value: "ssh",
410
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => form.type = $event)
411
+ }, null, 512), [[vModelRadio, form.type]]),
412
+ createBaseVNode("label", _hoisted_7, [_cache[31] || (_cache[31] = createBaseVNode("i", { class: "bi bi-terminal me-1" }, null, -1)), createTextVNode(toDisplayString(unref(t)("connection.typeSsh")), 1)]),
413
+ withDirectives(createBaseVNode("input", {
414
+ type: "radio",
415
+ class: "btn-check",
416
+ name: "connType",
417
+ id: "type-rdp",
418
+ value: "rdp",
419
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => form.type = $event)
420
+ }, null, 512), [[vModelRadio, form.type]]),
421
+ createBaseVNode("label", _hoisted_8, [_cache[32] || (_cache[32] = createBaseVNode("i", { class: "bi bi-display me-1" }, null, -1)), createTextVNode(toDisplayString(unref(t)("connection.typeRdp")), 1)])
422
+ ])]),
423
+ createBaseVNode("div", _hoisted_9, [createBaseVNode("div", _hoisted_10, [createBaseVNode("label", _hoisted_11, [
424
+ _cache[33] || (_cache[33] = createBaseVNode("i", { class: "bi bi-server me-1" }, null, -1)),
425
+ createTextVNode(toDisplayString(unref(t)("connection.host")) + " ", 1),
426
+ _cache[34] || (_cache[34] = createBaseVNode("span", { class: "text-danger" }, "*", -1))
427
+ ]), withDirectives(createBaseVNode("input", {
428
+ type: "text",
429
+ class: "form-control",
430
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => form.host = $event),
431
+ placeholder: unref(t)("connection.hostPlaceholder"),
432
+ required: form.type !== "local"
433
+ }, null, 8, _hoisted_12), [[vModelText, form.host]])]), createBaseVNode("div", _hoisted_13, [createBaseVNode("label", _hoisted_14, [_cache[35] || (_cache[35] = createBaseVNode("i", { class: "bi bi-door-closed me-1" }, null, -1)), createTextVNode(toDisplayString(unref(t)("connection.port")), 1)]), withDirectives(createBaseVNode("input", {
434
+ type: "number",
435
+ class: "form-control",
436
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => form.port = $event),
437
+ min: "1",
438
+ max: "65535"
439
+ }, null, 512), [[
440
+ vModelText,
441
+ form.port,
442
+ void 0,
443
+ { number: true }
444
+ ]])])]),
445
+ form.type === "ssh" ? (openBlock(), createElementBlock("div", _hoisted_15, [
446
+ createBaseVNode("label", _hoisted_16, [_cache[36] || (_cache[36] = createBaseVNode("i", { class: "bi bi-cpu me-1" }, null, -1)), createTextVNode(toDisplayString(unref(t)("connection.platform")), 1)]),
447
+ withDirectives(createBaseVNode("select", {
448
+ class: "form-select",
449
+ "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => form.platform = $event)
450
+ }, [
451
+ createBaseVNode("option", _hoisted_17, toDisplayString(unref(t)("connection.platformAuto")), 1),
452
+ createBaseVNode("option", _hoisted_18, toDisplayString(unref(t)("connection.platformLinux")), 1),
453
+ createBaseVNode("option", _hoisted_19, toDisplayString(unref(t)("connection.platformMacos")), 1),
454
+ createBaseVNode("option", _hoisted_20, toDisplayString(unref(t)("connection.platformWindows")), 1)
455
+ ], 512), [[vModelSelect, form.platform]]),
456
+ createBaseVNode("small", _hoisted_21, [_cache[37] || (_cache[37] = createBaseVNode("i", { class: "bi bi-info-circle me-1" }, null, -1)), createTextVNode(toDisplayString(unref(t)("connection.platformHint")), 1)])
457
+ ])) : createCommentVNode("", true),
458
+ createBaseVNode("div", _hoisted_22, [createBaseVNode("label", _hoisted_23, [
459
+ _cache[38] || (_cache[38] = createBaseVNode("i", { class: "bi bi-person me-1" }, null, -1)),
460
+ createTextVNode(toDisplayString(unref(t)("connection.username")) + " ", 1),
461
+ _cache[39] || (_cache[39] = createBaseVNode("span", { class: "text-danger" }, "*", -1))
462
+ ]), withDirectives(createBaseVNode("input", {
463
+ type: "text",
464
+ class: "form-control",
465
+ "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => form.username = $event),
466
+ placeholder: unref(t)("connection.usernamePlaceholder"),
467
+ required: form.type !== "local"
468
+ }, null, 8, _hoisted_24), [[vModelText, form.username]])]),
469
+ form.type === "rdp" ? (openBlock(), createElementBlock("div", _hoisted_25, [
470
+ createBaseVNode("div", _hoisted_26, [_cache[40] || (_cache[40] = createBaseVNode("i", { class: "bi bi-display me-1" }, null, -1)), createTextVNode(toDisplayString(unref(t)("connection.rdpSettings")), 1)]),
471
+ createBaseVNode("div", _hoisted_27, [
472
+ createBaseVNode("div", _hoisted_28, [createBaseVNode("label", _hoisted_29, toDisplayString(unref(t)("connection.rdpDomain")), 1), withDirectives(createBaseVNode("input", {
473
+ type: "text",
474
+ class: "form-control form-control-sm",
475
+ "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => rdpOptions.domain = $event),
476
+ placeholder: unref(t)("connection.rdpDomainPlaceholder")
477
+ }, null, 8, _hoisted_30), [[vModelText, rdpOptions.domain]])]),
478
+ createBaseVNode("div", _hoisted_31, [createBaseVNode("label", _hoisted_32, toDisplayString(unref(t)("connection.rdpWidth")), 1), withDirectives(createBaseVNode("input", {
479
+ type: "number",
480
+ class: "form-control form-control-sm",
481
+ "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => rdpOptions.width = $event),
482
+ min: "640",
483
+ max: "4096"
484
+ }, null, 512), [[
485
+ vModelText,
486
+ rdpOptions.width,
487
+ void 0,
488
+ { number: true }
489
+ ]])]),
490
+ createBaseVNode("div", _hoisted_33, [createBaseVNode("label", _hoisted_34, toDisplayString(unref(t)("connection.rdpHeight")), 1), withDirectives(createBaseVNode("input", {
491
+ type: "number",
492
+ class: "form-control form-control-sm",
493
+ "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => rdpOptions.height = $event),
494
+ min: "480",
495
+ max: "2160"
496
+ }, null, 512), [[
497
+ vModelText,
498
+ rdpOptions.height,
499
+ void 0,
500
+ { number: true }
501
+ ]])])
502
+ ]),
503
+ createBaseVNode("small", _hoisted_35, [_cache[41] || (_cache[41] = createBaseVNode("i", { class: "bi bi-info-circle me-1" }, null, -1)), createTextVNode(toDisplayString(unref(t)("connection.rdpHint")), 1)])
504
+ ])) : createCommentVNode("", true),
505
+ form.type === "ssh" ? (openBlock(), createElementBlock("div", _hoisted_36, [
506
+ createBaseVNode("label", _hoisted_37, [_cache[42] || (_cache[42] = createBaseVNode("i", { class: "bi bi-shield-lock me-1" }, null, -1)), createTextVNode(toDisplayString(unref(t)("connection.authType")), 1)]),
507
+ createBaseVNode("div", _hoisted_38, [
508
+ withDirectives(createBaseVNode("input", {
509
+ type: "radio",
510
+ class: "btn-check",
511
+ name: "authType",
512
+ id: "auth-auto",
513
+ value: "auto",
514
+ "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => form.authType = $event)
515
+ }, null, 512), [[vModelRadio, form.authType]]),
516
+ createBaseVNode("label", _hoisted_39, [_cache[43] || (_cache[43] = createBaseVNode("i", { class: "bi bi-magic me-1" }, null, -1)), createTextVNode(toDisplayString(unref(t)("connection.auto")), 1)]),
517
+ withDirectives(createBaseVNode("input", {
518
+ type: "radio",
519
+ class: "btn-check",
520
+ name: "authType",
521
+ id: "auth-password",
522
+ value: "password",
523
+ "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => form.authType = $event)
524
+ }, null, 512), [[vModelRadio, form.authType]]),
525
+ createBaseVNode("label", _hoisted_40, [_cache[44] || (_cache[44] = createBaseVNode("i", { class: "bi bi-key me-1" }, null, -1)), createTextVNode(toDisplayString(unref(t)("connection.password")), 1)]),
526
+ withDirectives(createBaseVNode("input", {
527
+ type: "radio",
528
+ class: "btn-check",
529
+ name: "authType",
530
+ id: "auth-key",
531
+ value: "privateKey",
532
+ "onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => form.authType = $event)
533
+ }, null, 512), [[vModelRadio, form.authType]]),
534
+ createBaseVNode("label", _hoisted_41, [_cache[45] || (_cache[45] = createBaseVNode("i", { class: "bi bi-file-earmark-lock me-1" }, null, -1)), createTextVNode(toDisplayString(unref(t)("connection.privateKey")), 1)])
535
+ ]),
536
+ form.authType === "auto" ? (openBlock(), createElementBlock("small", _hoisted_42, [_cache[46] || (_cache[46] = createBaseVNode("i", { class: "bi bi-info-circle me-1" }, null, -1)), createTextVNode(toDisplayString(unref(t)("connection.autoHint")), 1)])) : createCommentVNode("", true)
537
+ ])) : createCommentVNode("", true),
538
+ isRdp.value || form.authType === "password" ? (openBlock(), createElementBlock("div", _hoisted_43, [createBaseVNode("label", _hoisted_44, toDisplayString(unref(t)("connection.passwordLabel")), 1), withDirectives(createBaseVNode("input", {
539
+ type: "password",
540
+ class: "form-control",
541
+ "onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => form.password = $event),
542
+ placeholder: unref(t)("connection.passwordPlaceholder")
543
+ }, null, 8, _hoisted_45), [[vModelText, form.password]])])) : createCommentVNode("", true),
544
+ form.authType === "privateKey" ? (openBlock(), createElementBlock("div", _hoisted_46, [
545
+ createBaseVNode("label", _hoisted_47, toDisplayString(unref(t)("connection.privateKeyContent")), 1),
546
+ withDirectives(createBaseVNode("textarea", {
547
+ class: "form-control",
548
+ "onUpdate:modelValue": _cache[14] || (_cache[14] = ($event) => form.privateKey = $event),
549
+ rows: "5",
550
+ placeholder: unref(t)("connection.privateKeyPlaceholder")
551
+ }, null, 8, _hoisted_48), [[vModelText, form.privateKey]]),
552
+ createBaseVNode("div", _hoisted_49, [createBaseVNode("label", _hoisted_50, toDisplayString(unref(t)("connection.passphrase")), 1), withDirectives(createBaseVNode("input", {
553
+ type: "password",
554
+ class: "form-control",
555
+ "onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => form.passphrase = $event),
556
+ placeholder: unref(t)("connection.passphrasePlaceholder")
557
+ }, null, 8, _hoisted_51), [[vModelText, form.passphrase]])]),
558
+ createBaseVNode("div", _hoisted_52, [createBaseVNode("button", {
559
+ type: "button",
560
+ class: "btn btn-sm btn-outline-secondary",
561
+ onClick: loadPrivateKey
562
+ }, [_cache[47] || (_cache[47] = createBaseVNode("i", { class: "bi bi-folder-open me-1" }, null, -1)), createTextVNode(toDisplayString(unref(t)("connection.loadFromFile")), 1)])])
563
+ ])) : createCommentVNode("", true),
564
+ form.type === "ssh" ? (openBlock(), createElementBlock("div", _hoisted_53, [createBaseVNode("div", {
565
+ class: "card-header",
566
+ onClick: _cache[16] || (_cache[16] = ($event) => showStartupScript.value = !showStartupScript.value),
567
+ style: { "cursor": "pointer" }
568
+ }, [
569
+ _cache[48] || (_cache[48] = createBaseVNode("i", { class: "bi bi-lightning-charge me-1" }, null, -1)),
570
+ createTextVNode(toDisplayString(unref(t)("connection.startupScript")) + " ", 1),
571
+ createBaseVNode("i", { class: normalizeClass(showStartupScript.value ? "bi bi-chevron-up float-end" : "bi bi-chevron-down float-end") }, null, 2)
572
+ ]), withDirectives(createBaseVNode("div", _hoisted_54, [
573
+ createBaseVNode("div", _hoisted_55, [
574
+ withDirectives(createBaseVNode("input", {
575
+ class: "form-check-input",
576
+ type: "checkbox",
577
+ "onUpdate:modelValue": _cache[17] || (_cache[17] = ($event) => form.forwardAgent = $event),
578
+ id: "forwardAgent"
579
+ }, null, 512), [[vModelCheckbox, form.forwardAgent]]),
580
+ createBaseVNode("label", _hoisted_56, [_cache[49] || (_cache[49] = createBaseVNode("i", { class: "bi bi-arrow-repeat me-1" }, null, -1)), createTextVNode(toDisplayString(unref(t)("connection.forwardAgent")), 1)]),
581
+ createBaseVNode("small", _hoisted_57, [_cache[50] || (_cache[50] = createBaseVNode("i", { class: "bi bi-info-circle me-1" }, null, -1)), createTextVNode(toDisplayString(unref(t)("connection.forwardAgentHint")), 1)])
582
+ ]),
583
+ withDirectives(createBaseVNode("textarea", {
584
+ class: "form-control",
585
+ "onUpdate:modelValue": _cache[18] || (_cache[18] = ($event) => form.startupScript = $event),
586
+ rows: "3",
587
+ placeholder: unref(t)("connection.startupScriptPlaceholder")
588
+ }, null, 8, _hoisted_58), [[vModelText, form.startupScript]]),
589
+ createBaseVNode("small", _hoisted_59, [_cache[51] || (_cache[51] = createBaseVNode("i", { class: "bi bi-info-circle me-1" }, null, -1)), createTextVNode(toDisplayString(unref(t)("connection.startupScriptHint")), 1)])
590
+ ], 512), [[vShow, showStartupScript.value]])])) : createCommentVNode("", true),
591
+ form.type === "ssh" ? (openBlock(), createElementBlock("div", _hoisted_60, [createBaseVNode("div", {
592
+ class: "card-header",
593
+ onClick: _cache[19] || (_cache[19] = ($event) => showKeepaliveConfig.value = !showKeepaliveConfig.value),
594
+ style: { "cursor": "pointer" }
595
+ }, [
596
+ _cache[52] || (_cache[52] = createBaseVNode("i", { class: "bi bi-heart-pulse me-1" }, null, -1)),
597
+ createTextVNode(toDisplayString(unref(t)("connection.keepaliveConfig")) + " ", 1),
598
+ createBaseVNode("i", { class: normalizeClass(showKeepaliveConfig.value ? "bi bi-chevron-up float-end" : "bi bi-chevron-down float-end") }, null, 2)
599
+ ]), withDirectives(createBaseVNode("div", _hoisted_61, [createBaseVNode("div", _hoisted_62, [
600
+ withDirectives(createBaseVNode("input", {
601
+ class: "form-check-input",
602
+ type: "checkbox",
603
+ "onUpdate:modelValue": _cache[20] || (_cache[20] = ($event) => keepaliveEnabled.value = $event),
604
+ id: "keepaliveEnabled"
605
+ }, null, 512), [[vModelCheckbox, keepaliveEnabled.value]]),
606
+ createBaseVNode("label", _hoisted_63, [_cache[53] || (_cache[53] = createBaseVNode("i", { class: "bi bi-toggle-on me-1" }, null, -1)), createTextVNode(toDisplayString(unref(t)("connection.keepaliveEnabled")), 1)]),
607
+ createBaseVNode("small", _hoisted_64, [_cache[54] || (_cache[54] = createBaseVNode("i", { class: "bi bi-info-circle me-1" }, null, -1)), createTextVNode(toDisplayString(unref(t)("connection.keepaliveEnabledHint")), 1)])
608
+ ]), keepaliveEnabled.value ? (openBlock(), createElementBlock("div", _hoisted_65, [createBaseVNode("div", _hoisted_66, [
609
+ createBaseVNode("label", _hoisted_67, toDisplayString(unref(t)("connection.keepaliveInterval")), 1),
610
+ withDirectives(createBaseVNode("input", {
611
+ type: "number",
612
+ class: "form-control form-control-sm",
613
+ "onUpdate:modelValue": _cache[21] || (_cache[21] = ($event) => keepaliveInterval.value = $event),
614
+ min: "1000",
615
+ max: "300000",
616
+ placeholder: unref(t)("connection.keepaliveIntervalPlaceholder")
617
+ }, null, 8, _hoisted_68), [[
618
+ vModelText,
619
+ keepaliveInterval.value,
620
+ void 0,
621
+ { number: true }
622
+ ]]),
623
+ createBaseVNode("small", _hoisted_69, toDisplayString(unref(t)("connection.keepaliveIntervalHint")), 1)
624
+ ]), createBaseVNode("div", _hoisted_70, [
625
+ createBaseVNode("label", _hoisted_71, toDisplayString(unref(t)("connection.keepaliveCountMax")), 1),
626
+ withDirectives(createBaseVNode("input", {
627
+ type: "number",
628
+ class: "form-control form-control-sm",
629
+ "onUpdate:modelValue": _cache[22] || (_cache[22] = ($event) => keepaliveCountMax.value = $event),
630
+ min: "1",
631
+ max: "10",
632
+ placeholder: unref(t)("connection.keepaliveCountMaxPlaceholder")
633
+ }, null, 8, _hoisted_72), [[
634
+ vModelText,
635
+ keepaliveCountMax.value,
636
+ void 0,
637
+ { number: true }
638
+ ]]),
639
+ createBaseVNode("small", _hoisted_73, toDisplayString(unref(t)("connection.keepaliveCountMaxHint")), 1)
640
+ ])])) : createCommentVNode("", true)], 512), [[vShow, showKeepaliveConfig.value]])])) : createCommentVNode("", true),
641
+ form.type === "ssh" ? (openBlock(), createElementBlock("div", _hoisted_74, [createBaseVNode("div", {
642
+ class: "card-header",
643
+ onClick: _cache[23] || (_cache[23] = ($event) => showTerminalConfig.value = !showTerminalConfig.value),
644
+ style: { "cursor": "pointer" }
645
+ }, [
646
+ _cache[55] || (_cache[55] = createBaseVNode("i", { class: "bi bi-terminal me-1" }, null, -1)),
647
+ createTextVNode(toDisplayString(unref(t)("connection.terminalConfig")) + " ", 1),
648
+ createBaseVNode("i", { class: normalizeClass(showTerminalConfig.value ? "bi bi-chevron-up float-end" : "bi bi-chevron-down float-end") }, null, 2)
649
+ ]), withDirectives(createBaseVNode("div", _hoisted_75, [createBaseVNode("div", _hoisted_76, [createBaseVNode("div", _hoisted_77, [createBaseVNode("label", _hoisted_78, toDisplayString(unref(t)("connection.fontSize")), 1), withDirectives(createBaseVNode("input", {
650
+ type: "number",
651
+ class: "form-control form-control-sm",
652
+ "onUpdate:modelValue": _cache[24] || (_cache[24] = ($event) => form.terminal.fontSize = $event),
653
+ min: "8",
654
+ max: "32"
655
+ }, null, 512), [[
656
+ vModelText,
657
+ form.terminal.fontSize,
658
+ void 0,
659
+ { number: true }
660
+ ]])]), createBaseVNode("div", _hoisted_79, [createBaseVNode("label", _hoisted_80, toDisplayString(unref(t)("connection.cursorStyle")), 1), withDirectives(createBaseVNode("select", {
661
+ class: "form-select form-select-sm",
662
+ "onUpdate:modelValue": _cache[25] || (_cache[25] = ($event) => form.terminal.cursorStyle = $event)
663
+ }, [
664
+ createBaseVNode("option", _hoisted_81, toDisplayString(unref(t)("connection.cursorBlock")), 1),
665
+ createBaseVNode("option", _hoisted_82, toDisplayString(unref(t)("connection.cursorUnderline")), 1),
666
+ createBaseVNode("option", _hoisted_83, toDisplayString(unref(t)("connection.cursorBar")), 1)
667
+ ], 512), [[vModelSelect, form.terminal.cursorStyle]])])]), createBaseVNode("div", _hoisted_84, [createBaseVNode("div", _hoisted_85, [createBaseVNode("label", _hoisted_86, toDisplayString(unref(t)("connection.theme")), 1), withDirectives(createBaseVNode("select", {
668
+ class: "form-select form-select-sm",
669
+ "onUpdate:modelValue": _cache[26] || (_cache[26] = ($event) => form.terminal.theme = $event)
670
+ }, [createBaseVNode("option", _hoisted_87, toDisplayString(unref(t)("connection.themeDark")), 1), createBaseVNode("option", _hoisted_88, toDisplayString(unref(t)("connection.themeLight")), 1)], 512), [[vModelSelect, form.terminal.theme]])]), createBaseVNode("div", _hoisted_89, [createBaseVNode("label", _hoisted_90, toDisplayString(unref(t)("connection.fontFamily")), 1), withDirectives(createBaseVNode("input", {
671
+ type: "text",
672
+ class: "form-control form-control-sm",
673
+ "onUpdate:modelValue": _cache[27] || (_cache[27] = ($event) => form.terminal.fontFamily = $event),
674
+ placeholder: "字体"
675
+ }, null, 512), [[vModelText, form.terminal.fontFamily]])])])], 512), [[vShow, showTerminalConfig.value]])])) : createCommentVNode("", true),
676
+ createBaseVNode("div", _hoisted_91, [createBaseVNode("button", {
677
+ type: "button",
678
+ class: "btn btn-outline-secondary",
679
+ onClick: testConn,
680
+ disabled: testing.value
681
+ }, [testing.value ? (openBlock(), createElementBlock("span", _hoisted_93)) : (openBlock(), createElementBlock("i", _hoisted_94)), createTextVNode(" " + toDisplayString(testing.value ? unref(t)("connection.testing") : unref(t)("connection.testConnection")), 1)], 8, _hoisted_92), createBaseVNode("div", null, [createBaseVNode("button", {
682
+ type: "button",
683
+ class: "btn btn-secondary me-2",
684
+ onClick: cancel
685
+ }, toDisplayString(unref(t)("common.cancel")), 1), createBaseVNode("button", {
686
+ type: "submit",
687
+ class: "btn btn-primary",
688
+ disabled: saving.value
689
+ }, [saving.value ? (openBlock(), createElementBlock("span", _hoisted_96)) : createCommentVNode("", true), createTextVNode(" " + toDisplayString(saving.value ? unref(t)("connection.saving") : unref(t)("common.save")), 1)], 8, _hoisted_95)])])
690
+ ], 32)]),
691
+ _: 1
692
+ }, 8, [
693
+ "title",
694
+ "closeButton",
695
+ "embedded"
696
+ ]);
697
+ };
698
+ }
699
+ });
700
+ }));
701
+ // src/components/connection-editor/index.vue?vue&type=style&index=0&scoped=e4c9f0e9&lang.css
702
+ var init_index_vue_vue_type_style_index_0_scoped_e4c9f0e9_lang = __esmMin((() => {}));
703
+ // src/components/connection-editor/index.vue
704
+ var connection_editor_default;
705
+ var init_connection_editor = __esmMin((() => {
706
+ init_index_vue_vue_type_script_setup_true_lang();
707
+ init_index_vue_vue_type_script_setup_true_lang();
708
+ init_index_vue_vue_type_style_index_0_scoped_e4c9f0e9_lang();
709
+ init__plugin_vue_export_helper();
710
+ connection_editor_default = /*#__PURE__*/ _plugin_vue_export_helper_default(index_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-e4c9f0e9"]]);
711
+ }));
712
+ export { init_connection_editor as n, connection_editor_default as t };