updated file browser url logic
All checks were successful
Build and Push Docker Image / Build image (push) Successful in 1m40s

This commit is contained in:
2025-05-27 13:20:37 +03:00
parent 8e2806deb2
commit 1be267e0ff
4 changed files with 35 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ package docker
import (
"context"
"encoding/json"
"errors"
"fmt"
"log"
"maps"
@@ -656,6 +657,14 @@ func (im *InstanceManager) StopFileBrowser(ctx context.Context, serverId string)
return nil
}
func (im *InstanceManager) GetServerIdFromFileBrowserUrl(ctx context.Context, url string) (string, error) {
pathSegments := strings.Split(url, "/")
if len(pathSegments) < 3 {
return "", errors.New("invalid url")
}
return pathSegments[2], nil
}
func NewInstanceManager(config models.DockerInstanceManagerConfig, siteDomain string) (*InstanceManager, error) {
apiClient, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation())
if err != nil {