feat(deployments): deployment restart özelliği ekle
Deployment projeleri için yeniden başlatma (restart) yeteneği eklendi. Backend servisi, API endpoint'i ve kullanıcı arayüzü butonları güncellendi.
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
||||
faCloudArrowUp,
|
||||
faEye,
|
||||
faEyeSlash,
|
||||
faPenToSquare,
|
||||
faPlus,
|
||||
faRotate,
|
||||
faRocket
|
||||
@@ -25,6 +26,7 @@ import {
|
||||
fetchDeploymentBranches,
|
||||
fetchDeploymentEnvExamples,
|
||||
fetchDeployments,
|
||||
restartDeployment,
|
||||
runDeployment,
|
||||
updateDeployment
|
||||
} from "../api/deployments";
|
||||
@@ -293,6 +295,15 @@ export function DeploymentsPage() {
|
||||
}
|
||||
};
|
||||
|
||||
const handleRestart = async (id: string) => {
|
||||
try {
|
||||
await restartDeployment(id, "restart");
|
||||
toast.success("Restart tetiklendi");
|
||||
} catch {
|
||||
toast.error("Restart tetiklenemedi");
|
||||
}
|
||||
};
|
||||
|
||||
const handleDelete = async (deployment: DeploymentProject) => {
|
||||
const ok = window.confirm("Bu deployment'ı silmek istediğinize emin misiniz?");
|
||||
if (!ok) return;
|
||||
@@ -393,6 +404,18 @@ export function DeploymentsPage() {
|
||||
>
|
||||
<FontAwesomeIcon icon={faCloudArrowUp} className="h-4 w-4" />
|
||||
</Button>
|
||||
<Button
|
||||
variant="outline"
|
||||
size="icon"
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
handleRestart(deployment._id);
|
||||
}}
|
||||
title="Restart"
|
||||
aria-label="Restart"
|
||||
>
|
||||
<FontAwesomeIcon icon={faRotate} className="h-4 w-4" />
|
||||
</Button>
|
||||
<Button
|
||||
variant="outline"
|
||||
size="icon"
|
||||
@@ -402,7 +425,7 @@ export function DeploymentsPage() {
|
||||
}}
|
||||
title="Düzenle"
|
||||
>
|
||||
<FontAwesomeIcon icon={faRotate} className="h-4 w-4" />
|
||||
<FontAwesomeIcon icon={faPenToSquare} className="h-4 w-4" />
|
||||
</Button>
|
||||
<Button
|
||||
variant="outline"
|
||||
|
||||
Reference in New Issue
Block a user