flowpilot 0.0.3 → 0.1.16

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.
@@ -1,1928 +0,0 @@
1
- import { a as useRef, c as Fragment, i as useReducer, n as instance, r as useEffect, s as render, t as jsxDEV } from "./jsx-dev-runtime-DOO7Tqjo.js";
2
- import { t as filterByRelevance } from "./search-cPm8k8mK.js";
3
- //#region src/commands/release/client.tsx
4
- const initPromise = typeof window !== "undefined" && window.__I18N_LOCALE__ && window.__I18N_RESOURCES__ ? instance.init({
5
- lng: window.__I18N_LOCALE__,
6
- fallbackLng: "zh-CN",
7
- resources: window.__I18N_RESOURCES__,
8
- interpolation: { escapeValue: false }
9
- }) : Promise.resolve();
10
- const t = instance.t;
11
- const releaseStyle = `
12
- .page-header {
13
- margin-bottom: 28px;
14
- animation: slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1) 0.05s both;
15
- }
16
- .page-header h2 {
17
- font-size: 22px;
18
- font-weight: 600;
19
- letter-spacing: -0.02em;
20
- margin-bottom: 6px;
21
- }
22
- .page-header p {
23
- font-size: 13px;
24
- color: var(--text-2);
25
- font-weight: 300;
26
- line-height: 1.5;
27
- }
28
-
29
- /* ── Pipeline ── */
30
- .pipeline {
31
- display: flex;
32
- align-items: center;
33
- gap: 0;
34
- margin-bottom: 28px;
35
- animation: slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1) 0.08s both;
36
- }
37
- .pipeline-step {
38
- display: flex;
39
- align-items: center;
40
- gap: 6px;
41
- font-size: 11px;
42
- font-family: var(--mono);
43
- color: var(--text-3);
44
- font-weight: 400;
45
- white-space: nowrap;
46
- }
47
- .pipeline-step.active {
48
- color: var(--neon);
49
- font-weight: 500;
50
- }
51
- .pipeline-step.done {
52
- color: var(--cyan);
53
- }
54
- .pipeline-node {
55
- width: 8px; height: 8px;
56
- border-radius: 50%;
57
- background: var(--text-3);
58
- transition: background 0.3s, box-shadow 0.3s;
59
- }
60
- .pipeline-step.active .pipeline-node {
61
- background: var(--neon);
62
- box-shadow: 0 0 8px var(--neon-glow);
63
- animation: neon-pulse 2s ease infinite;
64
- }
65
- .pipeline-step.done .pipeline-node {
66
- background: var(--cyan);
67
- box-shadow: 0 0 4px var(--cyan-glow);
68
- }
69
- .pipeline-line {
70
- width: 32px;
71
- height: 1px;
72
- background: var(--border);
73
- margin: 0 4px;
74
- transition: background 0.3s;
75
- }
76
- .pipeline-line.done { background: var(--cyan); }
77
-
78
- /* ── Generic select ── */
79
- .sel {
80
- position: relative;
81
- margin-bottom: 16px;
82
- animation: slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1) 0.12s both;
83
- z-index: 1;
84
- }
85
- .sel-trigger {
86
- width: 100%;
87
- display: flex;
88
- align-items: center;
89
- gap: 8px;
90
- padding: 12px 14px;
91
- font-size: 13px;
92
- font-family: var(--sans);
93
- color: var(--text-1, #E2E8F0);
94
- background: var(--bg-input, #0A0E14);
95
- border: 1px solid var(--border);
96
- border-radius: 8px;
97
- cursor: pointer;
98
- outline: none;
99
- transition: border-color 0.2s, box-shadow 0.2s;
100
- text-align: left;
101
- }
102
- .sel-trigger:hover { border-color: var(--border-active); }
103
- .sel-trigger:focus,
104
- .sel-trigger.open {
105
- border-color: var(--neon);
106
- box-shadow: 0 0 0 2px var(--neon-soft), 0 0 8px var(--neon-glow);
107
- }
108
- .sel-trigger-label {
109
- font-size: 11px;
110
- color: var(--text-3, #64748B);
111
- flex-shrink: 0;
112
- }
113
- .sel-trigger-value {
114
- flex: 1;
115
- font-family: var(--mono);
116
- font-size: 13px;
117
- font-weight: 500;
118
- color: var(--text-1, #E2E8F0);
119
- }
120
- .sel-trigger-value.empty {
121
- color: var(--text-3);
122
- font-weight: 300;
123
- }
124
- .sel-trigger-arrow {
125
- color: var(--text-3, #64748B);
126
- font-size: 10px;
127
- transition: transform 0.2s;
128
- }
129
- .sel-trigger.open .sel-trigger-arrow {
130
- transform: rotate(180deg);
131
- }
132
- .sel-dropdown {
133
- position: absolute;
134
- top: calc(100% + 6px);
135
- left: 0; right: 0;
136
- max-height: 280px;
137
- overflow-y: auto;
138
- background: var(--bg-card, #111820);
139
- border: 1px solid rgba(0,255,136,0.08);
140
- border-radius: 8px;
141
- box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 12px rgba(0,255,136,0.03);
142
- z-index: 1000;
143
- animation: dropdown-in 0.12s ease both;
144
- }
145
- .sel-dropdown::-webkit-scrollbar { width: 6px; }
146
- .sel-dropdown::-webkit-scrollbar-track { background: transparent; }
147
- .sel-dropdown::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
148
- .sel-search {
149
- padding: 8px;
150
- border-bottom: 1px solid var(--border);
151
- position: sticky;
152
- top: 0;
153
- background: var(--bg-card, #111820);
154
- z-index: 1;
155
- }
156
- .sel-search-input {
157
- width: 100%;
158
- padding: 6px 10px;
159
- font-size: 12px;
160
- font-family: var(--mono);
161
- color: var(--text-1, #E2E8F0);
162
- background: var(--bg-void, #0A0A0F);
163
- border: 1px solid var(--border);
164
- border-radius: 4px;
165
- outline: none;
166
- transition: border-color 0.15s;
167
- }
168
- .sel-search-input::placeholder { color: var(--text-3); }
169
- .sel-search-input:focus { border-color: var(--neon); }
170
- .sel-item {
171
- padding: 10px 14px;
172
- font-size: 13px;
173
- cursor: pointer;
174
- transition: background 0.1s;
175
- border-left: 3px solid transparent;
176
- color: var(--text-1, #E2E8F0);
177
- }
178
- .sel-item:first-child { border-radius: 7px 7px 0 0; }
179
- .sel-item:last-child { border-radius: 0 0 7px 7px; }
180
- .sel-item:hover,
181
- .sel-item.highlighted { background: var(--bg-hover, rgba(0,255,136,0.04)); }
182
- .sel-item.active {
183
- background: var(--neon-soft, rgba(0,255,136,0.08));
184
- border-left-color: var(--neon);
185
- font-weight: 500;
186
- }
187
- .sel-item-name { font-weight: 500; color: var(--text-1, #E2E8F0); }
188
- .sel-item-sub { font-size: 11px; color: var(--text-3, #64748B); font-family: var(--mono); margin-top: 2px; }
189
- .sel-empty { padding: 12px; text-align: center; color: var(--text-3, #64748B); font-size: 12px; }
190
-
191
- /* ── Spinner ── */
192
- .spinner {
193
- display: inline-block;
194
- width: 14px; height: 14px;
195
- border: 2px solid var(--border);
196
- border-top-color: var(--neon);
197
- border-radius: 50%;
198
- animation: spin 0.6s linear infinite;
199
- }
200
- @keyframes spin { to { transform: rotate(360deg); } }
201
- .loading-row {
202
- display: flex;
203
- align-items: center;
204
- gap: 8px;
205
- padding: 10px 14px;
206
- color: var(--text-3);
207
- font-size: 13px;
208
- margin-bottom: 16px;
209
- animation: slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
210
- }
211
-
212
- /* ── Version display ── */
213
- .version-display {
214
- display: flex;
215
- align-items: center;
216
- gap: 12px;
217
- padding: 14px 20px;
218
- background: var(--bg-card);
219
- border: 1px solid rgba(0,212,255,0.08);
220
- border-radius: 8px;
221
- animation: slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
222
- }
223
- .version-tag { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; font-family: var(--mono); }
224
- .version-number { font-size: 20px; font-weight: 600; font-family: var(--mono); color: var(--cyan); letter-spacing: -0.01em; }
225
- .version-error { color: var(--error); font-size: 13px; animation: slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1) both; }
226
-
227
- .empty-hint { text-align: center; padding: 32px 0; color: var(--text-3); font-size: 13px; animation: slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both; }
228
- .state-error { color: var(--error); font-size: 13px; animation: slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1) both; }
229
-
230
- /* ── Jira ── */
231
- .jira-section { margin-top: 20px; animation: slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1) both; }
232
- .jira-btn {
233
- width: 100%;
234
- min-height: 44px;
235
- padding: 10px 20px;
236
- font-size: 13px;
237
- font-family: var(--sans);
238
- font-weight: 500;
239
- color: var(--bg-void);
240
- background: var(--neon);
241
- border: none;
242
- border-radius: 8px;
243
- cursor: pointer;
244
- transition: background 0.15s, box-shadow 0.2s;
245
- margin-top: 16px;
246
- position: relative;
247
- z-index: 1;
248
- }
249
- .jira-btn:hover { background: var(--neon-hover); box-shadow: 0 0 12px var(--neon-glow), 0 2px 12px rgba(0,255,136,0.2); }
250
- .jira-btn:disabled { opacity: 0.5; cursor: not-allowed; }
251
-
252
- /* ── Custom Checkbox ── */
253
- input[type="checkbox"] {
254
- appearance: none;
255
- width: 16px;
256
- height: 16px;
257
- border: 1px solid var(--border, rgba(0,255,136,0.2));
258
- border-radius: 3px;
259
- background: var(--bg-input, #0A0E14);
260
- cursor: pointer;
261
- position: relative;
262
- transition: border-color 0.15s, background 0.15s;
263
- }
264
- input[type="checkbox"]:checked {
265
- background: var(--neon, #00ff88);
266
- border-color: var(--neon, #00ff88);
267
- }
268
- input[type="checkbox"]:checked::after {
269
- content: "✓";
270
- position: absolute;
271
- top: -1px;
272
- left: 2px;
273
- font-size: 12px;
274
- font-weight: 700;
275
- color: var(--bg-void, #0A0A0F);
276
- }
277
- input[type="checkbox"]:focus-visible {
278
- outline: 2px solid var(--neon-soft, rgba(0,255,136,0.2));
279
- outline-offset: 2px;
280
- }
281
- .jira-result {
282
- margin-top: 12px;
283
- padding: 12px 16px;
284
- background: var(--bg-card);
285
- border: 1px solid var(--border);
286
- border-radius: 8px;
287
- animation: slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
288
- position: relative;
289
- z-index: 1;
290
- }
291
- .jira-result-key {
292
- font-family: var(--mono);
293
- font-size: 14px;
294
- font-weight: 600;
295
- color: var(--neon);
296
- text-decoration: none;
297
- border-bottom: 1px dashed rgba(0,255,136,0.3);
298
- transition: border-color 0.2s;
299
- }
300
- .jira-result-key:hover { border-bottom-color: var(--neon); }
301
- .jira-result-label { font-size: 11px; color: var(--text-3); margin-bottom: 4px; }
302
- .jira-result-badge { display: inline-block; font-size: 10px; padding: 2px 8px; border-radius: 4px; margin-left: 8px; font-weight: 500; }
303
- .jira-result-badge.created { background: var(--neon-soft); color: var(--neon); }
304
- .jira-result-badge.exists { background: var(--cyan-soft); color: var(--cyan); }
305
- .jira-error { margin-top: 12px; color: var(--error); font-size: 13px; animation: slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1) both; }
306
-
307
- /* ── History ── */
308
- .history-section {
309
- margin-bottom: 24px;
310
- animation: slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1) 0.06s both;
311
- }
312
- .history-title {
313
- font-size: 16px;
314
- font-weight: 600;
315
- margin-bottom: 12px;
316
- color: var(--text-1);
317
- }
318
- .history-list {
319
- display: flex;
320
- flex-direction: column;
321
- gap: 8px;
322
- }
323
- .history-item {
324
- display: flex;
325
- flex-direction: column;
326
- padding: 12px 16px;
327
- background: var(--bg-card);
328
- border: 1px solid var(--border);
329
- border-radius: 8px;
330
- transition: border-color 0.15s, box-shadow 0.15s;
331
- animation: slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
332
- }
333
- .history-item-row {
334
- display: flex;
335
- align-items: center;
336
- justify-content: space-between;
337
- }
338
- .history-item:hover {
339
- border-color: var(--border-active);
340
- box-shadow: 0 2px 8px rgba(0,0,0,0.3);
341
- }
342
- .history-info {
343
- display: flex;
344
- align-items: center;
345
- gap: 12px;
346
- flex: 1;
347
- }
348
- .history-project { font-weight: 500; color: var(--text-1); font-size: 14px; }
349
- .history-detail { font-size: 12px; color: var(--text-3); font-family: var(--mono); }
350
- .history-actions { display: flex; align-items: center; gap: 8px; }
351
- .history-quick-btn {
352
- padding: 6px 14px;
353
- font-size: 12px;
354
- font-family: var(--sans);
355
- font-weight: 500;
356
- color: var(--bg-void);
357
- background: var(--neon);
358
- border: none;
359
- border-radius: 6px;
360
- cursor: pointer;
361
- transition: background 0.15s;
362
- }
363
- .history-quick-btn:hover { background: var(--neon-hover); }
364
- .history-quick-btn:disabled { opacity: 0.5; cursor: not-allowed; }
365
- .history-quick-btn.executing {
366
- background: var(--border);
367
- color: var(--text-3);
368
- }
369
- .history-footer {
370
- display: flex;
371
- align-items: center;
372
- justify-content: space-between;
373
- margin-top: 16px;
374
- padding-top: 16px;
375
- border-top: 1px solid var(--border);
376
- }
377
- .history-new-btn {
378
- padding: 8px 16px;
379
- font-size: 13px;
380
- font-family: var(--sans);
381
- font-weight: 500;
382
- color: var(--bg-void);
383
- background: var(--neon);
384
- border: none;
385
- border-radius: 8px;
386
- cursor: pointer;
387
- transition: background 0.15s, box-shadow 0.2s;
388
- }
389
- .history-new-btn:hover { background: var(--neon-hover); box-shadow: 0 0 12px var(--neon-glow); }
390
- .history-clear-btn {
391
- padding: 8px 16px;
392
- font-size: 13px;
393
- font-family: var(--sans);
394
- font-weight: 400;
395
- color: var(--text-3);
396
- background: transparent;
397
- border: 1px solid var(--border);
398
- border-radius: 8px;
399
- cursor: pointer;
400
- transition: border-color 0.15s, color 0.15s;
401
- }
402
- .history-clear-btn:hover { border-color: var(--error); color: var(--error); }
403
- .history-result {
404
- margin-top: 12px;
405
- padding: 10px 14px;
406
- background: var(--bg-void);
407
- border: 1px solid rgba(0,255,136,0.08);
408
- border-radius: 8px;
409
- animation: slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
410
- }
411
- .history-result-key {
412
- font-family: var(--mono);
413
- font-size: 14px;
414
- font-weight: 600;
415
- color: var(--neon);
416
- text-decoration: none;
417
- }
418
- .history-result-error {
419
- color: var(--error);
420
- font-size: 13px;
421
- }
422
-
423
- /* ── Modal ── */
424
- .modal-overlay {
425
- position: fixed;
426
- top: 0; left: 0; right: 0; bottom: 0;
427
- background: rgba(0,0,0,0.7);
428
- display: flex;
429
- align-items: center;
430
- justify-content: center;
431
- z-index: 2000;
432
- animation: fade-in 0.2s ease both;
433
- }
434
- .modal-content {
435
- width: 90%;
436
- max-width: 560px;
437
- background: var(--bg-void);
438
- border: 1px solid var(--border);
439
- border-radius: 12px;
440
- padding: 24px;
441
- animation: slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
442
- }
443
- .modal-header {
444
- display: flex;
445
- align-items: center;
446
- justify-content: space-between;
447
- margin-bottom: 20px;
448
- }
449
- .modal-title { font-size: 18px; font-weight: 600; color: var(--text-1); }
450
- .modal-close {
451
- width: 32px; height: 32px;
452
- display: flex;
453
- align-items: center;
454
- justify-content: center;
455
- font-size: 16px;
456
- color: var(--text-3);
457
- background: transparent;
458
- border: 1px solid var(--border);
459
- border-radius: 6px;
460
- cursor: pointer;
461
- transition: border-color 0.15s, color 0.15s;
462
- }
463
- .modal-close:hover { border-color: var(--text-2); color: var(--text-2); }
464
- `;
465
- const initial = {
466
- jiraHost: "",
467
- projects: [],
468
- projectsLoading: true,
469
- projectsError: "",
470
- projectOpen: false,
471
- projectSearch: "",
472
- projectIndex: -1,
473
- selected: null,
474
- branches: [],
475
- branchesLoading: false,
476
- branchOpen: false,
477
- branchSearch: "",
478
- branchIndex: -1,
479
- selectedBranch: "",
480
- pomInfo: null,
481
- pomLoading: false,
482
- pomError: "",
483
- jiraProjects: [],
484
- jiraProjectsLoading: false,
485
- jiraProjectOpen: false,
486
- jiraProjectSearch: "",
487
- jiraProjectIndex: -1,
488
- selectedJiraProject: null,
489
- jiraStatus: "idle",
490
- jiraResult: null,
491
- jiraError: "",
492
- mrStatus: "idle",
493
- mrUrl: "",
494
- mrError: "",
495
- mrBranches: [],
496
- mrSourceBranch: "",
497
- mrBranchOpen: false,
498
- mrBranchSearch: "",
499
- mrBranchIndex: -1,
500
- history: [],
501
- historyLoading: true,
502
- quickExecuting: null,
503
- quickResults: {},
504
- quickErrors: {},
505
- showNewModal: false,
506
- clearConfirm: false,
507
- createMrChecked: {}
508
- };
509
- const reducer = (state, action) => {
510
- switch (action.type) {
511
- case "SET_JIRA_HOST": return {
512
- ...state,
513
- jiraHost: action.host
514
- };
515
- case "PROJECTS_LOADED": return {
516
- ...state,
517
- projects: action.projects,
518
- projectsLoading: false
519
- };
520
- case "PROJECTS_ERROR": return {
521
- ...state,
522
- projectsError: action.error,
523
- projectsLoading: false
524
- };
525
- case "SET_PROJECT_OPEN": return {
526
- ...state,
527
- projectOpen: action.open,
528
- ...action.open ? {} : {
529
- projectSearch: "",
530
- projectIndex: -1
531
- }
532
- };
533
- case "SET_PROJECT_SEARCH": return {
534
- ...state,
535
- projectSearch: action.search,
536
- projectIndex: -1
537
- };
538
- case "SET_PROJECT_INDEX": return {
539
- ...state,
540
- projectIndex: action.index
541
- };
542
- case "SELECT_PROJECT": return {
543
- ...state,
544
- selected: action.project,
545
- projectOpen: false,
546
- projectSearch: "",
547
- projectIndex: -1,
548
- branches: [],
549
- branchesLoading: false,
550
- selectedBranch: "",
551
- branchOpen: false,
552
- branchSearch: "",
553
- branchIndex: -1,
554
- pomInfo: null,
555
- pomError: "",
556
- selectedJiraProject: null,
557
- jiraStatus: "idle",
558
- jiraResult: null,
559
- jiraError: "",
560
- mrStatus: "idle",
561
- mrUrl: "",
562
- mrError: "",
563
- mrBranches: [],
564
- mrSourceBranch: "",
565
- mrBranchOpen: false,
566
- mrBranchSearch: "",
567
- mrBranchIndex: -1
568
- };
569
- case "CLEAR_PROJECT": return {
570
- ...state,
571
- selected: null,
572
- branches: [],
573
- selectedBranch: "",
574
- branchOpen: false,
575
- branchSearch: "",
576
- branchIndex: -1,
577
- pomInfo: null,
578
- pomError: "",
579
- pomLoading: false,
580
- selectedJiraProject: null,
581
- jiraStatus: "idle",
582
- jiraResult: null,
583
- jiraError: "",
584
- mrStatus: "idle",
585
- mrUrl: "",
586
- mrError: "",
587
- mrBranches: [],
588
- mrSourceBranch: "",
589
- mrBranchOpen: false,
590
- mrBranchSearch: "",
591
- mrBranchIndex: -1
592
- };
593
- case "BRANCHES_LOADING": return {
594
- ...state,
595
- branchesLoading: true,
596
- branches: [],
597
- selectedBranch: ""
598
- };
599
- case "BRANCHES_LOADED": return {
600
- ...state,
601
- branches: action.branches,
602
- branchesLoading: false
603
- };
604
- case "SET_BRANCH_OPEN": return {
605
- ...state,
606
- branchOpen: action.open,
607
- ...action.open ? {} : {
608
- branchSearch: "",
609
- branchIndex: -1
610
- }
611
- };
612
- case "SET_BRANCH_SEARCH": return {
613
- ...state,
614
- branchSearch: action.search,
615
- branchIndex: -1
616
- };
617
- case "SET_BRANCH_INDEX": return {
618
- ...state,
619
- branchIndex: action.index
620
- };
621
- case "SELECT_BRANCH": return {
622
- ...state,
623
- selectedBranch: action.branch,
624
- branchOpen: false,
625
- branchSearch: "",
626
- branchIndex: -1
627
- };
628
- case "POM_LOADING": return {
629
- ...state,
630
- pomLoading: true,
631
- pomError: "",
632
- pomInfo: null
633
- };
634
- case "POM_LOADED": return {
635
- ...state,
636
- pomLoading: false,
637
- pomInfo: action.info
638
- };
639
- case "POM_ERROR": return {
640
- ...state,
641
- pomLoading: false,
642
- pomError: action.error
643
- };
644
- case "JIRA_PROJECTS_LOADING": return {
645
- ...state,
646
- jiraProjectsLoading: true
647
- };
648
- case "JIRA_PROJECTS_LOADED": return {
649
- ...state,
650
- jiraProjects: action.projects,
651
- jiraProjectsLoading: false
652
- };
653
- case "JIRA_PROJECTS_ERROR": return {
654
- ...state,
655
- jiraProjectsLoading: false
656
- };
657
- case "SET_JIRA_PROJECT_OPEN": return {
658
- ...state,
659
- jiraProjectOpen: action.open,
660
- ...action.open ? {} : {
661
- jiraProjectSearch: "",
662
- jiraProjectIndex: -1
663
- }
664
- };
665
- case "SET_JIRA_PROJECT_SEARCH": return {
666
- ...state,
667
- jiraProjectSearch: action.search,
668
- jiraProjectIndex: -1
669
- };
670
- case "SET_JIRA_PROJECT_INDEX": return {
671
- ...state,
672
- jiraProjectIndex: action.index
673
- };
674
- case "SELECT_JIRA_PROJECT": return {
675
- ...state,
676
- selectedJiraProject: action.project,
677
- jiraProjectOpen: false,
678
- jiraProjectSearch: "",
679
- jiraProjectIndex: -1,
680
- jiraStatus: "idle",
681
- jiraResult: null,
682
- jiraError: ""
683
- };
684
- case "CLEAR_JIRA_PROJECT": return {
685
- ...state,
686
- selectedJiraProject: null,
687
- jiraProjectOpen: false,
688
- jiraProjectSearch: "",
689
- jiraProjectIndex: -1,
690
- jiraStatus: "idle",
691
- jiraResult: null,
692
- jiraError: ""
693
- };
694
- case "JIRA_CHECKING": return {
695
- ...state,
696
- jiraStatus: "checking",
697
- jiraResult: null,
698
- jiraError: ""
699
- };
700
- case "JIRA_CREATING": return {
701
- ...state,
702
- jiraStatus: "creating"
703
- };
704
- case "JIRA_DONE": return {
705
- ...state,
706
- jiraStatus: "done",
707
- jiraResult: action.result
708
- };
709
- case "JIRA_ERROR": return {
710
- ...state,
711
- jiraStatus: "error",
712
- jiraError: action.error
713
- };
714
- case "JIRA_RESET": return {
715
- ...state,
716
- jiraStatus: "idle",
717
- jiraResult: null,
718
- jiraError: ""
719
- };
720
- case "SET_HISTORY": return {
721
- ...state,
722
- history: action.history,
723
- historyLoading: false
724
- };
725
- case "QUICK_EXEC_START": return {
726
- ...state,
727
- quickExecuting: action.id
728
- };
729
- case "QUICK_EXEC_SUCCESS": return {
730
- ...state,
731
- quickExecuting: null,
732
- quickResults: {
733
- ...state.quickResults,
734
- [action.id]: action.result
735
- }
736
- };
737
- case "QUICK_EXEC_FAIL": return {
738
- ...state,
739
- quickExecuting: null,
740
- quickErrors: {
741
- ...state.quickErrors,
742
- [action.id]: action.error
743
- }
744
- };
745
- case "SHOW_NEW_MODAL": return {
746
- ...state,
747
- showNewModal: true
748
- };
749
- case "HIDE_NEW_MODAL": return {
750
- ...state,
751
- showNewModal: false
752
- };
753
- case "CLEAR_CONFIRM_TOGGLE": return {
754
- ...state,
755
- clearConfirm: !state.clearConfirm
756
- };
757
- case "CLEAR_HISTORY_DONE": return {
758
- ...state,
759
- history: [],
760
- clearConfirm: false,
761
- quickResults: {},
762
- quickErrors: {}
763
- };
764
- case "TOGGLE_CREATE_MR": return {
765
- ...state,
766
- createMrChecked: {
767
- ...state.createMrChecked,
768
- [action.id]: !state.createMrChecked[action.id]
769
- }
770
- };
771
- case "MR_SELECTING": return {
772
- ...state,
773
- mrStatus: "selecting",
774
- mrBranches: action.branches,
775
- mrSourceBranch: "",
776
- mrError: ""
777
- };
778
- case "MR_SOURCE_SELECTED": return {
779
- ...state,
780
- mrSourceBranch: action.branch,
781
- mrBranchOpen: false,
782
- mrBranchSearch: "",
783
- mrBranchIndex: -1
784
- };
785
- case "SET_MR_BRANCH_OPEN": return {
786
- ...state,
787
- mrBranchOpen: action.open,
788
- ...action.open ? {} : {
789
- mrBranchSearch: "",
790
- mrBranchIndex: -1
791
- }
792
- };
793
- case "SET_MR_BRANCH_SEARCH": return {
794
- ...state,
795
- mrBranchSearch: action.search,
796
- mrBranchIndex: -1
797
- };
798
- case "SET_MR_BRANCH_INDEX": return {
799
- ...state,
800
- mrBranchIndex: action.index
801
- };
802
- case "MR_LOADING": return {
803
- ...state,
804
- mrStatus: "loading",
805
- mrBranches: [],
806
- mrSourceBranch: "",
807
- mrError: ""
808
- };
809
- case "MR_CREATING": return {
810
- ...state,
811
- mrStatus: "creating",
812
- mrUrl: "",
813
- mrError: ""
814
- };
815
- case "MR_DONE": return {
816
- ...state,
817
- mrStatus: "done",
818
- mrUrl: action.mrUrl
819
- };
820
- case "MR_ERROR": return {
821
- ...state,
822
- mrStatus: "error",
823
- mrError: action.error
824
- };
825
- }
826
- };
827
- const cleanVersion = (v) => (v ?? "").split("-")[0];
828
- const selKeyDown = (e, open, len, idx, onSelect, onClose) => {
829
- if (!open || len === 0) return void 0;
830
- switch (e.key) {
831
- case "ArrowDown":
832
- e.preventDefault();
833
- return Math.min(idx + 1, len - 1);
834
- case "ArrowUp":
835
- e.preventDefault();
836
- return Math.max(idx - 1, -1);
837
- case "Enter":
838
- e.preventDefault();
839
- if (idx >= 0) onSelect(idx);
840
- return;
841
- case "Escape":
842
- onClose();
843
- return;
844
- }
845
- };
846
- const pipelineStepClass = (done, active) => done ? "pipeline-step done" : active ? "pipeline-step active" : "pipeline-step";
847
- const pipelineLineClass = (done) => done ? "pipeline-line done" : "pipeline-line";
848
- const HistoryList = ({ s, d }) => {
849
- const handleQuickExecute = async (id) => {
850
- d({
851
- type: "QUICK_EXEC_START",
852
- id
853
- });
854
- try {
855
- const data = await (await fetch(`/release/api/history/${id}/execute`, {
856
- method: "POST",
857
- headers: { "Content-Type": "application/json" },
858
- body: JSON.stringify({ createMr: s.createMrChecked[id] ?? false })
859
- })).json();
860
- if (data.error) d({
861
- type: "QUICK_EXEC_FAIL",
862
- id,
863
- error: data.error
864
- });
865
- else {
866
- d({
867
- type: "QUICK_EXEC_SUCCESS",
868
- id,
869
- result: data
870
- });
871
- d({
872
- type: "SET_HISTORY",
873
- history: await (await fetch("/release/api/history")).json()
874
- });
875
- }
876
- } catch (e) {
877
- d({
878
- type: "QUICK_EXEC_FAIL",
879
- id,
880
- error: e instanceof Error ? e.message : String(e)
881
- });
882
- }
883
- };
884
- const handleClearHistory = async () => {
885
- await fetch("/release/api/history", { method: "DELETE" });
886
- d({ type: "CLEAR_HISTORY_DONE" });
887
- };
888
- return /* @__PURE__ */ jsxDEV("div", {
889
- class: "history-section",
890
- children: [
891
- /* @__PURE__ */ jsxDEV("div", {
892
- class: "history-title",
893
- children: t("web.historyTitle")
894
- }),
895
- s.history.length > 0 ? /* @__PURE__ */ jsxDEV("div", {
896
- class: "history-list",
897
- children: s.history.map((entry) => /* @__PURE__ */ jsxDEV("div", {
898
- class: "history-item",
899
- children: [
900
- /* @__PURE__ */ jsxDEV("div", {
901
- class: "history-item-row",
902
- children: [/* @__PURE__ */ jsxDEV("div", {
903
- class: "history-info",
904
- children: [/* @__PURE__ */ jsxDEV("span", {
905
- class: "history-project",
906
- children: entry.projectName
907
- }), /* @__PURE__ */ jsxDEV("span", {
908
- class: "history-detail",
909
- children: [
910
- entry.branch,
911
- " / ",
912
- entry.jiraProjectKey
913
- ]
914
- })]
915
- }), /* @__PURE__ */ jsxDEV("div", {
916
- class: "history-actions",
917
- children: [/* @__PURE__ */ jsxDEV("label", {
918
- style: "display:flex;align-items:center;gap:4px;font-size:12px;color:var(--text-3);cursor:pointer",
919
- children: [/* @__PURE__ */ jsxDEV("input", {
920
- type: "checkbox",
921
- checked: s.createMrChecked[entry.id] ?? false,
922
- onChange: () => d({
923
- type: "TOGGLE_CREATE_MR",
924
- id: entry.id
925
- })
926
- }), t("web.createMrCheckbox")]
927
- }), /* @__PURE__ */ jsxDEV("button", {
928
- class: `history-quick-btn${s.quickExecuting === entry.id ? " executing" : ""}`,
929
- type: "button",
930
- disabled: s.quickExecuting !== null,
931
- onClick: () => handleQuickExecute(entry.id),
932
- children: s.quickExecuting === entry.id ? t("web.executing") : t("web.quickExecute")
933
- })]
934
- })]
935
- }),
936
- s.quickResults[entry.id] && /* @__PURE__ */ jsxDEV("div", {
937
- class: "history-result",
938
- children: [
939
- /* @__PURE__ */ jsxDEV("a", {
940
- class: "history-result-key",
941
- href: s.quickResults[entry.id].issueUrl,
942
- target: "_blank",
943
- rel: "noreferrer",
944
- children: s.quickResults[entry.id].issueKey
945
- }),
946
- /* @__PURE__ */ jsxDEV("span", {
947
- class: `jira-result-badge ${s.quickResults[entry.id].issueCreated ? "created" : "exists"}`,
948
- children: s.quickResults[entry.id].issueCreated ? t("web.createdBadge") : t("web.existsBadge")
949
- }),
950
- /* @__PURE__ */ jsxDEV("span", {
951
- style: "font-size:12px;color:var(--text-3);margin-left:8px",
952
- children: ["v", s.quickResults[entry.id].version]
953
- }),
954
- s.quickResults[entry.id].versionCreated && /* @__PURE__ */ jsxDEV("span", {
955
- style: "font-size:10px;color:var(--neon);margin-left:4px",
956
- children: t("web.createdBadge")
957
- }),
958
- s.quickResults[entry.id].mrUrl && /* @__PURE__ */ jsxDEV("span", {
959
- style: "font-size:12px;margin-left:12px",
960
- children: /* @__PURE__ */ jsxDEV("a", {
961
- href: s.quickResults[entry.id].mrUrl,
962
- target: "_blank",
963
- rel: "noreferrer",
964
- style: "color:var(--cyan);text-decoration:none;border-bottom:1px dashed var(--cyan)",
965
- children: t("release.mrFromTo", {
966
- source: s.quickResults[entry.id].mrSourceBranch ?? "",
967
- target: s.quickResults[entry.id].mrTargetBranch ?? entry.branch
968
- })
969
- })
970
- })
971
- ]
972
- }),
973
- s.quickErrors[entry.id] && /* @__PURE__ */ jsxDEV("div", {
974
- class: "history-result-error",
975
- children: s.quickErrors[entry.id]
976
- })
977
- ]
978
- }))
979
- }) : /* @__PURE__ */ jsxDEV("div", {
980
- class: "empty-hint",
981
- children: t("web.noHistory")
982
- }),
983
- /* @__PURE__ */ jsxDEV("div", {
984
- class: "history-footer",
985
- children: [/* @__PURE__ */ jsxDEV("button", {
986
- class: "history-new-btn",
987
- type: "button",
988
- onClick: () => d({ type: "SHOW_NEW_MODAL" }),
989
- children: t("web.createNew")
990
- }), s.history.length > 0 && (s.clearConfirm ? /* @__PURE__ */ jsxDEV("div", {
991
- style: "display:flex;align-items:center;gap:8px",
992
- children: [
993
- /* @__PURE__ */ jsxDEV("span", {
994
- style: "font-size:12px;color:var(--text-3)",
995
- children: t("web.clearConfirm")
996
- }),
997
- /* @__PURE__ */ jsxDEV("button", {
998
- class: "history-clear-btn",
999
- type: "button",
1000
- style: "border-color:var(--error);color:var(--error)",
1001
- onClick: handleClearHistory,
1002
- children: t("web.clearHistory")
1003
- }),
1004
- /* @__PURE__ */ jsxDEV("button", {
1005
- class: "history-clear-btn",
1006
- type: "button",
1007
- onClick: () => d({ type: "CLEAR_CONFIRM_TOGGLE" }),
1008
- children: t("web.cancel")
1009
- })
1010
- ]
1011
- }) : /* @__PURE__ */ jsxDEV("button", {
1012
- class: "history-clear-btn",
1013
- type: "button",
1014
- onClick: () => d({ type: "CLEAR_CONFIRM_TOGGLE" }),
1015
- children: t("web.clearHistory")
1016
- }))]
1017
- })
1018
- ]
1019
- });
1020
- };
1021
- const ReleaseFlow = ({ s, d }) => {
1022
- const projectSearchRef = useRef(null);
1023
- const branchSearchRef = useRef(null);
1024
- const jiraSearchRef = useRef(null);
1025
- const mrBranchSearchRef = useRef(null);
1026
- useEffect(() => {
1027
- fetch("/release/api/config").then((r) => r.json()).then((data) => {
1028
- if (data.jiraHost) d({
1029
- type: "SET_JIRA_HOST",
1030
- host: data.jiraHost
1031
- });
1032
- }).catch(() => {});
1033
- }, []);
1034
- useEffect(() => {
1035
- fetch("/release/api/projects").then((r) => r.json()).then((data) => {
1036
- if (data.error) d({
1037
- type: "PROJECTS_ERROR",
1038
- error: data.error
1039
- });
1040
- else d({
1041
- type: "PROJECTS_LOADED",
1042
- projects: data
1043
- });
1044
- }).catch((e) => d({
1045
- type: "PROJECTS_ERROR",
1046
- error: e.message
1047
- }));
1048
- }, []);
1049
- useEffect(() => {
1050
- if (!s.projectOpen && !s.branchOpen && !s.jiraProjectOpen && !s.mrBranchOpen) return;
1051
- const handler = (e) => {
1052
- const target = e.target;
1053
- if (!target.closest(".sel") && !target.closest(".mr-branch-sel")) {
1054
- d({
1055
- type: "SET_PROJECT_OPEN",
1056
- open: false
1057
- });
1058
- d({
1059
- type: "SET_BRANCH_OPEN",
1060
- open: false
1061
- });
1062
- d({
1063
- type: "SET_MR_BRANCH_OPEN",
1064
- open: false
1065
- });
1066
- d({
1067
- type: "SET_JIRA_PROJECT_OPEN",
1068
- open: false
1069
- });
1070
- }
1071
- };
1072
- document.addEventListener("click", handler);
1073
- return () => document.removeEventListener("click", handler);
1074
- }, [
1075
- s.projectOpen,
1076
- s.branchOpen,
1077
- s.jiraProjectOpen
1078
- ]);
1079
- useEffect(() => {
1080
- if (s.projectOpen) setTimeout(() => projectSearchRef.current?.focus(), 50);
1081
- if (s.branchOpen) setTimeout(() => branchSearchRef.current?.focus(), 50);
1082
- if (s.jiraProjectOpen) setTimeout(() => jiraSearchRef.current?.focus(), 50);
1083
- if (s.mrBranchOpen) setTimeout(() => mrBranchSearchRef.current?.focus(), 50);
1084
- }, [
1085
- s.projectOpen,
1086
- s.branchOpen,
1087
- s.jiraProjectOpen,
1088
- s.mrBranchOpen
1089
- ]);
1090
- useEffect(() => {
1091
- if (s.mrStatus !== "creating" || !s.mrSourceBranch || !s.selected) return;
1092
- const jiraUrl2 = s.jiraResult && s.jiraHost ? `${s.jiraHost}/browse/${s.jiraResult.key}` : "";
1093
- fetch("/release/api/create-mr", {
1094
- method: "POST",
1095
- headers: { "Content-Type": "application/json" },
1096
- body: JSON.stringify({
1097
- projectId: s.selected.id,
1098
- targetBranch: s.selectedBranch,
1099
- sourceBranch: s.mrSourceBranch,
1100
- jiraUrl: jiraUrl2
1101
- })
1102
- }).then((r) => r.json()).then((data) => {
1103
- if (data.mrUrl) d({
1104
- type: "MR_DONE",
1105
- mrUrl: data.mrUrl
1106
- });
1107
- else d({
1108
- type: "MR_ERROR",
1109
- error: data.error ?? "Failed"
1110
- });
1111
- }).catch((e) => d({
1112
- type: "MR_ERROR",
1113
- error: e instanceof Error ? e.message : "Failed"
1114
- }));
1115
- }, [s.mrStatus, s.mrSourceBranch]);
1116
- useEffect(() => {
1117
- if (!s.pomInfo?.version || s.jiraProjects.length > 0 || s.jiraProjectsLoading) return;
1118
- d({ type: "JIRA_PROJECTS_LOADING" });
1119
- fetch("/release/api/jira/projects").then((r) => r.json()).then((data) => {
1120
- if (Array.isArray(data)) d({
1121
- type: "JIRA_PROJECTS_LOADED",
1122
- projects: data
1123
- });
1124
- else d({
1125
- type: "JIRA_PROJECTS_ERROR",
1126
- error: data.error ?? "Failed"
1127
- });
1128
- }).catch(() => d({
1129
- type: "JIRA_PROJECTS_ERROR",
1130
- error: "Failed"
1131
- }));
1132
- }, [s.pomInfo?.version]);
1133
- const fetchPom = (projectId, ref) => {
1134
- d({ type: "POM_LOADING" });
1135
- fetch(`/release/api/projects/${projectId}/pom-version?ref=${encodeURIComponent(ref)}`).then((r) => r.json()).then((data) => {
1136
- if (data.error) d({
1137
- type: "POM_ERROR",
1138
- error: data.error
1139
- });
1140
- else d({
1141
- type: "POM_LOADED",
1142
- info: data
1143
- });
1144
- }).catch(() => d({
1145
- type: "POM_ERROR",
1146
- error: "Failed to fetch version"
1147
- }));
1148
- };
1149
- const handleSelectProject = (project) => {
1150
- d({
1151
- type: "SELECT_PROJECT",
1152
- project
1153
- });
1154
- d({ type: "BRANCHES_LOADING" });
1155
- fetch(`/release/api/projects/${project.id}/branches`).then((r) => r.json()).then((data) => {
1156
- d({
1157
- type: "BRANCHES_LOADED",
1158
- branches: "error" in data ? [] : data
1159
- });
1160
- }).catch(() => d({
1161
- type: "BRANCHES_LOADED",
1162
- branches: []
1163
- }));
1164
- };
1165
- const handleSelectBranch = (name) => {
1166
- d({
1167
- type: "SELECT_BRANCH",
1168
- branch: name
1169
- });
1170
- if (s.selected) fetchPom(s.selected.id, name);
1171
- };
1172
- const handleCreateIssue = async () => {
1173
- if (!s.selected || !s.pomInfo?.version || !s.selectedJiraProject) return;
1174
- const artifactId = s.pomInfo.artifactId ?? s.selected.name;
1175
- const projectVersion = cleanVersion(s.pomInfo.version);
1176
- const versionName = `${artifactId}-${projectVersion}`;
1177
- const summary = `${artifactId}-${projectVersion} ${t("web.releaseSuffix") ?? t("release.releaseSuffix")}`;
1178
- d({ type: "JIRA_CHECKING" });
1179
- try {
1180
- const searchData = await (await fetch("/release/api/jira/search", {
1181
- method: "POST",
1182
- headers: { "Content-Type": "application/json" },
1183
- body: JSON.stringify({
1184
- jql: `summary ~ "${summary}" AND project = ${s.selectedJiraProject.key}`,
1185
- maxResults: 1
1186
- })
1187
- })).json();
1188
- if (searchData.error) {
1189
- d({
1190
- type: "JIRA_ERROR",
1191
- error: searchData.error
1192
- });
1193
- return;
1194
- }
1195
- if (searchData.total > 0 && searchData.issues?.[0]) {
1196
- d({
1197
- type: "JIRA_DONE",
1198
- result: {
1199
- key: searchData.issues[0].key,
1200
- exists: true,
1201
- versionName
1202
- }
1203
- });
1204
- await fetch("/release/api/history", {
1205
- method: "POST",
1206
- headers: { "Content-Type": "application/json" },
1207
- body: JSON.stringify({
1208
- id: Date.now().toString(36),
1209
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1210
- projectId: s.selected.id,
1211
- projectName: s.selected.name,
1212
- projectPath: s.selected.pathWithNamespace ?? "",
1213
- branch: s.selectedBranch,
1214
- jiraProjectKey: s.selectedJiraProject.key
1215
- })
1216
- });
1217
- return;
1218
- }
1219
- d({ type: "JIRA_CREATING" });
1220
- const verData = await (await fetch("/release/api/jira/ensure-version", {
1221
- method: "POST",
1222
- headers: { "Content-Type": "application/json" },
1223
- body: JSON.stringify({
1224
- projectKey: s.selectedJiraProject.key,
1225
- versionName
1226
- })
1227
- })).json();
1228
- if (verData.error) {
1229
- d({
1230
- type: "JIRA_ERROR",
1231
- error: verData.error
1232
- });
1233
- return;
1234
- }
1235
- const issueData = await (await fetch("/release/api/jira/create-issue", {
1236
- method: "POST",
1237
- headers: { "Content-Type": "application/json" },
1238
- body: JSON.stringify({
1239
- projectKey: s.selectedJiraProject.key,
1240
- summary,
1241
- issuetypeId: "10000",
1242
- customfield_15800: "无",
1243
- customfield_13410: [{ id: verData.id }],
1244
- customfield_13341: [{ name: "licheng.li" }]
1245
- })
1246
- })).json();
1247
- if (issueData.error) {
1248
- d({
1249
- type: "JIRA_ERROR",
1250
- error: issueData.error
1251
- });
1252
- return;
1253
- }
1254
- d({
1255
- type: "JIRA_DONE",
1256
- result: {
1257
- key: issueData.key,
1258
- exists: false,
1259
- versionName: verData.name
1260
- }
1261
- });
1262
- await fetch("/release/api/history", {
1263
- method: "POST",
1264
- headers: { "Content-Type": "application/json" },
1265
- body: JSON.stringify({
1266
- id: Date.now().toString(36),
1267
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1268
- projectId: s.selected.id,
1269
- projectName: s.selected.name,
1270
- projectPath: s.selected.pathWithNamespace ?? "",
1271
- branch: s.selectedBranch,
1272
- jiraProjectKey: s.selectedJiraProject.key
1273
- })
1274
- });
1275
- } catch (e) {
1276
- d({
1277
- type: "JIRA_ERROR",
1278
- error: e instanceof Error ? e.message : String(e)
1279
- });
1280
- }
1281
- };
1282
- const fp = filterByRelevance(s.projects.map((p) => ({
1283
- ...p,
1284
- name: p.name,
1285
- path: p.pathWithNamespace ?? ""
1286
- })), s.projectSearch);
1287
- const fb = filterByRelevance(s.branches.map((b) => ({
1288
- ...b,
1289
- name: b.name
1290
- })), s.branchSearch);
1291
- const fj = filterByRelevance(s.jiraProjects.map((p) => ({
1292
- ...p,
1293
- name: `${p.key} ${p.name ?? ""}`
1294
- })), s.jiraProjectSearch);
1295
- const jiraUrl = s.jiraResult && s.jiraHost ? `${s.jiraHost}/browse/${s.jiraResult.key}` : "";
1296
- const step1Done = !!s.selected;
1297
- const step1Active = !s.projectsLoading && !step1Done;
1298
- const step2Done = !!s.selectedBranch;
1299
- const step2Active = !!s.selected && !step2Done;
1300
- const step3Done = !!s.pomInfo?.version;
1301
- const step3Active = !!s.selectedBranch && !step3Done;
1302
- const step4Done = !!s.selectedJiraProject;
1303
- const step4Active = !!s.pomInfo?.version && !step4Done;
1304
- const step5Done = !!s.jiraResult;
1305
- const step5Active = !!s.selectedJiraProject && !step5Done;
1306
- if (s.projectsLoading) return /* @__PURE__ */ jsxDEV("div", {
1307
- class: "loading-row",
1308
- children: [/* @__PURE__ */ jsxDEV("span", { class: "spinner" }), t("web.loadingProjects")]
1309
- });
1310
- if (s.projectsError) return /* @__PURE__ */ jsxDEV("div", {
1311
- class: "state-error",
1312
- children: s.projectsError
1313
- });
1314
- return /* @__PURE__ */ jsxDEV("div", { children: [
1315
- /* @__PURE__ */ jsxDEV("div", {
1316
- class: "pipeline",
1317
- children: [
1318
- /* @__PURE__ */ jsxDEV("div", {
1319
- class: pipelineStepClass(step1Done, step1Active),
1320
- children: [/* @__PURE__ */ jsxDEV("span", { class: "pipeline-node" }), t("web.projectLabel")]
1321
- }),
1322
- /* @__PURE__ */ jsxDEV("div", { class: pipelineLineClass(step1Done) }),
1323
- /* @__PURE__ */ jsxDEV("div", {
1324
- class: pipelineStepClass(step2Done, step2Active),
1325
- children: [/* @__PURE__ */ jsxDEV("span", { class: "pipeline-node" }), t("web.branchLabel")]
1326
- }),
1327
- /* @__PURE__ */ jsxDEV("div", { class: pipelineLineClass(step2Done) }),
1328
- /* @__PURE__ */ jsxDEV("div", {
1329
- class: pipelineStepClass(step3Done, step3Active),
1330
- children: [/* @__PURE__ */ jsxDEV("span", { class: "pipeline-node" }), t("web.versionTag")]
1331
- }),
1332
- /* @__PURE__ */ jsxDEV("div", { class: pipelineLineClass(step3Done) }),
1333
- /* @__PURE__ */ jsxDEV("div", {
1334
- class: pipelineStepClass(step4Done, step4Active),
1335
- children: [/* @__PURE__ */ jsxDEV("span", { class: "pipeline-node" }), t("web.jiraProjectLabel")]
1336
- }),
1337
- /* @__PURE__ */ jsxDEV("div", { class: pipelineLineClass(step4Done) }),
1338
- /* @__PURE__ */ jsxDEV("div", {
1339
- class: pipelineStepClass(step5Done, step5Active),
1340
- children: [/* @__PURE__ */ jsxDEV("span", { class: "pipeline-node" }), t("web.createBtn")]
1341
- })
1342
- ]
1343
- }),
1344
- /* @__PURE__ */ jsxDEV("div", {
1345
- class: "sel",
1346
- "data-sel": "project",
1347
- style: `z-index:${s.projectOpen ? 100 : 1}`,
1348
- children: [/* @__PURE__ */ jsxDEV("button", {
1349
- class: `sel-trigger${s.projectOpen ? " open" : ""}`,
1350
- type: "button",
1351
- role: "combobox",
1352
- "aria-expanded": s.projectOpen,
1353
- "aria-haspopup": "listbox",
1354
- onClick: () => {
1355
- d({
1356
- type: "SET_BRANCH_OPEN",
1357
- open: false
1358
- });
1359
- d({
1360
- type: "SET_JIRA_PROJECT_OPEN",
1361
- open: false
1362
- });
1363
- d({
1364
- type: "SET_MR_BRANCH_OPEN",
1365
- open: false
1366
- });
1367
- d({
1368
- type: "SET_PROJECT_OPEN",
1369
- open: !s.projectOpen
1370
- });
1371
- },
1372
- children: [
1373
- /* @__PURE__ */ jsxDEV("span", {
1374
- class: "sel-trigger-label",
1375
- children: t("web.projectLabel")
1376
- }),
1377
- /* @__PURE__ */ jsxDEV("span", {
1378
- class: `sel-trigger-value${s.selected ? "" : " empty"}`,
1379
- children: s.selected ? s.selected.name : t("web.selectProject")
1380
- }),
1381
- /* @__PURE__ */ jsxDEV("span", {
1382
- class: "sel-trigger-arrow",
1383
- children: "▼"
1384
- })
1385
- ]
1386
- }), s.projectOpen && /* @__PURE__ */ jsxDEV("div", {
1387
- class: "sel-dropdown",
1388
- role: "listbox",
1389
- "aria-label": t("web.selectProject"),
1390
- children: [/* @__PURE__ */ jsxDEV("div", {
1391
- class: "sel-search",
1392
- children: /* @__PURE__ */ jsxDEV("input", {
1393
- ref: projectSearchRef,
1394
- class: "sel-search-input",
1395
- type: "text",
1396
- placeholder: t("web.searchProjects"),
1397
- value: s.projectSearch,
1398
- onChange: (e) => d({
1399
- type: "SET_PROJECT_SEARCH",
1400
- search: e.target.value
1401
- }),
1402
- onKeyDown: (e) => {
1403
- const n = selKeyDown(e, s.projectOpen, fp.length, s.projectIndex, (i) => {
1404
- const p = fp[i];
1405
- if (p) handleSelectProject(p);
1406
- }, () => d({
1407
- type: "SET_PROJECT_OPEN",
1408
- open: false
1409
- }));
1410
- if (n !== void 0) d({
1411
- type: "SET_PROJECT_INDEX",
1412
- index: n
1413
- });
1414
- }
1415
- })
1416
- }), fp.length > 0 ? fp.map((p, i) => /* @__PURE__ */ jsxDEV("div", {
1417
- class: `sel-item${s.selected?.id === p.id ? " active" : ""}${i === s.projectIndex ? " highlighted" : ""}`,
1418
- onMouseEnter: () => d({
1419
- type: "SET_PROJECT_INDEX",
1420
- index: i
1421
- }),
1422
- onClick: () => handleSelectProject(p),
1423
- children: [/* @__PURE__ */ jsxDEV("div", {
1424
- class: "sel-item-name",
1425
- children: p.name
1426
- }), /* @__PURE__ */ jsxDEV("div", {
1427
- class: "sel-item-sub",
1428
- children: p.pathWithNamespace
1429
- })]
1430
- })) : /* @__PURE__ */ jsxDEV("div", {
1431
- class: "sel-empty",
1432
- children: t("web.noProjects")
1433
- })]
1434
- })]
1435
- }),
1436
- s.selected && (s.branchesLoading ? /* @__PURE__ */ jsxDEV("div", {
1437
- class: "loading-row",
1438
- children: [/* @__PURE__ */ jsxDEV("span", { class: "spinner" }), t("web.loadingBranches")]
1439
- }) : s.branches.length > 0 && /* @__PURE__ */ jsxDEV("div", {
1440
- class: "sel",
1441
- "data-sel": "branch",
1442
- style: `z-index:${s.branchOpen ? 100 : 1}`,
1443
- children: [/* @__PURE__ */ jsxDEV("button", {
1444
- class: `sel-trigger${s.branchOpen ? " open" : ""}`,
1445
- type: "button",
1446
- role: "combobox",
1447
- "aria-expanded": s.branchOpen,
1448
- "aria-haspopup": "listbox",
1449
- onClick: () => {
1450
- d({
1451
- type: "SET_PROJECT_OPEN",
1452
- open: false
1453
- });
1454
- d({
1455
- type: "SET_JIRA_PROJECT_OPEN",
1456
- open: false
1457
- });
1458
- d({
1459
- type: "SET_MR_BRANCH_OPEN",
1460
- open: false
1461
- });
1462
- d({
1463
- type: "SET_BRANCH_OPEN",
1464
- open: !s.branchOpen
1465
- });
1466
- },
1467
- children: [
1468
- /* @__PURE__ */ jsxDEV("span", {
1469
- class: "sel-trigger-label",
1470
- children: t("web.branchLabel")
1471
- }),
1472
- /* @__PURE__ */ jsxDEV("span", {
1473
- class: `sel-trigger-value${s.selectedBranch ? "" : " empty"}`,
1474
- children: s.selectedBranch || t("web.selectBranch")
1475
- }),
1476
- /* @__PURE__ */ jsxDEV("span", {
1477
- class: "sel-trigger-arrow",
1478
- children: "▼"
1479
- })
1480
- ]
1481
- }), s.branchOpen && /* @__PURE__ */ jsxDEV("div", {
1482
- class: "sel-dropdown",
1483
- role: "listbox",
1484
- "aria-label": t("web.selectBranch"),
1485
- children: [/* @__PURE__ */ jsxDEV("div", {
1486
- class: "sel-search",
1487
- children: /* @__PURE__ */ jsxDEV("input", {
1488
- ref: branchSearchRef,
1489
- class: "sel-search-input",
1490
- type: "text",
1491
- placeholder: t("web.filterBranches"),
1492
- value: s.branchSearch,
1493
- onChange: (e) => d({
1494
- type: "SET_BRANCH_SEARCH",
1495
- search: e.target.value
1496
- }),
1497
- onKeyDown: (e) => {
1498
- const n = selKeyDown(e, s.branchOpen, fb.length, s.branchIndex, (i) => {
1499
- const b = fb[i];
1500
- if (b) handleSelectBranch(b.name);
1501
- }, () => d({
1502
- type: "SET_BRANCH_OPEN",
1503
- open: false
1504
- }));
1505
- if (n !== void 0) d({
1506
- type: "SET_BRANCH_INDEX",
1507
- index: n
1508
- });
1509
- }
1510
- })
1511
- }), fb.length > 0 ? fb.map((b, i) => /* @__PURE__ */ jsxDEV("div", {
1512
- class: `sel-item${b.name === s.selectedBranch ? " active" : ""}${i === s.branchIndex ? " highlighted" : ""}`,
1513
- onMouseEnter: () => d({
1514
- type: "SET_BRANCH_INDEX",
1515
- index: i
1516
- }),
1517
- onClick: () => handleSelectBranch(b.name),
1518
- children: [/* @__PURE__ */ jsxDEV("span", {
1519
- class: "sel-item-name",
1520
- children: b.name
1521
- }), b.default && /* @__PURE__ */ jsxDEV("span", {
1522
- style: "font-size:10px;color:var(--neon);margin-left:6px",
1523
- children: t("web.defaultBranch")
1524
- })]
1525
- })) : /* @__PURE__ */ jsxDEV("div", {
1526
- class: "sel-empty",
1527
- children: t("web.noBranches")
1528
- })]
1529
- })]
1530
- })),
1531
- s.selected && s.selectedBranch && !s.branchesLoading && (s.pomLoading ? /* @__PURE__ */ jsxDEV("div", {
1532
- class: "loading-row",
1533
- children: [/* @__PURE__ */ jsxDEV("span", { class: "spinner" }), t("web.loadingVersion")]
1534
- }) : s.pomError ? /* @__PURE__ */ jsxDEV("div", {
1535
- class: "version-error",
1536
- role: "alert",
1537
- children: s.pomError.includes("404") ? t("web.noPom") : s.pomError
1538
- }) : s.pomInfo && /* @__PURE__ */ jsxDEV("div", {
1539
- class: "version-display",
1540
- children: [/* @__PURE__ */ jsxDEV("span", {
1541
- class: "version-tag",
1542
- children: t("web.versionTag")
1543
- }), /* @__PURE__ */ jsxDEV("span", {
1544
- class: "version-number",
1545
- children: cleanVersion(s.pomInfo.version)
1546
- })]
1547
- })),
1548
- s.selected && s.pomInfo?.version && !s.pomLoading && /* @__PURE__ */ jsxDEV("div", {
1549
- class: "jira-section",
1550
- children: [
1551
- s.jiraProjectsLoading ? /* @__PURE__ */ jsxDEV("div", {
1552
- class: "loading-row",
1553
- children: [/* @__PURE__ */ jsxDEV("span", { class: "spinner" }), t("web.loadingJiraProjects")]
1554
- }) : /* @__PURE__ */ jsxDEV("div", {
1555
- class: "sel",
1556
- "data-sel": "jira",
1557
- style: `z-index:${s.jiraProjectOpen ? 100 : 1}`,
1558
- children: [/* @__PURE__ */ jsxDEV("button", {
1559
- class: `sel-trigger${s.jiraProjectOpen ? " open" : ""}`,
1560
- type: "button",
1561
- role: "combobox",
1562
- "aria-expanded": s.jiraProjectOpen,
1563
- "aria-haspopup": "listbox",
1564
- onClick: () => {
1565
- d({
1566
- type: "SET_PROJECT_OPEN",
1567
- open: false
1568
- });
1569
- d({
1570
- type: "SET_BRANCH_OPEN",
1571
- open: false
1572
- });
1573
- d({
1574
- type: "SET_JIRA_PROJECT_OPEN",
1575
- open: !s.jiraProjectOpen
1576
- });
1577
- },
1578
- children: [
1579
- /* @__PURE__ */ jsxDEV("span", {
1580
- class: "sel-trigger-label",
1581
- children: t("web.jiraProjectLabel")
1582
- }),
1583
- /* @__PURE__ */ jsxDEV("span", {
1584
- class: `sel-trigger-value${s.selectedJiraProject ? "" : " empty"}`,
1585
- children: s.selectedJiraProject ? `${s.selectedJiraProject.key} - ${s.selectedJiraProject.name ?? ""}` : t("web.selectJiraProject")
1586
- }),
1587
- /* @__PURE__ */ jsxDEV("span", {
1588
- class: "sel-trigger-arrow",
1589
- children: "▼"
1590
- })
1591
- ]
1592
- }), s.jiraProjectOpen && /* @__PURE__ */ jsxDEV("div", {
1593
- class: "sel-dropdown",
1594
- role: "listbox",
1595
- "aria-label": t("web.selectJiraProject"),
1596
- children: [/* @__PURE__ */ jsxDEV("div", {
1597
- class: "sel-search",
1598
- children: /* @__PURE__ */ jsxDEV("input", {
1599
- ref: jiraSearchRef,
1600
- class: "sel-search-input",
1601
- type: "text",
1602
- placeholder: t("web.searchJiraProject"),
1603
- value: s.jiraProjectSearch,
1604
- onChange: (e) => d({
1605
- type: "SET_JIRA_PROJECT_SEARCH",
1606
- search: e.target.value
1607
- }),
1608
- onKeyDown: (e) => {
1609
- const n = selKeyDown(e, s.jiraProjectOpen, fj.length, s.jiraProjectIndex, (i) => {
1610
- const p = fj[i];
1611
- if (p) d({
1612
- type: "SELECT_JIRA_PROJECT",
1613
- project: p
1614
- });
1615
- }, () => d({
1616
- type: "SET_JIRA_PROJECT_OPEN",
1617
- open: false
1618
- }));
1619
- if (n !== void 0) d({
1620
- type: "SET_JIRA_PROJECT_INDEX",
1621
- index: n
1622
- });
1623
- }
1624
- })
1625
- }), fj.length > 0 ? fj.map((p, i) => /* @__PURE__ */ jsxDEV("div", {
1626
- class: `sel-item${s.selectedJiraProject?.key === p.key ? " active" : ""}${i === s.jiraProjectIndex ? " highlighted" : ""}`,
1627
- onMouseEnter: () => d({
1628
- type: "SET_JIRA_PROJECT_INDEX",
1629
- index: i
1630
- }),
1631
- onClick: () => d({
1632
- type: "SELECT_JIRA_PROJECT",
1633
- project: p
1634
- }),
1635
- children: [/* @__PURE__ */ jsxDEV("span", {
1636
- class: "sel-item-name",
1637
- children: p.key
1638
- }), p.name && /* @__PURE__ */ jsxDEV("div", {
1639
- class: "sel-item-sub",
1640
- children: p.name
1641
- })]
1642
- })) : /* @__PURE__ */ jsxDEV("div", {
1643
- class: "sel-empty",
1644
- children: t("web.noJiraProjects")
1645
- })]
1646
- })]
1647
- }),
1648
- /* @__PURE__ */ jsxDEV("button", {
1649
- class: "jira-btn",
1650
- type: "button",
1651
- disabled: !s.selectedJiraProject || s.jiraStatus === "checking" || s.jiraStatus === "creating",
1652
- onClick: handleCreateIssue,
1653
- children: s.jiraStatus === "checking" ? t("web.checkingBtn") : s.jiraStatus === "creating" ? t("web.creatingBtn") : t("web.createBtn")
1654
- }),
1655
- (s.jiraStatus === "checking" || s.jiraStatus === "creating") && /* @__PURE__ */ jsxDEV("div", {
1656
- class: "loading-row",
1657
- style: "margin-top:12px",
1658
- children: [/* @__PURE__ */ jsxDEV("span", { class: "spinner" }), s.jiraStatus === "checking" ? t("web.checkingIssues") : t("web.creatingIssue")]
1659
- }),
1660
- s.jiraResult && /* @__PURE__ */ jsxDEV("div", {
1661
- class: "jira-result",
1662
- children: [
1663
- /* @__PURE__ */ jsxDEV("div", {
1664
- class: "jira-result-label",
1665
- children: s.jiraResult.exists ? t("web.versionExistsResult", { version: s.jiraResult.versionName }) : t("web.versionCreatedResult", { version: s.jiraResult.versionName })
1666
- }),
1667
- /* @__PURE__ */ jsxDEV("a", {
1668
- class: "jira-result-key",
1669
- href: jiraUrl,
1670
- target: "_blank",
1671
- rel: "noreferrer",
1672
- children: s.jiraResult.key
1673
- }),
1674
- /* @__PURE__ */ jsxDEV("span", {
1675
- class: `jira-result-badge ${s.jiraResult.exists ? "exists" : "created"}`,
1676
- children: s.jiraResult.exists ? t("web.existsBadge") : t("web.createdBadge")
1677
- })
1678
- ]
1679
- }),
1680
- s.jiraError && /* @__PURE__ */ jsxDEV("div", {
1681
- class: "jira-error",
1682
- role: "alert",
1683
- children: s.jiraError
1684
- }),
1685
- s.jiraResult && (s.mrStatus === "idle" || s.mrStatus === "loading") && /* @__PURE__ */ jsxDEV("button", {
1686
- class: "jira-btn",
1687
- type: "button",
1688
- disabled: s.mrStatus === "loading",
1689
- style: "background:var(--cyan);margin-top:12px",
1690
- onClick: async () => {
1691
- if (s.mrStatus === "loading") return;
1692
- d({ type: "MR_LOADING" });
1693
- try {
1694
- const data = await (await fetch(`/release/api/projects/${s.selected.id}/branches`)).json();
1695
- const branches = (Array.isArray(data) ? data : []).filter((b) => b.name !== s.selectedBranch);
1696
- if (branches.length === 0) {
1697
- d({
1698
- type: "MR_ERROR",
1699
- error: t("release.noSourceBranches")
1700
- });
1701
- return;
1702
- }
1703
- d({
1704
- type: "MR_SELECTING",
1705
- branches
1706
- });
1707
- } catch (e) {
1708
- d({
1709
- type: "MR_ERROR",
1710
- error: e instanceof Error ? e.message : "Failed"
1711
- });
1712
- }
1713
- },
1714
- children: s.mrStatus === "loading" ? /* @__PURE__ */ jsxDEV(Fragment, { children: [/* @__PURE__ */ jsxDEV("span", {
1715
- class: "spinner",
1716
- style: "width:12px;height:12px;border-width:1px;margin-right:6px;vertical-align:middle"
1717
- }), t("web.loadingMr")] }) : t("web.createMrBtn")
1718
- }),
1719
- s.mrStatus === "selecting" && (() => {
1720
- const mrb = s.mrBranches.filter((b) => b.name.toLowerCase().includes(s.mrBranchSearch.toLowerCase()));
1721
- return /* @__PURE__ */ jsxDEV("div", {
1722
- class: "mr-branch-sel",
1723
- style: "margin-top:12px",
1724
- children: [/* @__PURE__ */ jsxDEV("div", {
1725
- style: "font-size:13px;color:var(--text-2);margin-bottom:4px",
1726
- children: t("release.selectMrBranch")
1727
- }), /* @__PURE__ */ jsxDEV("div", {
1728
- class: "sel",
1729
- style: "position:relative;z-index:100",
1730
- children: [/* @__PURE__ */ jsxDEV("button", {
1731
- type: "button",
1732
- class: "sel-trigger",
1733
- onClick: () => d({
1734
- type: "SET_MR_BRANCH_OPEN",
1735
- open: !s.mrBranchOpen
1736
- }),
1737
- children: [
1738
- /* @__PURE__ */ jsxDEV("span", {
1739
- class: "sel-trigger-label",
1740
- children: t("web.branchLabel")
1741
- }),
1742
- /* @__PURE__ */ jsxDEV("span", {
1743
- class: `sel-trigger-value${s.mrSourceBranch ? "" : " empty"}`,
1744
- children: s.mrSourceBranch || t("web.selectBranch")
1745
- }),
1746
- /* @__PURE__ */ jsxDEV("span", {
1747
- class: "sel-trigger-arrow",
1748
- children: "▼"
1749
- })
1750
- ]
1751
- }), s.mrBranchOpen && /* @__PURE__ */ jsxDEV("div", {
1752
- class: "sel-dropdown",
1753
- role: "listbox",
1754
- "aria-label": t("release.selectMrBranch"),
1755
- children: [/* @__PURE__ */ jsxDEV("div", {
1756
- class: "sel-search",
1757
- children: /* @__PURE__ */ jsxDEV("input", {
1758
- ref: mrBranchSearchRef,
1759
- class: "sel-search-input",
1760
- type: "text",
1761
- placeholder: t("web.filterBranches"),
1762
- value: s.mrBranchSearch,
1763
- onChange: (e) => d({
1764
- type: "SET_MR_BRANCH_SEARCH",
1765
- search: e.target.value
1766
- }),
1767
- onKeyDown: (e) => {
1768
- const n = selKeyDown(e, s.mrBranchOpen, mrb.length, s.mrBranchIndex, (i) => {
1769
- if (mrb[i]) d({
1770
- type: "MR_SOURCE_SELECTED",
1771
- branch: mrb[i].name
1772
- });
1773
- }, () => d({
1774
- type: "SET_MR_BRANCH_OPEN",
1775
- open: false
1776
- }));
1777
- if (n !== void 0) d({
1778
- type: "SET_MR_BRANCH_INDEX",
1779
- index: n
1780
- });
1781
- }
1782
- })
1783
- }), mrb.length > 0 ? mrb.map((b, i) => /* @__PURE__ */ jsxDEV("div", {
1784
- class: `sel-item${b.name === s.mrSourceBranch ? " active" : ""}${i === s.mrBranchIndex ? " highlighted" : ""}`,
1785
- onMouseEnter: () => d({
1786
- type: "SET_MR_BRANCH_INDEX",
1787
- index: i
1788
- }),
1789
- onClick: () => d({
1790
- type: "MR_SOURCE_SELECTED",
1791
- branch: b.name
1792
- }),
1793
- children: [/* @__PURE__ */ jsxDEV("span", {
1794
- class: "sel-item-name",
1795
- children: b.name
1796
- }), b.default && /* @__PURE__ */ jsxDEV("span", {
1797
- style: "font-size:10px;color:var(--neon);margin-left:6px",
1798
- children: t("web.defaultBranch")
1799
- })]
1800
- })) : /* @__PURE__ */ jsxDEV("div", {
1801
- class: "sel-empty",
1802
- children: t("web.noBranches")
1803
- })]
1804
- })]
1805
- })]
1806
- });
1807
- })(),
1808
- s.mrStatus === "selecting" && s.mrSourceBranch && /* @__PURE__ */ jsxDEV("div", {
1809
- style: "margin-top:8px;display:flex;align-items:center;gap:8px",
1810
- children: [/* @__PURE__ */ jsxDEV("span", {
1811
- style: "font-size:12px;color:var(--text-2)",
1812
- children: t("release.mrFromTo", {
1813
- source: s.mrSourceBranch,
1814
- target: s.selectedBranch
1815
- })
1816
- }), /* @__PURE__ */ jsxDEV("button", {
1817
- class: "jira-btn",
1818
- type: "button",
1819
- style: "background:var(--cyan);font-size:13px;padding:4px 12px",
1820
- onClick: () => d({ type: "MR_CREATING" }),
1821
- children: t("release.confirmCreateMr")
1822
- })]
1823
- }),
1824
- s.mrStatus === "creating" && /* @__PURE__ */ jsxDEV("div", {
1825
- class: "loading-row",
1826
- style: "margin-top:12px",
1827
- children: [/* @__PURE__ */ jsxDEV("span", { class: "spinner" }), t("release.creatingMrBtn")]
1828
- }),
1829
- s.mrStatus === "done" && s.mrUrl && /* @__PURE__ */ jsxDEV("div", {
1830
- class: "jira-result",
1831
- style: "margin-top:12px",
1832
- children: [/* @__PURE__ */ jsxDEV("div", {
1833
- class: "jira-result-label",
1834
- children: "MR"
1835
- }), /* @__PURE__ */ jsxDEV("a", {
1836
- class: "jira-result-key",
1837
- href: s.mrUrl,
1838
- target: "_blank",
1839
- rel: "noreferrer",
1840
- children: t("release.mrCreated")
1841
- })]
1842
- }),
1843
- s.mrStatus === "error" && s.mrError && /* @__PURE__ */ jsxDEV("div", {
1844
- class: "jira-error",
1845
- role: "alert",
1846
- style: "margin-top:12px",
1847
- children: s.mrError
1848
- })
1849
- ]
1850
- }),
1851
- !s.selected && /* @__PURE__ */ jsxDEV("div", {
1852
- class: "empty-hint",
1853
- children: t("web.emptyHint")
1854
- })
1855
- ] });
1856
- };
1857
- const ReleaseClient = () => {
1858
- const [s, d] = useReducer(reducer, initial);
1859
- useEffect(() => {
1860
- fetch("/release/api/history").then((r) => r.json()).then((data) => d({
1861
- type: "SET_HISTORY",
1862
- history: Array.isArray(data) ? data : []
1863
- })).catch(() => d({
1864
- type: "SET_HISTORY",
1865
- history: []
1866
- }));
1867
- }, []);
1868
- return /* @__PURE__ */ jsxDEV("div", { children: [
1869
- /* @__PURE__ */ jsxDEV("style", { children: releaseStyle }),
1870
- /* @__PURE__ */ jsxDEV("div", {
1871
- class: "page-header",
1872
- children: [/* @__PURE__ */ jsxDEV("h2", { children: t("web.releaseTitle") }), /* @__PURE__ */ jsxDEV("p", { children: t("web.releaseDesc") })]
1873
- }),
1874
- s.historyLoading ? /* @__PURE__ */ jsxDEV("div", {
1875
- class: "loading-row",
1876
- children: [/* @__PURE__ */ jsxDEV("span", { class: "spinner" }), t("web.loading")]
1877
- }) : s.showNewModal ? /* @__PURE__ */ jsxDEV("div", {
1878
- class: "modal-overlay",
1879
- onClick: (e) => {
1880
- if (e.target.classList.contains("modal-overlay")) fetch("/release/api/history").then((r) => r.json()).then((data) => {
1881
- d({
1882
- type: "SET_HISTORY",
1883
- history: Array.isArray(data) ? data : []
1884
- });
1885
- d({ type: "HIDE_NEW_MODAL" });
1886
- }).catch(() => d({ type: "HIDE_NEW_MODAL" }));
1887
- },
1888
- children: /* @__PURE__ */ jsxDEV("div", {
1889
- class: "modal-content",
1890
- children: [/* @__PURE__ */ jsxDEV("div", {
1891
- class: "modal-header",
1892
- children: [/* @__PURE__ */ jsxDEV("span", {
1893
- class: "modal-title",
1894
- children: t("web.newModalTitle")
1895
- }), /* @__PURE__ */ jsxDEV("button", {
1896
- class: "modal-close",
1897
- type: "button",
1898
- onClick: () => {
1899
- fetch("/release/api/history").then((r) => r.json()).then((data) => {
1900
- d({
1901
- type: "SET_HISTORY",
1902
- history: Array.isArray(data) ? data : []
1903
- });
1904
- d({ type: "HIDE_NEW_MODAL" });
1905
- }).catch(() => d({ type: "HIDE_NEW_MODAL" }));
1906
- },
1907
- children: "✕"
1908
- })]
1909
- }), /* @__PURE__ */ jsxDEV(ReleaseFlow, {
1910
- s,
1911
- d
1912
- })]
1913
- })
1914
- }) : s.history.length > 0 ? /* @__PURE__ */ jsxDEV(HistoryList, {
1915
- s,
1916
- d
1917
- }) : /* @__PURE__ */ jsxDEV(ReleaseFlow, {
1918
- s,
1919
- d
1920
- })
1921
- ] });
1922
- };
1923
- const mount = async (el) => {
1924
- await initPromise;
1925
- render(/* @__PURE__ */ jsxDEV(ReleaseClient, {}), el);
1926
- };
1927
- //#endregion
1928
- export { mount };