@fefeding/aicmd 1.0.26 → 1.0.28

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 (91) hide show
  1. package/README.md +60 -5
  2. package/README.zh.md +66 -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 +831 -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 +5540 -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 +27 -2
  37. package/dist/server/model/connection.entity.d.ts.map +1 -1
  38. package/dist/server/model/connection.entity.js +11 -1
  39. package/dist/server/model/connection.entity.js.map +1 -1
  40. package/dist/server/model/connection.entity.ts +30 -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/connection.service.d.ts +1 -1
  47. package/dist/server/service/connection.service.d.ts.map +1 -1
  48. package/dist/server/service/connection.service.js +32 -3
  49. package/dist/server/service/connection.service.js.map +1 -1
  50. package/dist/server/service/connection.service.ts +30 -3
  51. package/dist/server/service/monitor.service.d.ts.map +1 -1
  52. package/dist/server/service/monitor.service.js +8 -1
  53. package/dist/server/service/monitor.service.js.map +1 -1
  54. package/dist/server/service/monitor.service.ts +8 -1
  55. package/dist/server/service/rdp-tunnel.service.d.ts +22 -0
  56. package/dist/server/service/rdp-tunnel.service.d.ts.map +1 -0
  57. package/dist/server/service/rdp-tunnel.service.js +474 -0
  58. package/dist/server/service/rdp-tunnel.service.js.map +1 -0
  59. package/dist/server/service/rdp-tunnel.service.ts +439 -0
  60. package/dist/server/service/rdp.service.d.ts +64 -0
  61. package/dist/server/service/rdp.service.d.ts.map +1 -0
  62. package/dist/server/service/rdp.service.js +324 -0
  63. package/dist/server/service/rdp.service.js.map +1 -0
  64. package/dist/server/service/rdp.service.ts +324 -0
  65. package/dist/server/service/ssh.service.d.ts +57 -1
  66. package/dist/server/service/ssh.service.d.ts.map +1 -1
  67. package/dist/server/service/ssh.service.js +460 -109
  68. package/dist/server/service/ssh.service.js.map +1 -1
  69. package/dist/server/service/ssh.service.ts +455 -107
  70. package/dist/server/utils/ansi.d.ts +20 -0
  71. package/dist/server/utils/ansi.d.ts.map +1 -0
  72. package/dist/server/utils/ansi.js +39 -0
  73. package/dist/server/utils/ansi.js.map +1 -0
  74. package/dist/server/utils/ansi.ts +34 -0
  75. package/dist/server/utils/proxy.d.ts +28 -0
  76. package/dist/server/utils/proxy.d.ts.map +1 -0
  77. package/dist/server/utils/proxy.js +596 -0
  78. package/dist/server/utils/proxy.js.map +1 -0
  79. package/dist/server/utils/proxy.ts +556 -0
  80. package/dist/server/utils/rdp-ws.d.ts +15 -0
  81. package/dist/server/utils/rdp-ws.d.ts.map +1 -0
  82. package/dist/server/utils/rdp-ws.js +28 -0
  83. package/dist/server/utils/rdp-ws.js.map +1 -0
  84. package/dist/server/utils/rdp-ws.ts +32 -0
  85. package/dist/view/index.html +9 -7
  86. package/electron/main.js +118 -3
  87. package/electron/preload.js +4 -0
  88. package/package.json +32 -31
  89. package/public/aicmd.png +0 -0
  90. package/server.js +132 -12
  91. package/dist/public/rolldown-runtime.js +0 -41
@@ -0,0 +1,831 @@
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, b as Fragment, 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, _hoisted_97, _hoisted_98, _hoisted_99, _hoisted_100, _hoisted_101, _hoisted_102, _hoisted_103, _hoisted_104, _hoisted_105, _hoisted_106, _hoisted_107, _hoisted_108, _hoisted_109, _hoisted_110, _hoisted_111, _hoisted_112, _hoisted_113, _hoisted_114, _hoisted_115, _hoisted_116, _hoisted_117, _hoisted_118, 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: "card mb-3" };
161
+ _hoisted_92 = {
162
+ key: 0,
163
+ class: "badge bg-secondary ms-2"
164
+ };
165
+ _hoisted_93 = { class: "card-body" };
166
+ _hoisted_94 = { class: "form-label" };
167
+ _hoisted_95 = { value: "direct" };
168
+ _hoisted_96 = { value: "system" };
169
+ _hoisted_97 = { value: "custom" };
170
+ _hoisted_98 = { class: "form-text text-muted d-block" };
171
+ _hoisted_99 = { class: "row g-2 mt-2" };
172
+ _hoisted_100 = { class: "col-md-8" };
173
+ _hoisted_101 = { class: "form-label" };
174
+ _hoisted_102 = ["placeholder"];
175
+ _hoisted_103 = { class: "col-md-4" };
176
+ _hoisted_104 = { class: "form-label" };
177
+ _hoisted_105 = { class: "row g-2 mt-2" };
178
+ _hoisted_106 = { class: "col-md-6" };
179
+ _hoisted_107 = { class: "form-label" };
180
+ _hoisted_108 = { class: "col-md-6" };
181
+ _hoisted_109 = { class: "form-label" };
182
+ _hoisted_110 = {
183
+ key: 0,
184
+ class: "mt-2"
185
+ };
186
+ _hoisted_111 = { class: "form-label" };
187
+ _hoisted_112 = { class: "form-text text-muted d-block mt-2" };
188
+ _hoisted_113 = { class: "d-flex justify-content-between" };
189
+ _hoisted_114 = ["disabled"];
190
+ _hoisted_115 = {
191
+ key: 0,
192
+ class: "spinner-border spinner-border-sm me-1"
193
+ };
194
+ _hoisted_116 = {
195
+ key: 1,
196
+ class: "bi bi-plug me-1"
197
+ };
198
+ _hoisted_117 = ["disabled"];
199
+ _hoisted_118 = {
200
+ key: 0,
201
+ class: "spinner-border spinner-border-sm me-1"
202
+ };
203
+ index_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
204
+ __name: "index",
205
+ props: { embedded: {
206
+ type: Boolean,
207
+ default: false
208
+ } },
209
+ emits: ["saved", "close"],
210
+ setup(__props, { expose: __expose, emit: __emit }) {
211
+ const { t } = useI18n();
212
+ const props = __props;
213
+ const connectionModal = ref();
214
+ const editingConnection = ref(null);
215
+ const showTerminalConfig = ref(false);
216
+ const showStartupScript = ref(false);
217
+ const showKeepaliveConfig = ref(false);
218
+ const showProxyConfig = ref(false);
219
+ const testing = ref(false);
220
+ const saving = ref(false);
221
+ const keepaliveEnabled = ref(true);
222
+ const keepaliveInterval = ref(1e4);
223
+ const keepaliveCountMax = ref(3);
224
+ const defaultForm = () => ({
225
+ name: "",
226
+ type: "ssh",
227
+ host: "",
228
+ port: 22,
229
+ username: "root",
230
+ platform: "auto",
231
+ authType: "auto",
232
+ password: "",
233
+ privateKey: "",
234
+ passphrase: "",
235
+ startupScript: "",
236
+ forwardAgent: false,
237
+ terminal: {
238
+ cols: 80,
239
+ rows: 24,
240
+ fontSize: 14,
241
+ fontFamily: "Menlo, Monaco, \"Courier New\", monospace",
242
+ theme: "dark",
243
+ cursorStyle: "block"
244
+ },
245
+ options: {},
246
+ enabled: true
247
+ });
248
+ const form = reactive(defaultForm());
249
+ const defaultProxy = () => ({
250
+ mode: "system",
251
+ type: "http",
252
+ host: "",
253
+ port: 8080,
254
+ username: "",
255
+ password: ""
256
+ });
257
+ const proxyOptions = reactive(defaultProxy());
258
+ const proxyModeLabel = computed(() => {
259
+ if (proxyOptions.mode === "system") return t("connection.proxyModeSystem");
260
+ if (proxyOptions.mode === "custom") return t("connection.proxyModeCustom");
261
+ return "";
262
+ });
263
+ function syncProxyToForm() {
264
+ form.proxy = { ...proxyOptions };
265
+ }
266
+ function proxyValid() {
267
+ if (proxyOptions.mode !== "custom" || proxyOptions.host.trim()) return true;
268
+ toast.warning(t("connection.proxyHostRequired"));
269
+ return false;
270
+ }
271
+ let skipTypeWatch = false;
272
+ watch(() => form.type, (newType, oldType) => {
273
+ if (skipTypeWatch || newType === oldType) return;
274
+ if (newType === "rdp") {
275
+ if (form.port === 22) form.port = 3389;
276
+ if (form.username === "root") form.username = "";
277
+ form.authType = "password";
278
+ } else if (newType === "ssh") {
279
+ if (form.port === 3389) form.port = 22;
280
+ if (form.username === "") form.username = "root";
281
+ if (form.authType === "password" && !form.password) form.authType = "auto";
282
+ }
283
+ });
284
+ const isRdp = computed(() => form.type === "rdp");
285
+ const rdpOptions = reactive({
286
+ domain: "",
287
+ width: 1280,
288
+ height: 800
289
+ });
290
+ const connectionService = new ConnectionService();
291
+ function open(connection) {
292
+ skipTypeWatch = true;
293
+ if (connection) {
294
+ editingConnection.value = connection.id;
295
+ Object.assign(form, defaultForm(), connection);
296
+ Object.assign(proxyOptions, defaultProxy(), connection.proxy || {});
297
+ if (!form.platform) form.platform = "auto";
298
+ showStartupScript.value = !!connection.startupScript || !!connection.forwardAgent;
299
+ if (connection.options?.keepaliveInterval !== void 0) keepaliveInterval.value = connection.options.keepaliveInterval;
300
+ else keepaliveInterval.value = 1e4;
301
+ if (connection.options?.keepaliveCountMax !== void 0) keepaliveCountMax.value = connection.options.keepaliveCountMax;
302
+ else keepaliveCountMax.value = 3;
303
+ keepaliveEnabled.value = connection.options?.keepaliveInterval !== void 0 || connection.options?.keepaliveCountMax !== void 0;
304
+ showKeepaliveConfig.value = keepaliveEnabled.value;
305
+ const rOpts = connection.options?.rdp || {};
306
+ rdpOptions.domain = rOpts.domain || "";
307
+ rdpOptions.width = rOpts.width || 1280;
308
+ rdpOptions.height = rOpts.height || 800;
309
+ if (connection.type === "rdp" && !connection.port) form.port = 3389;
310
+ } else {
311
+ editingConnection.value = null;
312
+ Object.assign(form, defaultForm());
313
+ Object.assign(proxyOptions, defaultProxy());
314
+ showStartupScript.value = false;
315
+ showKeepaliveConfig.value = false;
316
+ keepaliveEnabled.value = true;
317
+ keepaliveInterval.value = 1e4;
318
+ keepaliveCountMax.value = 3;
319
+ rdpOptions.domain = "";
320
+ rdpOptions.width = 1280;
321
+ rdpOptions.height = 800;
322
+ }
323
+ showProxyConfig.value = false;
324
+ nextTick(() => {
325
+ skipTypeWatch = false;
326
+ });
327
+ if (!props.embedded) connectionModal.value?.show();
328
+ }
329
+ function close() {
330
+ if (!props.embedded) connectionModal.value?.hide();
331
+ }
332
+ function cancel() {
333
+ if (props.embedded) {
334
+ emit("close");
335
+ return;
336
+ }
337
+ connectionModal.value?.hide();
338
+ }
339
+ function handleModalClose() {
340
+ editingConnection.value = null;
341
+ }
342
+ async function saveConnection() {
343
+ if (!form.name) {
344
+ toast.warning(t("connection.nameRequired"));
345
+ return;
346
+ }
347
+ if (!form.host || !form.username) {
348
+ toast.warning(t("connection.hostUsernameRequired"));
349
+ return;
350
+ }
351
+ if (!proxyValid()) return;
352
+ syncProxyToForm();
353
+ saving.value = true;
354
+ try {
355
+ if (form.type === "rdp") {
356
+ form.port = form.port || 3389;
357
+ form.authType = "password";
358
+ form.options = {
359
+ ...form.options,
360
+ rdp: { ...rdpOptions }
361
+ };
362
+ }
363
+ if (keepaliveEnabled.value) form.options = {
364
+ ...form.options,
365
+ keepaliveInterval: keepaliveInterval.value,
366
+ keepaliveCountMax: keepaliveCountMax.value
367
+ };
368
+ else form.options = {
369
+ ...form.options,
370
+ keepaliveInterval: 0,
371
+ keepaliveCountMax: 0
372
+ };
373
+ if (editingConnection.value) await connectionService.updateConnection(editingConnection.value, { ...form });
374
+ else await connectionService.addConnection({ ...form });
375
+ toast.success(t("connection.saveSuccess"));
376
+ close();
377
+ emit("saved");
378
+ } catch (e) {
379
+ toast.error(e.message || t("connection.saveFailed"));
380
+ } finally {
381
+ saving.value = false;
382
+ }
383
+ }
384
+ async function testConn() {
385
+ if (!form.host || !form.username) {
386
+ toast.warning(t("connection.hostUsernameTestRequired"));
387
+ return;
388
+ }
389
+ if (!proxyValid()) return;
390
+ syncProxyToForm();
391
+ testing.value = true;
392
+ try {
393
+ if (await connectionService.testConnection({ ...form })) toast.success(t("connection.testSuccess"));
394
+ else toast.error(t("connection.testFailed"));
395
+ } catch (e) {
396
+ toast.error(e.message || t("connection.testError"));
397
+ } finally {
398
+ testing.value = false;
399
+ }
400
+ }
401
+ async function loadPrivateKey() {
402
+ const chooser = document.createElement("input");
403
+ chooser.type = "file";
404
+ chooser.accept = ".pem,.key,.pub,.rsa";
405
+ chooser.style.display = "none";
406
+ chooser.addEventListener("change", async () => {
407
+ if (chooser.files?.length) try {
408
+ const text = await chooser.files[0].text();
409
+ form.privateKey = text;
410
+ toast.success(t("connection.privateKeyLoaded"));
411
+ } catch (e) {
412
+ toast.error(e.message || t("connection.privateKeyLoadFailed"));
413
+ }
414
+ });
415
+ document.body.appendChild(chooser);
416
+ chooser.click();
417
+ setTimeout(() => {
418
+ if (chooser.parentNode) document.body.removeChild(chooser);
419
+ }, 0);
420
+ }
421
+ const emit = __emit;
422
+ __expose({
423
+ open,
424
+ close
425
+ });
426
+ return (_ctx, _cache) => {
427
+ return openBlock(), createBlock(modal_default, {
428
+ ref_key: "connectionModal",
429
+ ref: connectionModal,
430
+ title: editingConnection.value ? unref(t)("connection.editTitle") : unref(t)("connection.addTitle"),
431
+ closeButton: {
432
+ text: unref(t)("common.cancel"),
433
+ show: false
434
+ },
435
+ confirmButton: {
436
+ text: "",
437
+ show: false
438
+ },
439
+ dialogStyle: {
440
+ maxWidth: "700px",
441
+ width: "100%"
442
+ },
443
+ embedded: __props.embedded,
444
+ onOnClose: handleModalClose
445
+ }, {
446
+ default: withCtx(() => [createBaseVNode("form", {
447
+ onSubmit: withModifiers(saveConnection, ["prevent"]),
448
+ class: "connection-form"
449
+ }, [
450
+ createBaseVNode("div", _hoisted_1, [createBaseVNode("label", _hoisted_2, [
451
+ _cache[35] || (_cache[35] = createBaseVNode("i", { class: "bi bi-tag me-1" }, null, -1)),
452
+ createTextVNode(toDisplayString(unref(t)("connection.name")) + " ", 1),
453
+ _cache[36] || (_cache[36] = createBaseVNode("span", { class: "text-danger" }, "*", -1))
454
+ ]), withDirectives(createBaseVNode("input", {
455
+ type: "text",
456
+ class: "form-control",
457
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => form.name = $event),
458
+ placeholder: unref(t)("connection.namePlaceholder"),
459
+ required: ""
460
+ }, null, 8, _hoisted_3), [[vModelText, form.name]])]),
461
+ createBaseVNode("div", _hoisted_4, [createBaseVNode("label", _hoisted_5, [_cache[37] || (_cache[37] = createBaseVNode("i", { class: "bi bi-diagram-3 me-1" }, null, -1)), createTextVNode(toDisplayString(unref(t)("connection.connType")), 1)]), createBaseVNode("div", _hoisted_6, [
462
+ withDirectives(createBaseVNode("input", {
463
+ type: "radio",
464
+ class: "btn-check",
465
+ name: "connType",
466
+ id: "type-ssh",
467
+ value: "ssh",
468
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => form.type = $event)
469
+ }, null, 512), [[vModelRadio, form.type]]),
470
+ createBaseVNode("label", _hoisted_7, [_cache[38] || (_cache[38] = createBaseVNode("i", { class: "bi bi-terminal me-1" }, null, -1)), createTextVNode(toDisplayString(unref(t)("connection.typeSsh")), 1)]),
471
+ withDirectives(createBaseVNode("input", {
472
+ type: "radio",
473
+ class: "btn-check",
474
+ name: "connType",
475
+ id: "type-rdp",
476
+ value: "rdp",
477
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => form.type = $event)
478
+ }, null, 512), [[vModelRadio, form.type]]),
479
+ createBaseVNode("label", _hoisted_8, [_cache[39] || (_cache[39] = createBaseVNode("i", { class: "bi bi-display me-1" }, null, -1)), createTextVNode(toDisplayString(unref(t)("connection.typeRdp")), 1)])
480
+ ])]),
481
+ createBaseVNode("div", _hoisted_9, [createBaseVNode("div", _hoisted_10, [createBaseVNode("label", _hoisted_11, [
482
+ _cache[40] || (_cache[40] = createBaseVNode("i", { class: "bi bi-server me-1" }, null, -1)),
483
+ createTextVNode(toDisplayString(unref(t)("connection.host")) + " ", 1),
484
+ _cache[41] || (_cache[41] = createBaseVNode("span", { class: "text-danger" }, "*", -1))
485
+ ]), withDirectives(createBaseVNode("input", {
486
+ type: "text",
487
+ class: "form-control",
488
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => form.host = $event),
489
+ placeholder: unref(t)("connection.hostPlaceholder"),
490
+ required: form.type !== "local"
491
+ }, null, 8, _hoisted_12), [[vModelText, form.host]])]), createBaseVNode("div", _hoisted_13, [createBaseVNode("label", _hoisted_14, [_cache[42] || (_cache[42] = createBaseVNode("i", { class: "bi bi-door-closed me-1" }, null, -1)), createTextVNode(toDisplayString(unref(t)("connection.port")), 1)]), withDirectives(createBaseVNode("input", {
492
+ type: "number",
493
+ class: "form-control",
494
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => form.port = $event),
495
+ min: "1",
496
+ max: "65535"
497
+ }, null, 512), [[
498
+ vModelText,
499
+ form.port,
500
+ void 0,
501
+ { number: true }
502
+ ]])])]),
503
+ form.type === "ssh" ? (openBlock(), createElementBlock("div", _hoisted_15, [
504
+ createBaseVNode("label", _hoisted_16, [_cache[43] || (_cache[43] = createBaseVNode("i", { class: "bi bi-cpu me-1" }, null, -1)), createTextVNode(toDisplayString(unref(t)("connection.platform")), 1)]),
505
+ withDirectives(createBaseVNode("select", {
506
+ class: "form-select",
507
+ "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => form.platform = $event)
508
+ }, [
509
+ createBaseVNode("option", _hoisted_17, toDisplayString(unref(t)("connection.platformAuto")), 1),
510
+ createBaseVNode("option", _hoisted_18, toDisplayString(unref(t)("connection.platformLinux")), 1),
511
+ createBaseVNode("option", _hoisted_19, toDisplayString(unref(t)("connection.platformMacos")), 1),
512
+ createBaseVNode("option", _hoisted_20, toDisplayString(unref(t)("connection.platformWindows")), 1)
513
+ ], 512), [[vModelSelect, form.platform]]),
514
+ createBaseVNode("small", _hoisted_21, [_cache[44] || (_cache[44] = createBaseVNode("i", { class: "bi bi-info-circle me-1" }, null, -1)), createTextVNode(toDisplayString(unref(t)("connection.platformHint")), 1)])
515
+ ])) : createCommentVNode("", true),
516
+ createBaseVNode("div", _hoisted_22, [createBaseVNode("label", _hoisted_23, [
517
+ _cache[45] || (_cache[45] = createBaseVNode("i", { class: "bi bi-person me-1" }, null, -1)),
518
+ createTextVNode(toDisplayString(unref(t)("connection.username")) + " ", 1),
519
+ _cache[46] || (_cache[46] = createBaseVNode("span", { class: "text-danger" }, "*", -1))
520
+ ]), withDirectives(createBaseVNode("input", {
521
+ type: "text",
522
+ class: "form-control",
523
+ "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => form.username = $event),
524
+ placeholder: unref(t)("connection.usernamePlaceholder"),
525
+ required: form.type !== "local"
526
+ }, null, 8, _hoisted_24), [[vModelText, form.username]])]),
527
+ form.type === "rdp" ? (openBlock(), createElementBlock("div", _hoisted_25, [
528
+ createBaseVNode("div", _hoisted_26, [_cache[47] || (_cache[47] = createBaseVNode("i", { class: "bi bi-display me-1" }, null, -1)), createTextVNode(toDisplayString(unref(t)("connection.rdpSettings")), 1)]),
529
+ createBaseVNode("div", _hoisted_27, [
530
+ createBaseVNode("div", _hoisted_28, [createBaseVNode("label", _hoisted_29, toDisplayString(unref(t)("connection.rdpDomain")), 1), withDirectives(createBaseVNode("input", {
531
+ type: "text",
532
+ class: "form-control form-control-sm",
533
+ "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => rdpOptions.domain = $event),
534
+ placeholder: unref(t)("connection.rdpDomainPlaceholder")
535
+ }, null, 8, _hoisted_30), [[vModelText, rdpOptions.domain]])]),
536
+ createBaseVNode("div", _hoisted_31, [createBaseVNode("label", _hoisted_32, toDisplayString(unref(t)("connection.rdpWidth")), 1), withDirectives(createBaseVNode("input", {
537
+ type: "number",
538
+ class: "form-control form-control-sm",
539
+ "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => rdpOptions.width = $event),
540
+ min: "640",
541
+ max: "4096"
542
+ }, null, 512), [[
543
+ vModelText,
544
+ rdpOptions.width,
545
+ void 0,
546
+ { number: true }
547
+ ]])]),
548
+ createBaseVNode("div", _hoisted_33, [createBaseVNode("label", _hoisted_34, toDisplayString(unref(t)("connection.rdpHeight")), 1), withDirectives(createBaseVNode("input", {
549
+ type: "number",
550
+ class: "form-control form-control-sm",
551
+ "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => rdpOptions.height = $event),
552
+ min: "480",
553
+ max: "2160"
554
+ }, null, 512), [[
555
+ vModelText,
556
+ rdpOptions.height,
557
+ void 0,
558
+ { number: true }
559
+ ]])])
560
+ ]),
561
+ createBaseVNode("small", _hoisted_35, [_cache[48] || (_cache[48] = createBaseVNode("i", { class: "bi bi-info-circle me-1" }, null, -1)), createTextVNode(toDisplayString(unref(t)("connection.rdpHint")), 1)])
562
+ ])) : createCommentVNode("", true),
563
+ form.type === "ssh" ? (openBlock(), createElementBlock("div", _hoisted_36, [
564
+ createBaseVNode("label", _hoisted_37, [_cache[49] || (_cache[49] = createBaseVNode("i", { class: "bi bi-shield-lock me-1" }, null, -1)), createTextVNode(toDisplayString(unref(t)("connection.authType")), 1)]),
565
+ createBaseVNode("div", _hoisted_38, [
566
+ withDirectives(createBaseVNode("input", {
567
+ type: "radio",
568
+ class: "btn-check",
569
+ name: "authType",
570
+ id: "auth-auto",
571
+ value: "auto",
572
+ "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => form.authType = $event)
573
+ }, null, 512), [[vModelRadio, form.authType]]),
574
+ createBaseVNode("label", _hoisted_39, [_cache[50] || (_cache[50] = createBaseVNode("i", { class: "bi bi-magic me-1" }, null, -1)), createTextVNode(toDisplayString(unref(t)("connection.auto")), 1)]),
575
+ withDirectives(createBaseVNode("input", {
576
+ type: "radio",
577
+ class: "btn-check",
578
+ name: "authType",
579
+ id: "auth-password",
580
+ value: "password",
581
+ "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => form.authType = $event)
582
+ }, null, 512), [[vModelRadio, form.authType]]),
583
+ createBaseVNode("label", _hoisted_40, [_cache[51] || (_cache[51] = createBaseVNode("i", { class: "bi bi-key me-1" }, null, -1)), createTextVNode(toDisplayString(unref(t)("connection.password")), 1)]),
584
+ withDirectives(createBaseVNode("input", {
585
+ type: "radio",
586
+ class: "btn-check",
587
+ name: "authType",
588
+ id: "auth-key",
589
+ value: "privateKey",
590
+ "onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => form.authType = $event)
591
+ }, null, 512), [[vModelRadio, form.authType]]),
592
+ createBaseVNode("label", _hoisted_41, [_cache[52] || (_cache[52] = createBaseVNode("i", { class: "bi bi-file-earmark-lock me-1" }, null, -1)), createTextVNode(toDisplayString(unref(t)("connection.privateKey")), 1)])
593
+ ]),
594
+ form.authType === "auto" ? (openBlock(), createElementBlock("small", _hoisted_42, [_cache[53] || (_cache[53] = createBaseVNode("i", { class: "bi bi-info-circle me-1" }, null, -1)), createTextVNode(toDisplayString(unref(t)("connection.autoHint")), 1)])) : createCommentVNode("", true)
595
+ ])) : createCommentVNode("", true),
596
+ isRdp.value || form.authType === "password" ? (openBlock(), createElementBlock("div", _hoisted_43, [createBaseVNode("label", _hoisted_44, toDisplayString(unref(t)("connection.passwordLabel")), 1), withDirectives(createBaseVNode("input", {
597
+ type: "password",
598
+ class: "form-control",
599
+ "onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => form.password = $event),
600
+ placeholder: unref(t)("connection.passwordPlaceholder")
601
+ }, null, 8, _hoisted_45), [[vModelText, form.password]])])) : createCommentVNode("", true),
602
+ form.authType === "privateKey" ? (openBlock(), createElementBlock("div", _hoisted_46, [
603
+ createBaseVNode("label", _hoisted_47, toDisplayString(unref(t)("connection.privateKeyContent")), 1),
604
+ withDirectives(createBaseVNode("textarea", {
605
+ class: "form-control",
606
+ "onUpdate:modelValue": _cache[14] || (_cache[14] = ($event) => form.privateKey = $event),
607
+ rows: "5",
608
+ placeholder: unref(t)("connection.privateKeyPlaceholder")
609
+ }, null, 8, _hoisted_48), [[vModelText, form.privateKey]]),
610
+ createBaseVNode("div", _hoisted_49, [createBaseVNode("label", _hoisted_50, toDisplayString(unref(t)("connection.passphrase")), 1), withDirectives(createBaseVNode("input", {
611
+ type: "password",
612
+ class: "form-control",
613
+ "onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => form.passphrase = $event),
614
+ placeholder: unref(t)("connection.passphrasePlaceholder")
615
+ }, null, 8, _hoisted_51), [[vModelText, form.passphrase]])]),
616
+ createBaseVNode("div", _hoisted_52, [createBaseVNode("button", {
617
+ type: "button",
618
+ class: "btn btn-sm btn-outline-secondary",
619
+ onClick: loadPrivateKey
620
+ }, [_cache[54] || (_cache[54] = createBaseVNode("i", { class: "bi bi-folder-open me-1" }, null, -1)), createTextVNode(toDisplayString(unref(t)("connection.loadFromFile")), 1)])])
621
+ ])) : createCommentVNode("", true),
622
+ form.type === "ssh" ? (openBlock(), createElementBlock("div", _hoisted_53, [createBaseVNode("div", {
623
+ class: "card-header",
624
+ onClick: _cache[16] || (_cache[16] = ($event) => showStartupScript.value = !showStartupScript.value),
625
+ style: { "cursor": "pointer" }
626
+ }, [
627
+ _cache[55] || (_cache[55] = createBaseVNode("i", { class: "bi bi-lightning-charge me-1" }, null, -1)),
628
+ createTextVNode(toDisplayString(unref(t)("connection.startupScript")) + " ", 1),
629
+ createBaseVNode("i", { class: normalizeClass(showStartupScript.value ? "bi bi-chevron-up float-end" : "bi bi-chevron-down float-end") }, null, 2)
630
+ ]), withDirectives(createBaseVNode("div", _hoisted_54, [
631
+ createBaseVNode("div", _hoisted_55, [
632
+ withDirectives(createBaseVNode("input", {
633
+ class: "form-check-input",
634
+ type: "checkbox",
635
+ "onUpdate:modelValue": _cache[17] || (_cache[17] = ($event) => form.forwardAgent = $event),
636
+ id: "forwardAgent"
637
+ }, null, 512), [[vModelCheckbox, form.forwardAgent]]),
638
+ createBaseVNode("label", _hoisted_56, [_cache[56] || (_cache[56] = createBaseVNode("i", { class: "bi bi-arrow-repeat me-1" }, null, -1)), createTextVNode(toDisplayString(unref(t)("connection.forwardAgent")), 1)]),
639
+ createBaseVNode("small", _hoisted_57, [_cache[57] || (_cache[57] = createBaseVNode("i", { class: "bi bi-info-circle me-1" }, null, -1)), createTextVNode(toDisplayString(unref(t)("connection.forwardAgentHint")), 1)])
640
+ ]),
641
+ withDirectives(createBaseVNode("textarea", {
642
+ class: "form-control",
643
+ "onUpdate:modelValue": _cache[18] || (_cache[18] = ($event) => form.startupScript = $event),
644
+ rows: "3",
645
+ placeholder: unref(t)("connection.startupScriptPlaceholder")
646
+ }, null, 8, _hoisted_58), [[vModelText, form.startupScript]]),
647
+ createBaseVNode("small", _hoisted_59, [_cache[58] || (_cache[58] = createBaseVNode("i", { class: "bi bi-info-circle me-1" }, null, -1)), createTextVNode(toDisplayString(unref(t)("connection.startupScriptHint")), 1)])
648
+ ], 512), [[vShow, showStartupScript.value]])])) : createCommentVNode("", true),
649
+ form.type === "ssh" ? (openBlock(), createElementBlock("div", _hoisted_60, [createBaseVNode("div", {
650
+ class: "card-header",
651
+ onClick: _cache[19] || (_cache[19] = ($event) => showKeepaliveConfig.value = !showKeepaliveConfig.value),
652
+ style: { "cursor": "pointer" }
653
+ }, [
654
+ _cache[59] || (_cache[59] = createBaseVNode("i", { class: "bi bi-heart-pulse me-1" }, null, -1)),
655
+ createTextVNode(toDisplayString(unref(t)("connection.keepaliveConfig")) + " ", 1),
656
+ createBaseVNode("i", { class: normalizeClass(showKeepaliveConfig.value ? "bi bi-chevron-up float-end" : "bi bi-chevron-down float-end") }, null, 2)
657
+ ]), withDirectives(createBaseVNode("div", _hoisted_61, [createBaseVNode("div", _hoisted_62, [
658
+ withDirectives(createBaseVNode("input", {
659
+ class: "form-check-input",
660
+ type: "checkbox",
661
+ "onUpdate:modelValue": _cache[20] || (_cache[20] = ($event) => keepaliveEnabled.value = $event),
662
+ id: "keepaliveEnabled"
663
+ }, null, 512), [[vModelCheckbox, keepaliveEnabled.value]]),
664
+ createBaseVNode("label", _hoisted_63, [_cache[60] || (_cache[60] = createBaseVNode("i", { class: "bi bi-toggle-on me-1" }, null, -1)), createTextVNode(toDisplayString(unref(t)("connection.keepaliveEnabled")), 1)]),
665
+ createBaseVNode("small", _hoisted_64, [_cache[61] || (_cache[61] = createBaseVNode("i", { class: "bi bi-info-circle me-1" }, null, -1)), createTextVNode(toDisplayString(unref(t)("connection.keepaliveEnabledHint")), 1)])
666
+ ]), keepaliveEnabled.value ? (openBlock(), createElementBlock("div", _hoisted_65, [createBaseVNode("div", _hoisted_66, [
667
+ createBaseVNode("label", _hoisted_67, toDisplayString(unref(t)("connection.keepaliveInterval")), 1),
668
+ withDirectives(createBaseVNode("input", {
669
+ type: "number",
670
+ class: "form-control form-control-sm",
671
+ "onUpdate:modelValue": _cache[21] || (_cache[21] = ($event) => keepaliveInterval.value = $event),
672
+ min: "1000",
673
+ max: "300000",
674
+ placeholder: unref(t)("connection.keepaliveIntervalPlaceholder")
675
+ }, null, 8, _hoisted_68), [[
676
+ vModelText,
677
+ keepaliveInterval.value,
678
+ void 0,
679
+ { number: true }
680
+ ]]),
681
+ createBaseVNode("small", _hoisted_69, toDisplayString(unref(t)("connection.keepaliveIntervalHint")), 1)
682
+ ]), createBaseVNode("div", _hoisted_70, [
683
+ createBaseVNode("label", _hoisted_71, toDisplayString(unref(t)("connection.keepaliveCountMax")), 1),
684
+ withDirectives(createBaseVNode("input", {
685
+ type: "number",
686
+ class: "form-control form-control-sm",
687
+ "onUpdate:modelValue": _cache[22] || (_cache[22] = ($event) => keepaliveCountMax.value = $event),
688
+ min: "1",
689
+ max: "10",
690
+ placeholder: unref(t)("connection.keepaliveCountMaxPlaceholder")
691
+ }, null, 8, _hoisted_72), [[
692
+ vModelText,
693
+ keepaliveCountMax.value,
694
+ void 0,
695
+ { number: true }
696
+ ]]),
697
+ createBaseVNode("small", _hoisted_73, toDisplayString(unref(t)("connection.keepaliveCountMaxHint")), 1)
698
+ ])])) : createCommentVNode("", true)], 512), [[vShow, showKeepaliveConfig.value]])])) : createCommentVNode("", true),
699
+ form.type === "ssh" ? (openBlock(), createElementBlock("div", _hoisted_74, [createBaseVNode("div", {
700
+ class: "card-header",
701
+ onClick: _cache[23] || (_cache[23] = ($event) => showTerminalConfig.value = !showTerminalConfig.value),
702
+ style: { "cursor": "pointer" }
703
+ }, [
704
+ _cache[62] || (_cache[62] = createBaseVNode("i", { class: "bi bi-terminal me-1" }, null, -1)),
705
+ createTextVNode(toDisplayString(unref(t)("connection.terminalConfig")) + " ", 1),
706
+ createBaseVNode("i", { class: normalizeClass(showTerminalConfig.value ? "bi bi-chevron-up float-end" : "bi bi-chevron-down float-end") }, null, 2)
707
+ ]), 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", {
708
+ type: "number",
709
+ class: "form-control form-control-sm",
710
+ "onUpdate:modelValue": _cache[24] || (_cache[24] = ($event) => form.terminal.fontSize = $event),
711
+ min: "8",
712
+ max: "32"
713
+ }, null, 512), [[
714
+ vModelText,
715
+ form.terminal.fontSize,
716
+ void 0,
717
+ { number: true }
718
+ ]])]), createBaseVNode("div", _hoisted_79, [createBaseVNode("label", _hoisted_80, toDisplayString(unref(t)("connection.cursorStyle")), 1), withDirectives(createBaseVNode("select", {
719
+ class: "form-select form-select-sm",
720
+ "onUpdate:modelValue": _cache[25] || (_cache[25] = ($event) => form.terminal.cursorStyle = $event)
721
+ }, [
722
+ createBaseVNode("option", _hoisted_81, toDisplayString(unref(t)("connection.cursorBlock")), 1),
723
+ createBaseVNode("option", _hoisted_82, toDisplayString(unref(t)("connection.cursorUnderline")), 1),
724
+ createBaseVNode("option", _hoisted_83, toDisplayString(unref(t)("connection.cursorBar")), 1)
725
+ ], 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", {
726
+ class: "form-select form-select-sm",
727
+ "onUpdate:modelValue": _cache[26] || (_cache[26] = ($event) => form.terminal.theme = $event)
728
+ }, [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", {
729
+ type: "text",
730
+ class: "form-control form-control-sm",
731
+ "onUpdate:modelValue": _cache[27] || (_cache[27] = ($event) => form.terminal.fontFamily = $event),
732
+ placeholder: "字体"
733
+ }, null, 512), [[vModelText, form.terminal.fontFamily]])])])], 512), [[vShow, showTerminalConfig.value]])])) : createCommentVNode("", true),
734
+ createBaseVNode("div", _hoisted_91, [createBaseVNode("div", {
735
+ class: "card-header",
736
+ onClick: _cache[28] || (_cache[28] = ($event) => showProxyConfig.value = !showProxyConfig.value),
737
+ style: { "cursor": "pointer" }
738
+ }, [
739
+ _cache[63] || (_cache[63] = createBaseVNode("i", { class: "bi bi-shuffle me-1" }, null, -1)),
740
+ createTextVNode(toDisplayString(unref(t)("connection.proxyConfig")) + " ", 1),
741
+ proxyOptions.mode !== "direct" ? (openBlock(), createElementBlock("span", _hoisted_92, toDisplayString(proxyModeLabel.value), 1)) : createCommentVNode("", true),
742
+ createBaseVNode("i", { class: normalizeClass(showProxyConfig.value ? "bi bi-chevron-up float-end" : "bi bi-chevron-down float-end") }, null, 2)
743
+ ]), withDirectives(createBaseVNode("div", _hoisted_93, [
744
+ createBaseVNode("label", _hoisted_94, toDisplayString(unref(t)("connection.proxyMode")), 1),
745
+ withDirectives(createBaseVNode("select", {
746
+ class: "form-select form-select-sm",
747
+ "onUpdate:modelValue": _cache[29] || (_cache[29] = ($event) => proxyOptions.mode = $event)
748
+ }, [
749
+ createBaseVNode("option", _hoisted_95, toDisplayString(unref(t)("connection.proxyModeDirect")), 1),
750
+ createBaseVNode("option", _hoisted_96, toDisplayString(unref(t)("connection.proxyModeSystem")), 1),
751
+ createBaseVNode("option", _hoisted_97, toDisplayString(unref(t)("connection.proxyModeCustom")), 1)
752
+ ], 512), [[vModelSelect, proxyOptions.mode]]),
753
+ createBaseVNode("small", _hoisted_98, [_cache[64] || (_cache[64] = createBaseVNode("i", { class: "bi bi-info-circle me-1" }, null, -1)), createTextVNode(toDisplayString(unref(t)("connection.proxyModeHint")), 1)]),
754
+ proxyOptions.mode === "custom" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
755
+ createBaseVNode("div", _hoisted_99, [createBaseVNode("div", _hoisted_100, [createBaseVNode("label", _hoisted_101, [createTextVNode(toDisplayString(unref(t)("connection.proxyHost")) + " ", 1), _cache[65] || (_cache[65] = createBaseVNode("span", { class: "text-danger" }, "*", -1))]), withDirectives(createBaseVNode("input", {
756
+ type: "text",
757
+ class: "form-control form-control-sm",
758
+ "onUpdate:modelValue": _cache[30] || (_cache[30] = ($event) => proxyOptions.host = $event),
759
+ placeholder: unref(t)("connection.proxyHostPlaceholder")
760
+ }, null, 8, _hoisted_102), [[vModelText, proxyOptions.host]])]), createBaseVNode("div", _hoisted_103, [createBaseVNode("label", _hoisted_104, toDisplayString(unref(t)("connection.proxyPort")), 1), withDirectives(createBaseVNode("input", {
761
+ type: "number",
762
+ class: "form-control form-control-sm",
763
+ "onUpdate:modelValue": _cache[31] || (_cache[31] = ($event) => proxyOptions.port = $event),
764
+ min: "1",
765
+ max: "65535"
766
+ }, null, 512), [[
767
+ vModelText,
768
+ proxyOptions.port,
769
+ void 0,
770
+ { number: true }
771
+ ]])])]),
772
+ createBaseVNode("div", _hoisted_105, [createBaseVNode("div", _hoisted_106, [createBaseVNode("label", _hoisted_107, toDisplayString(unref(t)("connection.proxyType")), 1), withDirectives(createBaseVNode("select", {
773
+ class: "form-select form-select-sm",
774
+ "onUpdate:modelValue": _cache[32] || (_cache[32] = ($event) => proxyOptions.type = $event)
775
+ }, [..._cache[66] || (_cache[66] = [
776
+ createBaseVNode("option", { value: "http" }, "HTTP", -1),
777
+ createBaseVNode("option", { value: "https" }, "HTTPS", -1),
778
+ createBaseVNode("option", { value: "socks4" }, "SOCKS4", -1),
779
+ createBaseVNode("option", { value: "socks5" }, "SOCKS5", -1)
780
+ ])], 512), [[vModelSelect, proxyOptions.type]])]), createBaseVNode("div", _hoisted_108, [createBaseVNode("label", _hoisted_109, toDisplayString(unref(t)("connection.proxyUsername")), 1), withDirectives(createBaseVNode("input", {
781
+ type: "text",
782
+ class: "form-control form-control-sm",
783
+ "onUpdate:modelValue": _cache[33] || (_cache[33] = ($event) => proxyOptions.username = $event),
784
+ autocomplete: "off"
785
+ }, null, 512), [[vModelText, proxyOptions.username]])])]),
786
+ proxyOptions.type !== "socks4" ? (openBlock(), createElementBlock("div", _hoisted_110, [createBaseVNode("label", _hoisted_111, toDisplayString(unref(t)("connection.proxyPassword")), 1), withDirectives(createBaseVNode("input", {
787
+ type: "password",
788
+ class: "form-control form-control-sm",
789
+ "onUpdate:modelValue": _cache[34] || (_cache[34] = ($event) => proxyOptions.password = $event),
790
+ autocomplete: "new-password"
791
+ }, null, 512), [[vModelText, proxyOptions.password]])])) : createCommentVNode("", true),
792
+ createBaseVNode("small", _hoisted_112, [_cache[67] || (_cache[67] = createBaseVNode("i", { class: "bi bi-info-circle me-1" }, null, -1)), createTextVNode(toDisplayString(unref(t)("connection.proxyCustomHint")), 1)])
793
+ ], 64)) : createCommentVNode("", true)
794
+ ], 512), [[vShow, showProxyConfig.value]])]),
795
+ createBaseVNode("div", _hoisted_113, [createBaseVNode("button", {
796
+ type: "button",
797
+ class: "btn btn-outline-secondary",
798
+ onClick: testConn,
799
+ disabled: testing.value
800
+ }, [testing.value ? (openBlock(), createElementBlock("span", _hoisted_115)) : (openBlock(), createElementBlock("i", _hoisted_116)), createTextVNode(" " + toDisplayString(testing.value ? unref(t)("connection.testing") : unref(t)("connection.testConnection")), 1)], 8, _hoisted_114), createBaseVNode("div", null, [createBaseVNode("button", {
801
+ type: "button",
802
+ class: "btn btn-secondary me-2",
803
+ onClick: cancel
804
+ }, toDisplayString(unref(t)("common.cancel")), 1), createBaseVNode("button", {
805
+ type: "submit",
806
+ class: "btn btn-primary",
807
+ disabled: saving.value
808
+ }, [saving.value ? (openBlock(), createElementBlock("span", _hoisted_118)) : createCommentVNode("", true), createTextVNode(" " + toDisplayString(saving.value ? unref(t)("connection.saving") : unref(t)("common.save")), 1)], 8, _hoisted_117)])])
809
+ ], 32)]),
810
+ _: 1
811
+ }, 8, [
812
+ "title",
813
+ "closeButton",
814
+ "embedded"
815
+ ]);
816
+ };
817
+ }
818
+ });
819
+ }));
820
+ // src/components/connection-editor/index.vue?vue&type=style&index=0&scoped=85ecc05c&lang.css
821
+ var init_index_vue_vue_type_style_index_0_scoped_85ecc05c_lang = __esmMin((() => {}));
822
+ // src/components/connection-editor/index.vue
823
+ var connection_editor_default;
824
+ var init_connection_editor = __esmMin((() => {
825
+ init_index_vue_vue_type_script_setup_true_lang();
826
+ init_index_vue_vue_type_script_setup_true_lang();
827
+ init_index_vue_vue_type_style_index_0_scoped_85ecc05c_lang();
828
+ init__plugin_vue_export_helper();
829
+ connection_editor_default = /*#__PURE__*/ _plugin_vue_export_helper_default(index_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-85ecc05c"]]);
830
+ }));
831
+ export { init_connection_editor as n, connection_editor_default as t };