updated file browser url logic
All checks were successful
Build and Push Docker Image / Build image (push) Successful in 1m40s
All checks were successful
Build and Push Docker Image / Build image (push) Successful in 1m40s
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user