@orange-soft/strapi-deployment-trigger 1.1.2 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -13
- package/admin/src/pages/HomePage.jsx +59 -32
- package/admin/src/pages/SettingsPage.jsx +136 -61
- package/dist/_chunks/{App-DRqMK_8x.mjs → App-k07qAAvE.mjs} +154 -82
- package/dist/_chunks/{App-CCbQMMHR.js → App-vIrt97zQ.js} +152 -80
- package/dist/_chunks/{index-vQ0KWcpU.mjs → index-BwZtnn__.mjs} +1 -1
- package/dist/_chunks/{index-SuWmJtOE.js → index-w-vQ80Px.js} +1 -1
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/server/index.js +91 -27
- package/dist/server/index.mjs +91 -27
- package/package.json +1 -1
- package/server/src/controllers/controller.js +73 -23
- package/server/src/services/service.js +39 -8
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useFetchClient, Layouts, BackButton, Page } from "@strapi/strapi/admin";
|
|
3
3
|
import { useLocation, Link, useNavigate, Routes, Route } from "react-router-dom";
|
|
4
4
|
import { useState, useEffect } from "react";
|
|
5
5
|
import { useIntl } from "react-intl";
|
|
6
|
-
import { Flex, Loader, Button, Box, Alert, Typography, Table, Thead, Tr, Th, Tbody, Td, Field, Grid,
|
|
6
|
+
import { Flex, Loader, Button, Box, Alert, Typography, Table, Thead, Tr, Th, Tbody, Td, Field, Grid, SingleSelect, SingleSelectOption, Dialog } from "@strapi/design-system";
|
|
7
7
|
import { Cog, Rocket, Check, Plus, Pencil, Trash } from "@strapi/icons";
|
|
8
|
-
import { P as PLUGIN_ID } from "./index-
|
|
8
|
+
import { P as PLUGIN_ID } from "./index-BwZtnn__.mjs";
|
|
9
9
|
const getTranslation = (id) => `${PLUGIN_ID}.${id}`;
|
|
10
10
|
const HomePage = () => {
|
|
11
11
|
const { formatMessage } = useIntl();
|
|
@@ -65,9 +65,18 @@ const HomePage = () => {
|
|
|
65
65
|
}
|
|
66
66
|
const settings = status?.settings || {};
|
|
67
67
|
const parsed = status?.parsed || {};
|
|
68
|
-
|
|
68
|
+
status?.configured;
|
|
69
69
|
const hasToken = status?.hasToken;
|
|
70
70
|
const targets = settings.targets || [];
|
|
71
|
+
const hasGitHubTargets = targets.some((t) => (t.type || "github") === "github");
|
|
72
|
+
targets.some((t) => t.type === "vercel");
|
|
73
|
+
const canTrigger = (target) => {
|
|
74
|
+
const targetType = target.type || "github";
|
|
75
|
+
if (targetType === "github") {
|
|
76
|
+
return hasToken && parsed.owner && parsed.repo;
|
|
77
|
+
}
|
|
78
|
+
return !!target.webhookUrl;
|
|
79
|
+
};
|
|
71
80
|
return /* @__PURE__ */ jsxs(Layouts.Root, { children: [
|
|
72
81
|
/* @__PURE__ */ jsx(
|
|
73
82
|
Layouts.Header,
|
|
@@ -103,8 +112,8 @@ const HomePage = () => {
|
|
|
103
112
|
] })
|
|
104
113
|
}
|
|
105
114
|
) }),
|
|
106
|
-
!hasToken && /* @__PURE__ */ jsx(Box, { paddingBottom: 4, children: /* @__PURE__ */ jsx(Alert, { title: "Token Missing", variant: "danger", children: "GitHub Personal Access Token is not configured. Please add it in Settings." }) }),
|
|
107
|
-
!settings.repoUrl && /* @__PURE__ */ jsx(Box, { paddingBottom: 4, children: /* @__PURE__ */ jsx(Alert, { title: "Configuration Required", variant: "warning", children: "Please configure your GitHub repository in the Settings page before triggering deployments." }) }),
|
|
115
|
+
hasGitHubTargets && !hasToken && /* @__PURE__ */ jsx(Box, { paddingBottom: 4, children: /* @__PURE__ */ jsx(Alert, { title: "Token Missing", variant: "danger", children: "GitHub Personal Access Token is not configured. Please add it in Settings." }) }),
|
|
116
|
+
hasGitHubTargets && !settings.repoUrl && /* @__PURE__ */ jsx(Box, { paddingBottom: 4, children: /* @__PURE__ */ jsx(Alert, { title: "Configuration Required", variant: "warning", children: "Please configure your GitHub repository in the Settings page before triggering deployments." }) }),
|
|
108
117
|
/* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "stretch", gap: 4, children: [
|
|
109
118
|
/* @__PURE__ */ jsx(
|
|
110
119
|
Box,
|
|
@@ -157,27 +166,34 @@ const HomePage = () => {
|
|
|
157
166
|
/* @__PURE__ */ jsx(Typography, { variant: "delta", tag: "h2", children: "Deployment Targets" }),
|
|
158
167
|
targets.length > 0 ? /* @__PURE__ */ jsxs(Table, { children: [
|
|
159
168
|
/* @__PURE__ */ jsx(Thead, { children: /* @__PURE__ */ jsxs(Tr, { children: [
|
|
169
|
+
/* @__PURE__ */ jsx(Th, { children: /* @__PURE__ */ jsx(Typography, { variant: "sigma", children: "Type" }) }),
|
|
160
170
|
/* @__PURE__ */ jsx(Th, { children: /* @__PURE__ */ jsx(Typography, { variant: "sigma", children: "Name" }) }),
|
|
161
|
-
/* @__PURE__ */ jsx(Th, { children: /* @__PURE__ */ jsx(Typography, { variant: "sigma", children: "
|
|
162
|
-
/* @__PURE__ */ jsx(Th, { children: /* @__PURE__ */ jsx(Typography, { variant: "sigma", children: "Branch" }) }),
|
|
171
|
+
/* @__PURE__ */ jsx(Th, { children: /* @__PURE__ */ jsx(Typography, { variant: "sigma", children: "Details" }) }),
|
|
163
172
|
/* @__PURE__ */ jsx(Th, { children: /* @__PURE__ */ jsx(Typography, { variant: "sigma", children: "Action" }) })
|
|
164
173
|
] }) }),
|
|
165
|
-
/* @__PURE__ */ jsx(Tbody, { children: targets.map((target) =>
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
174
|
+
/* @__PURE__ */ jsx(Tbody, { children: targets.map((target) => {
|
|
175
|
+
const targetType = target.type || "github";
|
|
176
|
+
return /* @__PURE__ */ jsxs(Tr, { children: [
|
|
177
|
+
/* @__PURE__ */ jsx(Td, { children: /* @__PURE__ */ jsx(Typography, { variant: "omega", fontWeight: "bold", textColor: targetType === "github" ? "neutral800" : "secondary600", children: targetType === "github" ? "GitHub" : "Vercel" }) }),
|
|
178
|
+
/* @__PURE__ */ jsx(Td, { children: /* @__PURE__ */ jsx(Typography, { variant: "omega", fontWeight: "bold", children: target.name }) }),
|
|
179
|
+
/* @__PURE__ */ jsx(Td, { children: targetType === "github" ? /* @__PURE__ */ jsxs(Typography, { variant: "omega", textColor: "neutral600", children: [
|
|
180
|
+
target.workflow,
|
|
181
|
+
" / ",
|
|
182
|
+
target.branch
|
|
183
|
+
] }) : /* @__PURE__ */ jsx(Typography, { variant: "omega", textColor: "neutral600", children: "Webhook" }) }),
|
|
184
|
+
/* @__PURE__ */ jsx(Td, { children: /* @__PURE__ */ jsx(
|
|
185
|
+
Button,
|
|
186
|
+
{
|
|
187
|
+
onClick: () => handleDeploy(target.id, target.name),
|
|
188
|
+
loading: deployingTargetId === target.id,
|
|
189
|
+
disabled: !canTrigger(target) || deployingTargetId !== null,
|
|
190
|
+
startIcon: /* @__PURE__ */ jsx(Rocket, {}),
|
|
191
|
+
size: "S",
|
|
192
|
+
children: deployingTargetId === target.id ? "Triggering..." : "Trigger"
|
|
193
|
+
}
|
|
194
|
+
) })
|
|
195
|
+
] }, target.id);
|
|
196
|
+
}) })
|
|
181
197
|
] }) : /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "center", justifyContent: "center", gap: 3, padding: 6, children: [
|
|
182
198
|
/* @__PURE__ */ jsx(Typography, { variant: "epsilon", textColor: "neutral600", textAlign: "center", children: "No deployment targets configured" }),
|
|
183
199
|
/* @__PURE__ */ jsx(Link, { to: `/plugins/${PLUGIN_ID}/settings`, children: /* @__PURE__ */ jsx(Button, { variant: "default", startIcon: /* @__PURE__ */ jsx(Cog, {}), children: "Add Targets in Settings" }) })
|
|
@@ -185,7 +201,7 @@ const HomePage = () => {
|
|
|
185
201
|
] })
|
|
186
202
|
}
|
|
187
203
|
),
|
|
188
|
-
|
|
204
|
+
hasGitHubTargets && (!hasToken || !parsed.owner || !parsed.repo) && /* @__PURE__ */ jsx(
|
|
189
205
|
Box,
|
|
190
206
|
{
|
|
191
207
|
background: "neutral0",
|
|
@@ -196,8 +212,8 @@ const HomePage = () => {
|
|
|
196
212
|
paddingLeft: 7,
|
|
197
213
|
paddingRight: 7,
|
|
198
214
|
children: /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "center", justifyContent: "center", gap: 3, children: [
|
|
199
|
-
/* @__PURE__ */ jsx(Typography, { variant: "beta", textColor: "neutral600", textAlign: "center", children: "Setup Incomplete" }),
|
|
200
|
-
/* @__PURE__ */ jsx(Typography, { variant: "epsilon", textColor: "neutral600", textAlign: "center", children: "Please ensure repository URL and GitHub token are configured in Settings." }),
|
|
215
|
+
/* @__PURE__ */ jsx(Typography, { variant: "beta", textColor: "neutral600", textAlign: "center", children: "GitHub Setup Incomplete" }),
|
|
216
|
+
/* @__PURE__ */ jsx(Typography, { variant: "epsilon", textColor: "neutral600", textAlign: "center", children: "Please ensure repository URL and GitHub token are configured in Settings for GitHub targets." }),
|
|
201
217
|
/* @__PURE__ */ jsx(Box, { paddingTop: 2, children: /* @__PURE__ */ jsx(Link, { to: `/plugins/${PLUGIN_ID}/settings`, children: /* @__PURE__ */ jsx(Button, { variant: "default", startIcon: /* @__PURE__ */ jsx(Cog, {}), children: "Go to Settings" }) }) })
|
|
202
218
|
] })
|
|
203
219
|
}
|
|
@@ -209,6 +225,7 @@ const HomePage = () => {
|
|
|
209
225
|
const TOKEN_PATTERN = /^github_pat_[a-zA-Z0-9_]+$/;
|
|
210
226
|
const REPO_URL_PATTERN = /^https:\/\/github\.com\/[a-zA-Z0-9_.-]+\/[a-zA-Z0-9_.-]+\/?$/;
|
|
211
227
|
const WORKFLOW_PATTERN = /^[a-zA-Z0-9_.-]+\.ya?ml$/;
|
|
228
|
+
const VERCEL_WEBHOOK_PATTERN = /^https:\/\/api\.vercel\.com\/v1\/integrations\/deploy\/.+$/;
|
|
212
229
|
const validateToken = (value) => {
|
|
213
230
|
if (!value) return null;
|
|
214
231
|
if (!TOKEN_PATTERN.test(value)) {
|
|
@@ -230,6 +247,13 @@ const validateWorkflow = (value) => {
|
|
|
230
247
|
}
|
|
231
248
|
return null;
|
|
232
249
|
};
|
|
250
|
+
const validateVercelWebhook = (value) => {
|
|
251
|
+
if (!value) return "Webhook URL is required";
|
|
252
|
+
if (!VERCEL_WEBHOOK_PATTERN.test(value)) {
|
|
253
|
+
return "Must be a valid Vercel deploy hook URL (https://api.vercel.com/v1/integrations/deploy/...)";
|
|
254
|
+
}
|
|
255
|
+
return null;
|
|
256
|
+
};
|
|
233
257
|
const SettingsPage = () => {
|
|
234
258
|
const navigate = useNavigate();
|
|
235
259
|
const { get, put, post, del } = useFetchClient();
|
|
@@ -245,7 +269,7 @@ const SettingsPage = () => {
|
|
|
245
269
|
const [saving, setSaving] = useState(false);
|
|
246
270
|
const [notification, setNotification] = useState(null);
|
|
247
271
|
const [editingTarget, setEditingTarget] = useState(null);
|
|
248
|
-
const [targetForm, setTargetForm] = useState({ name: "", workflow: "", branch: "" });
|
|
272
|
+
const [targetForm, setTargetForm] = useState({ type: "github", name: "", workflow: "", branch: "", webhookUrl: "" });
|
|
249
273
|
const [targetErrors, setTargetErrors] = useState({});
|
|
250
274
|
const [showAddForm, setShowAddForm] = useState(false);
|
|
251
275
|
const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);
|
|
@@ -309,7 +333,7 @@ const SettingsPage = () => {
|
|
|
309
333
|
}
|
|
310
334
|
};
|
|
311
335
|
const resetTargetForm = () => {
|
|
312
|
-
setTargetForm({ name: "", workflow: "deploy.yml", branch: "master" });
|
|
336
|
+
setTargetForm({ type: "github", name: "", workflow: "deploy.yml", branch: "master", webhookUrl: "" });
|
|
313
337
|
setTargetErrors({});
|
|
314
338
|
setEditingTarget(null);
|
|
315
339
|
setShowAddForm(false);
|
|
@@ -317,9 +341,14 @@ const SettingsPage = () => {
|
|
|
317
341
|
const validateTargetForm = () => {
|
|
318
342
|
const newErrors = {};
|
|
319
343
|
if (!targetForm.name.trim()) newErrors.name = "Name is required";
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
344
|
+
if (targetForm.type === "github") {
|
|
345
|
+
const workflowError = validateWorkflow(targetForm.workflow);
|
|
346
|
+
if (workflowError) newErrors.workflow = workflowError;
|
|
347
|
+
if (!targetForm.branch.trim()) newErrors.branch = "Branch is required";
|
|
348
|
+
} else if (targetForm.type === "vercel") {
|
|
349
|
+
const webhookError = validateVercelWebhook(targetForm.webhookUrl);
|
|
350
|
+
if (webhookError) newErrors.webhookUrl = webhookError;
|
|
351
|
+
}
|
|
323
352
|
setTargetErrors(newErrors);
|
|
324
353
|
return Object.keys(newErrors).length === 0;
|
|
325
354
|
};
|
|
@@ -340,7 +369,13 @@ const SettingsPage = () => {
|
|
|
340
369
|
};
|
|
341
370
|
const handleEditTarget = (target) => {
|
|
342
371
|
setEditingTarget(target.id);
|
|
343
|
-
setTargetForm({
|
|
372
|
+
setTargetForm({
|
|
373
|
+
type: target.type || "github",
|
|
374
|
+
name: target.name,
|
|
375
|
+
workflow: target.workflow || "deploy.yml",
|
|
376
|
+
branch: target.branch || "master",
|
|
377
|
+
webhookUrl: target.webhookUrl || ""
|
|
378
|
+
});
|
|
344
379
|
setShowAddForm(false);
|
|
345
380
|
};
|
|
346
381
|
const handleUpdateTarget = async () => {
|
|
@@ -482,7 +517,7 @@ const SettingsPage = () => {
|
|
|
482
517
|
startIcon: /* @__PURE__ */ jsx(Plus, {}),
|
|
483
518
|
onClick: () => {
|
|
484
519
|
setShowAddForm(true);
|
|
485
|
-
setTargetForm({ name: "", workflow: "deploy.yml", branch: "master" });
|
|
520
|
+
setTargetForm({ type: "github", name: "", workflow: "deploy.yml", branch: "master", webhookUrl: "" });
|
|
486
521
|
},
|
|
487
522
|
size: "S",
|
|
488
523
|
children: "Add Target"
|
|
@@ -498,7 +533,21 @@ const SettingsPage = () => {
|
|
|
498
533
|
children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 4, children: [
|
|
499
534
|
/* @__PURE__ */ jsx(Typography, { variant: "omega", fontWeight: "bold", children: editingTarget ? "Edit Target" : "Add New Target" }),
|
|
500
535
|
/* @__PURE__ */ jsxs(Grid.Root, { gap: 4, children: [
|
|
501
|
-
/* @__PURE__ */ jsx(Grid.Item, { col:
|
|
536
|
+
/* @__PURE__ */ jsx(Grid.Item, { col: 3, s: 12, children: /* @__PURE__ */ jsxs(Field.Root, { name: "targetType", required: true, children: [
|
|
537
|
+
/* @__PURE__ */ jsx(Field.Label, { children: "Type" }),
|
|
538
|
+
/* @__PURE__ */ jsxs(
|
|
539
|
+
SingleSelect,
|
|
540
|
+
{
|
|
541
|
+
value: targetForm.type,
|
|
542
|
+
onChange: (value) => setTargetForm((prev) => ({ ...prev, type: value })),
|
|
543
|
+
children: [
|
|
544
|
+
/* @__PURE__ */ jsx(SingleSelectOption, { value: "github", children: "GitHub" }),
|
|
545
|
+
/* @__PURE__ */ jsx(SingleSelectOption, { value: "vercel", children: "Vercel" })
|
|
546
|
+
]
|
|
547
|
+
}
|
|
548
|
+
)
|
|
549
|
+
] }) }),
|
|
550
|
+
/* @__PURE__ */ jsx(Grid.Item, { col: 3, s: 12, children: /* @__PURE__ */ jsxs(Field.Root, { name: "targetName", required: true, error: targetErrors.name, children: [
|
|
502
551
|
/* @__PURE__ */ jsx(Field.Label, { children: "Name" }),
|
|
503
552
|
/* @__PURE__ */ jsx(
|
|
504
553
|
Field.Input,
|
|
@@ -510,26 +559,40 @@ const SettingsPage = () => {
|
|
|
510
559
|
),
|
|
511
560
|
/* @__PURE__ */ jsx(Field.Error, {})
|
|
512
561
|
] }) }),
|
|
513
|
-
|
|
514
|
-
/* @__PURE__ */ jsx(
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
/* @__PURE__ */ jsx(
|
|
562
|
+
targetForm.type === "github" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
563
|
+
/* @__PURE__ */ jsx(Grid.Item, { col: 3, s: 12, children: /* @__PURE__ */ jsxs(Field.Root, { name: "targetWorkflow", required: true, error: targetErrors.workflow, children: [
|
|
564
|
+
/* @__PURE__ */ jsx(Field.Label, { children: "Workflow File" }),
|
|
565
|
+
/* @__PURE__ */ jsx(
|
|
566
|
+
Field.Input,
|
|
567
|
+
{
|
|
568
|
+
placeholder: "deploy.yml",
|
|
569
|
+
value: targetForm.workflow,
|
|
570
|
+
onChange: handleTargetFormChange("workflow")
|
|
571
|
+
}
|
|
572
|
+
),
|
|
573
|
+
/* @__PURE__ */ jsx(Field.Error, {})
|
|
574
|
+
] }) }),
|
|
575
|
+
/* @__PURE__ */ jsx(Grid.Item, { col: 3, s: 12, children: /* @__PURE__ */ jsxs(Field.Root, { name: "targetBranch", required: true, error: targetErrors.branch, children: [
|
|
576
|
+
/* @__PURE__ */ jsx(Field.Label, { children: "Branch" }),
|
|
577
|
+
/* @__PURE__ */ jsx(
|
|
578
|
+
Field.Input,
|
|
579
|
+
{
|
|
580
|
+
placeholder: "main",
|
|
581
|
+
value: targetForm.branch,
|
|
582
|
+
onChange: handleTargetFormChange("branch")
|
|
583
|
+
}
|
|
584
|
+
),
|
|
585
|
+
/* @__PURE__ */ jsx(Field.Error, {})
|
|
586
|
+
] }) })
|
|
587
|
+
] }),
|
|
588
|
+
targetForm.type === "vercel" && /* @__PURE__ */ jsx(Grid.Item, { col: 6, s: 12, children: /* @__PURE__ */ jsxs(Field.Root, { name: "targetWebhookUrl", required: true, error: targetErrors.webhookUrl, children: [
|
|
589
|
+
/* @__PURE__ */ jsx(Field.Label, { children: "Webhook URL" }),
|
|
527
590
|
/* @__PURE__ */ jsx(
|
|
528
591
|
Field.Input,
|
|
529
592
|
{
|
|
530
|
-
placeholder: "
|
|
531
|
-
value: targetForm.
|
|
532
|
-
onChange: handleTargetFormChange("
|
|
593
|
+
placeholder: "https://api.vercel.com/v1/integrations/deploy/...",
|
|
594
|
+
value: targetForm.webhookUrl,
|
|
595
|
+
onChange: handleTargetFormChange("webhookUrl")
|
|
533
596
|
}
|
|
534
597
|
),
|
|
535
598
|
/* @__PURE__ */ jsx(Field.Error, {})
|
|
@@ -551,39 +614,48 @@ const SettingsPage = () => {
|
|
|
551
614
|
),
|
|
552
615
|
settings.targets.length > 0 ? /* @__PURE__ */ jsxs(Table, { children: [
|
|
553
616
|
/* @__PURE__ */ jsx(Thead, { children: /* @__PURE__ */ jsxs(Tr, { children: [
|
|
617
|
+
/* @__PURE__ */ jsx(Th, { children: /* @__PURE__ */ jsx(Typography, { variant: "sigma", children: "Type" }) }),
|
|
554
618
|
/* @__PURE__ */ jsx(Th, { children: /* @__PURE__ */ jsx(Typography, { variant: "sigma", children: "Name" }) }),
|
|
555
|
-
/* @__PURE__ */ jsx(Th, { children: /* @__PURE__ */ jsx(Typography, { variant: "sigma", children: "
|
|
556
|
-
/* @__PURE__ */ jsx(Th, { children: /* @__PURE__ */ jsx(Typography, { variant: "sigma", children: "Branch" }) }),
|
|
619
|
+
/* @__PURE__ */ jsx(Th, { children: /* @__PURE__ */ jsx(Typography, { variant: "sigma", children: "Details" }) }),
|
|
557
620
|
/* @__PURE__ */ jsx(Th, { children: /* @__PURE__ */ jsx(Typography, { variant: "sigma", children: "Actions" }) })
|
|
558
621
|
] }) }),
|
|
559
|
-
/* @__PURE__ */ jsx(Tbody, { children: settings.targets.map((target) =>
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
/* @__PURE__ */ jsx(
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
622
|
+
/* @__PURE__ */ jsx(Tbody, { children: settings.targets.map((target) => {
|
|
623
|
+
const targetType = target.type || "github";
|
|
624
|
+
return /* @__PURE__ */ jsxs(Tr, { children: [
|
|
625
|
+
/* @__PURE__ */ jsx(Td, { children: /* @__PURE__ */ jsx(Typography, { variant: "omega", fontWeight: "bold", textColor: targetType === "github" ? "neutral800" : "secondary600", children: targetType === "github" ? "GitHub" : "Vercel" }) }),
|
|
626
|
+
/* @__PURE__ */ jsx(Td, { children: /* @__PURE__ */ jsx(Typography, { variant: "omega", children: target.name }) }),
|
|
627
|
+
/* @__PURE__ */ jsx(Td, { children: targetType === "github" ? /* @__PURE__ */ jsxs(Typography, { variant: "omega", textColor: "neutral600", children: [
|
|
628
|
+
target.workflow,
|
|
629
|
+
" / ",
|
|
630
|
+
target.branch
|
|
631
|
+
] }) : /* @__PURE__ */ jsx(Typography, { variant: "omega", textColor: "neutral600", children: "Webhook configured" }) }),
|
|
632
|
+
/* @__PURE__ */ jsx(Td, { children: /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
|
|
633
|
+
/* @__PURE__ */ jsx(
|
|
634
|
+
Button,
|
|
635
|
+
{
|
|
636
|
+
onClick: () => handleEditTarget(target),
|
|
637
|
+
variant: "tertiary",
|
|
638
|
+
size: "S",
|
|
639
|
+
startIcon: /* @__PURE__ */ jsx(Pencil, {}),
|
|
640
|
+
children: "Edit"
|
|
641
|
+
}
|
|
642
|
+
),
|
|
643
|
+
/* @__PURE__ */ jsx(
|
|
644
|
+
Button,
|
|
645
|
+
{
|
|
646
|
+
onClick: () => {
|
|
647
|
+
setTargetToDelete(target.id);
|
|
648
|
+
setDeleteDialogOpen(true);
|
|
649
|
+
},
|
|
650
|
+
variant: "danger-light",
|
|
651
|
+
size: "S",
|
|
652
|
+
startIcon: /* @__PURE__ */ jsx(Trash, {}),
|
|
653
|
+
children: "Delete"
|
|
654
|
+
}
|
|
655
|
+
)
|
|
656
|
+
] }) })
|
|
657
|
+
] }, target.id);
|
|
658
|
+
}) })
|
|
587
659
|
] }) : !showAddForm && /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", children: 'No deployment targets configured. Click "Add Target" to create one.' })
|
|
588
660
|
] })
|
|
589
661
|
}
|