diff --git a/frontend/src/components/EditorLayout.tsx b/frontend/src/components/EditorLayout.tsx
index 1a185121..67aafb57 100644
--- a/frontend/src/components/EditorLayout.tsx
+++ b/frontend/src/components/EditorLayout.tsx
@@ -326,6 +326,11 @@ export default function EditorLayout() {
}
};
+ const handleSaveAndDeploy = async (e: React.MouseEvent) => {
+ await saveFile();
+ await deployStack(e);
+ };
+
const discardChanges = () => {
if (activeTab === 'compose') {
setContent(originalContent);
@@ -385,28 +390,6 @@ export default function EditorLayout() {
}
};
- const startStack = async (e: React.MouseEvent) => {
- e.preventDefault();
- e.stopPropagation();
- if (!selectedFile || isActionLoading) return;
- const stackName = selectedFile.replace(/\.(yml|yaml)$/, '');
- setIsActionLoading(true);
- try {
- await apiFetch(`/stacks/${stackName}/start`, {
- method: 'POST',
- });
- // Refresh containers after start
- const containersRes = await apiFetch(`/stacks/${stackName}/containers`);
- const conts = await containersRes.json();
- setContainers(Array.isArray(conts) ? conts : []);
- await refreshStacks(true);
- } catch (error) {
- console.error('Failed to start:', error);
- } finally {
- setIsActionLoading(false);
- }
- };
-
const restartStack = async (e: React.MouseEvent) => {
e.preventDefault();
e.stopPropagation();
@@ -525,7 +508,6 @@ export default function EditorLayout() {
const safeEnvContent = envContent || '';
// Stack state booleans for dynamic button rendering
- const isDeployed = safeContainers && safeContainers.length > 0;
const isRunning = safeContainers?.some(c => c.State === 'running');
// Stack name is now the same as selectedFile (no extension to strip)
@@ -833,33 +815,27 @@ export default function EditorLayout() {