chore: commit remaining workspace changes

This commit is contained in:
2026-03-03 19:51:17 +03:00
parent ba25659647
commit 4f273f33ea
17 changed files with 1679 additions and 580 deletions

View File

@@ -38,6 +38,13 @@
const stageMatched = all.filter((env) => normalizeEnvStage(env) === normalizedPreferredStage);
return stageMatched.length > 0 ? stageMatched : all;
});
const selectedEnvironment = $derived(
deploymentCandidates.find((env) => env.id === selectedEnv) || null,
);
const selectedEnvironmentStage = $derived(
selectedEnvironment ? normalizeEnvStage(selectedEnvironment) : "",
);
const isProdTarget = $derived(selectedEnvironmentStage === "PROD");
// [DEF:loadStatus:Watcher]
$effect(() => {
@@ -107,6 +114,14 @@
*/
async function handleDeploy() {
if (!selectedEnv) return;
if (isProdTarget) {
const expected = String(dashboardId);
const confirmation = prompt(`Подтвердите deploy в PROD. Введите slug: ${expected}`);
if (String(confirmation || "").trim() !== expected) {
toast("Подтверждение PROD не пройдено. Deploy отменен.", "error");
return;
}
}
console.log(`[DeploymentModal][Action] Deploying to ${selectedEnv}`);
deploying = true;
try {
@@ -171,6 +186,11 @@
{/each}
</select>
</div>
{#if isProdTarget}
<p class="mb-3 rounded border border-red-200 bg-red-50 px-3 py-2 text-xs text-red-800">
Внимание: выбрано PROD окружение. Потребуется подтверждение перед deploy.
</p>
{/if}
<div class="flex justify-end space-x-3">
<button
@@ -182,7 +202,7 @@
<button
onclick={handleDeploy}
disabled={deploying || !selectedEnv}
class="px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 disabled:opacity-50 flex items-center"
class={`px-4 py-2 text-white rounded disabled:opacity-50 flex items-center ${isProdTarget ? 'bg-red-600 hover:bg-red-700' : 'bg-green-600 hover:bg-green-700'}`}
>
{#if deploying}
<svg

File diff suppressed because it is too large Load Diff