Skip to content

Modern Docker Management, Designed for Everyone

chore: cleanup unused routes

Kyle Mendellba75009d3c1d
diff --git a/backend/internal/api/environment_handler.go b/backend/internal/api/environment_handler.go
index 3795c65d8..8fc245eec 100644
--- a/backend/internal/api/environment_handler.go
+++ b/backend/internal/api/environment_handler.go
@@ -204,9 +204,6 @@ func (h *EnvironmentHandler) handleStackEndpoints(c *gin.Context, endpoint strin
case endpoint == "/stacks" && c.Request.Method == http.MethodPost:
stackHandler.CreateStack(c)
return true
- case endpoint == "/stacks/convert" && c.Request.Method == http.MethodPost:
- stackHandler.ConvertDockerRun(c)
- return true
case strings.HasPrefix(endpoint, "/stacks/") && strings.HasSuffix(endpoint, "/deploy"):
stackHandler.DeployStack(c)
return true
diff --git a/backend/internal/api/stack_handler.go b/backend/internal/api/stack_handler.go
index 6b841d151..83156319d 100644
--- a/backend/internal/api/stack_handler.go
+++ b/backend/internal/api/stack_handler.go
@@ -12,7 +12,6 @@ import (
"github.com/gin-gonic/gin"
"github.com/ofkm/arcane-backend/internal/dto"
"github.com/ofkm/arcane-backend/internal/middleware"
- "github.com/ofkm/arcane-backend/internal/models"
"github.com/ofkm/arcane-backend/internal/services"
"github.com/ofkm/arcane-backend/internal/utils"
)
@@ -587,47 +586,6 @@ func (h *StackHandler) PullImages(c *gin.Context) {
}
}
-func (h *StackHandler) ConvertDockerRun(c *gin.Context) {
- var req models.ConvertDockerRunRequest
- if err := c.ShouldBindJSON(&req); err != nil {
- c.JSON(http.StatusBadRequest, gin.H{
- "success": false,
- "error": "Invalid request format: " + err.Error(),
- })
- return
- }
-
- parsed, err := h.converterService.ParseDockerRunCommand(req.DockerRunCommand)
- if err != nil {
- c.JSON(http.StatusBadRequest, gin.H{
- "success": false,
- "error": "Failed to parse docker run command. Please check the syntax.",
- "code": "BAD_REQUEST",
- })
- return
- }
-
- dockerCompose, envVars, serviceName, err := h.converterService.ConvertToDockerCompose(parsed)
- if err != nil {
- c.JSON(http.StatusInternalServerError, gin.H{
- "success": false,
- "error": "Failed to convert to Docker Compose format.",
- "code": "CONVERSION_ERROR",
- })
- return
- }
-
- c.JSON(http.StatusOK, gin.H{
- "success": true,
- "data": models.ConvertDockerRunResponse{
- Success: true,
- DockerCompose: dockerCompose,
- EnvVars: envVars,
- ServiceName: serviceName,
- },
- })
-}
-
func (h *StackHandler) GetStackLogsStream(c *gin.Context) {
stackID := c.Param("stackId")
if stackID == "" {
diff --git a/frontend/src/lib/services/api/environment-api-service.ts b/frontend/src/lib/services/api/environment-api-service.ts
index 5ddcd5b5b..c96f025e8 100644
--- a/frontend/src/lib/services/api/environment-api-service.ts
+++ b/frontend/src/lib/services/api/environment-api-service.ts
@@ -1,12 +1,7 @@
import BaseAPIService from './api-service';
import { get } from 'svelte/store';
import { environmentStore, LOCAL_DOCKER_ENVIRONMENT_ID } from '$lib/stores/environment.store';
-import type {
- ContainerCreateOptions,
- NetworkCreateOptions,
- VolumeCreateOptions,
- ContainerStats
-} from 'dockerode';
+import type { ContainerCreateOptions, NetworkCreateOptions, VolumeCreateOptions, ContainerStats } from 'dockerode';
import type { Project } from '$lib/types/project.type';
import type {
PaginationRequest,
@@ -33,9 +28,7 @@ export class EnvironmentAPIService extends BaseAPIService {
return currentEnvironment.id;
}
- async getContainers(
- options?: SearchPaginationSortRequest
- ): Promise<Paginated<ContainerSummaryDto>> {
+ async getContainers(options?: SearchPaginationSortRequest): Promise<Paginated<ContainerSummaryDto>> {
const envId = await this.getCurrentEnvironmentId();
const res = await this.api.get(`/environments/${envId}/containers`, { params: options });
@@ -49,9 +42,7 @@ export class EnvironmentAPIService extends BaseAPIService {
async startContainer(containerId: string): Promise<any> {
const envId = await this.getCurrentEnvironmentId();
- return this.handleResponse(
- this.api.post(`/environments/${envId}/containers/${containerId}/start`)
- );
+ return this.handleResponse(this.api.post(`/environments/${envId}/containers/${containerId}/start`));
}
async createContainer(options: ContainerCreateOptions): Promise<any> {
@@ -67,16 +58,12 @@ export class EnvironmentAPIService extends BaseAPIService {
async stopContainer(containerId: string): Promise<any> {
const envId = await this.getCurrentEnvironmentId();
- return this.handleResponse(
- this.api.post(`/environments/${envId}/containers/${containerId}/stop`)
- );
+ return this.handleResponse(this.api.post(`/environments/${envId}/containers/${containerId}/stop`));
}
async restartContainer(containerId: string): Promise<any> {
const envId = await this.getCurrentEnvironmentId();
- return this.handleResponse(
- this.api.post(`/environments/${envId}/containers/${containerId}/restart`)
- );
+ return this.handleResponse(this.api.post(`/environments/${envId}/containers/${containerId}/restart`));
}
async deleteContainer(containerId: string): Promise<any> {
@@ -86,9 +73,7 @@ export class EnvironmentAPIService extends BaseAPIService {
async pullContainerImage(containerId: string): Promise<Project> {
const envId = await this.getCurrentEnvironmentId();
- return this.handleResponse(
- this.api.post(`/environments/${envId}/containers/${containerId}/pull`)
- );
+ return this.handleResponse(this.api.post(`/environments/${envId}/containers/${containerId}/pull`));
}
async getImages(options?: SearchPaginationSortRequest): Promise<Paginated<ImageSummaryDto>> {
@@ -100,15 +85,12 @@ export class EnvironmentAPIService extends BaseAPIService {
async getTotalImageSize(): Promise<number> {
const envId = await this.getCurrentEnvironmentId();
- const res = await this.handleResponse<any>(
- this.api.get(`/environments/${envId}/images/total-size`)
- );
+ const res = await this.handleResponse<any>(this.api.get(`/environments/${envId}/images/total-size`));
// Support both shapes just in case
if (typeof res === 'number') return res;
if (res && typeof res === 'object') {
if ('totalSize' in res && typeof res.totalSize === 'number') return res.totalSize;
- if ('data' in res && res.data && typeof res.data.totalSize === 'number')
- return res.data.totalSize;
+ if ('data' in res && res.data && typeof res.data.totalSize === 'number') return res.data.totalSize;
}
return 0;
}
@@ -120,19 +102,12 @@ export class EnvironmentAPIService extends BaseAPIService {
async pullImage(imageName: string, tag: string = 'latest', auth?: any): Promise<any> {
const envId = await this.getCurrentEnvironmentId();
- return this.handleResponse(
- this.api.post(`/environments/${envId}/images/pull`, { imageName, tag, auth })
- );
+ return this.handleResponse(this.api.post(`/environments/${envId}/images/pull`, { imageName, tag, auth }));
}
- async deleteImage(
- imageId: string,
- options?: { force?: boolean; noprune?: boolean }
- ): Promise<void> {
+ async deleteImage(imageId: string, options?: { force?: boolean; noprune?: boolean }): Promise<void> {
const envId = await this.getCurrentEnvironmentId();
- await this.handleResponse(
- this.api.delete(`/environments/${envId}/images/${imageId}`, { params: options })
- );
+ await this.handleResponse(this.api.delete(`/environments/${envId}/images/${imageId}`, { params: options }));
}
async pruneImages(filters?: Record<string, string>): Promise<any> {
@@ -147,16 +122,12 @@ export class EnvironmentAPIService extends BaseAPIService {
async searchImages(term: string, limit?: number): Promise<any> {
const envId = await this.getCurrentEnvironmentId();
- return this.handleResponse(
- this.api.get(`/environments/${envId}/images/search`, { params: { term, limit } })
- );
+ return this.handleResponse(this.api.get(`/environments/${envId}/images/search`, { params: { term, limit } }));
}
async tagImage(imageId: string, repo: string, tag: string): Promise<any> {
const envId = await this.getCurrentEnvironmentId();
- return this.handleResponse(
- this.api.post(`/environments/${envId}/images/${imageId}/tag`, { repo, tag })
- );
+ return this.handleResponse(this.api.post(`/environments/${envId}/images/${imageId}/tag`, { repo, tag }));
}
async getImageHistory(imageId: string): Promise<any> {
@@ -195,16 +166,12 @@ export class EnvironmentAPIService extends BaseAPIService {
async getVolume(volumeName: string): Promise<VolumeDetailDto> {
const envId = await this.getCurrentEnvironmentId();
- return this.handleResponse(
- this.api.get(`/environments/${envId}/volumes/${volumeName}`)
- ) as Promise<VolumeDetailDto>;
+ return this.handleResponse(this.api.get(`/environments/${envId}/volumes/${volumeName}`)) as Promise<VolumeDetailDto>;
}
async getVolumeUsage(volumeName: string): Promise<VolumeUsageDto> {
const envId = await this.getCurrentEnvironmentId();
- return this.handleResponse(
- this.api.get(`/environments/${envId}/volumes/${volumeName}/usage`)
- ) as Promise<VolumeUsageDto>;
+ return this.handleResponse(this.api.get(`/environments/${envId}/volumes/${volumeName}/usage`)) as Promise<VolumeUsageDto>;
}
async createVolume(options: VolumeCreateOptions): Promise<any> {
@@ -268,11 +235,7 @@ export class EnvironmentAPIService extends BaseAPIService {
return response as Project;
}
- async deployProject(
- projectName: string,
- composeContent: string,
- envContent?: string
- ): Promise<Project> {
+ async deployProject(projectName: string, composeContent: string, envContent?: string): Promise<Project> {
const envId = await this.getCurrentEnvironmentId();
const payload = {
name: projectName,
@@ -282,19 +245,13 @@ export class EnvironmentAPIService extends BaseAPIService {
return this.handleResponse(this.api.post(`/environments/${envId}/stacks`, payload));
}
- async updateProject(
- projectName: string,
- composeContent: string,
- envContent?: string
- ): Promise<Project> {
+ async updateProject(projectName: string, composeContent: string, envContent?: string): Promise<Project> {
const envId = await this.getCurrentEnvironmentId();
const payload = {
composeContent,
envContent
};
- return this.handleResponse(
- this.api.put(`/environments/${envId}/stacks/${projectName}`, payload)
- );
+ return this.handleResponse(this.api.put(`/environments/${envId}/stacks/${projectName}`, payload));
}
async deleteProject(projectName: string): Promise<void> {
@@ -330,9 +287,7 @@ export class EnvironmentAPIService extends BaseAPIService {
options?: { profiles?: string[]; envOverrides?: Record<string, string> }
): Promise<Project> {
const envId = await this.getCurrentEnvironmentId();
- return this.handleResponse(
- this.api.post(`/environments/${envId}/stacks/${projectName}/deploy`, options || {})
- );
+ return this.handleResponse(this.api.post(`/environments/${envId}/stacks/${projectName}/deploy`, options || {}));
}
async downProject(projectName: string): Promise<Project> {
@@ -342,9 +297,7 @@ export class EnvironmentAPIService extends BaseAPIService {
async redeployProject(projectName: string): Promise<Project> {
const envId = await this.getCurrentEnvironmentId();
- return this.handleResponse(
- this.api.post(`/environments/${envId}/stacks/${projectName}/redeploy`)
- );
+ return this.handleResponse(this.api.post(`/environments/${envId}/stacks/${projectName}/redeploy`));
}
async pullProjectImages(projectName: string): Promise<Project> {
@@ -352,11 +305,7 @@ export class EnvironmentAPIService extends BaseAPIService {
return this.handleResponse(this.api.post(`/environments/${envId}/stacks/${projectName}/pull`));
}
- async destroyProject(
- projectName: string,
- removeVolumes = false,
- removeFiles = false
- ): Promise<void> {
+ async destroyProject(projectName: string, removeVolumes = false, removeFiles = false): Promise<void> {
const envId = await this.getCurrentEnvironmentId();
await this.handleResponse(
this.api.delete(`/environments/${envId}/stacks/${projectName}/destroy`, {
@@ -367,11 +316,6 @@ export class EnvironmentAPIService extends BaseAPIService {
})
);
}
-
- async convertDockerRun(command: string): Promise<{ composeContent: string }> {
- const envId = await this.getCurrentEnvironmentId();
- return this.handleResponse(this.api.post(`/environments/${envId}/stacks/convert`, { command }));
- }
}
export const environmentAPI = new EnvironmentAPIService();
diff --git a/frontend/src/routes/compose/new/+page.svelte b/frontend/src/routes/compose/new/+page.svelte
index baff6fa1a..3636c7820 100644
--- a/frontend/src/routes/compose/new/+page.svelte
+++ b/frontend/src/routes/compose/new/+page.svelte
@@ -136,7 +136,6 @@
</script>
<div class="bg-background min-h-screen">
- <!-- Sticky header: softer glass effect without changing spacing -->
<div class="bg-background/80 supports-[backdrop-filter]:bg-background/60 sticky top-0 z-20 border-b backdrop-blur">
<div class="max-w-full px-4 py-3">
<div class="flex items-center justify-between">