Skip to content

Modern Docker Management, Designed for Everyone

feat: mutiple ui/ux changes, backup login, and show both digest values (#4271)

Kyle Mendell1f1261b2728e
diff --git a/backend/docs/francis-migration.md b/backend/docs/francis-migration.md
deleted file mode 100644
index 9052a0e5d..000000000
--- a/backend/docs/francis-migration.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# Durable jobs migration
-
-Stop the old Arcane process before upgrading to the Francis-based release. Take a system backup before the upgrade. The first startup imports legacy persisted job records before accepting requests or executing jobs. Import resumes safely if startup is interrupted. Legacy records remain in the database but are never dispatched by the new runtime.
-
-Only one active Arcane process may use a database. Francis enforces this when the actor host registers. After an unclean shutdown, startup can wait for the previous registration to expire. Do not run the old and new releases against the same database at the same time.
-
-`ACTOR_PORT` defaults to `3551`. Francis uses QUIC over UDP bound to `127.0.0.1`. Do not publish this port from Docker. Processes sharing a network namespace must use different actor ports, even when they use different databases. No separate actor authentication secret is needed. Arcane derives it from the existing encryption key and instance ID.
-
-To roll back, stop Arcane and restore the pre-upgrade backup before starting the old release. Do not point the old release at the upgraded database. Restore accepts existing database/WAL/SHM archives and the new staged single-file database snapshot. The stopped restore helper removes copied live host ownership before restarting Arcane. Normal startup repairs schedules and pending dispatches from durable state.
diff --git a/backend/internal/container/handler.go b/backend/internal/container/handler.go
index 0abd5d7c2..ed525046d 100644
--- a/backend/internal/container/handler.go
+++ b/backend/internal/container/handler.go
@@ -806,6 +806,15 @@ type containerActionConfigInternal struct {
Error func(error) error
}
+// containerActivityNameInternal returns the container's name for activity records, falling back to its ID.
+func (h *ContainerHandler) containerActivityNameInternal(ctx context.Context, containerID string) string {
+ name, err := h.containerService.GetContainerNameByID(ctx, containerID)
+ if err != nil || name == "" {
+ return containerID
+ }
+ return name
+}
+
func (h *ContainerHandler) runContainerActionInternal(ctx context.Context, input *ContainerActionInput, cfg containerActionConfigInternal) (*handlerutil.Out[base.MessageResponse], error) {
user, err := handlerutil.RequireUser(ctx)
if err != nil {
@@ -813,7 +822,7 @@ func (h *ContainerHandler) runContainerActionInternal(ctx context.Context, input
}
runtimeCtx := utils.ActivityRuntimeContext(ctx, h.appCtx)
- activityID, runtimeCtx := activitylib.StartHandlerActivity(runtimeCtx, h.activityService, input.EnvironmentID, cfg.ActivityType, "container", input.ContainerID, input.ContainerID, user, cfg.Step, cfg.StartMessage, database.JSON{"containerID": input.ContainerID}, false)
+ activityID, runtimeCtx := activitylib.StartHandlerActivity(runtimeCtx, h.activityService, input.EnvironmentID, cfg.ActivityType, "container", input.ContainerID, h.containerActivityNameInternal(runtimeCtx, input.ContainerID), user, cfg.Step, cfg.StartMessage, database.JSON{"containerID": input.ContainerID}, false)
if err := cfg.Action(runtimeCtx, input.ContainerID, *user); err != nil {
activitylib.CompleteHandlerActivity(runtimeCtx, h.activityService, activityID, cfg.CompleteMessage, err)
return nil, cfg.Error(err)
@@ -858,7 +867,7 @@ func (h *ContainerHandler) RedeployContainer(ctx context.Context, input *Contain
}
runtimeCtx := utils.ActivityRuntimeContext(ctx, h.appCtx)
- activityID, runtimeCtx := activitylib.StartHandlerActivity(runtimeCtx, h.activityService, input.EnvironmentID, activitytypes.TypeContainerRedeploy, "container", input.ContainerID, input.ContainerID, user, "Starting redeploy", "Container redeploy requested", database.JSON{"containerID": input.ContainerID}, true)
+ activityID, runtimeCtx := activitylib.StartHandlerActivity(runtimeCtx, h.activityService, input.EnvironmentID, activitytypes.TypeContainerRedeploy, "container", input.ContainerID, h.containerActivityNameInternal(runtimeCtx, input.ContainerID), user, "Starting redeploy", "Container redeploy requested", database.JSON{"containerID": input.ContainerID}, true)
activitylib.AwaitHandlerActivitySlot(runtimeCtx, h.activityService, activityID, input.EnvironmentID)
activityWriter := activitylib.NewWriter(runtimeCtx, h.activityService, activityID, io.Discard, "Redeploying container")
redeployCtx := context.WithValue(runtimeCtx, dockerutils.ProgressWriterKey{}, activityWriter)
@@ -929,7 +938,7 @@ func (h *ContainerHandler) EditContainer(ctx context.Context, input *EditContain
}
runtimeCtx := utils.ActivityRuntimeContext(ctx, h.appCtx)
- activityID, runtimeCtx := activitylib.StartHandlerActivity(runtimeCtx, h.activityService, input.EnvironmentID, activitytypes.TypeContainerEdit, "container", input.ContainerID, input.ContainerID, user, "Starting edit", "Container edit requested", database.JSON{"containerID": input.ContainerID}, true)
+ activityID, runtimeCtx := activitylib.StartHandlerActivity(runtimeCtx, h.activityService, input.EnvironmentID, activitytypes.TypeContainerEdit, "container", input.ContainerID, h.containerActivityNameInternal(runtimeCtx, input.ContainerID), user, "Starting edit", "Container edit requested", database.JSON{"containerID": input.ContainerID}, true)
activitylib.AwaitHandlerActivitySlot(runtimeCtx, h.activityService, activityID, input.EnvironmentID)
activityWriter := activitylib.NewWriter(runtimeCtx, h.activityService, activityID, io.Discard, "Editing container")
editCtx := context.WithValue(runtimeCtx, dockerutils.ProgressWriterKey{}, activityWriter)
@@ -975,7 +984,7 @@ func (h *ContainerHandler) DeleteContainer(ctx context.Context, input *DeleteCon
}
runtimeCtx := utils.ActivityRuntimeContext(ctx, h.appCtx)
- activityID, runtimeCtx := activitylib.StartHandlerActivity(runtimeCtx, h.activityService, input.EnvironmentID, activitytypes.TypeContainerDelete, "container", input.ContainerID, input.ContainerID, user, "Deleting container", "Container delete requested", database.JSON{"containerID": input.ContainerID, "force": input.Force, "removeVolumes": input.RemoveVolumes}, false)
+ activityID, runtimeCtx := activitylib.StartHandlerActivity(runtimeCtx, h.activityService, input.EnvironmentID, activitytypes.TypeContainerDelete, "container", input.ContainerID, h.containerActivityNameInternal(runtimeCtx, input.ContainerID), user, "Deleting container", "Container delete requested", database.JSON{"containerID": input.ContainerID, "force": input.Force, "removeVolumes": input.RemoveVolumes}, false)
if err := h.containerService.DeleteContainer(runtimeCtx, input.ContainerID, input.Force, input.RemoveVolumes, *user); err != nil {
activitylib.CompleteHandlerActivity(runtimeCtx, h.activityService, activityID, "Container deleted", err)
return nil, huma.Error500InternalServerError("Failed to delete container: " + err.Error())
diff --git a/backend/internal/container/service.go b/backend/internal/container/service.go
index e8c08f07a..4c451faaf 100644
--- a/backend/internal/container/service.go
+++ b/backend/internal/container/service.go
@@ -15,6 +15,7 @@ import (
"sync"
"time"
+ "github.com/containerd/errdefs"
"github.com/getarcaneapp/arcane/backend/v2/internal/common"
"github.com/getarcaneapp/arcane/backend/v2/internal/database"
"github.com/getarcaneapp/arcane/backend/v2/internal/docker"
@@ -1196,10 +1197,12 @@ func (s *ContainerService) GetContainerDetails(ctx context.Context, id string) (
return details, nil
}
-// GetContainerNameByReference resolves a container's clean name from a Docker ID or name.
-
-// containerProcessesPsArgs asks ps for per-process CPU and memory; Windows daemons ignore it.
-var containerProcessesPsArgs = []string{"-eo", "pid,user,%cpu,%mem,etime,cmd"}
+// containerProcessesPsArgs lists ps argument sets in preference order: procps first, then
+// BusyBox, which rejects %cpu/%mem. Windows daemons ignore the arguments.
+var containerProcessesPsArgs = [][]string{
+ {"-eo", "pid,user,%cpu,%mem,etime,cmd"},
+ {"-o", "pid,user,etime,args"},
+}
// GetContainerProcesses returns Docker's `top` snapshot for a container.
func (s *ContainerService) GetContainerProcesses(ctx context.Context, containerID string) (containertypes.Processes, error) {
@@ -1215,7 +1218,13 @@ func (s *ContainerService) GetContainerProcesses(ctx context.Context, containerI
topCtx, cancel := context.WithTimeout(ctx, timeout)
defer cancel()
- result, err := dockerClient.ContainerTop(topCtx, containerID, client.ContainerTopOptions{Arguments: containerProcessesPsArgs})
+ var result client.ContainerTopResult
+ for _, args := range containerProcessesPsArgs {
+ result, err = dockerClient.ContainerTop(topCtx, containerID, client.ContainerTopOptions{Arguments: args})
+ if err == nil || errdefs.IsNotFound(err) || errdefs.IsConflict(err) || topCtx.Err() != nil {
+ break
+ }
+ }
if err != nil {
return containertypes.Processes{}, fmt.Errorf("failed to list container processes: %w", err)
}
@@ -1229,6 +1238,7 @@ func (s *ContainerService) GetContainerProcesses(ctx context.Context, containerI
return processes, nil
}
+// GetContainerNameByReference resolves a container's clean name from a Docker ID or name.
func (s *ContainerService) GetContainerNameByReference(ctx context.Context, ref string) (string, error) {
info, err := s.GetContainerByReference(ctx, ref)
if err != nil {
diff --git a/backend/internal/container/service_test.go b/backend/internal/container/service_test.go
index b2ee20147..5cb4665a9 100644
--- a/backend/internal/container/service_test.go
+++ b/backend/internal/container/service_test.go
@@ -8,7 +8,6 @@ import (
"net/http"
"net/http/httptest"
"net/netip"
- "net/url"
"regexp"
"strings"
"testing"
@@ -631,9 +630,13 @@ func TestBuildSummariesUsesContainerTagPolicyUpdates(t *testing.T) {
func TestContainerServiceGetContainerProcessesInternal(t *testing.T) {
tests := []struct {
- name string
- status int
- body string
+ name string
+ status int
+ body string
+ fallback *struct {
+ status int
+ body string
+ }
wantTitles []string
wantRows [][]string
wantErr func(error) bool
@@ -648,19 +651,34 @@ func TestContainerServiceGetContainerProcessesInternal(t *testing.T) {
{name: "empty", status: http.StatusOK, body: `{}`, wantTitles: []string{}, wantRows: [][]string{}},
{name: "not found", status: http.StatusNotFound, body: `{"message":"No such container: container-1"}`, wantErr: errdefs.IsNotFound},
{name: "not running", status: http.StatusConflict, body: `{"message":"container container-1 is not running"}`, wantErr: errdefs.IsConflict},
+ {
+ name: "busybox ps falls back",
+ status: http.StatusInternalServerError,
+ body: `{"message":"ps: bad -o argument '%cpu', supported arguments: user,group,comm,args,pid,ppid,pgid,etime,nice,rgroup,ruser,time,tty,vsz,stat,rss"}`,
+ fallback: &struct {
+ status int
+ body string
+ }{http.StatusOK, `{"Titles":["PID","USER","ELAPSED","COMMAND"],"Processes":[["1","root","01:02:03","nginx: master process nginx -g daemon off;"]]}`},
+ wantTitles: []string{"PID", "USER", "ELAPSED", "COMMAND"},
+ wantRows: [][]string{{"1", "root", "01:02:03", "nginx: master process nginx -g daemon off;"}},
+ },
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
- var gotQuery url.Values
+ var gotArgs []string
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if r.Method != http.MethodGet || dockerTestPathInternal(r.URL.Path) != "/containers/container-1/top" {
http.NotFound(w, r)
return
}
- gotQuery = r.URL.Query()
+ gotArgs = append(gotArgs, r.URL.Query().Get("ps_args"))
+ status, body := tt.status, tt.body
+ if tt.fallback != nil && len(gotArgs) > 1 {
+ status, body = tt.fallback.status, tt.fallback.body
+ }
w.Header().Set("Content-Type", "application/json")
- w.WriteHeader(tt.status)
- if _, err := io.WriteString(w, tt.body); err != nil {
+ w.WriteHeader(status)
+ if _, err := io.WriteString(w, body); err != nil {
t.Error(err)
}
}))
@@ -668,7 +686,11 @@ func TestContainerServiceGetContainerProcessesInternal(t *testing.T) {
svc := NewContainerService(nil, docker.NewDockerClientService(t.Context(), nil, nil, nil).WithClient(newTestDockerClientInternal(t, server)), nil, nil, nil)
processes, err := svc.GetContainerProcesses(context.Background(), "container-1")
- require.Equal(t, strings.Join(containerProcessesPsArgs, " "), gotQuery.Get("ps_args"))
+ wantArgs := []string{strings.Join(containerProcessesPsArgs[0], " ")}
+ if tt.fallback != nil {
+ wantArgs = append(wantArgs, strings.Join(containerProcessesPsArgs[1], " "))
+ }
+ require.Equal(t, wantArgs, gotArgs)
if tt.wantErr != nil {
require.True(t, tt.wantErr(err), "unexpected error: %v", err)
return
diff --git a/backend/internal/project/handler.go b/backend/internal/project/handler.go
index 497151bbe..85c4ec6db 100644
--- a/backend/internal/project/handler.go
+++ b/backend/internal/project/handler.go
@@ -463,7 +463,7 @@ func (h *ProjectHandler) UpdateProjectTag(ctx context.Context, input *UpdateProj
Type: activitytypes.TypeResourceAction,
ResourceType: "project",
ResourceID: input.ProjectID,
- ResourceName: input.ProjectID,
+ ResourceName: h.projectActivityNameInternal(runtimeCtx, input.ProjectID),
User: user,
Step: "Updating project tags",
Message: "Updating project tags",
@@ -512,6 +512,15 @@ type projectStreamOperationConfigInternal struct {
Action func(ctx context.Context, writer io.Writer) error
}
+// projectActivityNameInternal returns the project's name for activity records, falling back to its ID.
+func (h *ProjectHandler) projectActivityNameInternal(ctx context.Context, projectID string) string {
+ proj, err := h.projectService.GetProjectFromDatabaseByID(ctx, projectID)
+ if err != nil || proj.Name == "" {
+ return projectID
+ }
+ return proj.Name
+}
+
// streamProjectOperationInternal is the shared scaffold for the streamed
// project endpoints: NDJSON headers, activity lifecycle (started frame, queue
// slot, completion), the activity-teeing writer, and the terminal done/error
@@ -534,7 +543,7 @@ func (h *ProjectHandler) streamProjectOperationInternal(environmentID, projectID
cfg.ActivityType,
"project",
projectID,
- projectID,
+ h.projectActivityNameInternal(runtimeCtx, projectID),
user,
cfg.Step,
cfg.StartMessage,
@@ -598,7 +607,7 @@ func (h *ProjectHandler) DownProject(ctx context.Context, input *DownProjectInpu
}
runtimeCtx := utils.ActivityRuntimeContext(ctx, h.appCtx)
- activityID, runtimeCtx := activitylib.StartHandlerActivity(runtimeCtx, h.activityService, input.EnvironmentID, activitytypes.TypeProjectDown, "project", input.ProjectID, input.ProjectID, user, "Stopping project", "Project stop requested", database.JSON{"projectID": input.ProjectID}, false)
+ activityID, runtimeCtx := activitylib.StartHandlerActivity(runtimeCtx, h.activityService, input.EnvironmentID, activitytypes.TypeProjectDown, "project", input.ProjectID, h.projectActivityNameInternal(runtimeCtx, input.ProjectID), user, "Stopping project", "Project stop requested", database.JSON{"projectID": input.ProjectID}, false)
activityWriter := activitylib.NewWriter(runtimeCtx, h.activityService, activityID, io.Discard, "Stopping project")
downCtx := context.WithValue(runtimeCtx, dockerutils.ProgressWriterKey{}, activityWriter)
if err := h.projectService.DownProject(downCtx, input.ProjectID, *user); err != nil {
@@ -835,7 +844,7 @@ func (h *ProjectHandler) DestroyProject(ctx context.Context, input *DestroyProje
}
runtimeCtx := utils.ActivityRuntimeContext(ctx, h.appCtx)
- activityID, runtimeCtx := activitylib.StartHandlerActivity(runtimeCtx, h.activityService, input.EnvironmentID, activitytypes.TypeProjectDestroy, "project", input.ProjectID, input.ProjectID, user, "Destroying project", "Project destroy requested", database.JSON{"projectID": input.ProjectID, "removeFiles": removeFiles, "removeVolumes": removeVolumes}, false)
+ activityID, runtimeCtx := activitylib.StartHandlerActivity(runtimeCtx, h.activityService, input.EnvironmentID, activitytypes.TypeProjectDestroy, "project", input.ProjectID, h.projectActivityNameInternal(runtimeCtx, input.ProjectID), user, "Destroying project", "Project destroy requested", database.JSON{"projectID": input.ProjectID, "removeFiles": removeFiles, "removeVolumes": removeVolumes}, false)
activityWriter := activitylib.NewWriter(runtimeCtx, h.activityService, activityID, io.Discard, "Destroying project")
destroyCtx := context.WithValue(runtimeCtx, dockerutils.ProgressWriterKey{}, activityWriter)
if err := h.projectService.DestroyProject(destroyCtx, input.ProjectID, removeFiles, removeVolumes, *user); err != nil {
@@ -1031,12 +1040,13 @@ func (h *ProjectHandler) runProjectActivityActionInternal(ctx context.Context, e
}
runtimeCtx := utils.ActivityRuntimeContext(ctx, h.appCtx)
+ projectName := h.projectActivityNameInternal(runtimeCtx, projectID)
var activityID string
if cfg.Queue {
- activityID, runtimeCtx = activitylib.StartHandlerActivity(runtimeCtx, h.activityService, environmentID, cfg.ActivityType, "project", projectID, projectID, user, cfg.Step, cfg.StartMessage, database.JSON{"projectID": projectID}, true)
+ activityID, runtimeCtx = activitylib.StartHandlerActivity(runtimeCtx, h.activityService, environmentID, cfg.ActivityType, "project", projectID, projectName, user, cfg.Step, cfg.StartMessage, database.JSON{"projectID": projectID}, true)
activitylib.AwaitHandlerActivitySlot(runtimeCtx, h.activityService, activityID, environmentID)
} else {
- activityID, runtimeCtx = activitylib.StartHandlerActivity(runtimeCtx, h.activityService, environmentID, cfg.ActivityType, "project", projectID, projectID, user, cfg.Step, cfg.StartMessage, database.JSON{"projectID": projectID}, false)
+ activityID, runtimeCtx = activitylib.StartHandlerActivity(runtimeCtx, h.activityService, environmentID, cfg.ActivityType, "project", projectID, projectName, user, cfg.Step, cfg.StartMessage, database.JSON{"projectID": projectID}, false)
}
activityWriter := activitylib.NewWriter(runtimeCtx, h.activityService, activityID, io.Discard, cfg.WriterStep)
actionCtx := context.WithValue(runtimeCtx, dockerutils.ProgressWriterKey{}, activityWriter)
@@ -1247,7 +1257,7 @@ func (h *ProjectHandler) UpdateProjectWorkspace(ctx context.Context, input *Upda
var result *workspacetypes.Workspace
runtimeCtx := utils.ActivityRuntimeContext(ctx, h.appCtx)
activityID, err := activitylib.RunHandlerActivity(runtimeCtx, h.activityService, activitylib.HandlerOptions{
- EnvironmentID: input.EnvironmentID, Type: activitytypes.TypeResourceAction, ResourceType: "project", ResourceID: input.ProjectID, ResourceName: input.ProjectID, User: user,
+ EnvironmentID: input.EnvironmentID, Type: activitytypes.TypeResourceAction, ResourceType: "project", ResourceID: input.ProjectID, ResourceName: h.projectActivityNameInternal(runtimeCtx, input.ProjectID), User: user,
Step: "Updating project workspace", Message: "Updating project workspace", SuccessMessage: "Project workspace updated successfully",
Metadata: database.JSON{"action": "update_project_workspace", "fileChangeCount": len(manifest.FileChanges)},
}, func(runtimeCtx context.Context) error {
diff --git a/backend/pkg/projects/fs_templates.go b/backend/pkg/projects/fs_templates.go
index 43267be62..09748d552 100644
--- a/backend/pkg/projects/fs_templates.go
+++ b/backend/pkg/projects/fs_templates.go
@@ -99,45 +99,80 @@ func WriteTemplateFiles(composePath, envPath, composeContent, envContent string)
return &envContent, nil
}
+// Previous built-in templates; unedited on-disk copies are upgraded to the current defaults.
+const (
+ retiredDefaultComposeTemplate = `services:
+ nginx:
+ image: nginx:alpine
+ container_name: nginx_service
+ env_file:
+ - .env
+ ports:
+ - "8080:80"
+ volumes:
+ - nginx_data:/usr/share/nginx/html
+ restart: unless-stopped
+
+volumes:
+ nginx_data:
+ driver: local
+`
+
+ retiredDefaultEnvTemplate = `# Environment Variables
+# These variables will be available to your project services
+# Format: VARIABLE_NAME=value
+
+# Web Server Configuration
+NGINX_HOST=localhost
+NGINX_PORT=80
+
+# Database Configuration
+POSTGRES_DB=myapp
+POSTGRES_USER=myuser
+POSTGRES_PASSWORD=mypassword
+POSTGRES_PORT=5432
+
+# Example Additional Variables
+# API_KEY=your_api_key_here
+# SECRET_KEY=your_secret_key_here
+# DEBUG=false
+`
+)
+
+// EnsureDefaultTemplates writes missing default templates and upgrades unedited retired defaults.
func EnsureDefaultTemplates(ctx context.Context, configuredTemplatesDir string) error {
templatesDir, err := GetTemplatesDirectory(ctx, configuredTemplatesDir)
if err != nil {
return fmt.Errorf("get templates directory: %w", err)
}
- // Write default compose template if it doesn't exist
- if exists, err := acfs.Exists(ctx, templatesDir, "/.compose.template"); err != nil {
- return fmt.Errorf("write default compose template: %w", err)
- } else if !exists {
- if err := acfs.Write(ctx, templatesDir, "/.compose.template", []byte(getDefaultComposeTemplate()), acfs.WriteOptions{Mode: utils.FilePerm}); err != nil {
- return fmt.Errorf("write default compose template: %w", err)
- }
+ defaults := []struct {
+ path, name, content, retired string
+ }{
+ {"/.compose.template", "compose", getDefaultComposeTemplate(), retiredDefaultComposeTemplate},
+ {"/.swarm-stack.template", "swarm stack", DefaultSwarmStackTemplate(), ""},
+ {"/.swarm-stack.env.template", "swarm stack env", DefaultSwarmStackEnvTemplate(), ""},
+ {"/.env.template", "env", getDefaultEnvTemplate(), retiredDefaultEnvTemplate},
}
-
- // Write default swarm stack template if it doesn't exist
- if exists, err := acfs.Exists(ctx, templatesDir, "/.swarm-stack.template"); err != nil {
- return fmt.Errorf("write default swarm stack template: %w", err)
- } else if !exists {
- if err := acfs.Write(ctx, templatesDir, "/.swarm-stack.template", []byte(DefaultSwarmStackTemplate()), acfs.WriteOptions{Mode: utils.FilePerm}); err != nil {
- return fmt.Errorf("write default swarm stack template: %w", err)
+ for _, tmpl := range defaults {
+ exists, err := acfs.Exists(ctx, templatesDir, tmpl.path)
+ if err != nil {
+ return fmt.Errorf("write default %s template: %w", tmpl.name, err)
}
- }
-
- // Write default swarm stack env template if it doesn't exist
- if exists, err := acfs.Exists(ctx, templatesDir, "/.swarm-stack.env.template"); err != nil {
- return fmt.Errorf("write default swarm stack env template: %w", err)
- } else if !exists {
- if err := acfs.Write(ctx, templatesDir, "/.swarm-stack.env.template", []byte(DefaultSwarmStackEnvTemplate()), acfs.WriteOptions{Mode: utils.FilePerm}); err != nil {
- return fmt.Errorf("write default swarm stack env template: %w", err)
+ if exists {
+ if tmpl.retired == "" {
+ continue
+ }
+ current, err := acfs.ReadFile(ctx, templatesDir, tmpl.path)
+ if err != nil {
+ return fmt.Errorf("read default %s template: %w", tmpl.name, err)
+ }
+ if string(current) != tmpl.retired {
+ continue
+ }
}
- }
-
- // Write default env template if it doesn't exist
- if exists, err := acfs.Exists(ctx, templatesDir, "/.env.template"); err != nil {
- return fmt.Errorf("write default env template: %w", err)
- } else if !exists {
- if err := acfs.Write(ctx, templatesDir, "/.env.template", []byte(getDefaultEnvTemplate()), acfs.WriteOptions{Mode: utils.FilePerm}); err != nil {
- return fmt.Errorf("write default env template: %w", err)
+ if err := acfs.Write(ctx, templatesDir, tmpl.path, []byte(tmpl.content), acfs.WriteOptions{Mode: utils.FilePerm}); err != nil {
+ return fmt.Errorf("write default %s template: %w", tmpl.name, err)
}
}
@@ -152,7 +187,7 @@ func getDefaultComposeTemplate() string {
env_file:
- .env
ports:
- - "8080:80"
+ - "${NGINX_HOST_PORT:-8080}:80"
volumes:
- nginx_data:/usr/share/nginx/html
restart: unless-stopped
@@ -230,24 +265,14 @@ STACK_RESTART_DELAY=5s
}
func getDefaultEnvTemplate() string {
- return `# Environment Variables
-# These variables will be available to your project services
-# Format: VARIABLE_NAME=value
-
-# Web Server Configuration
-NGINX_HOST=localhost
-NGINX_PORT=80
-
-# Database Configuration
-POSTGRES_DB=myapp
-POSTGRES_USER=myuser
-POSTGRES_PASSWORD=mypassword
-POSTGRES_PORT=5432
+ return `# Project variables
+# These values are interpolated into compose.yaml and passed to services via env_file.
+# Example syntax in compose.yaml:
+# ports:
+# - "${NGINX_HOST_PORT:-8080}:80"
-# Example Additional Variables
-# API_KEY=your_api_key_here
-# SECRET_KEY=your_secret_key_here
-# DEBUG=false
+# Host port that serves the nginx container
+NGINX_HOST_PORT=8080
`
}
diff --git a/backend/pkg/projects/fs_templates_test.go b/backend/pkg/projects/fs_templates_test.go
index c9daadd1f..0b95115bf 100644
--- a/backend/pkg/projects/fs_templates_test.go
+++ b/backend/pkg/projects/fs_templates_test.go
@@ -123,3 +123,21 @@ services:
})
}
}
+
+func TestEnsureDefaultTemplates_UpgradesOnlyUneditedRetiredDefaults(t *testing.T) {
+ t.Parallel()
+
+ dir := t.TempDir()
+ customCompose := "services:\n app:\n image: custom\n"
+ require.NoError(t, os.WriteFile(filepath.Join(dir, ".compose.template"), []byte(customCompose), 0o600))
+ require.NoError(t, os.WriteFile(filepath.Join(dir, ".env.template"), []byte(retiredDefaultEnvTemplate), 0o600))
+
+ require.NoError(t, EnsureDefaultTemplates(t.Context(), dir))
+
+ compose, err := os.ReadFile(filepath.Join(dir, ".compose.template"))
+ require.NoError(t, err)
+ assert.Equal(t, customCompose, string(compose))
+ env, err := os.ReadFile(filepath.Join(dir, ".env.template"))
+ require.NoError(t, err)
+ assert.Equal(t, getDefaultEnvTemplate(), string(env))
+}
diff --git a/frontend/messages/en.json b/frontend/messages/en.json
index acd721f41..6d1c9f3de 100644
--- a/frontend/messages/en.json
+++ b/frontend/messages/en.json
@@ -1404,7 +1404,7 @@
"compose_start_failed": "Failed to start project",
"compose_start_success": "Project started successfully.",
"compose_stop_failed": "Failed to stop project",
- "compose_stop_success": "Project stopped successfully.",
+ "compose_down_success": "Project taken down. Containers and networks were removed; volumes were kept.",
"compose_restart_failed": "Failed to restart project",
"compose_restart_success": "Project restarted successfully.",
"compose_redeploy_success": "Project redeployed successfully.",
@@ -2396,6 +2396,7 @@
"image_update_up_to_date_desc": "No updates available",
"image_update_digest_title": "Digest Update",
"image_update_digest_desc": "Security or bug fixes available",
+ "image_update_current_digest_label": "Current Digest",
"image_update_latest_digest_label": "Latest Digest",
"image_update_version_title": "Version Update",
"image_update_version_desc": "New version available",
@@ -2620,7 +2621,7 @@
"notifications_test_vulnerability_notification": "Vulnerability",
"notifications_test_prune_report_notification": "Prune Report",
"notifications_test_auto_heal_notification": "Auto-Heal",
- "notifications_signal_title": "Signal Notifications",
+ "notifications_signal_title": "Signal",
"notifications_signal_description": "Send notifications via Signal Messenger through a Signal API server",
"notifications_signal_host_label": "Signal API Host",
"notifications_signal_host_placeholder": "localhost",
@@ -2651,7 +2652,7 @@
"notifications_signal_recipients_help": "Comma-separated list of phone numbers (with +) or Signal group IDs",
"notifications_signal_recipients_required": "At least one recipient is required when Signal is enabled",
"notifications_signal_disable_tls_description": "Disable TLS/SSL for Signal REST API connection (not recommended for production)",
- "notifications_slack_title": "Slack Notifications",
+ "notifications_slack_title": "Slack",
"notifications_slack_description": "Send notifications to Slack channels or direct messages",
"notifications_slack_token_label": "Slack Token",
"notifications_slack_token_placeholder": "xoxb-... or xoxp-...",
@@ -3678,7 +3679,6 @@
"jobs_run_empty": "No runs recorded yet.",
"jobs_upgrade_required": "Upgrade this agent to use durable jobs.",
"jobs_offline_status": "This environment is offline. Showing its last confirmed job status.",
- "jobs_run_id": "Run ID",
"jobs_run_targets": "Target outcomes",
"jobs_worker_health": "Worker health",
"jobs_run_previous": "Previous page",
@@ -3711,7 +3711,6 @@
"jobs_run_all": "Run all",
"jobs_local_health_check": "Local environment health",
"jobs_health_check": "Environment health",
- "jobs_settings_details": "Settings and details",
"jobs_health_scope_description": "Checks the health and connectivity of this environment.",
"editor_compose_updater_detail": "Image update policy",
"editor_compose_updater_info": "Project defaults apply to all services. Service updater fields override project defaults. Explicit updater labels take precedence for each field.",
@@ -3841,5 +3840,45 @@
"containers_processes_title": "Processes",
"containers_processes_description": "Processes running inside the container, as reported by Docker. Refreshes every few seconds.",
"containers_processes_unavailable": "Container is not running. Processes unavailable.",
- "containers_processes_empty": "No processes reported"
+ "containers_processes_empty": "No processes reported",
+ "projects_empty_title": "No projects yet",
+ "projects_empty_description": "A project deploys a Compose file and its environment together. Create one to get started.",
+ "registries_empty_title": "No container registries",
+ "registries_empty_description": "Add a registry to pull private images with stored credentials.",
+ "s3_destinations_empty_title": "No S3 destinations",
+ "s3_destinations_empty_description": "Add an S3-compatible destination to store backups away from this server.",
+ "image_build_history_empty_title": "No builds yet",
+ "image_build_history_empty_description": "Builds you start from the Build Workspace tab will appear here.",
+ "system_backups_empty_title": "No backups yet",
+ "system_backups_empty_description": "Create a backup or set up a schedule to protect Arcane's data.",
+ "security_no_images_description": "Pull or build an image first, then scan it for vulnerabilities.",
+ "security_not_scanned_title": "No images scanned yet",
+ "security_not_scanned_description": "Vulnerability results appear after an image is scanned. No results here does not mean no vulnerabilities.",
+ "security_no_findings_description": "Scanned images have no recorded vulnerabilities.",
+ "git_sync_add_description": "Connect a Git repository path to this environment and keep the project in sync with it.",
+ "environments_settings_offline_title": "Environment offline",
+ "environments_settings_offline_description": "These settings load from the environment and are unavailable until it reconnects. Your place on this tab is kept.",
+ "build_workspace_unavailable_title": "Build workspace unavailable",
+ "build_workspace_unavailable_description": "Arcane could not use the configured Builds Directory. Check that the path exists and is writable by Arcane, or change it in build settings.",
+ "build_workspace_open_settings": "Open build settings",
+ "build_workspace_ask_admin": "Ask an administrator to check the Builds Directory setting.",
+ "port_link_base_server_url_hint": "Opens {url}, built from this environment's Base Server URL.",
+ "volumes_size_calculation_failed": "Couldn't calculate volume sizes: {error}",
+ "volumes_size_not_reported": "Size not reported by this volume's driver",
+ "jobs_summary_failing": "Failing",
+ "jobs_last_run": "Last run",
+ "jobs_never_run": "Never run",
+ "jobs_prerequisites": "Prerequisites",
+ "jobs_prerequisite_met": "Met",
+ "jobs_prerequisite_unmet": "Not met",
+ "jobs_empty_title": "No automations for this environment",
+ "jobs_system_description": "Built-in jobs that always run. Schedules can still be adjusted.",
+ "environments_agent_mtls_downloads_label": "Certificate files",
+ "environments_agent_mtls_downloads_description": "Download the full bundle, or the certificate and key separately.",
+ "timeouts_seconds_help": "Timeout in seconds ({range})",
+ "settings_section_avatars": "Avatars",
+ "settings_section_avatars_description": "How user avatars are sourced and uploaded.",
+ "roles_details_section": "Role details",
+ "security_trivy_server_section": "Remote server",
+ "security_trivy_resource_section": "Resource limits"
}
diff --git a/frontend/src/lib/components/action-buttons.svelte b/frontend/src/lib/components/action-buttons.svelte
index 5fd4ac91b..1fc519472 100644
--- a/frontend/src/lib/components/action-buttons.svelte
+++ b/frontend/src/lib/components/action-buttons.svelte
@@ -396,7 +396,7 @@
const activityId = extractActivityId(data);
if (activityId) {
toast.success(
- type === 'project' ? m.compose_stop_success() : m.containers_stop_success(),
+ type === 'project' ? m.compose_down_success() : m.containers_stop_success(),
activityToastOptions(activityId)
);
}
diff --git a/frontend/src/lib/components/activity/activity-detail-panel.svelte b/frontend/src/lib/components/activity/activity-detail-panel.svelte
index 4a6e55b92..0615436e3 100644
--- a/frontend/src/lib/components/activity/activity-detail-panel.svelte
+++ b/frontend/src/lib/components/activity/activity-detail-panel.svelte
@@ -1,5 +1,7 @@
<script lang="ts">
import JobRunHistory from '#lib/components/job-card/job-run-history.svelte';
+ import { Button } from '#lib/components/ui/button/index.js';
+ import * as Dialog from '#lib/components/ui/dialog/index.js';
import IfPermitted from '#lib/components/if-permitted.svelte';
import { CopyButton } from '#lib/components/ui/copy-button/index.js';
import { activityStore } from '#lib/stores/activity.store.svelte.js';
@@ -9,6 +11,7 @@
import ActivityOutput from './activity-output.svelte';
let { activity }: { activity: Activity } = $props();
+ let historyOpen = $state(false);
// Prefer the freshest activity data from the store (messages stream may update it).
const liveActivity = $derived(activityStore.getActivity(activity.id) ?? activity);
@@ -29,7 +32,20 @@
<div class="border-b border-border/50 bg-muted/25">
{#if liveActivity.type === 'job_run' && jobId && runId}
<IfPermitted perm="jobs:manage" envId={environmentId}>
- <div class="px-4 py-2"><JobRunHistory {jobId} {environmentId} initialRunId={runId} /></div>
+ <div class="px-4 py-2">
+ <Button variant="ghost" size="sm" onclick={() => (historyOpen = true)}>{m.jobs_run_history()}</Button>
+ <Dialog.Root bind:open={historyOpen}>
+ <Dialog.Content class="max-h-(--max-height-screen-85) overflow-y-auto sm:max-w-2xl">
+ <Dialog.Header>
+ <Dialog.Title>{m.jobs_run_history()}</Dialog.Title>
+ <Dialog.Description>{jobId}</Dialog.Description>
+ </Dialog.Header>
+ {#if historyOpen}
+ <JobRunHistory {jobId} {environmentId} initialRunId={runId} />
+ {/if}
+ </Dialog.Content>
+ </Dialog.Root>
+ </div>
</IfPermitted>
{/if}
{#if liveActivity.type === 'job_run' && liveActivity.latestMessage && liveActivity.latestMessage !== liveActivity.error}
diff --git a/frontend/src/lib/components/arcane-table/arcane-table-desktop-view.svelte b/frontend/src/lib/components/arcane-table/arcane-table-desktop-view.svelte
index 7fdc56f13..e55189cb2 100644
--- a/frontend/src/lib/components/arcane-table/arcane-table-desktop-view.svelte
+++ b/frontend/src/lib/components/arcane-table/arcane-table-desktop-view.svelte
@@ -14,7 +14,6 @@
type SelectionModifiers
} from './arcane-table.types.svelte';
import TableCheckbox from './arcane-table-checkbox.svelte';
- import TableEmpty from './table-empty.svelte';
import { untrack, type Component, type Snippet } from 'svelte';
import type { Attachment } from 'svelte/attachments';
import { slide } from 'svelte/transition';
@@ -42,6 +41,7 @@
onToggleRowExpanded,
scrollElement,
loading = false,
+ empty,
wrapText = false
}: {
table: ArcaneSvelteTable<TData>;
@@ -65,6 +65,8 @@
scrollElement?: HTMLElement;
/** First-load flag — when set and there's no data, render skeleton rows. */
loading?: boolean;
+ /** Renders the empty state; receives an optional wrapper class. */
+ empty: Snippet;
/** Wrap cell content instead of truncating (disables virtualization: rows lose their fixed height). */
wrapText?: boolean;
} = $props();
@@ -293,7 +295,7 @@
{#snippet emptyState()}
<Table.Row>
<Table.Cell colspan={columnsCount} class="h-48">
- <TableEmpty {unstyled} />
+ {@render empty()}
</Table.Cell>
</Table.Row>
{/snippet}
diff --git a/frontend/src/lib/components/arcane-table/arcane-table-mobile-view.svelte b/frontend/src/lib/components/arcane-table/arcane-table-mobile-view.svelte
index 8d5785ab9..f2280232f 100644
--- a/frontend/src/lib/components/arcane-table/arcane-table-mobile-view.svelte
+++ b/frontend/src/lib/components/arcane-table/arcane-table-mobile-view.svelte
@@ -2,7 +2,6 @@
import type { ArcaneRow, ArcaneSvelteTable } from './table-features';
import Skeleton from '#lib/components/ui/skeleton/skeleton.svelte';
import DropdownCard from '#lib/components/dropdown-card.svelte';
- import TableEmpty from './table-empty.svelte';
import { m } from '#lib/paraglide/messages.js';
import { cn } from '#lib/utils.js';
import type { Snippet, Component } from 'svelte';
@@ -19,11 +18,11 @@
mobileFieldVisibility,
groupedRows = null,
groupIcon,
- unstyled = false,
expandedRowContent,
expandedRows,
onToggleRowExpanded,
- loading = false
+ loading = false,
+ empty
}: {
table: ArcaneSvelteTable<TData>;
rowIndex: ReadonlyMap<string, { row: ArcaneRow<TData>; index: number }>;
@@ -31,12 +30,13 @@
mobileFieldVisibility: Record<string, boolean>;
groupedRows?: GroupedData<TData>[] | null;
groupIcon?: (groupName: string) => Component;
- unstyled?: boolean;
expandedRowContent?: Snippet<[{ row: ArcaneRow<TData>; item: TData }]>;
expandedRows?: Set<string>;
onToggleRowExpanded?: (rowId: string) => void;
/** First-load flag — when set and there's no data, render skeleton cards. */
loading?: boolean;
+ /** Renders the empty state; receives an optional wrapper class. */
+ empty: Snippet;
} = $props();
const hasExpand = $derived(!!expandedRowContent);
@@ -80,8 +80,8 @@
{/snippet}
{#snippet emptyState()}
- <div class="p-4">
- <TableEmpty {unstyled} class="min-h-48" />
+ <div class="min-h-48 p-4">
+ {@render empty()}
</div>
{/snippet}
diff --git a/frontend/src/lib/components/arcane-table/arcane-table-toolbar.svelte b/frontend/src/lib/components/arcane-table/arcane-table-toolbar.svelte
index 55c348067..746be105c 100644
--- a/frontend/src/lib/components/arcane-table/arcane-table-toolbar.svelte
+++ b/frontend/src/lib/components/arcane-table/arcane-table-toolbar.svelte
@@ -34,7 +34,9 @@
class: className,
imageNameFilterOptions = [],
wrapText = false,
- onToggleWrapText
+ onToggleWrapText,
+ isFiltered = false,
+ onResetFilters
}: {
table: ArcaneSvelteTable<TData>;
selectedIds?: string[];
@@ -49,6 +51,8 @@
imageNameFilterOptions?: string[];
wrapText?: boolean;
onToggleWrapText?: () => void;
+ isFiltered?: boolean;
+ onResetFilters?: () => void;
} = $props();
const buttonActions = $derived(
bulkActions.map((item) => ({
@@ -57,12 +61,6 @@
}))
);
- // With `withoutFilters` the column filters aren't user-controlled — the page bakes
- // in its own scoping filter (e.g. /updates pins `updates`), which would otherwise
- // light up Reset on first paint and let a click wipe the page's own scope.
- const isFiltered = $derived(
- !!table.atoms.globalFilter.get() || (!withoutFilters && table.atoms.columnFilters.get().length > 0)
- );
const usageColumn = $derived(table.getAllColumns().some((col) => col.id === 'inUse') ? table.getColumn('inUse') : undefined);
const updatesColumn = $derived(
table.getAllColumns().some((col) => col.id === 'updates') ? table.getColumn('updates') : undefined
@@ -220,10 +218,7 @@
size="sm"
icon={ResetIcon}
customLabel={m.common_reset()}
- onclick={() => {
- if (!withoutFilters) table.setColumnFilters([]);
- table.setGlobalFilter('');
- }}
+ onclick={onResetFilters}
class="h-9 shrink-0"
/>
{/if}
diff --git a/frontend/src/lib/components/arcane-table/arcane-table.svelte b/frontend/src/lib/components/arcane-table/arcane-table.svelte
index dab6eb63a..5e6616512 100644
--- a/frontend/src/lib/components/arcane-table/arcane-table.svelte
+++ b/frontend/src/lib/components/arcane-table/arcane-table.svelte
@@ -39,6 +39,7 @@
import ArcaneTableCell from './arcane-table-cell.svelte';
import ArcaneTableDesktopView from './arcane-table-desktop-view.svelte';
import ArcaneTableMobileView from './arcane-table-mobile-view.svelte';
+ import TableEmpty from './table-empty.svelte';
let {
items,
@@ -73,7 +74,8 @@
onGroupToggle,
imageNameFilterOptions,
// Expandable row props
- expandedRowContent
+ expandedRowContent,
+ emptyState
}: {
items: Paginated<TData>;
requestOptions: SearchPaginationSortRequest;
@@ -118,6 +120,8 @@
imageNameFilterOptions?: string[];
// Expandable row props
expandedRowContent?: Snippet<[{ row: ArcaneRow<TData>; item: TData }]>;
+ /** First-use empty state, shown when the collection is empty and no search or filter is active. */
+ emptyState?: Snippet;
} = $props();
// Default page size constant
@@ -706,6 +710,17 @@
onDestroy(() => clearTimeout(persistTimeout));
+ // With `withoutFilters` the column filters aren't user-controlled — the page bakes
+ // in its own scoping filter (e.g. /updates pins `updates`), which must not count as filtering.
+ const isFiltered = $derived(
+ !!table.atoms.globalFilter.get() || (!withoutFilters && table.atoms.columnFilters.get().length > 0)
+ );
+
+ function resetFilters() {
+ if (!withoutFilters) table.setColumnFilters([]);
+ table.setGlobalFilter('');
+ }
+
// Styled/unstyled differ only in wrapper chrome; the inner table/mobile/pagination tree is shared.
const shellClass = $derived(
unstyled ? 'flex h-full min-h-0 flex-col' : 'bg-background/60 flex h-full min-h-0 flex-col overflow-hidden rounded-xl border'
@@ -717,6 +732,14 @@
<ArcaneTablePagination {items} {currentPage} {totalPages} {totalItems} {pageSize} {canPrev} {canNext} {setPage} {setPageSize} />
{/snippet}
+{#snippet EmptySnippet()}
+ {#if !isFiltered && emptyState}
+ {@render emptyState()}
+ {:else}
+ <TableEmpty onClear={isFiltered ? resetFilters : undefined} />
+ {/if}
+{/snippet}
+
{#snippet MobileViewSnippet()}
<ArcaneTableMobileView
{rowIndex}
@@ -725,11 +748,11 @@
{mobileFieldVisibility}
groupedRows={effectiveGroupedRows}
{groupIcon}
- {unstyled}
{expandedRowContent}
{expandedRows}
onToggleRowExpanded={toggleRowExpanded}
{loading}
+ empty={EmptySnippet}
/>
{/snippet}
@@ -752,6 +775,8 @@
{imageNameFilterOptions}
{wrapText}
onToggleWrapText={toggleWrapText}
+ {isFiltered}
+ onResetFilters={resetFilters}
/>
</div>
{/if}
@@ -783,6 +808,7 @@
scrollElement={desktopScrollEl}
{loading}
{wrapText}
+ empty={EmptySnippet}
/>
</div>
{:else}
diff --git a/frontend/src/lib/components/arcane-table/table-empty.svelte b/frontend/src/lib/components/arcane-table/table-empty.svelte
index 89cf7057a..d81928bd6 100644
--- a/frontend/src/lib/components/arcane-table/table-empty.svelte
+++ b/frontend/src/lib/components/arcane-table/table-empty.svelte
@@ -1,12 +1,13 @@
<script lang="ts">
import * as Empty from '#lib/components/ui/empty/index.js';
- import { FolderXIcon } from '#lib/icons/index.js';
+ import { ArcaneButton } from '#lib/components/arcane-button/index.js';
+ import { FolderXIcon, ResetIcon } from '#lib/icons/index.js';
import { m } from '#lib/paraglide/messages.js';
- let { class: className, unstyled = false }: { class?: string; unstyled?: boolean } = $props();
+ let { onClear }: { onClear?: () => void } = $props();
</script>
-<Empty.Root variant={unstyled ? 'plain' : 'card'} class={className} role="status" aria-live="polite">
+<Empty.Root variant="plain" class="h-full" role="status" aria-live="polite">
<Empty.Header>
<Empty.Media variant="icon">
<FolderXIcon class="size-10 text-muted-foreground/60" />
@@ -14,4 +15,16 @@
<Empty.Title><span class="font-semibold">{m.common_no_results_found()}</span></Empty.Title>
<Empty.Description>{m.common_no_results_hint()}</Empty.Description>
</Empty.Header>
+ {#if onClear}
+ <Empty.Content>
+ <ArcaneButton
+ action="base"
+ tone="outline"
+ size="sm"
+ icon={ResetIcon}
+ customLabel={m.common_clear_filters()}
+ onclick={onClear}
+ />
+ </Empty.Content>
+ {/if}
</Empty.Root>
diff --git a/frontend/src/lib/components/badges/port-badge.svelte b/frontend/src/lib/components/badges/port-badge.svelte
index 3dd4e077b..1a70bbada 100644
--- a/frontend/src/lib/components/badges/port-badge.svelte
+++ b/frontend/src/lib/components/badges/port-badge.svelte
@@ -136,6 +136,9 @@
{m.published()}: {ip.includes(':') ? `[${ip}]` : ip}:{p.hostPort} → {p.containerPort}{p.proto ? `/${p.proto}` : ''}
</p>
{/each}
+ <p class="mt-1 text-xs text-muted-foreground">
+ {m.port_link_base_server_url_hint({ url: toPortHref(p.hostPort!, baseServerUrl) })}
+ </p>
</ArcaneTooltip.Content>
</ArcaneTooltip.Root>
{/each}
diff --git a/frontend/src/lib/components/dialogs/gitops-sync-dialog.svelte b/frontend/src/lib/components/dialogs/gitops-sync-dialog.svelte
index 1cceb9d9f..44ae7b19a 100644
--- a/frontend/src/lib/components/dialogs/gitops-sync-dialog.svelte
+++ b/frontend/src/lib/components/dialogs/gitops-sync-dialog.svelte
@@ -597,7 +597,7 @@
<ResponsiveDialog
bind:open
title={isEditMode ? m.git_sync_edit_title() : m.git_sync_add_title()}
- description={isEditMode ? m.common_edit_description() : m.common_add_description()}
+ description={isEditMode ? m.common_edit_description() : m.git_sync_add_description()}
contentClass="sm:max-w-3xl"
>
{#snippet children()}
diff --git a/frontend/src/lib/components/dialogs/prune-confirmation-dialog-content.svelte b/frontend/src/lib/components/dialogs/prune-confirmation-dialog-content.svelte
index f9d97faf0..328f67fcb 100644
--- a/frontend/src/lib/components/dialogs/prune-confirmation-dialog-content.svelte
+++ b/frontend/src/lib/components/dialogs/prune-confirmation-dialog-content.svelte
@@ -1,6 +1,8 @@
<script lang="ts">
import { ArcaneButton } from '#lib/components/arcane-button/index.js';
- import PruneModeCard from '#lib/components/prune/prune-mode-card.svelte';
+ import PruneModePicker from '#lib/components/prune/prune-mode-picker.svelte';
+ import SettingsRow from '#lib/components/settings/settings-row.svelte';
+ import SettingsSection from '#lib/components/settings/settings-section.svelte';
import { m } from '#lib/paraglide/messages.js';
import type { SystemPruneRequest } from '#lib/types/automation.js';
import type { Settings } from '#lib/types/settings.js';
@@ -117,53 +119,41 @@
</script>
<div class="space-y-4">
- <div class="grid gap-2 md:grid-cols-2">
- <PruneModeCard
- title={m.containers()}
- description={m.scheduled_prune_containers_description()}
- modeOptions={containerModes}
- bind:value={containerMode}
- bind:untilValue={containerUntil}
- disabled={isPruning}
- />
- <PruneModeCard
- title={m.images()}
- description={m.prune_images_dialog_description()}
- modeOptions={imageModes}
- bind:value={imageMode}
- bind:untilValue={imageUntil}
- disabled={isPruning}
- />
- <PruneModeCard
- title={m.resource_networks_cap()}
- description={m.scheduled_prune_networks_description()}
- modeOptions={networkModes}
- bind:value={networkMode}
- bind:untilValue={networkUntil}
- disabled={isPruning}
- />
- <PruneModeCard
- title={m.resource_volumes_cap()}
- description={m.prune_volumes_guidance()}
- modeOptions={volumeModes}
- bind:value={volumeMode}
- disabled={isPruning}
- warningTitle={m.prune_volumes_warning_title()}
- warningDescription={volumeMode === 'all'
- ? m.prune_volumes_warning_description_all()
- : m.prune_volumes_warning_description()}
- />
- <div class="md:col-span-2">
- <PruneModeCard
- title={m.build_cache()}
- description={m.scheduled_prune_build_cache_description()}
+ <SettingsSection>
+ <SettingsRow label={m.containers()} description={m.scheduled_prune_containers_description()} layout="wide">
+ <PruneModePicker
+ modeOptions={containerModes}
+ bind:value={containerMode}
+ bind:untilValue={containerUntil}
+ disabled={isPruning}
+ />
+ </SettingsRow>
+ <SettingsRow label={m.images()} description={m.prune_images_dialog_description()} layout="wide">
+ <PruneModePicker modeOptions={imageModes} bind:value={imageMode} bind:untilValue={imageUntil} disabled={isPruning} />
+ </SettingsRow>
+ <SettingsRow label={m.resource_networks_cap()} description={m.scheduled_prune_networks_description()} layout="wide">
+ <PruneModePicker modeOptions={networkModes} bind:value={networkMode} bind:untilValue={networkUntil} disabled={isPruning} />
+ </SettingsRow>
+ <SettingsRow label={m.resource_volumes_cap()} description={m.prune_volumes_guidance()} layout="wide">
+ <PruneModePicker
+ modeOptions={volumeModes}
+ bind:value={volumeMode}
+ disabled={isPruning}
+ warningTitle={m.prune_volumes_warning_title()}
+ warningDescription={volumeMode === 'all'
+ ? m.prune_volumes_warning_description_all()
+ : m.prune_volumes_warning_description()}
+ />
+ </SettingsRow>
+ <SettingsRow label={m.build_cache()} description={m.scheduled_prune_build_cache_description()} layout="wide">
+ <PruneModePicker
modeOptions={buildCacheModes}
bind:value={buildCacheMode}
bind:untilValue={buildCacheUntil}
disabled={isPruning}
/>
- </div>
- </div>
+ </SettingsRow>
+ </SettingsSection>
<div class="grid grid-cols-2 gap-3">
<ArcaneButton action="cancel" onclick={handleCancelInternal} disabled={isPruning} class="w-full" />
diff --git a/frontend/src/lib/components/form/form-input.svelte b/frontend/src/lib/components/form/form-input.svelte
index 91c51efda..987eff456 100644
--- a/frontend/src/lib/components/form/form-input.svelte
+++ b/frontend/src/lib/components/form/form-input.svelte
@@ -62,7 +62,7 @@
{/if}
{/if}
{#if input?.error}
- <p class="mt-1 text-sm text-destructive">{input.error}</p>
+ <p class="mt-1 text-xs font-medium text-destructive">{input.error}</p>
{/if}
{#if helpText}
<p class="mt-1 text-xs text-muted-foreground">{helpText}</p>
diff --git a/frontend/src/lib/components/image-update-item.svelte b/frontend/src/lib/components/image-update-item.svelte
index c0198bdf7..0ec7499b2 100644
--- a/frontend/src/lib/components/image-update-item.svelte
+++ b/frontend/src/lib/components/image-update-item.svelte
@@ -174,6 +174,9 @@
: tag || m.common_unknown()
);
+ const currentDigest = $derived(effectiveUpdateInfo?.currentDigest?.trim() ?? '');
+ const latestDigest = $derived(effectiveUpdateInfo?.latestDigest?.trim() ?? '');
+
const latestVersion = $derived.by((): string | null => {
if (hasError) return null;
if (effectiveUpdateInfo?.latestVersion && effectiveUpdateInfo.latestVersion.trim() !== '') {
@@ -409,6 +412,22 @@
{@render versionDisplay(latestLabel, latestVersion, latestBg, latestText)}
{/if}
</div>
+ {#if effectiveUpdateInfo?.updateType === 'digest' || effectiveUpdateInfo?.updateType === 'not_pulled'}
+ <div class="space-y-2 text-xs">
+ {#if effectiveUpdateInfo.updateType === 'digest' && currentDigest}
+ <div class="space-y-1">
+ <div class="text-muted-foreground">{m.image_update_current_digest_label()}</div>
+ <div class="font-mono break-all whitespace-normal">{currentDigest}</div>
+ </div>
+ {/if}
+ {#if latestDigest}
+ <div class="space-y-1">
+ <div class="text-muted-foreground">{m.image_update_latest_digest_label()}</div>
+ <div class="font-mono break-all whitespace-normal">{latestDigest}</div>
+ </div>
+ {/if}
+ </div>
+ {/if}
{#if updatePriority}
<div class="rounded-lg {boxBg} p-3">
<div class="text-center text-xs leading-relaxed font-medium {boxText}">
@@ -431,7 +450,7 @@
</div>
</div>
</div>
- {@render updateDetails(m.image_update_latest_digest_label(), 'bg-info/10', 'text-info', 'bg-info/10', 'text-info')}
+ {@render updateDetails(m.image_update_latest_label(), 'bg-info/10', 'text-info', 'bg-info/10', 'text-info')}
{@render recheckButton()}
{/snippet}
diff --git a/frontend/src/lib/components/job-card/job-card.svelte b/frontend/src/lib/components/job-card/job-card.svelte
deleted file mode 100644
index 22967324a..000000000
--- a/frontend/src/lib/components/job-card/job-card.svelte
+++ /dev/null
@@ -1,218 +0,0 @@
-<script lang="ts">
- import { StartIcon, EditIcon, ClockIcon } from '#lib/icons/index.js';
- import { m } from '#lib/paraglide/messages.js';
- import { Badge } from '#lib/components/ui/badge/index.js';
- import { Button } from '#lib/components/ui/button/index.js';
- import { Spinner } from '#lib/components/ui/spinner/index.js';
- import { jobScheduleService } from '#lib/services/job-schedule-service.js';
- import { formatDateTimeShort, formatRelativeTime, parseInstant } from '#lib/utils/formatting.js';
- import type { Snippet } from 'svelte';
- import type { JobStatus } from '#lib/types/settings.js';
- import JobScheduleDialog from './job-schedule-dialog.svelte';
- import JobRunHistory from './job-run-history.svelte';
- import { jobStatusLabel, jobNameLabel } from './job-status';
- import { toast } from 'svelte-sonner';
- import { createMutation } from '@tanstack/svelte-query';
-
- let {
- job,
- environmentId = '0',
- isAgent = false,
- durableRuns = false,
- onScheduleUpdate,
- children,
- enabledOverride,
- headerAccessory,
- collapsibleSettings = false
- }: {
- job: JobStatus;
- environmentId?: string;
- isAgent?: boolean;
- durableRuns?: boolean;
- onScheduleUpdate?: () => void;
- children?: Snippet;
- enabledOverride?: boolean;
- headerAccessory?: Snippet;
- collapsibleSettings?: boolean;
- } = $props();
-
- let showScheduleDialog = $state(false);
- const runJobMutation = createMutation(() => ({
- mutationFn: () => jobScheduleService.runJob(job.id, environmentId),
- retry: false,
- onSuccess: () => {
- toast.success(m.jobs_run_queued());
- onScheduleUpdate?.();
- }
- }));
- const restartMutation = createMutation(() => ({
- mutationFn: () => jobScheduleService.restartWorker(job.id, environmentId),
- onSuccess: () => {
- toast.success(m.jobs_worker_restarted());
- onScheduleUpdate?.();
- }
- }));
- const run = $derived(job.currentRun ?? job.lastRun);
- const isRunning = $derived(runJobMutation.isPending);
-
- const nextRunText = $derived.by(() => {
- if (!job.nextRun) return null;
- const nextRun = parseInstant(job.nextRun);
- if (!nextRun) return null;
- const relative = formatRelativeTime(nextRun);
- const absolute = formatDateTimeShort(nextRun);
- return `${relative} (${absolute})`;
- });
-
- const isEnabled = $derived.by(() => enabledOverride ?? job.enabled);
-
- const canRun = $derived(durableRuns && isEnabled && job.canRunManually && !isRunning && !(isAgent && job.managerOnly));
-
- const statusBadge = $derived(
- !isEnabled
- ? { variant: 'secondary' as const, label: m.common_disabled() }
- : run
- ? {
- variant: ['failed', 'needs_attention'].includes(run.status) ? ('destructive' as const) : ('outline' as const),
- label: jobStatusLabel(run.status)
- }
- : job.isContinuous
- ? { variant: 'outline' as const, label: m.jobs_continuous() }
- : null
- );
- const description = $derived(job.id.startsWith('environment-health:') ? m.jobs_health_scope_description() : job.description);
- const showSchedule = $derived(isEnabled && job.schedule && (!job.isContinuous || job.settingsKey));
- const scheduleMetadata = $derived(
- [
- { id: 'next-run', visible: showSchedule && nextRunText, label: m.jobs_next_run(), value: nextRunText },
- { id: 'continuous', visible: isEnabled && !showSchedule && job.isContinuous, label: '', value: m.jobs_continuous() },
- {
- id: 'next-attempt',
- visible: isEnabled && run?.nextAttempt,
- label: m.jobs_next_retry(),
- value: formatDateTimeShort(run?.nextAttempt)
- },
- {
- id: 'worker-health',
- visible: job.workerHealth,
- label: m.jobs_worker_health(),
- value: jobStatusLabel(job.workerHealth?.status ?? '', true)
- }
- ].filter((item) => item.visible)
- );
- const errors = $derived(
- [
- { id: 'run', visible: runJobMutation.error, text: runJobMutation.error?.message, class: 'text-xs text-destructive' },
- { id: 'restart', visible: restartMutation.error, text: restartMutation.error?.message, class: 'text-xs text-destructive' },
- {
- id: 'last',
- visible: job.lastError,
- text: job.lastError,
- class: 'text-xs break-words text-destructive'
- },
- {
- id: 'worker',
- visible: job.workerHealth?.lastError,
- text: job.workerHealth?.lastError,
- class: 'text-xs break-words text-destructive'
- }
- ].filter((error) => error.visible)
- );
-
- function runJobNow() {
- if (!canRun) return;
- runJobMutation.mutate();
- }
-
- function openScheduleDialog() {
- showScheduleDialog = true;
- }
-
- function handleScheduleUpdated() {
- showScheduleDialog = false;
- onScheduleUpdate?.();
- }
-</script>
-
-<article class="flex min-w-0 flex-col gap-3 py-5">
- <div class="flex min-w-0 flex-wrap items-start justify-between gap-x-6 gap-y-3">
- <div class="flex min-w-0 grow basis-80 flex-col gap-1.5">
- <div class="flex min-h-9 flex-wrap items-center gap-2">
- {@render headerAccessory?.()}
- <h4 class="text-base font-semibold">{jobNameLabel(job)}</h4>
- {#if statusBadge}<Badge variant={statusBadge.variant} size="sm">{statusBadge.label}</Badge>{/if}
- </div>
- {#if description}<p class="text-sm leading-relaxed text-muted-foreground">{description}</p>{/if}
- {#if job.lastSuccess}<p class="text-xs text-muted-foreground">
- {m.jobs_last_success()}: {formatDateTimeShort(job.lastSuccess)}
- </p>{/if}
-
- <div class="mt-1 flex min-w-0 flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted-foreground">
- {#if showSchedule}
- <div class="flex items-center gap-2">
- <ClockIcon class="size-3.5 shrink-0" />
- <span class="font-medium">{m.jobs_schedule()}</span>
- <code class="break-all text-foreground">{job.schedule}</code>
- </div>
- {/if}
- {#each scheduleMetadata as item (item.id)}
- <p>{item.label ? `${item.label}: ` : ''}{item.value}</p>
- {/each}
- </div>
- </div>
- <div class="flex min-h-9 max-w-full flex-wrap items-center gap-1">
- {#if isEnabled && job.settingsKey}
- <Button
- variant="ghost"
- size="icon"
- onclick={openScheduleDialog}
- disabled={isAgent && job.managerOnly}
- aria-label={m.jobs_edit_schedule()}
- title={m.jobs_edit_schedule()}
- >
- <EditIcon />
- </Button>
- {/if}
- {#if durableRuns && !job.children?.length}<JobRunHistory jobId={job.id} {environmentId} onUpdate={onScheduleUpdate} />{/if}
- {#if isEnabled && job.canRunManually}
- <Button variant="outline" size="sm" onclick={runJobNow} disabled={!canRun}>
- {#if isRunning}<Spinner data-icon="inline-start" />{m.jobs_submitting()}
- {:else}<StartIcon data-icon="inline-start" />{job.children?.length ? m.jobs_run_all() : m.jobs_run_now()}{/if}
- </Button>
- {/if}
- {#if durableRuns && job.isContinuous && isEnabled}
- <Button variant="ghost" size="sm" disabled={restartMutation.isPending} onclick={() => restartMutation.mutate()}
- >{m.jobs_restart_worker()}</Button
- >
- {/if}
- </div>
- </div>
-
- {#each errors as error (error.id)}<p class={error.class}>{error.text}</p>{/each}
- {#if run?.status === 'waiting' && run.outcome.message}<p class="text-xs text-muted-foreground">{run.outcome.message}</p>{/if}
- {#if job.workerHealth?.nextRetry}<p class="text-xs text-muted-foreground">
- {m.jobs_next_retry()}: {formatDateTimeShort(job.workerHealth.nextRetry)}
- </p>{/if}
- {#if run?.status === 'waiting' && run.remoteOutcome}
- <p class="text-xs text-muted-foreground">
- {m.jobs_remote_status()}: {jobStatusLabel(run.remoteOutcome.status)}
- {#if run.lastConfirmedAt}<span class="ml-2">{m.jobs_last_confirmed()}: {formatDateTimeShort(run.lastConfirmedAt)}</span
- >{/if}
- </p>
- {/if}
- {#if children && collapsibleSettings}
- <details class="group">
- <summary
- class="w-fit cursor-pointer rounded-sm text-sm text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring"
- >{m.jobs_settings_details()}</summary
- >
- <div class="mt-4 max-w-3xl">{@render children()}</div>
- </details>
- {:else}
- {@render children?.()}
- {/if}
-</article>
-
-{#if showScheduleDialog}
- <JobScheduleDialog {job} {environmentId} bind:open={showScheduleDialog} onUpdate={handleScheduleUpdated} />
-{/if}
diff --git a/frontend/src/lib/components/job-card/job-detail-panel.svelte b/frontend/src/lib/components/job-card/job-detail-panel.svelte
new file mode 100644
index 000000000..7d9725ce0
--- /dev/null
+++ b/frontend/src/lib/components/job-card/job-detail-panel.svelte
@@ -0,0 +1,301 @@
+<script lang="ts">
+ import { ResponsiveDialog } from '#lib/components/ui/responsive-dialog/index.js';
+ import { TabBar, type TabItem } from '#lib/components/tab-bar/index.js';
+ import * as Tabs from '#lib/components/ui/tabs/index.js';
+ import * as Alert from '#lib/components/ui/alert/index.js';
+ import { Badge } from '#lib/components/ui/badge/index.js';
+ import { Button } from '#lib/components/ui/button/index.js';
+ import { Spinner } from '#lib/components/ui/spinner/index.js';
+ import { ArcaneButton } from '#lib/components/arcane-button/index.js';
+ import { AlertTriangleIcon, CheckIcon, ClockIcon, CloseIcon, EditIcon, RestartIcon, StartIcon } from '#lib/icons/index.js';
+ import { m } from '#lib/paraglide/messages.js';
+ import { jobScheduleService } from '#lib/services/job-schedule-service.js';
+ import { extractApiErrorMessage } from '#lib/utils/api.js';
+ import { formatDateTimeShort, formatRelativeTime } from '#lib/utils/formatting.js';
+ import type { JobStatus } from '#lib/types/settings.js';
+ import type { Snippet } from 'svelte';
+ import { toast } from 'svelte-sonner';
+ import { createMutation } from '@tanstack/svelte-query';
+ import JobRunHistory from './job-run-history.svelte';
+ import JobScheduleDialog from './job-schedule-dialog.svelte';
+ import { jobNameLabel, jobStatusLabel, jobStatusTone, type JobPanelSection } from './job-status';
+
+ let {
+ job,
+ environmentId,
+ isAgent = false,
+ durableRuns = false,
+ enabledOverride,
+ open = $bindable(false),
+ section = $bindable<JobPanelSection>('overview'),
+ settings,
+ enableControl,
+ onScheduleUpdate
+ }: {
+ job: JobStatus;
+ environmentId: string;
+ isAgent?: boolean;
+ durableRuns?: boolean;
+ enabledOverride?: boolean;
+ open?: boolean;
+ section?: JobPanelSection;
+ settings?: Snippet<[JobStatus]>;
+ /** The job's enable switch, mirrored from the row so it can be toggled from here. */
+ enableControl?: Snippet;
+ onScheduleUpdate?: () => void;
+ } = $props();
+
+ let showScheduleDialog = $state(false);
+ // History can show a target's runs instead of the parent's; cleared when another job is shown.
+ let historyJobId = $state<string | null>(null);
+ let historyOwnerId = $state<string | null>(null);
+
+ const runMutation = createMutation(() => ({
+ mutationFn: (jobId: string) => jobScheduleService.runJob(jobId, environmentId),
+ retry: false,
+ onSuccess: () => {
+ toast.success(m.jobs_run_queued());
+ onScheduleUpdate?.();
+ },
+ onError: (err) => toast.error(m.jobs_run_now(), { description: extractApiErrorMessage(err) })
+ }));
+ const restartMutation = createMutation(() => ({
+ mutationFn: () => jobScheduleService.restartWorker(job.id, environmentId),
+ onSuccess: () => {
+ toast.success(m.jobs_worker_restarted());
+ onScheduleUpdate?.();
+ },
+ onError: (err) => toast.error(m.jobs_restart_worker(), { description: extractApiErrorMessage(err) })
+ }));
+
+ const run = $derived(job.currentRun ?? job.lastRun);
+ const isEnabled = $derived(enabledOverride ?? job.enabled);
+ const managerLocked = $derived(isAgent && job.managerOnly);
+ const canRun = $derived(durableRuns && isEnabled && job.canRunManually && !runMutation.isPending && !managerLocked);
+ const canEditSchedule = $derived(isEnabled && !!job.settingsKey && !managerLocked);
+ const canRestartWorker = $derived(durableRuns && job.isContinuous && isEnabled);
+ const description = $derived(job.id.startsWith('environment-health:') ? m.jobs_health_scope_description() : job.description);
+ const showSchedule = $derived(isEnabled && !!job.schedule && (!job.isContinuous || !!job.settingsKey));
+ const statusLabel = $derived.by(() => {
+ if (!isEnabled) return m.common_disabled();
+ if (run) return jobStatusLabel(run.status);
+ if (job.isContinuous) return m.jobs_continuous();
+ return m.jobs_never_run();
+ });
+ const statusTone = $derived(!isEnabled ? 'gray' : run ? jobStatusTone(run.status) : jobStatusTone(job.workerHealth?.status));
+ const errors = $derived([job.lastError, job.workerHealth?.lastError].filter((text): text is string => !!text));
+ const activeHistoryJobId = $derived(historyOwnerId === job.id && historyJobId ? historyJobId : job.id);
+ const activeHistoryJob = $derived(job.children?.find((child) => child.id === activeHistoryJobId));
+
+ // Past runs stay readable while a job is disabled.
+ const historyAvailable = $derived(durableRuns);
+ const sectionItems = $derived.by((): TabItem[] => {
+ const items: TabItem[] = [{ value: 'overview', label: m.common_overview() }];
+ if (historyAvailable) items.push({ value: 'history', label: m.history() });
+ return items;
+ });
+ const activeSection = $derived(section === 'history' && historyAvailable ? 'history' : 'overview');
+
+ function showHistory(jobId: string | null) {
+ historyJobId = jobId;
+ historyOwnerId = job.id;
+ section = 'history';
+ }
+</script>
+
+{#snippet metaRow(label: string, value: string, title?: string)}
+ <div class="flex items-baseline justify-between gap-4 text-sm">
+ <span class="text-muted-foreground">{label}</span>
+ <span class="text-right tabular-nums" {title}>{value}</span>
+ </div>
+{/snippet}
+
+{#snippet sectionTitle(text: string)}
+ <h3 class="text-xs font-semibold tracking-wide text-muted-foreground uppercase">{text}</h3>
+{/snippet}
+
+<ResponsiveDialog bind:open variant="sheet" title={jobNameLabel(job)} {description} contentClass="sm:max-w-xl">
+ <div class="flex flex-col gap-5 pb-6">
+ <div class="flex flex-wrap items-center gap-2">
+ {@render enableControl?.()}
+ <Badge variant={statusTone}>{statusLabel}</Badge>
+ {#if job.workerHealth}
+ <Badge variant={jobStatusTone(job.workerHealth.status)} size="sm">
+ {m.jobs_worker_health()}: {jobStatusLabel(job.workerHealth.status, true)}
+ </Badge>
+ {/if}
+ <div class="ml-auto flex items-center gap-1">
+ {#if canRestartWorker}
+ <Button variant="ghost" size="sm" disabled={restartMutation.isPending} onclick={() => restartMutation.mutate()}>
+ <RestartIcon data-icon="inline-start" />
+ {m.jobs_restart_worker()}
+ </Button>
+ {/if}
+ {#if isEnabled && job.canRunManually}
+ <Button size="sm" disabled={!canRun} onclick={() => runMutation.mutate(job.id)}>
+ {#if runMutation.isPending}<Spinner data-icon="inline-start" />{:else}<StartIcon data-icon="inline-start" />{/if}
+ {job.children?.length ? m.jobs_run_all() : m.jobs_run_now()}
+ </Button>
+ {/if}
+ </div>
+ </div>
+
+ {#if sectionItems.length > 1}
+ <!-- Own Tabs.Root: the sheet sits inside the page's tabs context and must not drive it. -->
+ <Tabs.Root value={activeSection}>
+ <TabBar items={sectionItems} value={activeSection} onValueChange={(value) => (section = value as JobPanelSection)} />
+ </Tabs.Root>
+ {/if}
+
+ {#if activeSection === 'history'}
+ {#if activeHistoryJob}
+ <div class="flex items-center justify-between gap-3 text-sm">
+ <span class="truncate">{jobNameLabel(activeHistoryJob)}</span>
+ <ArcaneButton
+ action="base"
+ tone="ghost"
+ size="sm"
+ icon={CloseIcon}
+ customLabel={jobNameLabel(job)}
+ onclick={() => showHistory(null)}
+ />
+ </div>
+ {/if}
+ {#key activeHistoryJobId}
+ <JobRunHistory jobId={activeHistoryJobId} {environmentId} onUpdate={onScheduleUpdate} />
+ {/key}
+ {:else}
+ {#each errors as text (text)}
+ <Alert.Root variant="destructive-subtle" size="sm">
+ <AlertTriangleIcon class="size-4" />
+ <Alert.Description class="break-words">{text}</Alert.Description>
+ </Alert.Root>
+ {/each}
+
+ {#if isEnabled}
+ <section class="flex flex-col gap-2">
+ {@render sectionTitle(m.jobs_schedule())}
+ {#if showSchedule}
+ <div class="flex items-center justify-between gap-3">
+ <code class="rounded-md bg-muted/60 px-2 py-1 text-xs break-all">{job.schedule}</code>
+ {#if canEditSchedule}
+ <Button variant="ghost" size="sm" onclick={() => (showScheduleDialog = true)}>
+ <EditIcon data-icon="inline-start" />
+ {m.jobs_edit_schedule()}
+ </Button>
+ {/if}
+ </div>
+ {#if job.nextRun}
+ {@render metaRow(m.jobs_next_run(), `${formatRelativeTime(job.nextRun)} · ${formatDateTimeShort(job.nextRun)}`)}
+ {/if}
+ {:else if job.isContinuous}
+ <p class="flex items-center gap-2 text-sm text-muted-foreground">
+ <ClockIcon class="size-3.5" />
+ {m.jobs_continuous()}
+ </p>
+ {/if}
+ {#if job.lastSuccess}
+ {@render metaRow(m.jobs_last_success(), formatRelativeTime(job.lastSuccess), formatDateTimeShort(job.lastSuccess))}
+ {/if}
+ {#if run?.nextAttempt}
+ {@render metaRow(m.jobs_next_retry(), formatDateTimeShort(run.nextAttempt))}
+ {/if}
+ {#if job.workerHealth?.nextRetry}
+ {@render metaRow(m.jobs_next_retry(), formatDateTimeShort(job.workerHealth.nextRetry))}
+ {/if}
+ {#if run?.status === 'waiting' && run.remoteOutcome}
+ {@render metaRow(m.jobs_remote_status(), jobStatusLabel(run.remoteOutcome.status))}
+ {/if}
+ {#if run?.lastConfirmedAt}
+ {@render metaRow(m.jobs_last_confirmed(), formatDateTimeShort(run.lastConfirmedAt))}
+ {/if}
+ {#if run?.status === 'waiting' && run.outcome.message}
+ <p class="text-sm break-words text-muted-foreground">{run.outcome.message}</p>
+ {/if}
+ </section>
+ {/if}
+
+ {#if job.prerequisites?.length}
+ <section class="flex flex-col gap-2">
+ {@render sectionTitle(m.jobs_prerequisites())}
+ <ul class="flex flex-col gap-1.5">
+ {#each job.prerequisites as prereq (prereq.settingKey)}
+ <li class="flex items-center gap-2 text-sm">
+ {#if prereq.isMet}
+ <CheckIcon class="size-4 shrink-0 text-success" aria-label={m.jobs_prerequisite_met()} />
+ {:else}
+ <CloseIcon class="size-4 shrink-0 text-destructive" aria-label={m.jobs_prerequisite_unmet()} />
+ {/if}
+ {#if prereq.settingsUrl && !prereq.isMet}
+ <a href={prereq.settingsUrl} class="underline-offset-4 hover:underline" onclick={() => (open = false)}>
+ {prereq.label}
+ </a>
+ {:else}
+ <span>{prereq.label}</span>
+ {/if}
+ </li>
+ {/each}
+ </ul>
+ </section>
+ {/if}
+
+ {#if settings}
+ <section class="flex flex-col gap-3">
+ {@render sectionTitle(m.settings())}
+ {@render settings(job)}
+ </section>
+ {/if}
+
+ {#if job.children?.length}
+ <section class="flex flex-col gap-2">
+ {@render sectionTitle(m.jobs_target_runs({ count: job.children.length }))}
+ <div class="divide-y divide-border/50 overflow-hidden rounded-lg border border-border/60">
+ {#each job.children as child (child.id)}
+ {@const childRun = child.currentRun ?? child.lastRun}
+ <div class="flex items-center gap-3 px-3 py-2 text-sm">
+ <div class="flex min-w-0 flex-1 flex-col">
+ <span class="truncate">{jobNameLabel(child)}</span>
+ {#if childRun}
+ <span class="text-xs text-muted-foreground tabular-nums">
+ {formatRelativeTime(childRun.finishedAt ?? childRun.updatedAt)}
+ </span>
+ {/if}
+ </div>
+ {#if childRun}
+ <Badge variant={jobStatusTone(childRun.status)} size="sm">{jobStatusLabel(childRun.status)}</Badge>
+ {/if}
+ {#if durableRuns}
+ <Button variant="ghost" size="sm" onclick={() => showHistory(child.id)}>{m.history()}</Button>
+ {/if}
+ {#if child.canRunManually}
+ <Button
+ variant="outline"
+ size="icon"
+ class="size-8"
+ aria-label={m.jobs_run_now()}
+ disabled={!durableRuns || runMutation.isPending || managerLocked}
+ onclick={() => runMutation.mutate(child.id)}
+ >
+ <StartIcon class="size-4" />
+ </Button>
+ {/if}
+ </div>
+ {/each}
+ </div>
+ </section>
+ {/if}
+ {/if}
+ </div>
+</ResponsiveDialog>
+
+{#if showScheduleDialog}
+ <JobScheduleDialog
+ {job}
+ {environmentId}
+ bind:open={showScheduleDialog}
+ onUpdate={() => {
+ showScheduleDialog = false;
+ onScheduleUpdate?.();
+ }}
+ />
+{/if}
diff --git a/frontend/src/lib/components/job-card/job-row.svelte b/frontend/src/lib/components/job-card/job-row.svelte
new file mode 100644
index 000000000..7f54266f1
--- /dev/null
+++ b/frontend/src/lib/components/job-card/job-row.svelte
@@ -0,0 +1,200 @@
+<script lang="ts">
+ import { AlertTriangleIcon, EditIcon, EllipsisIcon, RestartIcon, StartIcon, ClockIcon } from '#lib/icons/index.js';
+ import { m } from '#lib/paraglide/messages.js';
+ import { Badge } from '#lib/components/ui/badge/index.js';
+ import { Button } from '#lib/components/ui/button/index.js';
+ import { Spinner } from '#lib/components/ui/spinner/index.js';
+ import * as DropdownMenu from '#lib/components/ui/dropdown-menu/index.js';
+ import * as ArcaneTooltip from '#lib/components/arcane-tooltip/index.js';
+ import { jobScheduleService } from '#lib/services/job-schedule-service.js';
+ import { extractApiErrorMessage } from '#lib/utils/api.js';
+ import { formatDateTimeShort, formatRelativeTime } from '#lib/utils/formatting.js';
+ import type { Snippet } from 'svelte';
+ import type { JobStatus } from '#lib/types/settings.js';
+ import JobScheduleDialog from './job-schedule-dialog.svelte';
+ import { jobStatusLabel, jobNameLabel, jobStatusTone } from './job-status';
+ import { toast } from 'svelte-sonner';
+ import { createMutation } from '@tanstack/svelte-query';
+
+ let {
+ job,
+ environmentId = '0',
+ isAgent = false,
+ durableRuns = false,
+ enabledOverride,
+ headerAccessory,
+ onSelect,
+ onScheduleUpdate
+ }: {
+ job: JobStatus;
+ environmentId?: string;
+ isAgent?: boolean;
+ durableRuns?: boolean;
+ enabledOverride?: boolean;
+ headerAccessory?: Snippet;
+ onSelect?: (job: JobStatus, section: 'overview' | 'history') => void;
+ onScheduleUpdate?: () => void;
+ } = $props();
+
+ let showScheduleDialog = $state(false);
+ const runJobMutation = createMutation(() => ({
+ mutationFn: () => jobScheduleService.runJob(job.id, environmentId),
+ retry: false,
+ onSuccess: () => {
+ toast.success(m.jobs_run_queued());
+ onScheduleUpdate?.();
+ },
+ onError: (err) => toast.error(m.jobs_run_now(), { description: extractApiErrorMessage(err) })
+ }));
+ const restartMutation = createMutation(() => ({
+ mutationFn: () => jobScheduleService.restartWorker(job.id, environmentId),
+ onSuccess: () => {
+ toast.success(m.jobs_worker_restarted());
+ onScheduleUpdate?.();
+ },
+ onError: (err) => toast.error(m.jobs_restart_worker(), { description: extractApiErrorMessage(err) })
+ }));
+
+ const run = $derived(job.currentRun ?? job.lastRun);
+ const isEnabled = $derived(enabledOverride ?? job.enabled);
+ const isSubmitting = $derived(runJobMutation.isPending);
+ const canRun = $derived(durableRuns && isEnabled && job.canRunManually && !isSubmitting && !(isAgent && job.managerOnly));
+ const canEditSchedule = $derived(isEnabled && !!job.settingsKey && !(isAgent && job.managerOnly));
+ const canRestartWorker = $derived(durableRuns && job.isContinuous && isEnabled);
+ const hasError = $derived(!!job.lastError || !!job.workerHealth?.lastError);
+ const isActive = $derived(['running', 'retrying', 'queued'].includes(run?.status ?? ''));
+
+ const statusBadge = $derived.by(() => {
+ if (!isEnabled) return { tone: 'gray' as const, label: m.common_disabled() };
+ if (run) return { tone: jobStatusTone(run.status), label: jobStatusLabel(run.status) };
+ if (job.isContinuous) return { tone: jobStatusTone(job.workerHealth?.status), label: m.jobs_continuous() };
+ return null;
+ });
+ const description = $derived(job.id.startsWith('environment-health:') ? m.jobs_health_scope_description() : job.description);
+ const lastRunAt = $derived(run?.finishedAt ?? run?.updatedAt ?? job.lastSuccess);
+ const showNextRun = $derived(isEnabled && !!job.nextRun && (!job.isContinuous || !!job.settingsKey));
+
+ function select(section: 'overview' | 'history' = 'overview') {
+ onSelect?.(job, section);
+ }
+
+ // Controls inside the row opt out of row selection via data-row-control.
+ function handleRowClick(event: MouseEvent) {
+ if ((event.target as HTMLElement | null)?.closest('[data-row-control]')) return;
+ select();
+ }
+
+ function handleRowKeydown(event: KeyboardEvent) {
+ if (event.target !== event.currentTarget) return;
+ if (event.key !== 'Enter' && event.key !== ' ') return;
+ event.preventDefault();
+ select();
+ }
+</script>
+
+<div
+ role="button"
+ tabindex="0"
+ class="group flex min-w-0 cursor-pointer items-center gap-3 px-4 py-3 transition-colors outline-none hover:bg-muted/40 focus-visible:bg-muted/40 sm:gap-4"
+ onclick={handleRowClick}
+ onkeydown={handleRowKeydown}
+>
+ {#if headerAccessory}
+ <div class="flex shrink-0 items-center" data-row-control>
+ {@render headerAccessory()}
+ </div>
+ {/if}
+
+ <div class="flex min-w-0 flex-1 flex-col gap-0.5">
+ <div class="flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1">
+ <span class="truncate text-sm font-medium">{jobNameLabel(job)}</span>
+ {#if statusBadge}
+ <Badge variant={statusBadge.tone} size="sm">
+ {#if isActive}<Spinner class="size-2.5" />{/if}
+ {statusBadge.label}
+ </Badge>
+ {/if}
+ {#if hasError}
+ <ArcaneTooltip.Root>
+ <ArcaneTooltip.Trigger>
+ <AlertTriangleIcon class="size-3.5 text-destructive" aria-label={m.jobs_last_error()} />
+ </ArcaneTooltip.Trigger>
+ <ArcaneTooltip.Content class="max-w-80 break-words"
+ >{job.lastError ?? job.workerHealth?.lastError}</ArcaneTooltip.Content
+ >
+ </ArcaneTooltip.Root>
+ {/if}
+ {#if job.children?.length}
+ <Badge variant="gray" size="sm">{m.jobs_target_runs({ count: job.children.length })}</Badge>
+ {/if}
+ </div>
+ {#if description}
+ <p class="truncate text-xs text-muted-foreground">{description}</p>
+ {/if}
+ </div>
+
+ <div class="hidden shrink-0 flex-col items-end gap-0.5 text-xs text-muted-foreground tabular-nums md:flex">
+ {#if lastRunAt}
+ <span title={formatDateTimeShort(lastRunAt)}>{m.jobs_last_run()}: {formatRelativeTime(lastRunAt)}</span>
+ {:else if isEnabled}
+ <span>{m.jobs_never_run()}</span>
+ {/if}
+ {#if showNextRun}
+ <span class="flex items-center gap-1" title={formatDateTimeShort(job.nextRun)}>
+ <ClockIcon class="size-3" />
+ {m.jobs_next_run()}: {formatRelativeTime(job.nextRun)}
+ </span>
+ {/if}
+ </div>
+
+ <div class="flex shrink-0 items-center gap-1" data-row-control>
+ {#if isEnabled && job.canRunManually}
+ <Button variant="outline" size="sm" onclick={() => runJobMutation.mutate()} disabled={!canRun}>
+ {#if isSubmitting}<Spinner data-icon="inline-start" />{:else}<StartIcon data-icon="inline-start" />{/if}
+ <span class="hidden sm:inline">{job.children?.length ? m.jobs_run_all() : m.jobs_run_now()}</span>
+ </Button>
+ {/if}
+ <DropdownMenu.Root>
+ <DropdownMenu.Trigger>
+ {#snippet child({ props })}
+ <Button {...props} variant="ghost" size="icon" class="size-8" aria-label={m.common_actions()}>
+ <EllipsisIcon class="size-4" />
+ </Button>
+ {/snippet}
+ </DropdownMenu.Trigger>
+ <DropdownMenu.Content align="end" class="min-w-44">
+ <DropdownMenu.Item onclick={() => select('overview')}>{m.common_view_details()}</DropdownMenu.Item>
+ {#if durableRuns}
+ <DropdownMenu.Item onclick={() => select('history')}>{m.jobs_run_history()}</DropdownMenu.Item>
+ {/if}
+ {#if canEditSchedule || canRestartWorker}
+ <DropdownMenu.Separator />
+ {/if}
+ {#if canEditSchedule}
+ <DropdownMenu.Item onclick={() => (showScheduleDialog = true)}>
+ <EditIcon class="size-4" />
+ {m.jobs_edit_schedule()}
+ </DropdownMenu.Item>
+ {/if}
+ {#if canRestartWorker}
+ <DropdownMenu.Item disabled={restartMutation.isPending} onclick={() => restartMutation.mutate()}>
+ <RestartIcon class="size-4" />
+ {m.jobs_restart_worker()}
+ </DropdownMenu.Item>
+ {/if}
+ </DropdownMenu.Content>
+ </DropdownMenu.Root>
+ </div>
+</div>
+
+{#if showScheduleDialog}
+ <JobScheduleDialog
+ {job}
+ {environmentId}
+ bind:open={showScheduleDialog}
+ onUpdate={() => {
+ showScheduleDialog = false;
+ onScheduleUpdate?.();
+ }}
+ />
+{/if}
diff --git a/frontend/src/lib/components/job-card/job-run-history.svelte b/frontend/src/lib/components/job-card/job-run-history.svelte
index db6901173..3f46dcd83 100644
--- a/frontend/src/lib/components/job-card/job-run-history.svelte
+++ b/frontend/src/lib/components/job-card/job-run-history.svelte
@@ -3,31 +3,36 @@
import { queryKeys } from '#lib/query/query-keys.js';
import { createQuery, createMutation } from '@tanstack/svelte-query';
import { m } from '#lib/paraglide/messages.js';
+ import { Badge } from '#lib/components/ui/badge/index.js';
import { Button } from '#lib/components/ui/button/index.js';
- import * as Dialog from '#lib/components/ui/dialog/index.js';
+ import { Spinner } from '#lib/components/ui/spinner/index.js';
import { jobScheduleService } from '#lib/services/job-schedule-service.js';
import { activityStore } from '#lib/stores/activity.store.svelte.js';
+ import { extractApiErrorMessage } from '#lib/utils/api.js';
import { formatDateTimeShort } from '#lib/utils/formatting.js';
- import { jobStatusLabel } from './job-status';
+ import { cn } from '#lib/utils.js';
+ import { jobStatusLabel, jobStatusTone } from './job-status';
+
+ // Renders the run list and selected-run detail; the host decides where it lives (panel or dialog).
let {
jobId,
environmentId,
initialRunId,
onUpdate
}: { jobId: string; environmentId: string; initialRunId?: string; onUpdate?: () => void } = $props();
- let open = $state(false);
let page = $state(1);
- let selected = $state<string | undefined>();
+ // Hosts re-key this component per job, so the initial run only seeds state once.
+ // svelte-ignore state_referenced_locally
+ let selected = $state<string | undefined>(initialRunId);
const runs = createQuery(() => ({
queryKey: queryKeys.jobs.runs(environmentId, jobId, page),
queryFn: () => jobScheduleService.listRuns(jobId, environmentId, page),
- enabled: open,
refetchInterval: 5000
}));
const detail = createQuery(() => ({
queryKey: queryKeys.jobs.run(environmentId, jobId, selected),
queryFn: () => jobScheduleService.getRun(jobId, selected!, environmentId),
- enabled: open && !!selected,
+ enabled: !!selected,
refetchInterval: 5000
}));
const action = createMutation(() => ({
@@ -41,6 +46,8 @@
}
}));
const selectedRun = $derived(selected ? detail.data : undefined);
+ const hasPrev = $derived(page > 1);
+ const hasNext = $derived(!!runs.data && page * runs.data.limit < runs.data.total);
const metadata = $derived(
[
{
@@ -86,10 +93,15 @@
}
].filter((item) => item.visible)
);
+
+ function changePage(delta: number) {
+ page += delta;
+ selected = undefined;
+ }
</script>
{#snippet outcomeMessage(message: string | undefined)}
- {#if message}<p class="break-words whitespace-pre-wrap">{message}</p>{/if}
+ {#if message}<p class="break-words whitespace-pre-wrap text-muted-foreground">{message}</p>{/if}
{/snippet}
{#snippet outcomeActivity(
@@ -97,102 +109,99 @@
label = m.jobs_activity_output(),
activityEnvironmentId = environmentId
)}
- {#if activityId}<Button variant="link" onclick={() => activityStore.openCenter(activityId, undefined, activityEnvironmentId)}
- >{label}</Button
+ {#if activityId}<Button
+ variant="link"
+ size="inline"
+ onclick={() => activityStore.openCenter(activityId, undefined, activityEnvironmentId)}>{label}</Button
>{/if}
{/snippet}
-<Button
- variant="ghost"
- size="sm"
- onclick={() => {
- open = true;
- page = 1;
- selected = initialRunId;
- }}>{m.jobs_run_history()}</Button
->
-<Dialog.Root bind:open>
- <Dialog.Content class="max-h-(--max-height-screen-85) overflow-y-auto sm:max-w-2xl">
- <Dialog.Header
- ><Dialog.Title>{m.jobs_run_history()}</Dialog.Title><Dialog.Description>{jobId}</Dialog.Description></Dialog.Header
- >
- {#if runs.error}<p class="text-sm text-destructive">{runs.error.message}</p>{/if}
+<div class="flex flex-col gap-4">
+ {#if runs.error}
+ <p class="text-sm text-destructive">{extractApiErrorMessage(runs.error)}</p>
+ {/if}
+ <div class="divide-y divide-border/50 overflow-hidden rounded-lg border border-border/60">
{#each runs.data?.runs ?? [] as run (run.id)}
- <Button
- variant="outline"
- class="h-auto w-full justify-between text-left"
- onclick={() => {
- selected = run.id;
- }}
+ <button
+ type="button"
+ class={cn(
+ 'flex w-full items-center justify-between gap-3 px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40',
+ selected === run.id && 'bg-muted/50'
+ )}
+ aria-pressed={selected === run.id}
+ onclick={() => (selected = run.id)}
>
- <span class="truncate">{formatDateTimeShort(run.createdAt)}</span><span>{jobStatusLabel(run.status)}</span>
- </Button>
+ <span class="flex min-w-0 flex-col">
+ <span class="truncate tabular-nums">{formatDateTimeShort(run.createdAt)}</span>
+ <span class="truncate text-xs text-muted-foreground">{m.volume_backup_trigger()}: {run.trigger}</span>
+ </span>
+ <Badge variant={jobStatusTone(run.status)} size="sm">{jobStatusLabel(run.status)}</Badge>
+ </button>
{:else}
- <p class="text-sm text-muted-foreground">{runs.isPending ? m.common_loading() : m.jobs_run_empty()}</p>
+ <p class="px-3 py-6 text-center text-sm text-muted-foreground">
+ {#if runs.isPending}<Spinner class="mx-auto size-4" />{:else}{m.jobs_run_empty()}{/if}
+ </p>
{/each}
+ </div>
+ {#if hasPrev || hasNext}
<div class="flex justify-between gap-2">
- <Button
- variant="outline"
- size="sm"
- disabled={page <= 1 || runs.isFetching}
- onclick={() => {
- page--;
- selected = undefined;
- }}>{m.jobs_run_previous()}</Button
+ <Button variant="outline" size="sm" disabled={!hasPrev || runs.isFetching} onclick={() => changePage(-1)}
+ >{m.jobs_run_previous()}</Button
>
- <Button
- variant="outline"
- size="sm"
- disabled={!runs.data || page * runs.data.limit >= runs.data.total || runs.isFetching}
- onclick={() => {
- page++;
- selected = undefined;
- }}>{m.jobs_run_next()}</Button
+ <Button variant="outline" size="sm" disabled={!hasNext || runs.isFetching} onclick={() => changePage(1)}
+ >{m.jobs_run_next()}</Button
>
</div>
- {#if detail.error}<p class="text-sm text-destructive">{detail.error.message}</p>{/if}
- {#if selectedRun}
- {@const run = selectedRun}
- <div class="space-y-3 border-t pt-4 text-sm">
- <p class="break-all"><strong>{m.jobs_run_id()}:</strong> {run.id}</p>
- <p>{jobStatusLabel(run.status)}</p>
- {#each metadata as item (item.id)}<p class={item.class}>{item.label ? `${item.label}: ` : ''}{item.value}</p>{/each}
+ {/if}
+ {#if detail.error}<p class="text-sm text-destructive">{extractApiErrorMessage(detail.error)}</p>{/if}
+ {#if selectedRun}
+ {@const run = selectedRun}
+ <div class="space-y-3 border-t border-border/50 pt-4 text-sm">
+ <div class="flex flex-wrap items-center gap-2">
+ <Badge variant={jobStatusTone(run.status)}>{jobStatusLabel(run.status)}</Badge>
+ <span class="font-mono text-xs break-all text-muted-foreground">{run.id}</span>
+ </div>
+ {#each metadata as item (item.id)}<p class={item.class}>{item.label ? `${item.label}: ` : ''}{item.value}</p>{/each}
+ <div class="flex flex-wrap gap-4">
{@render outcomeActivity(run.activityId, m.jobs_activity_summary(), run.activityEnvironmentId ?? environmentId)}
{@render outcomeActivity(run.outcome.activityId)}
- {#if run.resolution && run.resolution.resolvedBy !== 'System'}
- <p>
- {m.jobs_resolution_details({ user: run.resolution.resolvedBy, date: formatDateTimeShort(run.resolution.resolvedAt) })}
- </p>
- <p>{m.jobs_resolution_reason()}: {run.resolution.reason}</p>
- {/if}
- <h4 class="font-medium">{m.jobs_run_attempts()}: {run.attemptCount}</h4>
- {#each run.attempts ?? [] as attempt (attempt.number)}
- <div class="space-y-1 rounded border p-2">
- <p>{attempt.number} · {formatDateTimeShort(attempt.startedAt)} · {jobStatusLabel(attempt.outcome.status)}</p>
- {@render outcomeMessage(attempt.outcome.message)}
+ </div>
+ {#if run.resolution && run.resolution.resolvedBy !== 'System'}
+ <p>
+ {m.jobs_resolution_details({ user: run.resolution.resolvedBy, date: formatDateTimeShort(run.resolution.resolvedAt) })}
+ </p>
+ <p>{m.jobs_resolution_reason()}: {run.resolution.reason}</p>
+ {/if}
+ <h4 class="font-medium">{m.jobs_run_attempts()}: {run.attemptCount}</h4>
+ {#each run.attempts ?? [] as attempt (attempt.number)}
+ <div class="space-y-1 rounded-lg border border-border/60 p-2">
+ <p>{attempt.number} · {formatDateTimeShort(attempt.startedAt)} · {jobStatusLabel(attempt.outcome.status)}</p>
+ {@render outcomeMessage(attempt.outcome.message)}
+ </div>
+ {/each}
+ {#if run.outcome.targets?.length}
+ <h4 class="font-medium">{m.jobs_run_targets()}</h4>
+ {#each run.outcome.targets as target (target.id)}
+ <div class="space-y-1 rounded-lg border border-border/60 p-2">
+ <p class="break-all">{target.id} · {jobStatusLabel(target.status)}</p>
+ {@render outcomeMessage(target.message)}
+ {@render outcomeActivity(target.activityId)}
</div>
{/each}
- {#if run.outcome.targets?.length}
- <h4 class="font-medium">{m.jobs_run_targets()}</h4>
- {#each run.outcome.targets as target (target.id)}
- <div class="space-y-1 rounded border p-2">
- <p class="break-all">{target.id} · {jobStatusLabel(target.status)}</p>
- {@render outcomeMessage(target.message)}
- {@render outcomeActivity(target.activityId)}
- </div>
- {/each}
- {/if}
- {#if action.error}<p class="text-destructive">{action.error.message}</p>{/if}
- <IfPermitted perm="jobs:manage" envId={environmentId}>
+ {/if}
+ {#if action.error}<p class="text-destructive">{extractApiErrorMessage(action.error)}</p>{/if}
+ <IfPermitted perm="jobs:manage" envId={environmentId}>
+ <div class="flex flex-wrap gap-2">
{#each availableActions as item (item.id)}
<Button
variant={item.variant}
+ size="sm"
disabled={action.isPending}
onclick={() => action.mutate({ runId: run.id, action: item.id })}>{item.label}</Button
>
{/each}
- </IfPermitted>
- </div>
- {/if}
- </Dialog.Content>
-</Dialog.Root>
+ </div>
+ </IfPermitted>
+ </div>
+ {/if}
+</div>
diff --git a/frontend/src/lib/components/job-card/job-status.ts b/frontend/src/lib/components/job-card/job-status.ts
index 2089ecda4..5c6e80361 100644
--- a/frontend/src/lib/components/job-card/job-status.ts
+++ b/frontend/src/lib/components/job-card/job-status.ts
@@ -32,3 +32,31 @@ export function jobNameLabel(job: JobStatus): string {
if (!label) return job.name;
return target.length ? m.jobs_dynamic_job_name({ name: label, target: target.join(':') }) : label;
}
+
+export type JobPanelSection = 'overview' | 'history';
+
+export type JobStatusTone = 'green' | 'red' | 'amber' | 'blue' | 'gray';
+
+/** Badge tone for a run or worker status. */
+export function jobStatusTone(status: string | undefined): JobStatusTone {
+ switch (status) {
+ case 'succeeded':
+ case 'healthy':
+ return 'green';
+ case 'failed':
+ case 'needs_attention':
+ case 'stopped':
+ return 'red';
+ case 'partial':
+ case 'degraded':
+ case 'retrying':
+ case 'waiting':
+ return 'amber';
+ case 'running':
+ case 'queued':
+ case 'starting':
+ return 'blue';
+ default:
+ return 'gray';
+ }
+}
diff --git a/frontend/src/lib/components/prune/prune-mode-card.svelte b/frontend/src/lib/components/prune/prune-mode-picker.svelte
similarity index 51%
rename from frontend/src/lib/components/prune/prune-mode-card.svelte
rename to frontend/src/lib/components/prune/prune-mode-picker.svelte
index 6607c57af..57c777faf 100644
--- a/frontend/src/lib/components/prune/prune-mode-card.svelte
+++ b/frontend/src/lib/components/prune/prune-mode-picker.svelte
@@ -1,7 +1,9 @@
<script lang="ts">
import { Input } from '#lib/components/ui/input/index.js';
import * as Tabs from '#lib/components/ui/tabs/index.js';
+ import SelectWithLabel from '#lib/components/form/select-with-label.svelte';
import { m } from '#lib/paraglide/messages.js';
+ import { useId } from 'bits-ui';
export type PruneModeOption = {
value: string;
@@ -11,9 +13,8 @@
type DurationUnit = 'minutes' | 'hours' | 'days';
+ // Segmented prune-mode choice with an optional "older than" duration; the host row supplies the label.
interface Props {
- title: string;
- description: string;
modeOptions: PruneModeOption[];
value?: string;
untilValue?: string;
@@ -24,8 +25,6 @@
}
let {
- title,
- description,
modeOptions,
value = $bindable<string>(),
untilValue = $bindable(''),
@@ -43,17 +42,10 @@
{ value: 'days', label: m.prune_duration_unit_days() }
];
- function hasOlderThanInternal(): boolean {
- return modeOptions.some((option) => option.value === olderThanMode);
- }
-
- function getSelectedOptionInternal(): PruneModeOption | undefined {
- return modeOptions.find((option) => option.value === value);
- }
-
- let parsedDurationInternal = $derived.by(() => parsePruneDurationInternal(untilValue));
- let durationAmountInternal = $derived(parsedDurationInternal.amount);
- let durationUnitInternal = $derived(parsedDurationInternal.unit);
+ const durationUnitId = `prune-duration-unit-${useId()}`;
+ const hasOlderThan = $derived(modeOptions.some((option) => option.value === olderThanMode));
+ const selectedOption = $derived(modeOptions.find((option) => option.value === value));
+ const parsedDuration = $derived(parsePruneDurationInternal(untilValue));
function handleModeChange(nextMode: string) {
if (disabled) return;
@@ -63,57 +55,30 @@
}
}
- function updateDurationAmountInternal(nextAmount: string) {
- untilValue = serializePruneDurationInternal(nextAmount, durationUnitInternal);
- }
-
- function updateDurationUnitInternal(nextUnit: DurationUnit) {
- untilValue = serializePruneDurationInternal(durationAmountInternal, nextUnit);
- }
-
function handleDurationAmountInputInternal(event: Event) {
- updateDurationAmountInternal((event.currentTarget as HTMLInputElement).value);
+ untilValue = serializePruneDurationInternal((event.currentTarget as HTMLInputElement).value, parsedDuration.unit);
}
- function handleDurationUnitChangeInternal(event: Event) {
- updateDurationUnitInternal((event.currentTarget as HTMLSelectElement).value as DurationUnit);
+ function handleDurationUnitChangeInternal(nextUnit: string) {
+ untilValue = serializePruneDurationInternal(parsedDuration.amount, nextUnit as DurationUnit);
}
function parsePruneDurationInternal(valueToParse: string): { amount: string; unit: DurationUnit } {
const trimmed = valueToParse.trim();
if (!trimmed) {
- return {
- amount: defaultDurationAmountInternal,
- unit: defaultDurationUnitInternal
- };
+ return { amount: defaultDurationAmountInternal, unit: defaultDurationUnitInternal };
}
-
if (trimmed.endsWith('m')) {
- return {
- amount: trimmed.slice(0, -1) || defaultDurationAmountInternal,
- unit: 'minutes'
- };
+ return { amount: trimmed.slice(0, -1) || defaultDurationAmountInternal, unit: 'minutes' };
}
-
if (trimmed.endsWith('h')) {
const rawHours = Number(trimmed.slice(0, -1));
if (Number.isFinite(rawHours) && rawHours > 0 && rawHours % 24 === 0) {
- return {
- amount: String(rawHours / 24),
- unit: 'days'
- };
+ return { amount: String(rawHours / 24), unit: 'days' };
}
-
- return {
- amount: trimmed.slice(0, -1) || defaultDurationAmountInternal,
- unit: 'hours'
- };
+ return { amount: trimmed.slice(0, -1) || defaultDurationAmountInternal, unit: 'hours' };
}
-
- return {
- amount: defaultDurationAmountInternal,
- unit: defaultDurationUnitInternal
- };
+ return { amount: defaultDurationAmountInternal, unit: defaultDurationUnitInternal };
}
function serializePruneDurationInternal(amount: string, unit: DurationUnit): string {
@@ -129,21 +94,16 @@
}
</script>
-<div class="flex h-full flex-col gap-2.5 rounded-lg bg-muted/20 p-3 ring-1 ring-border/20">
- <div class="space-y-0.5">
- <p class="text-xs font-medium">{title}</p>
- <p class="text-2xs leading-tight text-muted-foreground">{description}</p>
- </div>
-
+<div class="flex flex-col gap-2.5">
<Tabs.Root {value} onValueChange={handleModeChange}>
- <Tabs.List class="min-h-8 w-full">
+ <Tabs.List class="min-h-8 w-full sm:w-fit">
{#each modeOptions as option (option.value)}
<Tabs.Trigger
value={option.value}
{disabled}
size="sm"
variant={option.destructive ? 'destructive' : 'default'}
- class="h-6 flex-1"
+ class="h-7 flex-1 sm:flex-none"
>
{option.label}
</Tabs.Trigger>
@@ -151,34 +111,36 @@
</Tabs.List>
</Tabs.Root>
- {#if hasOlderThanInternal() && value === olderThanMode}
- <div class="grid gap-1.5 sm:grid-cols-content-action">
+ {#if hasOlderThan && value === olderThanMode}
+ <div class="flex flex-wrap items-center gap-2">
<Input
type="number"
min="1"
- value={durationAmountInternal}
+ value={parsedDuration.amount}
oninput={handleDurationAmountInputInternal}
{disabled}
size="sm"
- class="h-8"
+ class="h-8 w-24"
placeholder={m.prune_duration_placeholder()}
+ aria-label={m.prune_duration_help()}
/>
- <select
- class="h-8 rounded-md border border-input bg-background px-2.5 py-1 text-xs ring-offset-background placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50"
- value={durationUnitInternal}
- onchange={handleDurationUnitChangeInternal}
+ <SelectWithLabel
+ id={durationUnitId}
+ label={m.prune_duration_help()}
+ hideLabel
+ compact
+ triggerSize="sm"
+ value={parsedDuration.unit}
+ options={durationUnitOptionsInternal}
+ onValueChange={handleDurationUnitChangeInternal}
{disabled}
- >
- {#each durationUnitOptionsInternal as option (option.value)}
- <option value={option.value}>{option.label}</option>
- {/each}
- </select>
+ />
</div>
<p class="text-xs text-muted-foreground">{m.prune_duration_help()}</p>
{/if}
- {#if warningDescription && getSelectedOptionInternal()?.destructive}
- <div class="mt-auto rounded-md border border-warning/30 bg-warning/10 p-2 text-xs text-warning">
+ {#if warningDescription && selectedOption?.destructive}
+ <div class="rounded-md border border-warning/30 bg-warning/10 p-2 text-xs text-warning">
{#if warningTitle}
<p class="font-medium">{warningTitle}</p>
{/if}
diff --git a/frontend/src/lib/components/role-editor/role-editor.svelte b/frontend/src/lib/components/role-editor/role-editor.svelte
index 0514e4b63..77ae98997 100644
--- a/frontend/src/lib/components/role-editor/role-editor.svelte
+++ b/frontend/src/lib/components/role-editor/role-editor.svelte
@@ -1,7 +1,8 @@
<script lang="ts">
- import * as Card from '#lib/components/ui/card/index.js';
import { ArcaneButton } from '#lib/components/arcane-button/index.js';
- import FormInput from '#lib/components/form/form-input.svelte';
+ import { Input } from '#lib/components/ui/input/index.js';
+ import SettingsRow from '#lib/components/settings/settings-row.svelte';
+ import SettingsSection from '#lib/components/settings/settings-section.svelte';
import { Badge } from '#lib/components/ui/badge/index.js';
import PermissionPicker from './permission-picker.svelte';
import type { Role, PermissionsManifest } from '#lib/types/auth.js';
@@ -55,76 +56,63 @@
</script>
<form onsubmit={preventDefault(handleSubmit)} novalidate class="grid grid-cols-1 gap-6 lg:grid-cols-aside-80">
- <div class="space-y-4">
- <Card.Root>
- <Card.Header>
- <Card.Title>
- <span class="text-base">{role ? m.roles_edit_title() : m.roles_create_title()}</span>
- </Card.Title>
- </Card.Header>
- <Card.Content>
- <div class="flex flex-col gap-4">
- <div class="flex items-center gap-2">
- <Badge variant={isBuiltIn ? 'blue' : 'green'} size="sm">{isBuiltIn ? m.roles_built_in() : m.custom()}</Badge>
- </div>
-
- <FormInput
- label={m.common_name()}
- type="text"
- placeholder={m.roles_name_placeholder()}
- disabled={isBuiltIn || isLoading}
- bind:input={inputs.name}
- />
-
- <FormInput
- label={m.common_description()}
- type="text"
- placeholder={m.roles_description_placeholder()}
- disabled={isBuiltIn || isLoading}
- bind:input={inputs.description}
- />
-
- <div>
- <div class="text-xs text-muted-foreground">
- {m.roles_permissions_count({ count: selectedCount, total: totalPermissions })}
- </div>
- {#if inputs.permissions?.error}
- <p class="mt-1 text-sm text-destructive">{inputs.permissions.error}</p>
- {/if}
- </div>
-
- {#if isBuiltIn}
- <p class="text-xs text-muted-foreground">{m.roles_built_in_note()}</p>
- {/if}
-
- {#if isBuiltIn && onClone}
- <ArcaneButton
- action="base"
- tone="outline"
- type="button"
- class="w-full"
- icon={CopyIcon}
- onclick={onClone}
- customLabel={m.roles_clone_button()}
- disabled={isLoading}
- />
- {/if}
-
- {#if !isBuiltIn}
- <ArcaneButton
- action="save"
- type="submit"
- class="w-full"
- disabled={isLoading}
- loading={isLoading}
- onclick={handleSubmit}
- customLabel={role ? m.roles_save_changes() : m.common_create_button({ resource: m.roles_title() })}
- />
- {/if}
- </div>
- </Card.Content>
- </Card.Root>
- </div>
+ <SettingsSection title={m.roles_details_section()}>
+ {#snippet actions()}
+ <Badge variant={isBuiltIn ? 'blue' : 'green'} size="sm">{isBuiltIn ? m.roles_built_in() : m.custom()}</Badge>
+ {/snippet}
+ <SettingsRow for="role-name" label={m.common_name()} error={inputs.name.error}>
+ <Input
+ id="role-name"
+ placeholder={m.roles_name_placeholder()}
+ disabled={isBuiltIn || isLoading}
+ bind:value={inputs.name.value}
+ aria-invalid={!!inputs.name.error}
+ />
+ </SettingsRow>
+ <SettingsRow for="role-description" label={m.common_description()} error={inputs.description.error}>
+ <Input
+ id="role-description"
+ placeholder={m.roles_description_placeholder()}
+ disabled={isBuiltIn || isLoading}
+ bind:value={inputs.description.value}
+ aria-invalid={!!inputs.description.error}
+ />
+ </SettingsRow>
+ <div class="flex flex-col gap-3 px-5 py-4">
+ <p class="text-xs text-muted-foreground">
+ {m.roles_permissions_count({ count: selectedCount, total: totalPermissions })}
+ </p>
+ {#if inputs.permissions?.error}
+ <p class="text-xs font-medium text-destructive">{inputs.permissions.error}</p>
+ {/if}
+ {#if isBuiltIn}
+ <p class="text-xs text-muted-foreground">{m.roles_built_in_note()}</p>
+ {/if}
+ {#if isBuiltIn && onClone}
+ <ArcaneButton
+ action="base"
+ tone="outline"
+ type="button"
+ class="w-full"
+ icon={CopyIcon}
+ onclick={onClone}
+ customLabel={m.roles_clone_button()}
+ disabled={isLoading}
+ />
+ {/if}
+ {#if !isBuiltIn}
+ <ArcaneButton
+ action="save"
+ type="submit"
+ class="w-full"
+ disabled={isLoading}
+ loading={isLoading}
+ onclick={handleSubmit}
+ customLabel={role ? m.roles_save_changes() : m.common_create_button({ resource: m.roles_title() })}
+ />
+ {/if}
+ </div>
+ </SettingsSection>
<div>
<PermissionPicker {manifest} bind:selected={inputs.permissions.value} disabled={isBuiltIn || isLoading} />
diff --git a/frontend/src/lib/components/settings/image-patch-settings.svelte b/frontend/src/lib/components/settings/image-patch-settings.svelte
index e9d67b3b1..20605250a 100644
--- a/frontend/src/lib/components/settings/image-patch-settings.svelte
+++ b/frontend/src/lib/components/settings/image-patch-settings.svelte
@@ -2,13 +2,11 @@
import { environmentStore } from '#lib/stores/environment.store.svelte.js';
import { featureStore } from '#lib/stores/features.store.svelte.js';
import { Switch } from '#lib/components/ui/switch/index.js';
- import TextInputWithLabel from '#lib/components/form/text-input-with-label.svelte';
+ import { Input } from '#lib/components/ui/input/index.js';
import SettingsRow from '#lib/components/settings/settings-row.svelte';
- import { SecurityIcon } from '#lib/icons/index.js';
+ import SettingsSection from '#lib/components/settings/settings-section.svelte';
import { m } from '#lib/paraglide/messages.js';
- import SectionCard from '#lib/components/section-card.svelte';
-
type ImagePatchFormValues = {
imagePatchSuffix: string;
imagePatchTimeoutSec: number;
@@ -30,11 +28,12 @@
const vulnerabilityManagementEnabled = $derived(featureStore.isEnabled('vulnerabilityManagement', targetEnvironmentId));
</script>
-<SectionCard variant="transparent" title={m.security_image_patching_heading()} icon={SecurityIcon} class="flex flex-col" divided>
+<SettingsSection title={m.security_image_patching_heading()}>
<SettingsRow
+ for="imageAutoPatchEnabledSwitch"
label={m.security_image_auto_patch_enabled_label()}
description={m.security_image_auto_patch_enabled_description()}
- layout="inline"
+ layout="switch"
>
<Switch
id="imageAutoPatchEnabledSwitch"
@@ -44,32 +43,40 @@
</SettingsRow>
<SettingsRow
+ for="imagePatchAllPlatformsSwitch"
label={m.security_image_patch_all_platforms_label()}
description={m.security_image_patch_all_platforms_description()}
- layout="inline"
+ layout="switch"
>
<Switch id="imagePatchAllPlatformsSwitch" bind:checked={formInputs.imagePatchAllPlatforms.value} />
</SettingsRow>
- <div class="max-w-xl">
- <TextInputWithLabel
+ <SettingsRow
+ for="imagePatchSuffix"
+ label={m.security_image_patch_suffix_label()}
+ description={m.security_image_patch_suffix_description()}
+ error={formInputs.imagePatchSuffix.error}
+ >
+ <Input
+ id="imagePatchSuffix"
bind:value={formInputs.imagePatchSuffix.value}
- error={formInputs.imagePatchSuffix.error}
- label={m.security_image_patch_suffix_label()}
- description={m.security_image_patch_suffix_description()}
placeholder="patched"
- type="text"
+ aria-invalid={!!formInputs.imagePatchSuffix.error}
/>
- </div>
+ </SettingsRow>
- <div class="max-w-xs">
- <TextInputWithLabel
+ <SettingsRow
+ for="imagePatchTimeoutSec"
+ label={m.security_image_patch_timeout_label()}
+ description={m.security_image_patch_timeout_description()}
+ error={formInputs.imagePatchTimeoutSec.error}
+ >
+ <Input
+ id="imagePatchTimeoutSec"
+ type="number"
bind:value={formInputs.imagePatchTimeoutSec.value}
- error={formInputs.imagePatchTimeoutSec.error}
- label={m.security_image_patch_timeout_label()}
- description={m.security_image_patch_timeout_description()}
placeholder="600"
- type="number"
+ aria-invalid={!!formInputs.imagePatchTimeoutSec.error}
/>
- </div>
-</SectionCard>
+ </SettingsRow>
+</SettingsSection>
diff --git a/frontend/src/lib/components/settings/lifecycle-security-settings.svelte b/frontend/src/lib/components/settings/lifecycle-security-settings.svelte
index 9fd605dcb..e69a126e3 100644
--- a/frontend/src/lib/components/settings/lifecycle-security-settings.svelte
+++ b/frontend/src/lib/components/settings/lifecycle-security-settings.svelte
@@ -1,13 +1,12 @@
<script lang="ts">
import * as Alert from '#lib/components/ui/alert/index.js';
import { Switch } from '#lib/components/ui/switch/index.js';
- import TextInputWithLabel from '#lib/components/form/text-input-with-label.svelte';
+ import { Input } from '#lib/components/ui/input/index.js';
import SettingsRow from '#lib/components/settings/settings-row.svelte';
- import { AlertIcon, CodeIcon } from '#lib/icons/index.js';
+ import SettingsSection from '#lib/components/settings/settings-section.svelte';
+ import { AlertIcon } from '#lib/icons/index.js';
import { m } from '#lib/paraglide/messages.js';
- import SectionCard from '#lib/components/section-card.svelte';
-
type LifecycleSecurityFormValues = {
lifecycleEnabled: boolean;
lifecycleDefaultRunnerImage: string;
@@ -26,44 +25,50 @@
let { formInputs = $bindable() }: { formInputs: LifecycleSecurityFormInputs } = $props();
</script>
-<SectionCard variant="transparent" title={m.security_lifecycle_hooks_heading()} icon={CodeIcon} class="flex flex-col" divided>
+<SettingsSection title={m.security_lifecycle_hooks_heading()}>
+ {#snippet actions()}
+ <Alert.Root variant="warning" size="sm" class="max-w-xl">
+ <AlertIcon class="size-4" />
+ <Alert.Description>{m.security_lifecycle_hooks_note()}</Alert.Description>
+ </Alert.Root>
+ {/snippet}
+
<SettingsRow
+ for="lifecycleEnabledSwitch"
label={m.security_lifecycle_enabled_label()}
description={m.security_lifecycle_enabled_description()}
- layout="inline"
+ layout="switch"
>
<Switch id="lifecycleEnabledSwitch" bind:checked={formInputs.lifecycleEnabled.value} />
</SettingsRow>
- <div class="max-w-xl">
- <TextInputWithLabel
+ <SettingsRow
+ for="lifecycleDefaultRunnerImage"
+ label={m.security_lifecycle_runner_image_label()}
+ description={m.security_lifecycle_runner_image_description()}
+ helpText={m.security_lifecycle_runner_image_help()}
+ error={formInputs.lifecycleDefaultRunnerImage.error}
+ >
+ <Input
+ id="lifecycleDefaultRunnerImage"
bind:value={formInputs.lifecycleDefaultRunnerImage.value}
- error={formInputs.lifecycleDefaultRunnerImage.error}
- label={m.security_lifecycle_runner_image_label()}
- description={m.security_lifecycle_runner_image_description()}
- helpText={m.security_lifecycle_runner_image_help()}
placeholder="alpine:latest"
- type="text"
+ aria-invalid={!!formInputs.lifecycleDefaultRunnerImage.error}
/>
- </div>
+ </SettingsRow>
- <div class="max-w-xs">
- <TextInputWithLabel
- bind:value={formInputs.lifecycleMaxTimeoutSec.value}
- error={formInputs.lifecycleMaxTimeoutSec.error}
- label={m.security_lifecycle_max_timeout_label()}
- description={m.security_lifecycle_max_timeout_description()}
- helpText={m.security_lifecycle_max_timeout_help()}
+ <SettingsRow
+ for="lifecycleMaxTimeoutSec"
+ label={m.security_lifecycle_max_timeout_label()}
+ description={m.security_lifecycle_max_timeout_description()}
+ helpText={m.security_lifecycle_max_timeout_help()}
+ error={formInputs.lifecycleMaxTimeoutSec.error}
+ >
+ <Input
+ id="lifecycleMaxTimeoutSec"
type="number"
+ bind:value={formInputs.lifecycleMaxTimeoutSec.value}
+ aria-invalid={!!formInputs.lifecycleMaxTimeoutSec.error}
/>
- </div>
-
- <div>
- <Alert.Root variant="warning" size="sm">
- <AlertIcon class="size-4" />
- <Alert.Description>
- {m.security_lifecycle_hooks_note()}
- </Alert.Description>
- </Alert.Root>
- </div>
-</SectionCard>
+ </SettingsRow>
+</SettingsSection>
diff --git a/frontend/src/lib/components/settings/settings-row.svelte b/frontend/src/lib/components/settings/settings-row.svelte
index f8abfae9c..741324249 100644
--- a/frontend/src/lib/components/settings/settings-row.svelte
+++ b/frontend/src/lib/components/settings/settings-row.svelte
@@ -1,50 +1,93 @@
<script lang="ts">
import { Label } from '#lib/components/ui/label/index.js';
+ import * as Alert from '#lib/components/ui/alert/index.js';
+ import { AlertTriangleIcon } from '#lib/icons/index.js';
import { cn } from '#lib/utils.js';
import type { Snippet } from 'svelte';
+ // One setting: label and description on the left, the control on the right.
+ // `switch` keeps a compact right-aligned control; `wide` drops the control under the label.
interface Props {
label: string;
description?: string;
helpText?: string | Snippet;
+ /** Caution shown as a small warning alert; use for side effects worth a second look. */
+ warningText?: string;
+ error?: string | null;
+ /** Id of the control, so the label focuses it. */
+ for?: string;
+ layout?: 'default' | 'switch' | 'wide';
labelExtra?: Snippet;
- children: Snippet;
+ /** Extra content under the row (e.g. fields revealed by a switch), indented. */
+ expanded?: Snippet;
contentClass?: string;
- layout?: 'stacked' | 'inline';
+ class?: string;
+ children: Snippet;
}
- let { label, description, helpText, labelExtra, children, contentClass, layout = 'stacked' }: Props = $props();
+ let {
+ label,
+ description,
+ helpText,
+ warningText,
+ error,
+ for: htmlFor,
+ layout = 'default',
+ labelExtra,
+ expanded,
+ contentClass,
+ class: className,
+ children
+ }: Props = $props();
</script>
-{#snippet labelBlock(wrapperClass: string)}
- <div class={wrapperClass}>
- <Label>{label}</Label>
- {#if description}
- <p class="mt-0.5 text-xs text-muted-foreground">{description}</p>
- {/if}
- {#if typeof helpText === 'function'}
- {@render helpText()}
- {:else if helpText}
- <p class="mt-1 text-xs text-muted-foreground">{helpText}</p>
- {/if}
- {#if labelExtra}
- {@render labelExtra()}
- {/if}
- </div>
+{#snippet notes()}
+ {#if error}
+ <p class="mt-1.5 text-xs font-medium text-destructive">{error}</p>
+ {/if}
+ {#if typeof helpText === 'function'}
+ <div class="mt-1.5 text-xs text-muted-foreground">{@render helpText()}</div>
+ {:else if helpText}
+ <p class="mt-1.5 text-xs text-muted-foreground">{helpText}</p>
+ {/if}
+ {#if warningText}
+ <Alert.Root variant="warning-subtle" size="sm" class="mt-2 w-fit max-w-full">
+ <AlertTriangleIcon class="size-4" />
+ <Alert.Description>{warningText}</Alert.Description>
+ </Alert.Root>
+ {/if}
{/snippet}
-{#if layout === 'inline'}
- <div class="flex items-start justify-between gap-6">
- {@render labelBlock('min-w-0 flex-1')}
- <div class={cn('shrink-0', contentClass)}>
- {@render children()}
+<div class={cn('flex flex-col gap-4 px-5 py-4', className)}>
+ <div
+ class={cn(
+ 'grid gap-x-8 gap-y-2',
+ layout === 'default' && 'md:grid-cols-settings-row md:items-start',
+ layout === 'switch' && 'grid-cols-content-action items-center'
+ )}
+ >
+ <div class="min-w-0">
+ <Label for={htmlFor}>{label}</Label>
+ {#if description}
+ <p class="mt-0.5 text-xs text-muted-foreground">{description}</p>
+ {/if}
+ {#if labelExtra}
+ {@render labelExtra()}
+ {/if}
+ {#if layout === 'switch'}
+ {@render notes()}
+ {/if}
</div>
- </div>
-{:else}
- <div class="space-y-2">
- {@render labelBlock('')}
- <div class={cn('pt-1', contentClass)}>
+ <div class={cn('min-w-0', layout === 'switch' && 'flex justify-end', contentClass)}>
{@render children()}
+ {#if layout !== 'switch'}
+ {@render notes()}
+ {/if}
</div>
</div>
-{/if}
+ {#if expanded}
+ <div class="flex flex-col gap-4 border-l-2 border-border/60 pl-5">
+ {@render expanded()}
+ </div>
+ {/if}
+</div>
diff --git a/frontend/src/lib/components/settings/settings-section.svelte b/frontend/src/lib/components/settings/settings-section.svelte
new file mode 100644
index 000000000..75f724991
--- /dev/null
+++ b/frontend/src/lib/components/settings/settings-section.svelte
@@ -0,0 +1,43 @@
+<script lang="ts">
+ import { cn } from '#lib/utils.js';
+ import type { Snippet } from 'svelte';
+
+ // A titled group of settings. `list` frames the rows in one bordered, divided block;
+ // `plain` leaves the content unframed for tables and card grids.
+ interface Props {
+ title?: string;
+ description?: string;
+ variant?: 'list' | 'plain';
+ id?: string;
+ actions?: Snippet;
+ class?: string;
+ children: Snippet;
+ }
+
+ let { title, description, variant = 'list', id, actions, class: className, children }: Props = $props();
+</script>
+
+<section {id} class={cn('flex flex-col gap-3', className)}>
+ {#if title || actions}
+ <div class="flex flex-wrap items-start justify-between gap-x-6 gap-y-2 px-1">
+ <div class="min-w-0">
+ {#if title}
+ <h2 class="text-sm font-semibold">{title}</h2>
+ {/if}
+ {#if description}
+ <p class="text-xs text-muted-foreground">{description}</p>
+ {/if}
+ </div>
+ {#if actions}
+ <div class="flex shrink-0 items-center gap-2">{@render actions()}</div>
+ {/if}
+ </div>
+ {/if}
+ {#if variant === 'list'}
+ <div class="divide-y divide-border/50 overflow-hidden rounded-xl border border-border/60 bg-card/30">
+ {@render children()}
+ </div>
+ {:else}
+ {@render children()}
+ {/if}
+</section>
diff --git a/frontend/src/lib/components/settings/trivy-security-settings.svelte b/frontend/src/lib/components/settings/trivy-security-settings.svelte
index e8de5331f..f02ce6b54 100644
--- a/frontend/src/lib/components/settings/trivy-security-settings.svelte
+++ b/frontend/src/lib/components/settings/trivy-security-settings.svelte
@@ -9,20 +9,18 @@
import { hasPermission } from '#lib/utils/auth.js';
import { Switch } from '#lib/components/ui/switch/index.js';
import { Textarea } from '#lib/components/ui/textarea/index.js';
- import * as Alert from '#lib/components/ui/alert/index.js';
import SearchableSelect from '#lib/components/form/searchable-select.svelte';
import SelectWithLabel from '#lib/components/form/select-with-label.svelte';
- import TextInputWithLabel from '#lib/components/form/text-input-with-label.svelte';
+ import { Input } from '#lib/components/ui/input/index.js';
import SettingsRow from '#lib/components/settings/settings-row.svelte';
+ import SettingsSection from '#lib/components/settings/settings-section.svelte';
import CodeEditor from '#lib/components/code-editor/editor.svelte';
- import { SecurityIcon, InfoIcon } from '#lib/icons/index.js';
import { m } from '#lib/paraglide/messages.js';
import { toast } from 'svelte-sonner';
import { networkService } from '#lib/services/network-service.js';
import type { SearchPaginationSortRequest } from '#lib/types/shared.js';
import type { Settings } from '#lib/types/settings.js';
- import SectionCard from '#lib/components/section-card.svelte';
import { arcaneImageRegistryOptions, arcaneTrivyDbImages } from '#lib/utils/registry.js';
type TrivySecurityFormValues = Pick<
@@ -156,171 +154,170 @@
</script>
{#if vulnerabilityManagementEnabled}
- <SectionCard
- variant="transparent"
- title={m.security_vulnerability_scanning_heading()}
- icon={SecurityIcon}
- class="flex flex-col"
- divided
- >
- <div class="max-w-xl">
- <SelectWithLabel
- id="trivyDbRegistry"
- name="trivyDbRegistry"
- bind:value={formInputs.trivyDbRegistry.value}
- label={m.trivy_db_registry_label()}
- description={m.trivy_db_registry_description()}
- options={arcaneImageRegistryOptions()}
- onValueChange={(v) => (formInputs.trivyDbRegistry.value = v as 'ghcr.io' | 'docker.io')}
- />
- <ul class="mt-2 space-y-0.5 font-mono text-xs text-muted-foreground">
- {#each arcaneTrivyDbImages(formInputs.trivyDbRegistry.value) as image (image)}
- <li>{image}</li>
- {/each}
- </ul>
- </div>
+ <div class="space-y-8">
+ <SettingsSection title={m.security_vulnerability_scanning_heading()}>
+ <SettingsRow for="trivyDbRegistry" label={m.trivy_db_registry_label()} description={m.trivy_db_registry_description()}>
+ <SelectWithLabel
+ id="trivyDbRegistry"
+ name="trivyDbRegistry"
+ hideLabel
+ bind:value={formInputs.trivyDbRegistry.value}
+ label={m.trivy_db_registry_label()}
+ options={arcaneImageRegistryOptions()}
+ onValueChange={(v) => (formInputs.trivyDbRegistry.value = v as 'ghcr.io' | 'docker.io')}
+ />
+ {#snippet helpText()}
+ <ul class="space-y-0.5 font-mono">
+ {#each arcaneTrivyDbImages(formInputs.trivyDbRegistry.value) as image (image)}
+ <li>{image}</li>
+ {/each}
+ </ul>
+ {/snippet}
+ </SettingsRow>
- <SettingsRow
- label={m.security_trivy_ignore_unfixed_label()}
- description={m.security_trivy_ignore_unfixed_description()}
- layout="inline"
- >
- <Switch id="trivyIgnoreUnfixedSwitch" bind:checked={formInputs.trivyIgnoreUnfixed.value} />
- </SettingsRow>
+ <SettingsRow
+ for="trivyIgnoreUnfixedSwitch"
+ label={m.security_trivy_ignore_unfixed_label()}
+ description={m.security_trivy_ignore_unfixed_description()}
+ layout="switch"
+ >
+ <Switch id="trivyIgnoreUnfixedSwitch" bind:checked={formInputs.trivyIgnoreUnfixed.value} />
+ </SettingsRow>
- <SettingsRow
- label={m.security_threat_intel_enabled_label()}
- description={m.security_threat_intel_enabled_description()}
- layout="inline"
- >
- <Switch id="vulnerabilityThreatIntelEnabledSwitch" bind:checked={formInputs.vulnerabilityThreatIntelEnabled.value} />
- </SettingsRow>
+ <SettingsRow
+ for="vulnerabilityThreatIntelEnabledSwitch"
+ label={m.security_threat_intel_enabled_label()}
+ description={m.security_threat_intel_enabled_description()}
+ layout="switch"
+ >
+ <Switch id="vulnerabilityThreatIntelEnabledSwitch" bind:checked={formInputs.vulnerabilityThreatIntelEnabled.value} />
+ </SettingsRow>
- <SettingsRow label={m.security_trivy_config_label()} description={m.security_trivy_config_description()}>
- <div class="overflow-hidden rounded-md border border-border/60">
- <CodeEditor
- bind:value={formInputs.trivyConfig.value}
- language="yaml"
- validationMode="none"
- autoHeight={true}
- statusBar={false}
- fontSize="13px"
- placeholder={m.security_trivy_config_placeholder()}
+ <SettingsRow label={m.security_trivy_config_label()} description={m.security_trivy_config_description()} layout="wide">
+ <div class="overflow-hidden rounded-md border border-border/60">
+ <CodeEditor
+ bind:value={formInputs.trivyConfig.value}
+ language="yaml"
+ validationMode="none"
+ autoHeight={true}
+ statusBar={false}
+ fontSize="13px"
+ placeholder={m.security_trivy_config_placeholder()}
+ />
+ </div>
+ </SettingsRow>
+
+ <SettingsRow label={m.security_trivy_ignore_label()} description={m.security_trivy_ignore_description()} layout="wide">
+ <div class="overflow-hidden rounded-md border border-border/60">
+ <CodeEditor
+ bind:value={formInputs.trivyIgnore.value}
+ language="plaintext"
+ validationMode="none"
+ autoHeight={true}
+ statusBar={false}
+ fontSize="13px"
+ placeholder={m.security_trivy_ignore_placeholder()}
+ />
+ </div>
+ </SettingsRow>
+
+ <SettingsRow
+ for="trivyNetwork"
+ label={m.security_trivy_network_label()}
+ description={m.security_trivy_network_description()}
+ helpText={m.security_trivy_network_help()}
+ error={formInputs.trivyNetwork.error}
+ >
+ <SearchableSelect
+ triggerId="trivyNetwork"
+ items={trivyNetworkOptions.map((option) => ({
+ value: option.value,
+ label: option.label,
+ hint: option.description
+ }))}
+ bind:value={formInputs.trivyNetwork.value}
+ onSelect={(value) => (formInputs.trivyNetwork.value = value)}
+ placeholder={false}
+ class="w-full justify-between"
/>
- </div>
- </SettingsRow>
+ </SettingsRow>
- <SettingsRow label={m.security_trivy_ignore_label()} description={m.security_trivy_ignore_description()}>
- <div class="overflow-hidden rounded-md border border-border/60">
- <CodeEditor
- bind:value={formInputs.trivyIgnore.value}
- language="plaintext"
- validationMode="none"
- autoHeight={true}
- statusBar={false}
- fontSize="13px"
- placeholder={m.security_trivy_ignore_placeholder()}
+ <SettingsRow
+ label={m.security_trivy_security_opts_label()}
+ description={m.security_trivy_security_opts_description()}
+ helpText={m.security_trivy_security_opts_help()}
+ error={formInputs.trivySecurityOpts.error}
+ layout="wide"
+ >
+ <Textarea
+ bind:value={formInputs.trivySecurityOpts.value}
+ aria-label={m.security_trivy_security_opts_label()}
+ mono
+ class="min-h-28"
+ placeholder={m.security_trivy_security_opts_placeholder()}
+ rows={4}
/>
- </div>
- </SettingsRow>
+ </SettingsRow>
- <SettingsRow
- label={m.security_trivy_network_label()}
- description={m.security_trivy_network_description()}
- helpText={m.security_trivy_network_help()}
- contentClass="max-w-xs"
- >
- <SearchableSelect
- triggerId="trivyNetwork"
- items={trivyNetworkOptions.map((option) => ({
- value: option.value,
- label: option.label,
- hint: option.description
- }))}
- bind:value={formInputs.trivyNetwork.value}
- onSelect={(value) => (formInputs.trivyNetwork.value = value)}
- placeholder={false}
- class="w-full justify-between"
- />
- {#if formInputs.trivyNetwork.error}
- <p class="mt-2 text-sm text-destructive">{formInputs.trivyNetwork.error}</p>
- {/if}
- </SettingsRow>
+ <SettingsRow
+ for="trivyPrivilegedSwitch"
+ label={m.security_trivy_privileged_label()}
+ description={m.security_trivy_privileged_description()}
+ warningText={formInputs.trivyPrivileged.value ? m.security_trivy_privileged_note() : undefined}
+ layout="switch"
+ >
+ <Switch id="trivyPrivilegedSwitch" bind:checked={formInputs.trivyPrivileged.value} />
+ </SettingsRow>
+ </SettingsSection>
- <div class="space-y-4">
+ <SettingsSection title={m.security_trivy_server_section()}>
<SettingsRow
+ for="trivyServerEnabledSwitch"
label={m.security_trivy_server_enabled_label()}
description={m.security_trivy_server_enabled_description()}
- layout="inline"
+ layout="switch"
>
<Switch id="trivyServerEnabledSwitch" bind:checked={formInputs.trivyServerEnabled.value} />
</SettingsRow>
{#if formInputs.trivyServerEnabled.value}
- <div class="space-y-4 border-l-2 border-border/60 pl-5">
- <TextInputWithLabel
+ <SettingsRow
+ for="trivyServerUrl"
+ label={m.security_trivy_server_url_label()}
+ description={m.security_trivy_server_url_description()}
+ error={formInputs.trivyServerUrl.error}
+ >
+ <Input
+ id="trivyServerUrl"
+ type="url"
bind:value={formInputs.trivyServerUrl.value}
- error={formInputs.trivyServerUrl.error}
- label={m.security_trivy_server_url_label()}
- description={m.security_trivy_server_url_description()}
placeholder={m.security_trivy_server_url_placeholder()}
- type="url"
+ aria-invalid={!!formInputs.trivyServerUrl.error}
/>
- <TextInputWithLabel
- bind:value={formInputs.trivyServerToken.value}
- error={formInputs.trivyServerToken.error}
- label={m.security_trivy_server_token_label()}
- description={m.security_trivy_server_token_description()}
+ </SettingsRow>
+ <SettingsRow
+ for="trivyServerToken"
+ label={m.security_trivy_server_token_label()}
+ description={m.security_trivy_server_token_description()}
+ error={formInputs.trivyServerToken.error}
+ helpText={m.security_trivy_server_note()}
+ >
+ <Input
+ id="trivyServerToken"
type="password"
+ autocomplete="off"
+ bind:value={formInputs.trivyServerToken.value}
+ aria-invalid={!!formInputs.trivyServerToken.error}
/>
- <Alert.Root variant="warning-subtle">
- <InfoIcon class="h-4 w-4 text-warning" />
- <Alert.Description>
- {m.security_trivy_server_note()}
- </Alert.Description>
- </Alert.Root>
- </div>
+ </SettingsRow>
{/if}
- </div>
-
- <SettingsRow
- label={m.security_trivy_security_opts_label()}
- description={m.security_trivy_security_opts_description()}
- helpText={m.security_trivy_security_opts_help()}
- >
- <Textarea
- bind:value={formInputs.trivySecurityOpts.value}
- aria-label={m.security_trivy_security_opts_label()}
- mono
- class="min-h-28"
- placeholder={m.security_trivy_security_opts_placeholder()}
- rows={4}
- />
- {#if formInputs.trivySecurityOpts.error}
- <p class="mt-2 text-sm text-destructive">{formInputs.trivySecurityOpts.error}</p>
- {/if}
- </SettingsRow>
-
- <SettingsRow
- label={m.security_trivy_privileged_label()}
- description={m.security_trivy_privileged_description()}
- layout="inline"
- >
- <Switch id="trivyPrivilegedSwitch" bind:checked={formInputs.trivyPrivileged.value} />
- </SettingsRow>
- {#if formInputs.trivyPrivileged.value}
- <Alert.Root variant="warning-subtle">
- <InfoIcon class="h-4 w-4 text-warning" />
- <Alert.Description>
- {m.security_trivy_privileged_note()}
- </Alert.Description>
- </Alert.Root>
- {/if}
+ </SettingsSection>
- <div class="space-y-4">
+ <SettingsSection title={m.security_trivy_resource_section()}>
<SettingsRow
+ for="trivyResourceLimitsEnabledSwitch"
label={m.security_trivy_resource_limits_label()}
description={m.security_trivy_resource_limits_description()}
- layout="inline"
+ layout="switch"
>
<Switch
id="trivyResourceLimitsEnabledSwitch"
@@ -329,41 +326,49 @@
/>
</SettingsRow>
{#if formInputs.trivyResourceLimitsEnabled.value}
- <div class="space-y-4 border-l-2 border-border/60 pl-5">
- <div class="grid gap-4 sm:grid-cols-2">
- <TextInputWithLabel
- id="trivyCpuLimit"
- bind:value={formInputs.trivyCpuLimit.value}
- error={formInputs.trivyCpuLimit.error}
- disabled={!formInputs.trivyResourceLimitsEnabled.value}
- label={m.security_trivy_cpu_limit_label()}
- helpText={m.security_trivy_cpu_limit_help()}
- type="number"
- min={0}
- step="any"
- />
- <TextInputWithLabel
- bind:value={formInputs.trivyMemoryLimitMb.value}
- error={formInputs.trivyMemoryLimitMb.error}
- disabled={!formInputs.trivyResourceLimitsEnabled.value}
- label={m.security_trivy_memory_limit_label()}
- reserveHelpTextSpace={true}
- type="number"
- />
- </div>
- <div class="max-w-xs">
- <TextInputWithLabel
- bind:value={formInputs.trivyConcurrentScanContainers.value}
- error={formInputs.trivyConcurrentScanContainers.error}
- label={m.security_trivy_concurrent_scan_containers_label()}
- helpText={m.security_trivy_concurrent_scan_containers_help()}
- type="number"
- />
- </div>
- </div>
+ <SettingsRow
+ for="trivyCpuLimit"
+ label={m.security_trivy_cpu_limit_label()}
+ description={m.security_trivy_cpu_limit_help()}
+ error={formInputs.trivyCpuLimit.error}
+ >
+ <Input
+ id="trivyCpuLimit"
+ type="number"
+ min={0}
+ step="any"
+ bind:value={formInputs.trivyCpuLimit.value}
+ aria-invalid={!!formInputs.trivyCpuLimit.error}
+ />
+ </SettingsRow>
+ <SettingsRow
+ for="trivyMemoryLimitMb"
+ label={m.security_trivy_memory_limit_label()}
+ error={formInputs.trivyMemoryLimitMb.error}
+ >
+ <Input
+ id="trivyMemoryLimitMb"
+ type="number"
+ bind:value={formInputs.trivyMemoryLimitMb.value}
+ aria-invalid={!!formInputs.trivyMemoryLimitMb.error}
+ />
+ </SettingsRow>
+ <SettingsRow
+ for="trivyConcurrentScanContainers"
+ label={m.security_trivy_concurrent_scan_containers_label()}
+ description={m.security_trivy_concurrent_scan_containers_help()}
+ error={formInputs.trivyConcurrentScanContainers.error}
+ >
+ <Input
+ id="trivyConcurrentScanContainers"
+ type="number"
+ bind:value={formInputs.trivyConcurrentScanContainers.value}
+ aria-invalid={!!formInputs.trivyConcurrentScanContainers.error}
+ />
+ </SettingsRow>
{/if}
- </div>
- </SectionCard>
+ </SettingsSection>
+ </div>
{:else}
<FeatureDisabled environmentId={targetEnvironmentId} />
{/if}
diff --git a/frontend/src/lib/components/states/empty-state.svelte b/frontend/src/lib/components/states/empty-state.svelte
index 60f4d2da0..0f8e571cd 100644
--- a/frontend/src/lib/components/states/empty-state.svelte
+++ b/frontend/src/lib/components/states/empty-state.svelte
@@ -15,14 +15,26 @@
onAction?: () => void;
actionHref?: string;
class?: ClassValue;
+ /** Use `plain` when the surrounding container already draws the frame (e.g. tables). */
+ variant?: 'default' | 'card' | 'plain';
/** Custom action content; overrides the actionLabel button when present. */
children?: Snippet;
}
- let { icon: Icon, title, description, actionLabel, onAction, actionHref, class: className, children }: Props = $props();
+ let {
+ icon: Icon,
+ title,
+ description,
+ actionLabel,
+ onAction,
+ actionHref,
+ class: className,
+ variant,
+ children
+ }: Props = $props();
</script>
-<Empty.Root class={className}>
+<Empty.Root class={className} {variant}>
<Empty.Header>
{#if Icon}
<Empty.Media variant="icon">
diff --git a/frontend/src/lib/config/navigation-config.ts b/frontend/src/lib/config/navigation-config.ts
index bfad8284a..4daf556d4 100644
--- a/frontend/src/lib/config/navigation-config.ts
+++ b/frontend/src/lib/config/navigation-config.ts
@@ -271,9 +271,8 @@ export const navigationItems: NavigationSections = {
};
// Keep the settings sub-navigation alphabetical regardless of the order
-// entries are declared in the literal above. Sidebar, mobile nav, and the
-// settings landing page all read from navigationItems.settingsItems, so a
-// single sort here propagates everywhere.
+// entries are declared in the literal above. The sidebar and mobile nav render it;
+// the settings landing page uses it for card order and for Roles/Diagnostics cards.
{
const settingsParent = navigationItems.settingsItems.find((item) => item.url === '/settings');
if (settingsParent?.items) {
@@ -331,6 +330,24 @@ function canSeeItem(
return canReachAccessSurface(accessManifest, item.accessSurfaceId, user, currentEnvId);
}
+/** Returns the title of the navigation item whose URL is the longest prefix of `pathname`. */
+export function getNavigationTitleForPath(pathname: string): string | undefined {
+ let title: string | undefined;
+ let bestLength = 0;
+ const visit = (items: NavigationItem[]) => {
+ for (const item of items) {
+ const url = item.url.split('?')[0] ?? item.url;
+ if (url.length > bestLength && (pathname === url || pathname.startsWith(`${url}/`))) {
+ title = item.title;
+ bestLength = url.length;
+ }
+ if (item.items) visit(item.items);
+ }
+ };
+ visit(Object.values(navigationItems).flat());
+ return title;
+}
+
export function getSettingsSubpageUrlsInNavOrder(): string[] {
const entry = navigationItems.settingsItems.find((item) => item.url === '/settings');
return entry?.items?.map((item) => item.url) ?? [];
diff --git a/frontend/src/lib/index.ts b/frontend/src/lib/index.ts
deleted file mode 100644
index 73c55efb4..000000000
--- a/frontend/src/lib/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-// place files you want to import through the `#lib` alias in this folder.
diff --git a/frontend/src/lib/layouts/resource-detail-layout.svelte b/frontend/src/lib/layouts/resource-detail-layout.svelte
index dd3efc315..3bf81308e 100644
--- a/frontend/src/lib/layouts/resource-detail-layout.svelte
+++ b/frontend/src/lib/layouts/resource-detail-layout.svelte
@@ -62,27 +62,23 @@
{/if}
<div class={cn('space-y-6 pb-8', className)}>
- <div class="space-y-4">
- {#if backUrl}
- <div>
- <ArcaneButton action="base" tone="ghost" href={backUrl} class="-ml-2">
- <ArrowLeftIcon class="size-4" />
- {backLabel}
- </ArcaneButton>
- </div>
- {/if}
-
- <div class="flex items-start justify-between gap-4">
- <div class="min-w-0 flex-1 space-y-2">
- <h1 class="text-xl font-semibold tracking-tight break-all sm:text-2xl">{title}</h1>
- {#if subtitle}
- <p class="text-sm text-muted-foreground">{subtitle}</p>
+ <div class="space-y-3">
+ <div class="flex items-start gap-3">
+ <div class="flex min-w-0 flex-1 items-start gap-2">
+ {#if backUrl}
+ <ArcaneButton action="base" tone="ghost" size="icon" href={backUrl} class="size-8 shrink-0" title={backLabel}>
+ <ArrowLeftIcon class="size-4" />
+ </ArcaneButton>
{/if}
- {#if badges}
- <div class="flex flex-wrap items-center gap-2 pt-1">
- {@render badges()}
+ <div class="min-w-0 flex-1">
+ <div class="flex min-h-8 min-w-0 flex-wrap items-center gap-x-2 gap-y-1">
+ <h1 class="truncate text-lg font-semibold tracking-tight" {title}>{title}</h1>
+ {@render badges?.()}
</div>
- {/if}
+ {#if subtitle}
+ <p class="mt-0.5 text-sm text-muted-foreground">{subtitle}</p>
+ {/if}
+ </div>
</div>
<ActionButtonGroup buttons={actions} class="shrink-0" />
diff --git a/frontend/src/lib/layouts/settings-page-layout.svelte b/frontend/src/lib/layouts/settings-page-layout.svelte
index 073f81d9a..6af0507be 100644
--- a/frontend/src/lib/layouts/settings-page-layout.svelte
+++ b/frontend/src/lib/layouts/settings-page-layout.svelte
@@ -83,7 +83,7 @@
{/if}
{#if pageType === 'form' && formState?.saveFunction && !showReadOnlyTag}
- <div class="hidden items-center gap-2 sm:flex">
+ <div class="hidden items-center gap-2 md:flex">
{#if formState.hasChanges}
<span class="mr-2 text-xs text-warning">{m.common_unsaved_changes()}</span>
{:else}
diff --git a/frontend/src/routes/(app)/account/components/account-preferences-panel.svelte b/frontend/src/routes/(app)/account/components/account-preferences-panel.svelte
index 955d6ed7e..a3f50241b 100644
--- a/frontend/src/routes/(app)/account/components/account-preferences-panel.svelte
+++ b/frontend/src/routes/(app)/account/components/account-preferences-panel.svelte
@@ -7,6 +7,7 @@
import TimeFormatPicker from '#lib/components/time-format-picker.svelte';
import FontSizePicker from '#lib/components/font-size-picker.svelte';
import SettingsRow from '#lib/components/settings/settings-row.svelte';
+ import SettingsSection from '#lib/components/settings/settings-section.svelte';
import SelectWithLabel from '#lib/components/form/select-with-label.svelte';
import AccentColorPicker from '#lib/components/accent-color/accent-color-picker.svelte';
import ApplicationThemePicker from '#lib/components/application-theme/application-theme-picker.svelte';
@@ -107,199 +108,185 @@
}
</script>
-<div class="space-y-10">
- <section>
- <h3 class="text-xs font-semibold tracking-wide text-muted-foreground uppercase">{m.general_title()}</h3>
- <div class="mt-4 divide-y divide-border/40 [&>*]:py-4 [&>*:first-child]:pt-0 [&>*:last-child]:pb-0">
- <SettingsRow label={m.language()} description={m.account_language_desc()} layout="inline">
- <LocalePicker inline id="accountLocalePicker" />
- </SettingsRow>
- <SettingsRow label={m.time_format()} description={m.account_time_format_desc()} layout="inline">
- <TimeFormatPicker id="accountTimeFormatPicker" />
- </SettingsRow>
- <SettingsRow label={m.project_editor_layout()} description={m.project_editor_layout_description()} layout="inline">
- <div class="w-52">
- <SelectWithLabel
- id="account-project-editor-layout"
- label={m.project_editor_layout()}
- hideLabel
- triggerSize="sm"
- value={projectEditorLayoutValue}
- options={projectEditorLayoutOptions}
- onValueChange={(value) => void savePreferences({ defaultProjectEditorLayout: value as ProjectEditorLayout })}
- />
- </div>
- </SettingsRow>
- </div>
- </section>
-
- <section>
- <h3 class="text-xs font-semibold tracking-wide text-muted-foreground uppercase">{m.appearance_title()}</h3>
- <div class="mt-4 divide-y divide-border/40 [&>*]:py-4 [&>*:first-child]:pt-0 [&>*:last-child]:pb-0">
- <SettingsRow label={m.account_theme()} description={m.appearance_theme_current_user_description()} layout="inline">
- <ThemeModeSelector />
- </SettingsRow>
- <SettingsRow label={m.font_size()} description={m.font_size_description()} layout="inline">
- <FontSizePicker />
- </SettingsRow>
- <SettingsRow label={m.layout_mode()} description={m.layout_mode_description()} layout="inline">
- <div class="w-52">
- <SelectWithLabel
- id="account-layout-mode"
- label={m.layout_mode()}
- hideLabel
- triggerSize="sm"
- value={layoutModeValue}
- options={layoutModeOptions}
- onValueChange={(value) => (layoutModeStore.current = value as LayoutMode)}
- />
- </div>
- </SettingsRow>
- <SettingsRow label={m.icon_catalog()} description={m.icon_catalog_description()} layout="inline">
- <div class="w-52">
- <SelectWithLabel
- id="account-icon-catalog"
- label={m.icon_catalog()}
- hideLabel
- triggerSize="sm"
- value={iconCatalogValue}
- options={iconCatalogOptions}
- onValueChange={(value) => void savePreferences({ iconCatalog: value as IconCatalog })}
- />
- </div>
- </SettingsRow>
- <SettingsRow label={m.application_theme()} description={m.application_theme_description()}>
- <ApplicationThemePicker
- selectedTheme={applicationThemeValue}
- accentColor={accentColorValue}
- onSelect={(value) => savePreferencesDebounced({ applicationTheme: value })}
- />
- </SettingsRow>
- <SettingsRow label={m.accent_color()} description={m.accent_color_description()}>
- <AccentColorPicker
- previousColor={accentColorValue}
- selectedColor={accentColorValue}
- onSelect={(value) => savePreferencesDebounced({ accentColor: value })}
- />
- </SettingsRow>
- <SettingsRow label={m.oled_mode()} description={m.oled_mode_description()} layout="inline">
- {#snippet helpText()}
- {#if !isDefaultApplicationTheme}
- <p class="mt-1 text-xs text-muted-foreground/70 italic">{m.oled_mode_requires_default_theme()}</p>
- {:else if !isDarkMode}
- <p class="mt-1 text-xs text-muted-foreground/70 italic">{m.oled_mode_requires_dark()}</p>
- {/if}
- {/snippet}
- <Switch
- id="account-oled-mode"
- checked={oledModeEnabled}
- disabled={!isDefaultApplicationTheme}
- onCheckedChange={(checked) => {
- applyOledMode(checked);
- void savePreferences({ oledMode: checked });
- }}
+<div class="space-y-8">
+ <SettingsSection title={m.general_title()}>
+ <SettingsRow label={m.language()} description={m.account_language_desc()} layout="switch">
+ <LocalePicker inline id="accountLocalePicker" />
+ </SettingsRow>
+ <SettingsRow label={m.time_format()} description={m.account_time_format_desc()} layout="switch">
+ <TimeFormatPicker id="accountTimeFormatPicker" />
+ </SettingsRow>
+ <SettingsRow label={m.project_editor_layout()} description={m.project_editor_layout_description()} layout="switch">
+ <div class="w-52">
+ <SelectWithLabel
+ id="account-project-editor-layout"
+ label={m.project_editor_layout()}
+ hideLabel
+ triggerSize="sm"
+ value={projectEditorLayoutValue}
+ options={projectEditorLayoutOptions}
+ onValueChange={(value) => void savePreferences({ defaultProjectEditorLayout: value as ProjectEditorLayout })}
/>
- </SettingsRow>
- <SettingsRow label={m.glass_effects()} description={m.glass_effects_description()} layout="inline">
- <Switch
- id="account-glass-effects"
- checked={glassEffectsEnabled}
- onCheckedChange={(checked) => {
- applyGlassEffects(checked);
- void savePreferences({ glassEffectsEnabled: checked });
- }}
- />
- </SettingsRow>
- <SettingsRow label={m.interface_animations()} description={m.interface_animations_description()} layout="inline">
- <Switch
- id="account-animations"
- checked={animationsEnabled}
- onCheckedChange={(checked) => {
- applyInterfaceAnimations(checked);
- void savePreferences({ animationsEnabled: checked });
- }}
- />
- </SettingsRow>
- </div>
- </section>
+ </div>
+ </SettingsRow>
+ </SettingsSection>
- <section>
- <h3 class="text-xs font-semibold tracking-wide text-muted-foreground uppercase">{m.navigation_title()}</h3>
- <div class="mt-4 divide-y divide-border/40 [&>*]:py-4 [&>*:first-child]:pt-0 [&>*:last-child]:pb-0">
- <SettingsRow
- label={m.navigation_default_landing_page_label()}
- description={m.navigation_default_landing_page_description()}
- layout="inline"
- >
- <div class="w-52">
- <SelectWithLabel
- id="account-default-landing-page"
- label={m.navigation_default_landing_page_label()}
- hideLabel
- triggerSize="sm"
- value={landingValue}
- options={landingPageOptions}
- onValueChange={(value) => void savePreferences({ defaultLandingPage: value })}
- />
- </div>
- </SettingsRow>
- <SettingsRow
- label={m.navigation_sidebar_hover_expansion_label()}
- description={m.navigation_sidebar_hover_expansion_description()}
- layout="inline"
- >
- <Switch
- id="account-sidebar-hover-expansion"
- checked={sidebarHoverExpansionEnabled}
- onCheckedChange={(checked) => void savePreferences({ sidebarHoverExpansion: checked })}
+ <SettingsSection title={m.appearance_title()}>
+ <SettingsRow label={m.account_theme()} description={m.appearance_theme_current_user_description()} layout="switch">
+ <ThemeModeSelector />
+ </SettingsRow>
+ <SettingsRow label={m.font_size()} description={m.font_size_description()} layout="switch">
+ <FontSizePicker />
+ </SettingsRow>
+ <SettingsRow label={m.layout_mode()} description={m.layout_mode_description()} layout="switch">
+ <div class="w-52">
+ <SelectWithLabel
+ id="account-layout-mode"
+ label={m.layout_mode()}
+ hideLabel
+ triggerSize="sm"
+ value={layoutModeValue}
+ options={layoutModeOptions}
+ onValueChange={(value) => (layoutModeStore.current = value as LayoutMode)}
/>
- </SettingsRow>
- <SettingsRow
- label={m.navigation_keyboard_shortcuts_label()}
- description={m.navigation_keyboard_shortcuts_description()}
- layout="inline"
- >
- <Switch
- id="account-keyboard-shortcuts"
- checked={keyboardShortcutsEnabled}
- onCheckedChange={(checked) => void savePreferences({ keyboardShortcutsEnabled: checked })}
+ </div>
+ </SettingsRow>
+ <SettingsRow label={m.icon_catalog()} description={m.icon_catalog_description()} layout="switch">
+ <div class="w-52">
+ <SelectWithLabel
+ id="account-icon-catalog"
+ label={m.icon_catalog()}
+ hideLabel
+ triggerSize="sm"
+ value={iconCatalogValue}
+ options={iconCatalogOptions}
+ onValueChange={(value) => void savePreferences({ iconCatalog: value as IconCatalog })}
/>
- </SettingsRow>
- </div>
- </section>
+ </div>
+ </SettingsRow>
+ <SettingsRow label={m.application_theme()} description={m.application_theme_description()} layout="wide">
+ <ApplicationThemePicker
+ selectedTheme={applicationThemeValue}
+ accentColor={accentColorValue}
+ onSelect={(value) => savePreferencesDebounced({ applicationTheme: value })}
+ />
+ </SettingsRow>
+ <SettingsRow label={m.accent_color()} description={m.accent_color_description()} layout="wide">
+ <AccentColorPicker
+ previousColor={accentColorValue}
+ selectedColor={accentColorValue}
+ onSelect={(value) => savePreferencesDebounced({ accentColor: value })}
+ />
+ </SettingsRow>
+ <SettingsRow label={m.oled_mode()} description={m.oled_mode_description()} layout="switch">
+ {#snippet helpText()}
+ {#if !isDefaultApplicationTheme}
+ <span class="italic">{m.oled_mode_requires_default_theme()}</span>
+ {:else if !isDarkMode}
+ <span class="italic">{m.oled_mode_requires_dark()}</span>
+ {/if}
+ {/snippet}
+ <Switch
+ id="account-oled-mode"
+ checked={oledModeEnabled}
+ disabled={!isDefaultApplicationTheme}
+ onCheckedChange={(checked) => {
+ applyOledMode(checked);
+ void savePreferences({ oledMode: checked });
+ }}
+ />
+ </SettingsRow>
+ <SettingsRow label={m.glass_effects()} description={m.glass_effects_description()} layout="switch">
+ <Switch
+ id="account-glass-effects"
+ checked={glassEffectsEnabled}
+ onCheckedChange={(checked) => {
+ applyGlassEffects(checked);
+ void savePreferences({ glassEffectsEnabled: checked });
+ }}
+ />
+ </SettingsRow>
+ <SettingsRow label={m.interface_animations()} description={m.interface_animations_description()} layout="switch">
+ <Switch
+ id="account-animations"
+ checked={animationsEnabled}
+ onCheckedChange={(checked) => {
+ applyInterfaceAnimations(checked);
+ void savePreferences({ animationsEnabled: checked });
+ }}
+ />
+ </SettingsRow>
+ </SettingsSection>
- <section>
- <h3 class="text-xs font-semibold tracking-wide text-muted-foreground uppercase">
- {m.navigation_mobile_appearance_title()}
- </h3>
- <div class="mt-4 divide-y divide-border/40 [&>*]:py-4 [&>*:first-child]:pt-0 [&>*:last-child]:pb-0">
- <SettingsRow label={m.navigation_mode_label()} description={m.navigation_mode_description()} layout="inline">
- <div class="inline-flex rounded-lg bg-muted/40 p-0.5">
- {#each [{ value: 'floating' as const, label: m.navigation_mode_floating(), icon: MonitorSpeakerIcon }, { value: 'docked' as const, label: m.navigation_mode_docked(), icon: DockIcon }] as option (option.value)}
- <button
- type="button"
- aria-pressed={mobileNavigationMode === option.value}
- onclick={() => selectMobileNavigationMode(option.value)}
- class={cn(
- 'inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors',
- mobileNavigationMode === option.value
- ? 'bg-background text-foreground shadow-sm'
- : 'text-muted-foreground hover:text-foreground'
- )}
- >
- <option.icon class="size-3.5" />
- {option.label}
- </button>
- {/each}
- </div>
- </SettingsRow>
- <SettingsRow label={m.navigation_show_labels_label()} description={m.navigation_show_labels_description()} layout="inline">
- <Switch
- id="account-mobile-nav-labels"
- checked={mobileNavigationShowLabels}
- onCheckedChange={(checked) => void savePreferences({ mobileNavigationShowLabels: checked })}
+ <SettingsSection title={m.navigation_title()}>
+ <SettingsRow
+ label={m.navigation_default_landing_page_label()}
+ description={m.navigation_default_landing_page_description()}
+ layout="switch"
+ >
+ <div class="w-52">
+ <SelectWithLabel
+ id="account-default-landing-page"
+ label={m.navigation_default_landing_page_label()}
+ hideLabel
+ triggerSize="sm"
+ value={landingValue}
+ options={landingPageOptions}
+ onValueChange={(value) => void savePreferences({ defaultLandingPage: value })}
/>
- </SettingsRow>
- </div>
- </section>
+ </div>
+ </SettingsRow>
+ <SettingsRow
+ label={m.navigation_sidebar_hover_expansion_label()}
+ description={m.navigation_sidebar_hover_expansion_description()}
+ layout="switch"
+ >
+ <Switch
+ id="account-sidebar-hover-expansion"
+ checked={sidebarHoverExpansionEnabled}
+ onCheckedChange={(checked) => void savePreferences({ sidebarHoverExpansion: checked })}
+ />
+ </SettingsRow>
+ <SettingsRow
+ label={m.navigation_keyboard_shortcuts_label()}
+ description={m.navigation_keyboard_shortcuts_description()}
+ layout="switch"
+ >
+ <Switch
+ id="account-keyboard-shortcuts"
+ checked={keyboardShortcutsEnabled}
+ onCheckedChange={(checked) => void savePreferences({ keyboardShortcutsEnabled: checked })}
+ />
+ </SettingsRow>
+ </SettingsSection>
+
+ <SettingsSection title={m.navigation_mobile_appearance_title()}>
+ <SettingsRow label={m.navigation_mode_label()} description={m.navigation_mode_description()} layout="switch">
+ <div class="inline-flex rounded-lg bg-muted/40 p-0.5">
+ {#each [{ value: 'floating' as const, label: m.navigation_mode_floating(), icon: MonitorSpeakerIcon }, { value: 'docked' as const, label: m.navigation_mode_docked(), icon: DockIcon }] as option (option.value)}
+ <button
+ type="button"
+ aria-pressed={mobileNavigationMode === option.value}
+ onclick={() => selectMobileNavigationMode(option.value)}
+ class={cn(
+ 'inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors',
+ mobileNavigationMode === option.value
+ ? 'bg-background text-foreground shadow-sm'
+ : 'text-muted-foreground hover:text-foreground'
+ )}
+ >
+ <option.icon class="size-3.5" />
+ {option.label}
+ </button>
+ {/each}
+ </div>
+ </SettingsRow>
+ <SettingsRow label={m.navigation_show_labels_label()} description={m.navigation_show_labels_description()} layout="switch">
+ <Switch
+ id="account-mobile-nav-labels"
+ checked={mobileNavigationShowLabels}
+ onCheckedChange={(checked) => void savePreferences({ mobileNavigationShowLabels: checked })}
+ />
+ </SettingsRow>
+ </SettingsSection>
</div>
diff --git a/frontend/src/routes/(app)/containers/[containerId]/+page.svelte b/frontend/src/routes/(app)/containers/[containerId]/+page.svelte
index 88a3230e3..c87bee28f 100644
--- a/frontend/src/routes/(app)/containers/[containerId]/+page.svelte
+++ b/frontend/src/routes/(app)/containers/[containerId]/+page.svelte
@@ -78,7 +78,7 @@
const autoUpdateStatusAvailable = $derived(typeof container?.autoUpdateEnabled === 'boolean');
const autoUpdateEnabled = $derived(container?.autoUpdateEnabled === true);
- async function handleAutoUpdateChanged() {
+ async function refreshContainerDetails() {
await Promise.all([
queryClient.invalidateQueries({ queryKey: queryKeys.containers.all }),
queryClient.invalidateQueries({ queryKey: queryKeys.containers.detail(currentEnvId, container.id) })
@@ -242,7 +242,7 @@
setStatus: (status) => {
lifecycleStatus = status === 'pausing' ? status : '';
},
- onRefresh: () => refreshAll()
+ onRefresh: refreshContainerDetails
});
}
@@ -254,7 +254,7 @@
setStatus: (status) => {
lifecycleStatus = status === 'unpausing' ? status : '';
},
- onRefresh: () => refreshAll()
+ onRefresh: refreshContainerDetails
});
}
const showStats = $derived(!!container?.state?.running);
@@ -500,7 +500,7 @@
{autoUpdateEnabled}
{autoUpdateLabelControlled}
{autoUpdateStatusAvailable}
- onAutoUpdateChange={handleAutoUpdateChanged}
+ onAutoUpdateChange={refreshContainerDetails}
onViewPortMappings={showNetworkTab ? navigateToNetworkPortMappings : undefined}
onViewStorage={hasMounts ? () => onTabChange('storage') : undefined}
onViewNetworks={showNetworkTab ? () => onTabChange('network') : undefined}
@@ -609,6 +609,7 @@
itemState={container.state?.running ? 'running' : 'stopped'}
disableRedeploy={!!container.redeployDisabled}
extraActions={containerExtraActions}
+ onActionComplete={refreshContainerDetails}
/>
{/snippet}
@@ -622,7 +623,10 @@
containerId={container.id}
containerName={containerDisplayName}
onClose={() => (killDialogOpen = false)}
- onComplete={() => refreshAll()}
+ onComplete={() => {
+ killDialogOpen = false;
+ return refreshContainerDetails();
+ }}
/>
{/if}
{#if commitDialogOpen && canCommitImage}
@@ -630,7 +634,7 @@
bind:open={commitDialogOpen}
containerId={container.id}
containerName={containerDisplayName}
- onCommitted={() => refreshAll()}
+ onCommitted={refreshContainerDetails}
/>
{/if}
{:else}
diff --git a/frontend/src/routes/(app)/customize/registries/+page.svelte b/frontend/src/routes/(app)/customize/registries/+page.svelte
index 9db564f69..e83ff6e91 100644
--- a/frontend/src/routes/(app)/customize/registries/+page.svelte
+++ b/frontend/src/routes/(app)/customize/registries/+page.svelte
@@ -1,4 +1,6 @@
<script lang="ts">
+ import { EmptyState } from '#lib/components/states/index.js';
+ import { RegistryIcon } from '#lib/icons/index.js';
import * as Dialog from '#lib/components/ui/dialog/index.js';
import { toast } from 'svelte-sonner';
import type { ContainerRegistry, ContainerRegistryPullUsage } from '#lib/types/docker.js';
@@ -130,9 +132,21 @@
});
</script>
+{#snippet registriesEmptyState()}
+ <EmptyState
+ variant="plain"
+ icon={RegistryIcon}
+ title={m.registries_empty_title()}
+ description={m.registries_empty_description()}
+ actionLabel={canCreateRegistry ? m.common_add_button({ resource: m.common_registry() }) : undefined}
+ onAction={openCreateRegistryDialog}
+ />
+{/snippet}
+
<ResourcePageLayout title={m.registries_title()} subtitle={m.registries_subtitle()} {actionButtons}>
{#snippet mainContent()}
<RegistryTable
+ emptyState={registriesEmptyState}
bind:registries
bind:selectedIds
bind:requestOptions
diff --git a/frontend/src/routes/(app)/customize/registries/components/registry-table.svelte b/frontend/src/routes/(app)/customize/registries/components/registry-table.svelte
index 1a8ca692b..5d058c90f 100644
--- a/frontend/src/routes/(app)/customize/registries/components/registry-table.svelte
+++ b/frontend/src/routes/(app)/customize/registries/components/registry-table.svelte
@@ -1,4 +1,5 @@
<script lang="ts">
+ import type { Snippet } from 'svelte';
import ArcaneTable from '#lib/components/arcane-table/arcane-table.svelte';
import * as DropdownMenu from '#lib/components/ui/dropdown-menu/index.js';
import RowActionsMenu from '#lib/components/arcane-table/row-actions-menu.svelte';
@@ -26,13 +27,15 @@
selectedIds = $bindable(),
requestOptions = $bindable(),
pullUsageByRegistry = {},
- onEditRegistry
+ onEditRegistry,
+ emptyState
}: {
registries: Paginated<ContainerRegistry>;
selectedIds: string[];
requestOptions: SearchPaginationSortRequest;
pullUsageByRegistry?: Record<string, ContainerRegistryPullUsage>;
onEditRegistry: (registry: ContainerRegistry) => void;
+ emptyState?: Snippet;
} = $props();
let removingId = $state<string | null>(null);
@@ -307,6 +310,7 @@
<div>
<ArcaneTable
+ {emptyState}
persistKey="arcane-registries-table"
items={registries}
bind:requestOptions
diff --git a/frontend/src/routes/(app)/environments/[id]/+page.svelte b/frontend/src/routes/(app)/environments/[id]/+page.svelte
index 7de5b76ed..e1c8ee91d 100644
--- a/frontend/src/routes/(app)/environments/[id]/+page.svelte
+++ b/frontend/src/routes/(app)/environments/[id]/+page.svelte
@@ -1,7 +1,8 @@
<script lang="ts">
import type { Settings } from '#lib/types/settings.js';
- import SectionCard from '#lib/components/section-card.svelte';
- import LabeledSwitch from '#lib/components/form/labeled-switch.svelte';
+ import SettingsRow from '#lib/components/settings/settings-row.svelte';
+ import SettingsSection from '#lib/components/settings/settings-section.svelte';
+ import { EmptyState } from '#lib/components/states/index.js';
import TextInputWithLabel from '#lib/components/form/text-input-with-label.svelte';
import { featureStore } from '#lib/stores/features.store.svelte.js';
import { featureDefinitions } from '#lib/config/features.js';
@@ -10,6 +11,7 @@
import { onMount } from 'svelte';
import * as Tabs from '#lib/components/ui/tabs/index.js';
+ import TabbedPageLayout from '#lib/layouts/tabbed-page-layout.svelte';
import { TabBar, type TabItem } from '#lib/components/tab-bar/index.js';
import { ActionButtonGroup, type ActionButton } from '#lib/components/action-button-group/index.js';
import { ArcaneButton } from '#lib/components/arcane-button/index.js';
@@ -29,8 +31,8 @@
import { queryKeys } from '#lib/query/query-keys.js';
import type { Environment, EnvironmentStatus } from '#lib/types/environment.js';
import { hasPermission } from '#lib/utils/auth.js';
+ import { extractApiErrorMessage } from '#lib/utils/api.js';
import { isEnvironmentOnline, resolveEnvironmentStatus } from '#lib/utils/docker.js';
- import MobileFloatingFormActions from '#lib/components/form/mobile-floating-form-actions.svelte';
import { createSettingsForm } from '#lib/utils/settings-form.js';
import { useUrlTab } from '#lib/hooks/use-url-tab.svelte.js';
import EnvironmentStatusSummary from './components/EnvironmentStatusSummary.svelte';
@@ -50,7 +52,6 @@
import { useEasyJoinCandidates } from '#lib/hooks/use-easy-join-candidates.svelte.js';
import EasyJoinDialog from '../../swarm/cluster/components/easy-join-dialog.svelte';
import {
- ArrowLeftIcon,
AlertIcon,
DockerBrandIcon,
SecurityIcon,
@@ -109,9 +110,9 @@
const isLoadingVersion = $derived(versionQuery.isFetching);
let isCurrentlyStandby = $derived(currentStatus === 'standby');
- let showSettingsTabs = $derived(
- runtimeEnvironment.enabled && isCurrentlyOnline && settings !== null && hasPermission('settings:read', environment.id)
- );
+ // Settings tabs stay listed while offline so the selected tab survives a temporary outage.
+ let showSettingsTabs = $derived(runtimeEnvironment.enabled && hasPermission('settings:read', environment.id));
+ let settingsAvailable = $derived(isCurrentlyOnline && settings !== null);
let showJobsTab = $derived(showSettingsTabs && hasPermission('jobs:manage', environment.id));
let hasMTLSAssets = $derived(Boolean(runtimeEnvironment.edgeMTLSCertificate));
let canPairEnvironments = $derived(hasPermission('environments:pair'));
@@ -133,7 +134,7 @@
actions.push({
id: 'reset',
action: 'base',
- placement: 'secondary',
+ placement: 'primary',
label: m.common_reset(),
onclick: resetForm,
disabled: settingsForm.isLoading,
@@ -660,8 +661,7 @@
const error = operationResult.error;
statusOverride = environment.isEdge ? null : 'offline';
- toast.error(m.environments_test_connection_failed());
- console.error(error);
+ toast.error(m.environments_test_connection_failed(), { description: extractApiErrorMessage(error) });
}
} finally {
isTestingConnection = false;
@@ -701,164 +701,158 @@
}
</script>
+{#snippet settingsOffline()}
+ <EmptyState
+ icon={ConnectionIcon}
+ title={m.environments_settings_offline_title()}
+ description={m.environments_settings_offline_description()}
+ actionLabel={isTestingConnection ? undefined : m.test_connection()}
+ onAction={testConnection}
+ />
+{/snippet}
+
{#snippet enabledIndicator()}
- <div class="flex shrink-0 items-center gap-2.5 rounded-lg border border-border/60 bg-card/40 px-3 py-1.5">
- <div class="flex items-center gap-2">
- <div
- class={cn(
- 'size-2 rounded-full transition-colors',
- formInputs.enabled.value ? 'bg-success shadow-glow shadow-success' : 'bg-muted-foreground/40'
- )}
- ></div>
- <span class="text-sm font-medium">
- {formInputs.enabled.value ? m.common_enabled() : m.common_disabled()}
- </span>
- </div>
+ <label for="env-enabled-header" class="flex shrink-0 cursor-pointer items-center gap-2 text-sm">
+ <span
+ class={cn(
+ 'size-2 rounded-full transition-colors',
+ formInputs.enabled.value ? 'bg-success shadow-glow shadow-success' : 'bg-muted-foreground/40'
+ )}
+ ></span>
+ <span class="hidden sm:inline">{formInputs.enabled.value ? m.common_enabled() : m.common_disabled()}</span>
<Switch id="env-enabled-header" bind:checked={formInputs.enabled.value} />
- </div>
+ </label>
{/snippet}
-<div class="container mx-auto max-w-full space-y-6 overflow-hidden p-2 sm:p-6">
- <div class="space-y-3 sm:space-y-4">
- <ArcaneButton
- action="base"
- tone="ghost"
- onclick={() => goto('/environments')}
- class="w-fit gap-2"
- icon={ArrowLeftIcon}
- customLabel={m.common_back_to({ resource: m.environments_title() })}
- />
-
- <div class="flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between">
- <div class="flex flex-1 items-start gap-4">
- <div class="min-w-0 flex-1">
- <div class="flex min-h-9 min-w-0 flex-wrap items-center gap-x-2 gap-y-1">
- <EditableName
- bind:value={formInputs.name.value}
- bind:ref={nameInputRef}
- variant="inline"
- error={formInputs.name.error ?? undefined}
- originalValue={environment.name}
- placeholder={m.environments_name_placeholder()}
- class="max-w-56 min-w-0 sm:max-w-80 md:max-w-104"
- />
- </div>
- <div class="mt-1 flex min-w-0 items-center gap-1">
- {#if isEditingApiUrl}
- <Input
- id="api-url"
- type="url"
- bind:value={formInputs.apiUrl.value}
- oninput={clearAccessToken}
- mono
- size="sm"
- class="h-7 w-full max-w-md"
- aria-invalid={!!formInputs.apiUrl.error}
- placeholder={m.environments_api_url_placeholder()}
- autofocus
- onkeydown={(e) => {
- if (e.key === 'Enter') {
- e.preventDefault();
- isEditingApiUrl = false;
- }
- if (e.key === 'Escape') {
- formInputs.apiUrl.value = environment.apiUrl;
- clearAccessToken();
- isEditingApiUrl = false;
- }
- }}
- onblur={() => (isEditingApiUrl = false)}
- />
- {:else if environment.id === '0'}
- <ArcaneTooltip.Root>
- <ArcaneTooltip.Trigger class="min-w-0">
- <span class="block truncate px-1 font-mono text-xs text-muted-foreground">{formInputs.apiUrl.value}</span>
- </ArcaneTooltip.Trigger>
- <ArcaneTooltip.Content>
- <p>{m.environments_local_setting_disabled()}</p>
- </ArcaneTooltip.Content>
- </ArcaneTooltip.Root>
- {:else}
- <button
- type="button"
- class="min-w-0 truncate rounded px-1 py-0.5 text-left font-mono text-xs text-muted-foreground transition-colors hover:bg-muted/50 hover:text-foreground"
- title={m.environments_api_url()}
- onclick={() => (isEditingApiUrl = true)}
- >
- {formInputs.apiUrl.value || m.environments_api_url_placeholder()}
- </button>
- {/if}
- <CopyButton text={formInputs.apiUrl.value} size="icon" class="size-6 shrink-0" />
- </div>
- {#if formInputs.apiUrl.error}
- <p class="mt-1 text-xs text-destructive">{formInputs.apiUrl.error}</p>
- {/if}
- {#if directRemoteUrlChanged}
- <div class="mt-3 max-w-md">
- <TextInputWithLabel
- id="agent-access-token-for-url"
- type="password"
- autocomplete="off"
- label={m.environments_access_token_for_url_label()}
- description={m.environments_access_token_for_url_help()}
- bind:value={formInputs.accessToken.value}
- disabled={settingsForm.isLoading}
- />
- </div>
- {/if}
- </div>
- </div>
-
- <div class="flex w-full min-w-0 shrink-0 flex-col items-start gap-2 sm:w-auto sm:items-end">
- <span class={cn('text-xs', settingsForm.hasChanges ? 'text-warning' : 'text-success')}>
- {settingsForm.hasChanges ? m.common_unsaved_changes() : m.common_all_changes_saved()}
- </span>
- <div class="flex w-full items-center justify-end gap-2">
- {#if environment.id !== '0'}
- {@render enabledIndicator()}
- {/if}
- <ActionButtonGroup buttons={headerActions} />
- </div>
- </div>
+{#snippet environmentHeader()}
+ <div class="flex min-w-0 flex-col gap-1">
+ <div class="flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1">
+ <EditableName
+ bind:value={formInputs.name.value}
+ bind:ref={nameInputRef}
+ variant="inline"
+ error={formInputs.name.error ?? undefined}
+ originalValue={environment.name}
+ placeholder={m.environments_name_placeholder()}
+ class="max-w-56 min-w-0 sm:max-w-80 md:max-w-104"
+ />
+ <EnvironmentStatusSummary
+ environment={runtimeEnvironment}
+ {currentStatus}
+ {isLoadingVersion}
+ {remoteVersion}
+ {versionInformation}
+ />
</div>
+ {@render apiUrlLine()}
+ </div>
+{/snippet}
- <EnvironmentStatusSummary
- environment={runtimeEnvironment}
- {currentStatus}
- {isLoadingVersion}
- {remoteVersion}
- {versionInformation}
- />
-
- {#if environment.enabled && settings && isCurrentlyStandby}
- <div class="flex items-start gap-3 rounded-lg border border-info/30 bg-info/10 p-4 text-info">
- <AlertIcon class="mt-0.5 size-5 shrink-0 text-info" />
- <div class="flex-1 space-y-1">
- <p class="text-sm font-medium">{m.common_status()}: {m.common_standby()}</p>
- </div>
- </div>
- {:else if !environment.enabled || !isCurrentlyOnline || !settings}
- <div class="flex items-start gap-3 rounded-lg border border-warning/30 bg-warning/10 p-4 text-warning">
- <AlertIcon class="mt-0.5 size-5 shrink-0 text-warning" />
- <div class="flex-1 space-y-1">
- <p class="text-sm font-medium">
- {#if !environment.enabled}
- {m.environments_warning_disabled()}
- {:else if !isCurrentlyOnline}
- {m.common_status()}: {currentStatus === 'pending'
- ? m.common_pending()
- : currentStatus === 'error'
- ? m.common_error()
- : m.common_offline()}
- {:else if !settings}
- {m.environments_warning_no_settings()}
- {/if}
- </p>
- </div>
- </div>
+{#snippet apiUrlLine()}
+ <div class="flex min-w-0 items-center gap-1">
+ {#if isEditingApiUrl}
+ <Input
+ id="api-url"
+ type="url"
+ bind:value={formInputs.apiUrl.value}
+ oninput={clearAccessToken}
+ mono
+ size="sm"
+ class="h-7 w-full max-w-md"
+ aria-invalid={!!formInputs.apiUrl.error}
+ placeholder={m.environments_api_url_placeholder()}
+ autofocus
+ onkeydown={(e) => {
+ if (e.key === 'Enter') {
+ e.preventDefault();
+ isEditingApiUrl = false;
+ }
+ if (e.key === 'Escape') {
+ formInputs.apiUrl.value = environment.apiUrl;
+ clearAccessToken();
+ isEditingApiUrl = false;
+ }
+ }}
+ onblur={() => (isEditingApiUrl = false)}
+ />
+ {:else if environment.id === '0'}
+ <ArcaneTooltip.Root>
+ <ArcaneTooltip.Trigger class="min-w-0">
+ <span class="block truncate px-1 font-mono text-xs text-muted-foreground">{formInputs.apiUrl.value}</span>
+ </ArcaneTooltip.Trigger>
+ <ArcaneTooltip.Content>
+ <p>{m.environments_local_setting_disabled()}</p>
+ </ArcaneTooltip.Content>
+ </ArcaneTooltip.Root>
+ {:else}
+ <button
+ type="button"
+ class="min-w-0 truncate rounded px-1 py-0.5 text-left font-mono text-xs text-muted-foreground transition-colors hover:bg-muted/50 hover:text-foreground"
+ title={m.environments_api_url()}
+ onclick={() => (isEditingApiUrl = true)}
+ >
+ {formInputs.apiUrl.value || m.environments_api_url_placeholder()}
+ </button>
{/if}
+ <CopyButton text={formInputs.apiUrl.value} size="icon" class="size-6 shrink-0" />
+ <span class="shrink-0 font-mono text-xs text-muted-foreground/70">#{environment.id}</span>
</div>
+ {#if formInputs.apiUrl.error}
+ <p class="mt-1 text-xs text-destructive">{formInputs.apiUrl.error}</p>
+ {/if}
+ {#if directRemoteUrlChanged}
+ <div class="mt-3 max-w-md">
+ <TextInputWithLabel
+ id="agent-access-token-for-url"
+ type="password"
+ autocomplete="off"
+ label={m.environments_access_token_for_url_label()}
+ description={m.environments_access_token_for_url_help()}
+ bind:value={formInputs.accessToken.value}
+ disabled={settingsForm.isLoading}
+ />
+ </div>
+ {/if}
+{/snippet}
+{#snippet environmentHeaderActions()}
+ {#if settingsForm.hasChanges}
+ <span class="hidden text-xs text-warning md:inline">{m.common_unsaved_changes()}</span>
+ {/if}
+ {#if environment.id !== '0'}
+ {@render enabledIndicator()}
+ {/if}
+ <ActionButtonGroup buttons={headerActions} />
+{/snippet}
+
+{#snippet environmentSubHeader()}
+ {#if environment.enabled && settings && isCurrentlyStandby}
+ <div class="flex items-start gap-3 rounded-lg border border-info/30 bg-info/10 p-4 text-info">
+ <AlertIcon class="mt-0.5 size-5 shrink-0 text-info" />
+ <div class="flex-1 space-y-1">
+ <p class="text-sm font-medium">{m.common_status()}: {m.common_standby()}</p>
+ </div>
+ </div>
+ {:else if !environment.enabled || !isCurrentlyOnline || !settings}
+ <div class="flex items-start gap-3 rounded-lg border border-warning/30 bg-warning/10 p-4 text-warning">
+ <AlertIcon class="mt-0.5 size-5 shrink-0 text-warning" />
+ <div class="flex-1 space-y-1">
+ <p class="text-sm font-medium">
+ {#if !environment.enabled}
+ {m.environments_warning_disabled()}
+ {:else if !isCurrentlyOnline}
+ {m.common_status()}: {currentStatus === 'pending'
+ ? m.common_pending()
+ : currentStatus === 'error'
+ ? m.common_error()
+ : m.common_offline()}
+ {:else if !settings}
+ {m.environments_warning_no_settings()}
+ {/if}
+ </p>
+ </div>
+ </div>
+ {/if}
{#if regeneratedApiKey}
<div class="rounded-lg border border-success/30 bg-success/10 p-4 text-success">
<div class="flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between">
@@ -883,48 +877,75 @@
</div>
</div>
{/if}
+{/snippet}
- <Tabs.Root value={activeTab} class="w-full">
- <div class="my-4">
- <TabBar items={tabItems} value={activeTab} onValueChange={handleTabChange} />
- </div>
-
+<!-- The compact header stays sticky; the floating pill would leave an empty band in its place. -->
+<TabbedPageLayout
+ backUrl="/environments"
+ backLabel={m.common_back()}
+ {tabItems}
+ selectedTab={activeTab}
+ onTabChange={handleTabChange}
+ showFloatingHeader={false}
+>
+ {#snippet headerInfo()}
+ {@render environmentHeader()}
+ {/snippet}
+
+ {#snippet headerActions()}
+ {@render environmentHeaderActions()}
+ {/snippet}
+
+ {#snippet subHeader()}
+ {@render environmentSubHeader()}
+ {/snippet}
+
+ {#snippet tabContent()}
<Tabs.Content value="features">
- <section id="features">
- <SectionCard title={m.features_title()} icon={SettingsIcon} variant="transparent">
- {#if featureStore.status(environment.id) === 'ready'}
- <div class="space-y-6">
- <LabeledSwitch
- id="vulnerability-management"
- bind:checked={formInputs.featureVulnerabilityManagementEnabled.value}
- label={m.features_vulnerability_management()}
- description={m.features_vulnerability_description()}
- error={formInputs.featureVulnerabilityManagementEnabled.error}
- disabled={featureSwitchDisabled('vulnerabilityManagement')}
- />
- {#if swarmActive}
- <!-- An active cluster keeps Swarm on, so the stored toggle is shown locked. -->
- <LabeledSwitch id="swarm" checked={true} label={m.swarm()} description={m.features_swarm_locked()} disabled />
- {:else}
- <LabeledSwitch
- id="swarm"
- bind:checked={formInputs.featureSwarmEnabled.value}
- label={m.swarm()}
- description={m.features_swarm_description()}
- error={formInputs.featureSwarmEnabled.error}
- disabled={featureSwitchDisabled('swarm')}
- />
- {/if}
- </div>
- {#if featureDefinitions.some((feature) => !featureStore.isSupported(feature.id, environment.id))}
- <p role="status" class="mt-4 text-sm text-muted-foreground">{m.features_unsupported()}</p>
- {/if}
+ <SettingsSection
+ id="features"
+ title={m.features_title()}
+ description={featureDefinitions.some((feature) => !featureStore.isSupported(feature.id, environment.id))
+ ? m.features_unsupported()
+ : undefined}
+ >
+ {#if featureStore.status(environment.id) === 'ready'}
+ <SettingsRow
+ for="vulnerability-management"
+ label={m.features_vulnerability_management()}
+ description={m.features_vulnerability_description()}
+ error={formInputs.featureVulnerabilityManagementEnabled.error}
+ layout="switch"
+ >
+ <Switch
+ id="vulnerability-management"
+ bind:checked={formInputs.featureVulnerabilityManagementEnabled.value}
+ disabled={featureSwitchDisabled('vulnerabilityManagement')}
+ />
+ </SettingsRow>
+ {#if swarmActive}
+ <!-- An active cluster keeps Swarm on, so the stored toggle is shown locked. -->
+ <SettingsRow for="swarm" label={m.swarm()} description={m.features_swarm_locked()} layout="switch">
+ <Switch id="swarm" checked={true} disabled />
+ </SettingsRow>
{:else}
- <p role="status">{m.features_unavailable()}</p>
- <ArcaneButton action="base" customLabel={m.common_retry()} onclick={refreshEnvironment} />
+ <SettingsRow
+ for="swarm"
+ label={m.swarm()}
+ description={m.features_swarm_description()}
+ error={formInputs.featureSwarmEnabled.error}
+ layout="switch"
+ >
+ <Switch id="swarm" bind:checked={formInputs.featureSwarmEnabled.value} disabled={featureSwitchDisabled('swarm')} />
+ </SettingsRow>
{/if}
- </SectionCard>
- </section>
+ {:else}
+ <div class="flex flex-col items-start gap-3 px-5 py-4">
+ <p role="status" class="text-sm text-muted-foreground">{m.features_unavailable()}</p>
+ <ArcaneButton action="base" customLabel={m.common_retry()} onclick={refreshEnvironment} />
+ </div>
+ {/if}
+ </SettingsSection>
</Tabs.Content>
{#if runtimeEnvironment.isEdge}
@@ -939,7 +960,7 @@
</Tabs.Content>
{/if}
- {#if showSettingsTabs}
+ {#if showSettingsTabs && settingsAvailable}
<Tabs.Content value="storage">
<StorageTab bind:formInputs />
</Tabs.Content>
@@ -970,35 +991,44 @@
</Tabs.Content>
</Tabs.Root>
</Tabs.Content>
+ {:else if showSettingsTabs}
+ {#each ['storage', 'docker', 'security'] as tab (tab)}
+ <Tabs.Content value={tab}>
+ {@render settingsOffline()}
+ </Tabs.Content>
+ {/each}
{/if}
- {#if showJobsTab}
+ {#if showJobsTab && settingsAvailable}
<Tabs.Content value="jobs">
<JobsTab bind:formInputs environmentId={environment.id} />
</Tabs.Content>
+ {:else if showJobsTab}
+ <Tabs.Content value="jobs">
+ {@render settingsOffline()}
+ </Tabs.Content>
{/if}
<Tabs.Content value="gitops" />
- </Tabs.Root>
-
- <AlertDialog.Root bind:open={showRegenerateDialog}>
- <AlertDialog.Content>
- <AlertDialog.Header>
- <AlertDialog.Title>{m.environments_regenerate_dialog_title()}</AlertDialog.Title>
- <AlertDialog.Description>
- {m.environments_regenerate_dialog_message()}
- </AlertDialog.Description>
- </AlertDialog.Header>
- <AlertDialog.Footer>
- <AlertDialog.Cancel>{m.common_cancel()}</AlertDialog.Cancel>
- <AlertDialog.Action onclick={handleRegenerateApiKey}>
- {m.environments_regenerate_api_key()}
- </AlertDialog.Action>
- </AlertDialog.Footer>
- </AlertDialog.Content>
- </AlertDialog.Root>
-</div>
-
+ {/snippet}
+</TabbedPageLayout>
+
+<AlertDialog.Root bind:open={showRegenerateDialog}>
+ <AlertDialog.Content>
+ <AlertDialog.Header>
+ <AlertDialog.Title>{m.environments_regenerate_dialog_title()}</AlertDialog.Title>
+ <AlertDialog.Description>
+ {m.environments_regenerate_dialog_message()}
+ </AlertDialog.Description>
+ </AlertDialog.Header>
+ <AlertDialog.Footer>
+ <AlertDialog.Cancel>{m.common_cancel()}</AlertDialog.Cancel>
+ <AlertDialog.Action onclick={handleRegenerateApiKey}>
+ {m.environments_regenerate_api_key()}
+ </AlertDialog.Action>
+ </AlertDialog.Footer>
+ </AlertDialog.Content>
+</AlertDialog.Root>
{#key `${easyJoinSession}:${easyJoinCandidates.managerEnvironmentId}`}
<EasyJoinDialog
bind:open={easyJoinDialogOpen}
@@ -1007,10 +1037,3 @@
onComplete={easyJoinCandidates.refresh}
/>
{/key}
-
-<MobileFloatingFormActions
- hasChanges={settingsForm.hasChanges}
- isLoading={settingsForm.isLoading}
- onSave={onSubmit}
- onReset={resetForm}
-/>
diff --git a/frontend/src/routes/(app)/environments/[id]/components/ConnectionEdgeTab.svelte b/frontend/src/routes/(app)/environments/[id]/components/ConnectionEdgeTab.svelte
index 5941a914b..0bcf214db 100644
--- a/frontend/src/routes/(app)/environments/[id]/components/ConnectionEdgeTab.svelte
+++ b/frontend/src/routes/(app)/environments/[id]/components/ConnectionEdgeTab.svelte
@@ -1,10 +1,11 @@
<script lang="ts">
- import * as Card from '#lib/components/ui/card/index.js';
+ import SettingsRow from '#lib/components/settings/settings-row.svelte';
+ import SettingsSection from '#lib/components/settings/settings-section.svelte';
import { Badge, type BadgeVariant } from '#lib/components/ui/badge/index.js';
import { ArcaneButton } from '#lib/components/arcane-button/index.js';
import EnvironmentConnectionDetails from './EnvironmentConnectionDetails.svelte';
import { m } from '#lib/paraglide/messages.js';
- import { ConnectionIcon, DownloadIcon, ResetIcon, SecurityIcon } from '#lib/icons/index.js';
+ import { DownloadIcon, ResetIcon } from '#lib/icons/index.js';
import { formatDateTimeShort } from '#lib/utils/formatting.js';
import type { ConnectionEdgeTabProps } from './tab-props';
@@ -47,113 +48,92 @@
</div>
{/snippet}
-<div class="space-y-6">
- <Card.Root variant="transparent" class="flex flex-col">
- <Card.Header icon={ConnectionIcon}>
- <div class="flex flex-col space-y-1.5">
- <Card.Title>
- <h2>{m.connection_edge()}</h2>
- </Card.Title>
- <Card.Description>{m.connection_edge_description()}</Card.Description>
- </div>
- </Card.Header>
- <Card.Content>
- <EnvironmentConnectionDetails {environment} {currentStatus} />
- </Card.Content>
- </Card.Root>
+<div class="space-y-8">
+ <SettingsSection title={m.connection_edge()} description={m.connection_edge_description()} variant="plain">
+ <EnvironmentConnectionDetails {environment} {currentStatus} />
+ </SettingsSection>
{#if showAgentSecurity}
- <Card.Root variant="transparent" class="flex flex-col">
- <Card.Header icon={SecurityIcon}>
- <div class="flex flex-col space-y-1.5">
- <Card.Title>
- <h2>{m.environments_agent_mtls_section_title()}</h2>
- </Card.Title>
- <Card.Description>{m.environments_agent_mtls_description()}</Card.Description>
- </div>
- </Card.Header>
- <Card.Content>
- <div class="flex flex-col gap-6">
- {#if mtlsCertificateBadge && environment.edgeMTLSCertificate}
- <div class="grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3">
- {@render badgeTile(
- m.environments_edge_mtls_certificate_status_label(),
- mtlsCertificateBadge.text,
- mtlsCertificateBadge.variant
- )}
- {@render tile(
- m.environments_edge_mtls_certificate_expires_label(),
- environment.edgeMTLSCertificate.expiresAt
- ? formatDateTimeShort(environment.edgeMTLSCertificate.expiresAt) || m.common_unknown()
- : '—',
- {
- subtext:
- environment.edgeMTLSCertificate.daysRemaining !== undefined
- ? m.environments_edge_mtls_certificate_days_remaining({
- count: environment.edgeMTLSCertificate.daysRemaining
- })
- : undefined
- }
- )}
- {#if environment.edgeMTLSCertificate.commonName}
- {@render tile(
- m.environments_edge_mtls_certificate_common_name_label(),
- environment.edgeMTLSCertificate.commonName,
- { mono: true }
- )}
- {/if}
- </div>
- {/if}
-
- {#if showMTLSDownloads}
- <div class="flex flex-wrap items-center gap-2">
- <ArcaneButton
- action="base"
- tone="outline"
- href={mtlsBundleDownloadHref}
- rel="external"
- icon={DownloadIcon}
- customLabel={m.environments_agent_mtls_download_bundle()}
- />
- <ArcaneButton
- action="base"
- tone="outline"
- href={mtlsCertificateDownloadHref}
- rel="external"
- icon={DownloadIcon}
- customLabel={m.environments_agent_mtls_download_certificate()}
- />
- <ArcaneButton
- action="base"
- tone="outline"
- href={mtlsKeyDownloadHref}
- rel="external"
- icon={DownloadIcon}
- customLabel={m.environments_agent_mtls_download_key()}
- />
- </div>
+ <SettingsSection title={m.environments_agent_mtls_section_title()} description={m.environments_agent_mtls_description()}>
+ {#if mtlsCertificateBadge && environment.edgeMTLSCertificate}
+ <div class="grid grid-cols-1 gap-3 p-5 sm:grid-cols-2 lg:grid-cols-3">
+ {@render badgeTile(
+ m.environments_edge_mtls_certificate_status_label(),
+ mtlsCertificateBadge.text,
+ mtlsCertificateBadge.variant
+ )}
+ {@render tile(
+ m.environments_edge_mtls_certificate_expires_label(),
+ environment.edgeMTLSCertificate.expiresAt
+ ? formatDateTimeShort(environment.edgeMTLSCertificate.expiresAt) || m.common_unknown()
+ : '—',
+ {
+ subtext:
+ environment.edgeMTLSCertificate.daysRemaining !== undefined
+ ? m.environments_edge_mtls_certificate_days_remaining({
+ count: environment.edgeMTLSCertificate.daysRemaining
+ })
+ : undefined
+ }
+ )}
+ {#if environment.edgeMTLSCertificate.commonName}
+ {@render tile(m.environments_edge_mtls_certificate_common_name_label(), environment.edgeMTLSCertificate.commonName, {
+ mono: true
+ })}
{/if}
+ </div>
+ {/if}
- <div class={showMTLSDownloads || mtlsCertificateBadge ? 'border-t pt-6' : ''}>
- <div class="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
- <div class="space-y-0.5">
- <h3 class="text-sm font-medium">{m.environments_regenerate_api_key()}</h3>
- <p class="text-xs text-muted-foreground">{m.environments_regenerate_dialog_message()}</p>
- </div>
- <ArcaneButton
- action="base"
- tone="outline"
- onclick={onRegenerateApiKey}
- disabled={isRegeneratingKey}
- loading={isRegeneratingKey}
- icon={ResetIcon}
- customLabel={m.environments_regenerate_api_key()}
- class="shrink-0"
- />
- </div>
+ {#if showMTLSDownloads}
+ <SettingsRow
+ label={m.environments_agent_mtls_downloads_label()}
+ description={m.environments_agent_mtls_downloads_description()}
+ layout="wide"
+ >
+ <div class="flex flex-wrap items-center gap-2">
+ <ArcaneButton
+ action="base"
+ tone="outline"
+ href={mtlsBundleDownloadHref}
+ rel="external"
+ icon={DownloadIcon}
+ customLabel={m.environments_agent_mtls_download_bundle()}
+ />
+ <ArcaneButton
+ action="base"
+ tone="outline"
+ href={mtlsCertificateDownloadHref}
+ rel="external"
+ icon={DownloadIcon}
+ customLabel={m.environments_agent_mtls_download_certificate()}
+ />
+ <ArcaneButton
+ action="base"
+ tone="outline"
+ href={mtlsKeyDownloadHref}
+ rel="external"
+ icon={DownloadIcon}
+ customLabel={m.environments_agent_mtls_download_key()}
+ />
</div>
- </div>
- </Card.Content>
- </Card.Root>
+ </SettingsRow>
+ {/if}
+
+ <SettingsRow
+ label={m.environments_regenerate_api_key()}
+ description={m.environments_regenerate_dialog_message()}
+ layout="switch"
+ >
+ <ArcaneButton
+ action="base"
+ tone="outline"
+ onclick={onRegenerateApiKey}
+ disabled={isRegeneratingKey}
+ loading={isRegeneratingKey}
+ icon={ResetIcon}
+ customLabel={m.environments_regenerate_api_key()}
+ />
+ </SettingsRow>
+ </SettingsSection>
{/if}
</div>
diff --git a/frontend/src/routes/(app)/environments/[id]/components/DockerTab.svelte b/frontend/src/routes/(app)/environments/[id]/components/DockerTab.svelte
index 1dc3e68f4..4d078a1b5 100644
--- a/frontend/src/routes/(app)/environments/[id]/components/DockerTab.svelte
+++ b/frontend/src/routes/(app)/environments/[id]/components/DockerTab.svelte
@@ -1,12 +1,11 @@
<script lang="ts">
- import * as Card from '#lib/components/ui/card/index.js';
import { Switch } from '#lib/components/ui/switch/index.js';
import SelectWithLabel from '#lib/components/form/select-with-label.svelte';
- import TextInputWithLabel from '#lib/components/form/text-input-with-label.svelte';
+ import { Input } from '#lib/components/ui/input/index.js';
import SettingsRow from '#lib/components/settings/settings-row.svelte';
- import PruneModeCard from '#lib/components/prune/prune-mode-card.svelte';
+ import SettingsSection from '#lib/components/settings/settings-section.svelte';
+ import PruneModePicker from '#lib/components/prune/prune-mode-picker.svelte';
import { m } from '#lib/paraglide/messages.js';
- import { DockerBrandIcon } from '#lib/icons/index.js';
import type { DockerTabProps } from './tab-props';
import {
arcaneImageRegistryOptions,
@@ -63,148 +62,145 @@
];
</script>
-<Card.Root variant="transparent" class="flex flex-col">
- <Card.Header icon={DockerBrandIcon}>
- <div class="flex flex-col space-y-1.5">
- <Card.Title>
- <h2>{m.environments_docker_settings_title()}</h2>
- </Card.Title>
- <Card.Description>{m.environments_config_description()}</Card.Description>
- </div>
- </Card.Header>
- <Card.Content>
- <div class="flex flex-col gap-6">
- <div class="grid gap-6 sm:grid-cols-2">
- <div class="space-y-2">
- <SelectWithLabel
- id="shellSelectValue"
- name="shellSelectValue"
- value={shellSelectValue}
- onValueChange={handleShellSelectChange}
- label={m.docker_default_shell_label()}
- description={m.docker_default_shell_description()}
- placeholder={m.select_shell_placeholder()}
- options={[...shellOptions, { value: 'custom', label: m.custom(), description: m.docker_shell_custom_description() }]}
- />
-
- {#if shellSelectValue === 'custom'}
- <div class="pt-2">
- <TextInputWithLabel
- bind:value={formInputs.defaultShell.value}
- error={formInputs.defaultShell.error}
- label={m.custom()}
- placeholder={m.bin_sh_placeholder()}
- helpText={m.docker_shell_custom_path_help()}
- type="text"
- />
- </div>
- {/if}
- </div>
-
- <div class="space-y-2">
- <SelectWithLabel
- id="defaultDeployPullPolicy"
- name="defaultDeployPullPolicy"
- bind:value={formInputs.defaultDeployPullPolicy.value}
- label={m.settings_default_deploy_pull_policy()}
- description={m.settings_default_deploy_pull_policy_description()}
- options={deployPullPolicyOptions}
- onValueChange={(v) => (formInputs.defaultDeployPullPolicy.value = v as 'missing' | 'always' | 'never')}
- />
- </div>
+<div class="space-y-8">
+ <SettingsSection title={m.environments_docker_settings_title()} description={m.environments_config_description()}>
+ <SettingsRow
+ for="shellSelectValue"
+ label={m.docker_default_shell_label()}
+ description={m.docker_default_shell_description()}
+ error={formInputs.defaultShell.error}
+ helpText={shellSelectValue === 'custom' ? m.docker_shell_custom_path_help() : undefined}
+ >
+ <SelectWithLabel
+ id="shellSelectValue"
+ name="shellSelectValue"
+ hideLabel
+ value={shellSelectValue}
+ onValueChange={handleShellSelectChange}
+ label={m.docker_default_shell_label()}
+ placeholder={m.select_shell_placeholder()}
+ options={[...shellOptions, { value: 'custom', label: m.custom(), description: m.docker_shell_custom_description() }]}
+ />
+ {#if shellSelectValue === 'custom'}
+ <Input
+ class="mt-2"
+ bind:value={formInputs.defaultShell.value}
+ placeholder={m.bin_sh_placeholder()}
+ aria-label={m.custom()}
+ aria-invalid={!!formInputs.defaultShell.error}
+ />
+ {/if}
+ </SettingsRow>
- <div class="space-y-2">
- <SelectWithLabel
- id="toolsImageRegistry"
- name="toolsImageRegistry"
- bind:value={formInputs.toolsImageRegistry.value}
- label={m.tools_image_registry_label()}
- description={m.tools_image_registry_description()}
- options={registryOptions}
- onValueChange={(v) => (formInputs.toolsImageRegistry.value = v as 'ghcr.io' | 'docker.io')}
- />
- <p class="font-mono text-xs text-muted-foreground">{arcaneToolsImage(formInputs.toolsImageRegistry.value)}</p>
- </div>
+ <SettingsRow
+ for="defaultDeployPullPolicy"
+ label={m.settings_default_deploy_pull_policy()}
+ description={m.settings_default_deploy_pull_policy_description()}
+ >
+ <SelectWithLabel
+ id="defaultDeployPullPolicy"
+ name="defaultDeployPullPolicy"
+ hideLabel
+ bind:value={formInputs.defaultDeployPullPolicy.value}
+ label={m.settings_default_deploy_pull_policy()}
+ options={deployPullPolicyOptions}
+ onValueChange={(v) => (formInputs.defaultDeployPullPolicy.value = v as 'missing' | 'always' | 'never')}
+ />
+ </SettingsRow>
- <div class="space-y-2">
- <SelectWithLabel
- id="updateCheckRegistry"
- name="updateCheckRegistry"
- bind:value={formInputs.updateCheckRegistry.value}
- label={m.update_check_registry_label()}
- description={m.update_check_registry_description()}
- options={updateCheckRegistryOptions}
- onValueChange={(v) => (formInputs.updateCheckRegistry.value = v as UpdateCheckRegistry)}
- />
- <p class="text-xs text-muted-foreground {updateCheckImage ? 'font-mono' : ''}">
- {updateCheckImage ?? m.follows_running_image()}
- </p>
- </div>
+ <SettingsRow
+ for="toolsImageRegistry"
+ label={m.tools_image_registry_label()}
+ description={m.tools_image_registry_description()}
+ >
+ <SelectWithLabel
+ id="toolsImageRegistry"
+ name="toolsImageRegistry"
+ hideLabel
+ bind:value={formInputs.toolsImageRegistry.value}
+ label={m.tools_image_registry_label()}
+ options={registryOptions}
+ onValueChange={(v) => (formInputs.toolsImageRegistry.value = v as 'ghcr.io' | 'docker.io')}
+ />
+ {#snippet helpText()}
+ <span class="font-mono">{arcaneToolsImage(formInputs.toolsImageRegistry.value)}</span>
+ {/snippet}
+ </SettingsRow>
- <TextInputWithLabel
- id="base-server-url"
- label={m.general_base_url_label()}
- bind:value={formInputs.baseServerUrl.value}
- error={formInputs.baseServerUrl.error}
- helpText={m.general_base_url_help()}
- />
- </div>
+ <SettingsRow
+ for="updateCheckRegistry"
+ label={m.update_check_registry_label()}
+ description={m.update_check_registry_description()}
+ >
+ <SelectWithLabel
+ id="updateCheckRegistry"
+ name="updateCheckRegistry"
+ hideLabel
+ bind:value={formInputs.updateCheckRegistry.value}
+ label={m.update_check_registry_label()}
+ options={updateCheckRegistryOptions}
+ onValueChange={(v) => (formInputs.updateCheckRegistry.value = v as UpdateCheckRegistry)}
+ />
+ {#snippet helpText()}
+ {#if updateCheckImage}<span class="font-mono">{updateCheckImage}</span>{:else}{m.follows_running_image()}{/if}
+ {/snippet}
+ </SettingsRow>
- <div class="border-t pt-6">
- <SettingsRow
- layout="inline"
- label={m.docker_auto_inject_env_label()}
- description={m.docker_auto_inject_env_description()}
- >
- <Switch id="auto-inject-env" bind:checked={formInputs.autoInjectEnv.value} />
- </SettingsRow>
- </div>
+ <SettingsRow
+ for="base-server-url"
+ label={m.general_base_url_label()}
+ description={m.general_base_url_help()}
+ error={formInputs.baseServerUrl.error}
+ >
+ <Input id="base-server-url" bind:value={formInputs.baseServerUrl.value} aria-invalid={!!formInputs.baseServerUrl.error} />
+ </SettingsRow>
- <div class="space-y-4 border-t pt-6">
- <div class="space-y-0.5">
- <h3 class="text-sm font-medium">{m.prune_options_title()}</h3>
- <p class="text-xs text-muted-foreground">{m.prune_options_description()}</p>
- </div>
+ <SettingsRow
+ for="auto-inject-env"
+ label={m.docker_auto_inject_env_label()}
+ description={m.docker_auto_inject_env_description()}
+ layout="switch"
+ >
+ <Switch id="auto-inject-env" bind:checked={formInputs.autoInjectEnv.value} />
+ </SettingsRow>
+ </SettingsSection>
- <div class="grid gap-4 sm:grid-cols-2">
- <PruneModeCard
- title={m.containers()}
- description={m.scheduled_prune_containers_description()}
- modeOptions={pruneContainerModes}
- bind:value={formInputs.pruneContainerMode.value}
- bind:untilValue={formInputs.pruneContainerUntil.value}
- />
- <PruneModeCard
- title={m.images()}
- description={m.scheduled_prune_images_description()}
- modeOptions={pruneImageModes}
- bind:value={formInputs.pruneImageMode.value}
- bind:untilValue={formInputs.pruneImageUntil.value}
- />
- <PruneModeCard
- title={m.resource_volumes_cap()}
- description={m.scheduled_prune_volumes_description()}
- modeOptions={pruneVolumeModes}
- bind:value={formInputs.pruneVolumeMode.value}
- warningTitle={m.prune_volumes_warning_title()}
- warningDescription={m.scheduled_prune_volumes_warning()}
- />
- <PruneModeCard
- title={m.resource_networks_cap()}
- description={m.scheduled_prune_networks_description()}
- modeOptions={pruneNetworkModes}
- bind:value={formInputs.pruneNetworkMode.value}
- bind:untilValue={formInputs.pruneNetworkUntil.value}
- />
- <PruneModeCard
- title={m.build_cache()}
- description={m.scheduled_prune_build_cache_description()}
- modeOptions={pruneBuildCacheModes}
- bind:value={formInputs.pruneBuildCacheMode.value}
- bind:untilValue={formInputs.pruneBuildCacheUntil.value}
- />
- </div>
- </div>
- </div>
- </Card.Content>
-</Card.Root>
+ <SettingsSection title={m.prune_options_title()} description={m.prune_options_description()}>
+ <SettingsRow label={m.containers()} description={m.scheduled_prune_containers_description()} layout="wide">
+ <PruneModePicker
+ modeOptions={pruneContainerModes}
+ bind:value={formInputs.pruneContainerMode.value}
+ bind:untilValue={formInputs.pruneContainerUntil.value}
+ />
+ </SettingsRow>
+ <SettingsRow label={m.images()} description={m.scheduled_prune_images_description()} layout="wide">
+ <PruneModePicker
+ modeOptions={pruneImageModes}
+ bind:value={formInputs.pruneImageMode.value}
+ bind:untilValue={formInputs.pruneImageUntil.value}
+ />
+ </SettingsRow>
+ <SettingsRow label={m.resource_volumes_cap()} description={m.scheduled_prune_volumes_description()} layout="wide">
+ <PruneModePicker
+ modeOptions={pruneVolumeModes}
+ bind:value={formInputs.pruneVolumeMode.value}
+ warningTitle={m.prune_volumes_warning_title()}
+ warningDescription={m.scheduled_prune_volumes_warning()}
+ />
+ </SettingsRow>
+ <SettingsRow label={m.resource_networks_cap()} description={m.scheduled_prune_networks_description()} layout="wide">
+ <PruneModePicker
+ modeOptions={pruneNetworkModes}
+ bind:value={formInputs.pruneNetworkMode.value}
+ bind:untilValue={formInputs.pruneNetworkUntil.value}
+ />
+ </SettingsRow>
+ <SettingsRow label={m.build_cache()} description={m.scheduled_prune_build_cache_description()} layout="wide">
+ <PruneModePicker
+ modeOptions={pruneBuildCacheModes}
+ bind:value={formInputs.pruneBuildCacheMode.value}
+ bind:untilValue={formInputs.pruneBuildCacheUntil.value}
+ />
+ </SettingsRow>
+ </SettingsSection>
+</div>
diff --git a/frontend/src/routes/(app)/environments/[id]/components/EnvironmentStatusSummary.svelte b/frontend/src/routes/(app)/environments/[id]/components/EnvironmentStatusSummary.svelte
index 5ce411699..450de289f 100644
--- a/frontend/src/routes/(app)/environments/[id]/components/EnvironmentStatusSummary.svelte
+++ b/frontend/src/routes/(app)/environments/[id]/components/EnvironmentStatusSummary.svelte
@@ -4,8 +4,7 @@
import { Spinner } from '#lib/components/ui/spinner/index.js';
import { cn } from '#lib/utils.js';
import { m } from '#lib/paraglide/messages.js';
- import { HashIcon, HealthIcon, TagIcon } from '#lib/icons/index.js';
- import { DetailMetaStrip } from '#lib/components/resource-detail/index.js';
+ import { HealthIcon, TagIcon } from '#lib/icons/index.js';
import type { Environment, EnvironmentStatus } from '#lib/types/environment.js';
import type { AppVersionInformation } from '#lib/types/settings.js';
import { formatRelativeTime } from '#lib/utils/formatting.js';
@@ -95,32 +94,33 @@
});
</script>
-<DetailMetaStrip>
- <div class="flex items-center gap-2">
- <span class={cn('size-2.5 rounded-full transition-colors', statusDotClass)}></span>
- <span class="text-sm font-semibold">{statusBadge.text}</span>
- </div>
+<!-- Inline header chips: status, transport, version, and (edge) heartbeat. -->
+<div class="flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1">
+ <Badge variant={statusBadge.variant} minWidth="20">
+ <span class={cn('size-1.5 rounded-full', statusDotClass)}></span>
+ {statusBadge.text}
+ </Badge>
<Badge variant={transportBadge.variant} minWidth="20">{transportBadge.text}</Badge>
- <div class="flex items-center gap-1.5 text-sm text-muted-foreground">
- <TagIcon class="size-4 shrink-0" />
+ <div class="flex items-center gap-1.5 text-xs text-muted-foreground">
+ <TagIcon class="size-3.5 shrink-0" />
{#if environment.id === '0'}
<span class="font-mono">{localDisplayVersion}</span>
{#if versionInformation?.updateAvailable}
- <Badge variant="amber">
+ <Badge variant="amber" size="sm">
{m.sidebar_update_available()}: {versionInformation.newestVersion}
</Badge>
{/if}
{:else if isLoadingVersion}
- <Spinner class="size-4" />
+ <Spinner class="size-3.5" />
<span>{m.common_action_checking()}</span>
{:else if remoteVersion}
<span class="font-mono">{remoteDisplayVersion}</span>
{#if remoteVersion.updateAvailable}
- <Badge variant="amber">
+ <Badge variant="amber" size="sm">
{m.sidebar_update_available()}: {remoteVersion.newestVersion}
</Badge>
{#if remoteVersion.releaseUrl}
- <a href={remoteVersion.releaseUrl} target="_blank" rel="noopener noreferrer" class="text-xs text-info hover:underline">
+ <a href={remoteVersion.releaseUrl} target="_blank" rel="noopener noreferrer" class="text-info hover:underline">
{m.version_info_view_release()}
</a>
{/if}
@@ -132,13 +132,9 @@
{/if}
</div>
{#if environment.isEdge && environment.lastHeartbeat}
- <div class="flex items-center gap-1.5 text-sm text-muted-foreground">
- <HealthIcon class="size-4 shrink-0" />
+ <div class="flex items-center gap-1.5 text-xs text-muted-foreground" title={m.environments_edge_last_heartbeat_label()}>
+ <HealthIcon class="size-3.5 shrink-0" />
<span>{heartbeatRelative}</span>
</div>
{/if}
- <div class="flex items-center gap-1.5 text-sm text-muted-foreground sm:ml-auto">
- <HashIcon class="size-4 shrink-0" />
- <span class="font-mono">{environment.id}</span>
- </div>
-</DetailMetaStrip>
+</div>
diff --git a/frontend/src/routes/(app)/environments/[id]/components/JobsTab.svelte b/frontend/src/routes/(app)/environments/[id]/components/JobsTab.svelte
index d140620e3..e40d0b96e 100644
--- a/frontend/src/routes/(app)/environments/[id]/components/JobsTab.svelte
+++ b/frontend/src/routes/(app)/environments/[id]/components/JobsTab.svelte
@@ -7,7 +7,14 @@
import { containerService } from '#lib/services/container-service.js';
import { tryCatch } from '#lib/utils/try-catch.js';
import { hasPermission } from '#lib/utils/auth.js';
- import JobCard from '#lib/components/job-card/job-card.svelte';
+ import JobRow from '#lib/components/job-card/job-row.svelte';
+ import JobDetailPanel from '#lib/components/job-card/job-detail-panel.svelte';
+ import { jobNameLabel, type JobPanelSection } from '#lib/components/job-card/job-status.js';
+ import { Badge } from '#lib/components/ui/badge/index.js';
+ import { EmptyState } from '#lib/components/states/index.js';
+ import SettingsSection from '#lib/components/settings/settings-section.svelte';
+ import { extractApiErrorMessage } from '#lib/utils/api.js';
+ import { formatRelativeTime, parseInstant } from '#lib/utils/formatting.js';
import { Spinner } from '#lib/components/ui/spinner/index.js';
import { m } from '#lib/paraglide/messages.js';
import * as Alert from '#lib/components/ui/alert/index.js';
@@ -16,7 +23,7 @@
import { Input } from '#lib/components/ui/input/index.js';
import { Checkbox } from '#lib/components/ui/checkbox/index.js';
import * as ScrollArea from '#lib/components/ui/scroll-area/index.js';
- import { AlertTriangleIcon, JobsIcon } from '#lib/icons/index.js';
+ import { AlertTriangleIcon, InfoIcon, JobsIcon } from '#lib/icons/index.js';
import type { JobStatus, JobPrerequisite } from '#lib/types/settings.js';
import type { ContainerSummaryDto } from '#lib/types/docker.js';
import type { JobsTabProps } from './tab-props';
@@ -88,13 +95,13 @@
switch (prereq.settingKey) {
case 'pollingEnabled':
case 'autoUpdate':
- return `${envBase}?tab=jobs`;
case 'scheduledPruneEnabled':
+ case 'autoHealEnabled':
return `${envBase}?tab=jobs`;
case 'vulnerabilityScanEnabled':
return undefined;
- case 'autoHealEnabled':
- return `${envBase}?tab=jobs`;
+ case 'imageAutoPatchEnabled':
+ return `${envBase}?tab=security`;
default:
return prereq.settingsUrl;
}
@@ -130,6 +137,56 @@
};
}
+ // The selected job stays set after close so the sheet can animate out before unmounting.
+ let selectedJobId = $state<string | null>(null);
+ let panelOpen = $state(false);
+ let panelSection = $state<JobPanelSection>('overview');
+ const visibleJobs = $derived((jobsResponse?.jobs ?? []).filter((job) => !job.managerOnly || environmentId === '0'));
+ const selectedJob = $derived(visibleJobs.find((job) => job.id === selectedJobId));
+
+ // Only these jobs have extra settings, and only once they are switched on.
+ function jobHasSettings(job: JobStatus): boolean {
+ switch (job.id) {
+ case 'image-polling':
+ return true;
+ case 'auto-update':
+ return formInputs.autoUpdate.value;
+ case 'auto-heal':
+ return formInputs.autoHealEnabled.value;
+ default:
+ return false;
+ }
+ }
+
+ function selectJob(job: JobStatus, section: JobPanelSection) {
+ selectedJobId = job.id;
+ panelSection = section;
+ panelOpen = true;
+ }
+
+ function isJobEnabled(job: JobStatus): boolean {
+ return capabilityUnknown ? job.enabled : (getEnabledOverride(job) ?? job.enabled);
+ }
+
+ const summary = $derived.by(() => {
+ const enabled = visibleJobs.filter(isJobEnabled);
+ const failing = enabled.filter((job) => {
+ const run = job.currentRun ?? job.lastRun;
+ return (
+ ['failed', 'needs_attention', 'partial'].includes(run?.status ?? '') ||
+ ['degraded', 'stopped'].includes(job.workerHealth?.status ?? '')
+ );
+ });
+ const running = enabled.filter((job) => ['running', 'retrying', 'queued'].includes(job.currentRun?.status ?? ''));
+ let next: { job: JobStatus; at: ReturnType<typeof parseInstant> } | null = null;
+ for (const job of enabled) {
+ const at = parseInstant(job.nextRun);
+ if (!at) continue;
+ if (!next || at.epochMilliseconds < next.at!.epochMilliseconds) next = { job, at };
+ }
+ return { total: visibleJobs.length, enabled: enabled.length, failing: failing.length, running: running.length, next };
+ });
+
const categories = [
{ id: 'updates', label: m.updates() },
{ id: 'monitoring', label: m.jobs_monitoring_heading() },
@@ -139,13 +196,12 @@
{ id: 'telemetry', label: m.jobs_telemetry_heading() }
];
- function getJobsByCategory(categoryId: string, jobs: JobStatus[]): JobStatus[] {
- return jobs.filter((j) => {
- if (j.category !== categoryId) return false;
- // Only show manager-only jobs on the local environment (ID "0")
- if (j.managerOnly && environmentId !== '0') return false;
- return true;
- });
+ // Jobs with prerequisites can be turned on or off; the rest are built-in and always run.
+ const configurableJobs = $derived(visibleJobs.filter((job) => job.prerequisites.length > 0));
+ const systemJobs = $derived(visibleJobs.filter((job) => job.prerequisites.length === 0));
+
+ function getJobsByCategory(categoryId: string): JobStatus[] {
+ return configurableJobs.filter((job) => job.category === categoryId);
}
function getEnabledOverride(job: JobStatus): boolean | undefined {
@@ -185,26 +241,9 @@
}
</script>
-{#snippet jobCategory(label: string, categoryJobs: JobStatus[], isAgent: boolean, durableRuns: boolean)}
- {#if categoryJobs.length > 0}
- <div
- class="grid min-w-0 gap-x-6 gap-y-2 rounded-xl border border-border bg-transparent px-4 py-2 sm:px-5 lg:grid-cols-aside-28"
- >
- <h3 class="flex min-h-9 items-center text-sm font-semibold text-foreground lg:mt-5 lg:self-start">
- {label}
- </h3>
- <div class="min-w-0 divide-y divide-border/50">
- {#each categoryJobs as job (job.id)}
- {@render environmentJob(job, isAgent, durableRuns)}
- {/each}
- </div>
- </div>
- {/if}
-{/snippet}
-
{#snippet autoUpdateSettings(job: JobStatus)}
- {#if job.id === 'auto-update' && formInputs.autoUpdate.value}
- <div class="space-y-3 border-t border-border/20 pt-3">
+ {#if job.id === 'auto-update'}
+ <div class="space-y-3">
<div class="space-y-1">
<Label>
{m.excluded_containers()}
@@ -235,7 +274,7 @@
{#snippet imagePollingSettings(job: JobStatus)}
{#if job.id === 'image-polling'}
- <div class="space-y-3 border-t border-border/20 pt-3">
+ <div class="space-y-3">
<div class="flex items-center justify-between gap-3">
<div class="space-y-1">
<Label>{m.jobs_image_event_watcher_label()}</Label>
@@ -252,8 +291,8 @@
{/snippet}
{#snippet autoHealSettings(job: JobStatus)}
- {#if job.id === 'auto-heal' && formInputs.autoHealEnabled.value}
- <div class="space-y-3 border-t border-border/20 pt-3">
+ {#if job.id === 'auto-heal'}
+ <div class="space-y-3">
<div class="grid gap-3 sm:grid-cols-2">
<div class="space-y-1">
<Label for="auto-heal-max-restarts">{m.auto_heal_max_restarts_label()}</Label>
@@ -322,47 +361,34 @@
{/if}
{/snippet}
-{#snippet environmentJob(job: JobStatus, isAgent: boolean, durableRuns: boolean)}
- <JobCard
- {job}
- {environmentId}
- {isAgent}
- durableRuns={durableRuns || capabilityUnknown}
- onScheduleUpdate={loadJobs}
- enabledOverride={capabilityUnknown ? undefined : getEnabledOverride(job)}
- collapsibleSettings={job.id === 'image-polling' ||
- (job.id === 'auto-update' && formInputs.autoUpdate.value) ||
- (job.id === 'auto-heal' && formInputs.autoHealEnabled.value)}
- >
- {#snippet headerAccessory()}
- {@render jobEnableControl(job)}
- {/snippet}
-
- {@render autoUpdateSettings(job)}
-
- {@render imagePollingSettings(job)}
-
- {@render autoHealSettings(job)}
- {#if job.children?.length}
- <details class="mt-1">
- <summary
- class="w-fit cursor-pointer rounded-sm text-sm text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring"
- >{m.jobs_target_runs({ count: job.children.length })}</summary
- >
- <div class="mt-3 divide-y divide-border border-l border-border pl-4 sm:pl-6">
- {#each job.children ?? [] as child (child.id)}
- <JobCard
- job={child}
- {environmentId}
- {isAgent}
- durableRuns={durableRuns || capabilityUnknown}
- onScheduleUpdate={loadJobs}
- />
- {/each}
- </div>
- </details>
- {/if}
- </JobCard>
+{#snippet jobGroup(label: string, jobs: JobStatus[], description?: string)}
+ <SettingsSection title={label} {description}>
+ {#each jobs as job (job.id)}
+ <JobRow
+ {job}
+ {environmentId}
+ isAgent={jobsResponse?.isAgent ?? false}
+ durableRuns={(jobsResponse?.durableRuns ?? false) || capabilityUnknown}
+ enabledOverride={capabilityUnknown ? undefined : getEnabledOverride(job)}
+ onSelect={selectJob}
+ onScheduleUpdate={loadJobs}
+ >
+ {#snippet headerAccessory()}
+ {@render jobEnableControl(job)}
+ {/snippet}
+ </JobRow>
+ {/each}
+ </SettingsSection>
+{/snippet}
+
+{#snippet selectedEnableControl()}
+ {#if selectedJob}{@render jobEnableControl(selectedJob)}{/if}
+{/snippet}
+
+{#snippet jobSettings(job: JobStatus)}
+ {@render autoUpdateSettings(job)}
+ {@render imagePollingSettings(job)}
+ {@render autoHealSettings(job)}
{/snippet}
{#snippet ContainerExclusionList(config: {
@@ -429,36 +455,87 @@
{/snippet}
<section class="flex w-full min-w-0 flex-col gap-6">
- <header class="flex items-start gap-3">
- <JobsIcon class="mt-0.5 size-5 text-muted-foreground" />
- <div class="flex flex-col gap-1.5">
- <h2 class="text-lg font-semibold">{m.automations()}</h2>
- <p class="text-sm text-muted-foreground">{m.jobs_environment_scope_description()}</p>
+ <header class="flex flex-wrap items-start justify-between gap-x-6 gap-y-3">
+ <div class="flex items-start gap-3">
+ <JobsIcon class="mt-0.5 size-5 text-muted-foreground" />
+ <div class="flex flex-col gap-1.5">
+ <h2 class="text-lg font-semibold">{m.automations()}</h2>
+ <p class="text-sm text-muted-foreground">{m.jobs_environment_scope_description()}</p>
+ </div>
</div>
- </header>
- <div>
- {#if jobsQuery.isPending}
- <div class="flex h-32 items-center justify-center">
- <Spinner class="size-8" />
+ {#if jobsResponse}
+ <div class="flex flex-wrap items-center gap-2 text-xs text-muted-foreground">
+ <Badge variant="gray">{summary.enabled} / {summary.total} {m.common_enabled().toLowerCase()}</Badge>
+ {#if summary.failing > 0}
+ <Badge variant="red">{summary.failing} {m.jobs_summary_failing().toLowerCase()}</Badge>
+ {/if}
+ {#if summary.running > 0}
+ <Badge variant="blue"
+ ><Spinner class="size-2.5" />{summary.running} {m.health_next_check_running_now().toLowerCase()}</Badge
+ >
+ {/if}
+ {#if summary.next}
+ <span class="tabular-nums">
+ {m.jobs_next_run()}: {jobNameLabel(summary.next.job)} · {formatRelativeTime(summary.next.at)}
+ </span>
+ {/if}
</div>
- {:else}
- {#if jobsResponse}
- {#if capabilityUnknown}<p class="mb-4 text-sm text-muted-foreground">{m.jobs_capability_unknown()}</p>
- {:else if !jobsResponse.durableRuns}<p class="mb-4 text-sm text-muted-foreground">{m.jobs_upgrade_required()}</p>{/if}
- {#if jobsResponse.offline}<p class="mb-4 text-sm text-muted-foreground">
+ {/if}
+ </header>
+
+ {#if jobsResponse}
+ {#if capabilityUnknown || !jobsResponse.durableRuns || jobsResponse.offline}
+ <Alert.Root variant={jobsResponse.offline ? 'warning-subtle' : 'default'} size="sm">
+ <InfoIcon class="size-4" />
+ <Alert.Description>
+ {#if capabilityUnknown}{m.jobs_capability_unknown()}
+ {:else if !jobsResponse.durableRuns}{m.jobs_upgrade_required()}{/if}
+ {#if jobsResponse.offline}
{m.jobs_offline_status()}
{#if !capabilityUnknown}{m.jobs_last_confirmed()}: {jobsResponse.observedAt}{/if}
- </p>{/if}
- <div class="grid items-start gap-x-12 gap-y-10 2xl:grid-cols-2">
- {#each categories as category (category.id)}
- {@const categoryJobs = getJobsByCategory(category.id, jobsResponse.jobs)}
- {@render jobCategory(category.label, categoryJobs, jobsResponse.isAgent, jobsResponse.durableRuns)}
- {/each}
- </div>
- {/if}
+ {/if}
+ </Alert.Description>
+ </Alert.Root>
{/if}
- {#if jobsQuery.error}<div class="rounded-lg border border-destructive/50 bg-destructive/10 p-4 text-destructive">
- {jobsQuery.error.message}
- </div>{/if}
- </div>
+ {/if}
+
+ {#if jobsQuery.error}
+ <Alert.Root variant="destructive-subtle" size="sm">
+ <AlertTriangleIcon class="size-4" />
+ <Alert.Description>{extractApiErrorMessage(jobsQuery.error)}</Alert.Description>
+ </Alert.Root>
+ {:else if jobsQuery.isPending}
+ <div class="flex h-32 items-center justify-center">
+ <Spinner class="size-8" />
+ </div>
+ {:else if jobsResponse && visibleJobs.length === 0}
+ <EmptyState icon={JobsIcon} title={m.jobs_empty_title()} />
+ {:else if jobsResponse}
+ <div class="flex flex-col gap-8">
+ {#each categories as category (category.id)}
+ {@const categoryJobs = getJobsByCategory(category.id)}
+ {#if categoryJobs.length > 0}
+ {@render jobGroup(category.label, categoryJobs)}
+ {/if}
+ {/each}
+ {#if systemJobs.length > 0}
+ {@render jobGroup(m.system(), systemJobs, m.jobs_system_description())}
+ {/if}
+ </div>
+ {/if}
</section>
+
+{#if selectedJob && jobsResponse}
+ <JobDetailPanel
+ job={selectedJob}
+ {environmentId}
+ isAgent={jobsResponse.isAgent}
+ durableRuns={jobsResponse.durableRuns || capabilityUnknown}
+ enabledOverride={capabilityUnknown ? undefined : getEnabledOverride(selectedJob)}
+ bind:open={panelOpen}
+ bind:section={panelSection}
+ settings={jobHasSettings(selectedJob) ? jobSettings : undefined}
+ enableControl={selectedEnableControl}
+ onScheduleUpdate={loadJobs}
+ />
+{/if}
diff --git a/frontend/src/routes/(app)/environments/[id]/components/StorageTab.svelte b/frontend/src/routes/(app)/environments/[id]/components/StorageTab.svelte
index 6087fafee..80436c9cc 100644
--- a/frontend/src/routes/(app)/environments/[id]/components/StorageTab.svelte
+++ b/frontend/src/routes/(app)/environments/[id]/components/StorageTab.svelte
@@ -1,124 +1,125 @@
<script lang="ts">
- import * as Card from '#lib/components/ui/card/index.js';
+ import { Input } from '#lib/components/ui/input/index.js';
import { Switch } from '#lib/components/ui/switch/index.js';
- import TextInputWithLabel from '#lib/components/form/text-input-with-label.svelte';
import SettingsRow from '#lib/components/settings/settings-row.svelte';
+ import SettingsSection from '#lib/components/settings/settings-section.svelte';
import { m } from '#lib/paraglide/messages.js';
- import { FolderOpenIcon, UploadIcon } from '#lib/icons/index.js';
import type { StorageTabProps } from './tab-props';
let { formInputs = $bindable() }: StorageTabProps = $props();
</script>
-<div class="space-y-6">
- <Card.Root variant="transparent" class="flex flex-col">
- <Card.Header icon={FolderOpenIcon}>
- <div class="flex flex-col space-y-1.5">
- <Card.Title>
- <h2>{m.directories_storage_paths()}</h2>
- </Card.Title>
- <Card.Description>{m.directories_storage_paths_description()}</Card.Description>
- </div>
- </Card.Header>
- <Card.Content>
- <div class="grid gap-6 sm:grid-cols-2">
- <TextInputWithLabel
- id="projects-directory"
- label={m.general_projects_directory_label()}
- bind:value={formInputs.projectsDirectory.value}
- error={formInputs.projectsDirectory.error}
- helpText={m.general_projects_directory_help()}
- />
- <TextInputWithLabel
- id="templates-directory"
- label={m.general_templates_directory_label()}
- bind:value={formInputs.templatesDirectory.value}
- error={formInputs.templatesDirectory.error}
- helpText={m.general_templates_directory_help()}
- />
- <TextInputWithLabel
- id="swarm-stack-sources-directory"
- label={m.environments_swarm_stack_source_label()}
- bind:value={formInputs.swarmStackSourcesDirectory.value}
- error={formInputs.swarmStackSourcesDirectory.error}
- helpText={m.environments_swarm_stack_source_help()}
- />
- <TextInputWithLabel
- id="disk-usage-path"
- label={m.disk_usage_settings()}
- bind:value={formInputs.diskUsagePath.value}
- error={formInputs.diskUsagePath.error}
- helpText={m.disk_usage_settings_description()}
- />
- </div>
+<div class="space-y-8">
+ <SettingsSection title={m.directories_storage_paths()} description={m.directories_storage_paths_description()}>
+ <SettingsRow
+ for="projects-directory"
+ label={m.general_projects_directory_label()}
+ description={m.general_projects_directory_help()}
+ error={formInputs.projectsDirectory.error}
+ >
+ <Input
+ id="projects-directory"
+ bind:value={formInputs.projectsDirectory.value}
+ aria-invalid={!!formInputs.projectsDirectory.error}
+ />
+ </SettingsRow>
+ <SettingsRow
+ for="templates-directory"
+ label={m.general_templates_directory_label()}
+ description={m.general_templates_directory_help()}
+ error={formInputs.templatesDirectory.error}
+ >
+ <Input
+ id="templates-directory"
+ bind:value={formInputs.templatesDirectory.value}
+ aria-invalid={!!formInputs.templatesDirectory.error}
+ />
+ </SettingsRow>
+ <SettingsRow
+ for="swarm-stack-sources-directory"
+ label={m.environments_swarm_stack_source_label()}
+ description={m.environments_swarm_stack_source_help()}
+ error={formInputs.swarmStackSourcesDirectory.error}
+ >
+ <Input
+ id="swarm-stack-sources-directory"
+ bind:value={formInputs.swarmStackSourcesDirectory.value}
+ aria-invalid={!!formInputs.swarmStackSourcesDirectory.error}
+ />
+ </SettingsRow>
+ <SettingsRow
+ for="disk-usage-path"
+ label={m.disk_usage_settings()}
+ description={m.disk_usage_settings_description()}
+ error={formInputs.diskUsagePath.error}
+ >
+ <Input id="disk-usage-path" bind:value={formInputs.diskUsagePath.value} aria-invalid={!!formInputs.diskUsagePath.error} />
+ </SettingsRow>
+ <SettingsRow
+ for="follow-project-symlinks"
+ label={m.general_follow_project_symlinks_label()}
+ description={m.general_follow_project_symlinks_help()}
+ layout="switch"
+ >
+ <Switch id="follow-project-symlinks" bind:checked={formInputs.followProjectSymlinks.value} />
+ </SettingsRow>
+ </SettingsSection>
- <div class="mt-6 border-t pt-6">
- <SettingsRow
- layout="inline"
- label={m.general_follow_project_symlinks_label()}
- description={m.general_follow_project_symlinks_help()}
- >
- <Switch id="follow-project-symlinks" bind:checked={formInputs.followProjectSymlinks.value} />
- </SettingsRow>
- </div>
- </Card.Content>
- </Card.Root>
+ <SettingsSection title={m.sync_upload_limits()} description={m.sync_upload_limits_description()}>
+ <SettingsRow
+ for="max-upload-size"
+ label={m.docker_max_upload_size_label()}
+ description={m.docker_max_upload_size_description()}
+ error={formInputs.maxImageUploadSize.error}
+ >
+ <Input
+ id="max-upload-size"
+ type="number"
+ bind:value={formInputs.maxImageUploadSize.value}
+ aria-invalid={!!formInputs.maxImageUploadSize.error}
+ />
+ </SettingsRow>
+ </SettingsSection>
- <Card.Root variant="transparent" class="flex flex-col">
- <Card.Header icon={UploadIcon}>
- <div class="flex flex-col space-y-1.5">
- <Card.Title>
- <h2>{m.sync_upload_limits()}</h2>
- </Card.Title>
- <Card.Description>{m.sync_upload_limits_description()}</Card.Description>
- </div>
- </Card.Header>
- <Card.Content>
- <div class="flex flex-col gap-6">
- <div class="grid gap-6 sm:grid-cols-2">
- <TextInputWithLabel
- id="max-upload-size"
- type="number"
- label={m.docker_max_upload_size_label()}
- bind:value={formInputs.maxImageUploadSize.value}
- error={formInputs.maxImageUploadSize.error}
- helpText={m.docker_max_upload_size_description()}
- />
- </div>
-
- <div class="space-y-4 border-t pt-6">
- <div class="space-y-0.5">
- <h3 class="text-sm font-medium">{m.git_sync_file_limits_title()}</h3>
- <div class="text-xs text-muted-foreground">{m.git_sync_file_limits_description()}</div>
- </div>
- <div class="grid gap-4 sm:grid-cols-3">
- <TextInputWithLabel
- id="git-sync-max-files"
- type="number"
- label={m.git_sync_max_files_label()}
- bind:value={formInputs.gitSyncMaxFiles.value}
- error={formInputs.gitSyncMaxFiles.error}
- helpText={m.git_sync_max_files_help()}
- />
- <TextInputWithLabel
- id="git-sync-max-total-size"
- type="number"
- label={m.git_sync_max_total_size_label()}
- bind:value={formInputs.gitSyncMaxTotalSizeMb.value}
- error={formInputs.gitSyncMaxTotalSizeMb.error}
- helpText={m.git_sync_max_total_size_help()}
- />
- <TextInputWithLabel
- id="git-sync-max-binary-size"
- type="number"
- label={m.git_sync_max_binary_size_label()}
- bind:value={formInputs.gitSyncMaxBinarySizeMb.value}
- error={formInputs.gitSyncMaxBinarySizeMb.error}
- helpText={m.git_sync_max_binary_size_help()}
- />
- </div>
- </div>
- </div>
- </Card.Content>
- </Card.Root>
+ <SettingsSection title={m.git_sync_file_limits_title()} description={m.git_sync_file_limits_description()}>
+ <SettingsRow
+ for="git-sync-max-files"
+ label={m.git_sync_max_files_label()}
+ description={m.git_sync_max_files_help()}
+ error={formInputs.gitSyncMaxFiles.error}
+ >
+ <Input
+ id="git-sync-max-files"
+ type="number"
+ bind:value={formInputs.gitSyncMaxFiles.value}
+ aria-invalid={!!formInputs.gitSyncMaxFiles.error}
+ />
+ </SettingsRow>
+ <SettingsRow
+ for="git-sync-max-total-size"
+ label={m.git_sync_max_total_size_label()}
+ description={m.git_sync_max_total_size_help()}
+ error={formInputs.gitSyncMaxTotalSizeMb.error}
+ >
+ <Input
+ id="git-sync-max-total-size"
+ type="number"
+ bind:value={formInputs.gitSyncMaxTotalSizeMb.value}
+ aria-invalid={!!formInputs.gitSyncMaxTotalSizeMb.error}
+ />
+ </SettingsRow>
+ <SettingsRow
+ for="git-sync-max-binary-size"
+ label={m.git_sync_max_binary_size_label()}
+ description={m.git_sync_max_binary_size_help()}
+ error={formInputs.gitSyncMaxBinarySizeMb.error}
+ >
+ <Input
+ id="git-sync-max-binary-size"
+ type="number"
+ bind:value={formInputs.gitSyncMaxBinarySizeMb.value}
+ aria-invalid={!!formInputs.gitSyncMaxBinarySizeMb.error}
+ />
+ </SettingsRow>
+ </SettingsSection>
</div>
diff --git a/frontend/src/routes/(app)/images/+page.svelte b/frontend/src/routes/(app)/images/+page.svelte
index 98d1be837..8f5223329 100644
--- a/frontend/src/routes/(app)/images/+page.svelte
+++ b/frontend/src/routes/(app)/images/+page.svelte
@@ -23,7 +23,9 @@
import { ResourcePageLayout, type ActionButton, type StatCardConfig } from '#lib/layouts/index.js';
import { CloseIcon, VolumesIcon, LocalFolderComputerIcon, SearchIcon } from '#lib/icons/index.js';
import { createMutation, createQuery, useQueryClient } from '@tanstack/svelte-query';
- import PruneModeCard from '#lib/components/prune/prune-mode-card.svelte';
+ import PruneModePicker from '#lib/components/prune/prune-mode-picker.svelte';
+ import SettingsRow from '#lib/components/settings/settings-row.svelte';
+ import SettingsSection from '#lib/components/settings/settings-section.svelte';
import { activityToastOptions, extractActivityId } from '#lib/utils/activity-toast.js';
let { data } = $props();
@@ -424,16 +426,16 @@
<Dialog.Title>{m.images_prune_confirm_title()}</Dialog.Title>
<Dialog.Description>{m.images_prune_confirm_description({ mode: imagePruneMode })}</Dialog.Description>
</Dialog.Header>
- <div class="py-4">
- <PruneModeCard
- title={m.images()}
- description={m.prune_images_dialog_description()}
- modeOptions={imagePruneModes}
- bind:value={imagePruneMode}
- bind:untilValue={imagePruneUntil}
- disabled={isPruning}
- />
- </div>
+ <SettingsSection class="py-4">
+ <SettingsRow label={m.images()} description={m.prune_images_dialog_description()} layout="wide">
+ <PruneModePicker
+ modeOptions={imagePruneModes}
+ bind:value={imagePruneMode}
+ bind:untilValue={imagePruneUntil}
+ disabled={isPruning}
+ />
+ </SettingsRow>
+ </SettingsSection>
<div class="flex justify-end gap-3 pt-6">
<ArcaneButton action="cancel" onclick={() => (isConfirmPruneDialogOpen = false)} disabled={isPruning} />
<ArcaneButton
diff --git a/frontend/src/routes/(app)/images/builds/components/build-workspace-browser.svelte b/frontend/src/routes/(app)/images/builds/components/build-workspace-browser.svelte
index 5b13cda5a..2c346eb04 100644
--- a/frontend/src/routes/(app)/images/builds/components/build-workspace-browser.svelte
+++ b/frontend/src/routes/(app)/images/builds/components/build-workspace-browser.svelte
@@ -6,7 +6,9 @@
import CreateFolderDialog from '#lib/components/file-browser/CreateFolderDialog.svelte';
import FileUploadDialog from '#lib/components/file-browser/FileUploadDialog.svelte';
import { ArcaneButton } from '#lib/components/arcane-button/index.js';
- import { UploadIcon, MoveToFolderIcon, EllipsisIcon, CopyIcon } from '#lib/icons/index.js';
+ import { UploadIcon, MoveToFolderIcon, EllipsisIcon, CopyIcon, AlertTriangleIcon } from '#lib/icons/index.js';
+ import { EmptyState } from '#lib/components/states/index.js';
+ import { extractApiErrorMessage } from '#lib/utils/api.js';
import { Spinner } from '#lib/components/ui/spinner/index.js';
import * as DropdownMenu from '#lib/components/ui/dropdown-menu/index.js';
import * as Dialog from '#lib/components/ui/dialog/index.js';
@@ -53,11 +55,8 @@
});
const loading = $derived(filesQuery.isPending);
- const error = $derived.by(() => {
- const err = filesQuery.error as any;
- if (!err) return null;
- return err.message || 'Failed to load files';
- });
+ const error = $derived(filesQuery.error ? extractApiErrorMessage(filesQuery.error) : null);
+ const canOpenBuildSettings = $derived(hasPermission('settings:read'));
let showCreateFolder = $state(false);
let showUpload = $state(false);
@@ -240,9 +239,21 @@
<Spinner tone="muted" class="size-8" />
</div>
{:else if error}
- <div class="rounded-lg border border-destructive/20 bg-destructive/10 p-6 text-sm text-destructive">
- {error}
- </div>
+ <EmptyState
+ icon={AlertTriangleIcon}
+ title={m.build_workspace_unavailable_title()}
+ description={m.build_workspace_unavailable_description()}
+ >
+ <p class="max-w-md text-xs break-words text-muted-foreground">{error}</p>
+ <div class="flex flex-wrap justify-center gap-2">
+ <ArcaneButton action="refresh" customLabel={m.common_retry()} onclick={() => filesQuery.refetch()} />
+ {#if canOpenBuildSettings}
+ <ArcaneButton action="base" tone="outline" customLabel={m.build_workspace_open_settings()} href="/settings/builds" />
+ {:else}
+ <p class="text-xs text-muted-foreground">{m.build_workspace_ask_admin()}</p>
+ {/if}
+ </div>
+ </EmptyState>
{:else}
<div class="min-h-0 flex-1 overflow-hidden">
<FileList
diff --git a/frontend/src/routes/(app)/images/builds/components/build-workspace-panel.svelte b/frontend/src/routes/(app)/images/builds/components/build-workspace-panel.svelte
index aad7e181a..71700097e 100644
--- a/frontend/src/routes/(app)/images/builds/components/build-workspace-panel.svelte
+++ b/frontend/src/routes/(app)/images/builds/components/build-workspace-panel.svelte
@@ -53,9 +53,17 @@
</p>
</div>
</div>
- <ArcaneButton action="base" tone="ghost" size="sm" onclick={() => goto('/settings/builds')} class="hover:bg-white/5">
- <SettingsIcon class="size-4" />
- </ArcaneButton>
+ <ArcaneButton
+ action="base"
+ tone="ghost"
+ size="sm"
+ icon={SettingsIcon}
+ showLabel={false}
+ customLabel={m.build_workspace_open_settings()}
+ title={m.build_workspace_open_settings()}
+ onclick={() => goto('/settings/builds')}
+ class="hover:bg-white/5"
+ />
</div>
<div class="flex items-center gap-2 rounded-lg border border-border/70 bg-muted/50 p-1">
diff --git a/frontend/src/routes/(app)/images/builds/components/image-build-history-panel.svelte b/frontend/src/routes/(app)/images/builds/components/image-build-history-panel.svelte
index 588aac280..75c38d7da 100644
--- a/frontend/src/routes/(app)/images/builds/components/image-build-history-panel.svelte
+++ b/frontend/src/routes/(app)/images/builds/components/image-build-history-panel.svelte
@@ -16,12 +16,14 @@
ArrowDownIcon,
ClockIcon,
EllipsisIcon,
+ HammerIcon,
InfoIcon,
RedeployIcon,
SettingsIcon,
TagIcon,
TerminalIcon
} from '#lib/icons/index.js';
+ import { EmptyState } from '#lib/components/states/index.js';
import { m } from '#lib/paraglide/messages.js';
import { queryKeys } from '#lib/query/query-keys.js';
import { imageService } from '#lib/services/image-service.js';
@@ -286,7 +288,16 @@
{mobileFields}
rowActions={BuildHistoryRowActions}
mobileCard={BuildHistoryMobileCard}
- />
+ >
+ {#snippet emptyState()}
+ <EmptyState
+ variant="plain"
+ icon={HammerIcon}
+ title={m.image_build_history_empty_title()}
+ description={m.image_build_history_empty_description()}
+ />
+ {/snippet}
+ </ArcaneTable>
<ResponsiveDialog
bind:open={detailsOpen}
diff --git a/frontend/src/routes/(app)/projects/+layout.svelte b/frontend/src/routes/(app)/projects/+layout.svelte
deleted file mode 100644
index 0fca6d3a2..000000000
--- a/frontend/src/routes/(app)/projects/+layout.svelte
+++ /dev/null
@@ -1,12 +0,0 @@
-<script lang="ts">
- import type { LayoutProps } from './$types';
- import { m } from '#lib/paraglide/messages.js';
-
- let { children }: LayoutProps = $props();
-
- const pageTitle = $derived(`${m.layout_title()} | ${m.projects_title()}`);
-</script>
-
-<svelte:head><title>{pageTitle}</title></svelte:head>
-
-{@render children()}
diff --git a/frontend/src/routes/(app)/projects/+page.svelte b/frontend/src/routes/(app)/projects/+page.svelte
index 4d10748fb..4867a8816 100644
--- a/frontend/src/routes/(app)/projects/+page.svelte
+++ b/frontend/src/routes/(app)/projects/+page.svelte
@@ -15,6 +15,7 @@
import type { ProjectStatusCounts } from '#lib/types/swarm.js';
import { untrack } from 'svelte';
import { createMutation, createQuery, keepPreviousData } from '@tanstack/svelte-query';
+ import { EmptyState } from '#lib/components/states/index.js';
import { ResourcePageLayout, type ActionButton, type StatCardConfig } from '#lib/layouts/index.js';
import { activityToastOptions, extractActivityId } from '#lib/utils/activity-toast.js';
@@ -255,11 +256,23 @@
]);
</script>
+{#snippet projectsEmptyState()}
+ <EmptyState
+ variant="plain"
+ icon={ProjectsIcon}
+ title={m.projects_empty_title()}
+ description={m.projects_empty_description()}
+ actionLabel={canCreateProject ? m.compose_create_project() : undefined}
+ actionHref="/projects/new"
+ />
+{/snippet}
+
<ResourcePageLayout title={m.projects_title()} subtitle={m.compose_subtitle()} {actionButtons} {statCards}>
{#snippet mainContent()}
{#if projects}
<ProjectsTable
{projects}
+ emptyState={projectsEmptyState}
bind:selectedIds
requestOptions={projectRequestOptions}
{showArchived}
diff --git a/frontend/src/routes/(app)/projects/[projectId]/+layout.svelte b/frontend/src/routes/(app)/projects/[projectId]/+layout.svelte
deleted file mode 100644
index 0ad90c8ec..000000000
--- a/frontend/src/routes/(app)/projects/[projectId]/+layout.svelte
+++ /dev/null
@@ -1,14 +0,0 @@
-<script lang="ts">
- import type { LayoutProps } from './$types';
- import { page } from '$app/state';
- import { m } from '#lib/paraglide/messages.js';
-
- let { children }: LayoutProps = $props();
-
- const projectName = $derived(page.data['project'].name);
- const pageTitle = $derived(`${m.layout_title()} | ${m.projects_title()} | ${projectName}`);
-</script>
-
-<svelte:head><title>{pageTitle}</title></svelte:head>
-
-{@render children()}
diff --git a/frontend/src/routes/(app)/projects/components/projects-table.svelte b/frontend/src/routes/(app)/projects/components/projects-table.svelte
index 1d2189c9f..cfe8e6313 100644
--- a/frontend/src/routes/(app)/projects/components/projects-table.svelte
+++ b/frontend/src/routes/(app)/projects/components/projects-table.svelte
@@ -1,4 +1,5 @@
<script lang="ts">
+ import type { Snippet } from 'svelte';
import { tryCatch } from '#lib/utils/try-catch.js';
import type { Project, ProjectTagColor, ProjectTagOption } from '#lib/types/swarm.js';
@@ -46,7 +47,8 @@
showArchived = false,
onToggleArchived,
onRefreshData,
- availableTags = []
+ availableTags = [],
+ emptyState
}: {
projects: Paginated<Project>;
selectedIds: string[];
@@ -56,6 +58,7 @@
onToggleArchived?: (checked: boolean) => void | Promise<void>;
onRefreshData?: (options: SearchPaginationSortRequest) => Promise<void>;
availableTags?: ProjectTagOption[];
+ emptyState?: Snippet;
} = $props();
let actionStatus = $state<Record<string, ActionStatus>>({});
@@ -594,6 +597,7 @@
{/snippet}
<ArcaneTable
+ {emptyState}
persistKey="arcane-project-table"
items={projects}
bind:requestOptions
diff --git a/frontend/src/routes/(app)/projects/new/+layout.svelte b/frontend/src/routes/(app)/projects/new/+layout.svelte
deleted file mode 100644
index 17b604e42..000000000
--- a/frontend/src/routes/(app)/projects/new/+layout.svelte
+++ /dev/null
@@ -1,13 +0,0 @@
-<script lang="ts">
- import type { LayoutProps } from './$types';
- import { m } from '#lib/paraglide/messages.js';
-
- let { children }: LayoutProps = $props();
-
- const projectName = $derived(m.compose_project_name_placeholder());
- const pageTitle = $derived(`${m.layout_title()} | ${m.projects_title()} | ${projectName}`);
-</script>
-
-<svelte:head><title>{pageTitle}</title></svelte:head>
-
-{@render children()}
diff --git a/frontend/src/routes/(app)/projects/projects-table.actions.ts b/frontend/src/routes/(app)/projects/projects-table.actions.ts
index 182c12d5a..8b87271b4 100644
--- a/frontend/src/routes/(app)/projects/projects-table.actions.ts
+++ b/frontend/src/routes/(app)/projects/projects-table.actions.ts
@@ -62,7 +62,7 @@ const projectActionConfigs: Record<ProjectActionKind, ProjectActionConfig> = {
stop: {
status: 'stopping',
run: (id) => projectService.downProject(id),
- success: () => m.compose_stop_success(),
+ success: () => m.compose_down_success(),
failure: () => m.compose_stop_failed()
},
restart: {
diff --git a/frontend/src/routes/(app)/security/+page.svelte b/frontend/src/routes/(app)/security/+page.svelte
index ef1d26451..f404058a0 100644
--- a/frontend/src/routes/(app)/security/+page.svelte
+++ b/frontend/src/routes/(app)/security/+page.svelte
@@ -17,7 +17,8 @@
import SecurityOverview from './components/security-overview.svelte';
import type { ImagePatchTargetDto } from '#lib/types/docker.js';
import { toast } from 'svelte-sonner';
- import { ActivityIcon, InspectIcon, ShieldAlertIcon, ShieldCheckIcon } from '#lib/icons/index.js';
+ import { ActivityIcon, ImagesIcon, InspectIcon, ScanIcon, ShieldAlertIcon, ShieldCheckIcon } from '#lib/icons/index.js';
+ import { EmptyState } from '#lib/components/states/index.js';
import { TabBar, type TabItem } from '#lib/components/tab-bar/index.js';
import * as Tabs from '#lib/components/ui/tabs/index.js';
import { environmentStore } from '#lib/stores/environment.store.svelte.js';
@@ -381,6 +382,37 @@
});
</script>
+{#snippet vulnerabilitiesEmptyState()}
+ {#if overview?.drivers.imagesTotal === 0}
+ <EmptyState
+ variant="plain"
+ icon={ImagesIcon}
+ title={m.security_no_images_to_scan()}
+ description={m.security_no_images_description()}
+ actionLabel={hasPermission('images:pull', currentEnvId) ? m.images_pull_image() : undefined}
+ actionHref="/images"
+ />
+ {:else if overview?.drivers.imagesScanned === 0}
+ <EmptyState
+ variant="plain"
+ icon={ScanIcon}
+ title={m.security_not_scanned_title()}
+ description={m.security_not_scanned_description()}
+ actionLabel={canScanVuln && !isLoading.scanningAll ? m.security_scan_all() : undefined}
+ onAction={scanAllImages}
+ />
+ {:else if !showIgnored && !fixAvailable && vulnerabilities.pagination.totalItems === 0}
+ <EmptyState
+ variant="plain"
+ icon={ShieldCheckIcon}
+ title={m.vuln_no_vulnerabilities()}
+ description={m.security_no_findings_description()}
+ />
+ {:else}
+ <EmptyState variant="plain" title={m.common_no_results_found()} description={m.common_no_results_hint()} />
+ {/if}
+{/snippet}
+
<ResourcePageLayout
title={m.security()}
subtitle={m.security_subtitle()}
@@ -417,6 +449,7 @@
{/if}
<div class="rounded-xl border border-border/60">
<SecurityVulnerabilityTable
+ emptyState={vulnerabilitiesEmptyState}
bind:vulnerabilities
bind:requestOptions
bind:selectedIds={selectedVulnerabilityIds}
diff --git a/frontend/src/routes/(app)/security/components/security-vulnerability-table.svelte b/frontend/src/routes/(app)/security/components/security-vulnerability-table.svelte
index 538f6ec7f..412d4a3ec 100644
--- a/frontend/src/routes/(app)/security/components/security-vulnerability-table.svelte
+++ b/frontend/src/routes/(app)/security/components/security-vulnerability-table.svelte
@@ -32,7 +32,7 @@
import { toast } from 'svelte-sonner';
import { handleApiResultWithCallbacks } from '#lib/utils/api.js';
import { bulkConfirmAndRun, confirmAndRun } from '#lib/utils/bulk-actions.js';
- import { onMount } from 'svelte';
+ import { onMount, type Snippet } from 'svelte';
import { environmentStore } from '#lib/stores/environment.store.svelte.js';
import { hasPermission } from '#lib/utils/auth.js';
import { downloadBlob } from '#lib/utils/browser-download.js';
@@ -56,7 +56,8 @@
showIgnored = false,
onToggleIgnored,
fixAvailable = false,
- onToggleFixAvailable
+ onToggleFixAvailable,
+ emptyState
}: {
vulnerabilities: Paginated<VulnerabilityRow>;
requestOptions: SearchPaginationSortRequest;
@@ -65,6 +66,7 @@
onToggleIgnored?: (checked: boolean) => void | Promise<void>;
fixAvailable?: boolean;
onToggleFixAvailable?: (checked: boolean) => void | Promise<void>;
+ emptyState?: Snippet;
} = $props();
let imageNameFilterOptions = $state<string[]>([]);
@@ -469,6 +471,7 @@
{/snippet}
<ArcaneTable
+ {emptyState}
items={vulnerabilities}
bind:requestOptions
onRefresh={refreshVulnerabilityTable}
diff --git a/frontend/src/routes/(app)/settings/+layout.svelte b/frontend/src/routes/(app)/settings/+layout.svelte
index f71f125ab..b205e0805 100644
--- a/frontend/src/routes/(app)/settings/+layout.svelte
+++ b/frontend/src/routes/(app)/settings/+layout.svelte
@@ -37,8 +37,8 @@
return m.api_key_page_title();
case 'webhooks':
return m.webhook_page_title();
- case 'build':
- return m.build();
+ case 'builds':
+ return m.builds();
case 'diagnostics':
return m.diagnostics();
default:
diff --git a/frontend/src/routes/(app)/settings/+page.svelte b/frontend/src/routes/(app)/settings/+page.svelte
index 386c8e8a5..998349402 100644
--- a/frontend/src/routes/(app)/settings/+page.svelte
+++ b/frontend/src/routes/(app)/settings/+page.svelte
@@ -25,7 +25,7 @@
import { environmentStore } from '#lib/stores/environment.store.svelte.js';
import type { SettingsCategory } from '#lib/types/shared.js';
import { canReachAccessSurfaceUrl } from '#lib/utils/access-policy.js';
- import { getSettingsSubpageUrlsInNavOrder } from '#lib/config/navigation-config.js';
+ import { filterByPermissions, getSettingsSubpageUrlsInNavOrder, navigationItems } from '#lib/config/navigation-config.js';
import { useCategorySearch } from '#lib/hooks/use-category-search.svelte.js';
import { getCategoryIcon, orderCategoriesByNav } from '#lib/utils/category-page.js';
import CategoryIndexPage from '#lib/components/category-index-page.svelte';
@@ -147,7 +147,25 @@
href: '/account?tab=preferences'
};
- const normalizedCategories = $derived([...settingsCategories.map(normalize), accountPreferencesCategory]);
+ // Roles and Diagnostics have no backend settings fields, so their cards reuse the gated sidebar entries.
+ const navOnlyCardDescriptions: Record<string, () => string> = {
+ '/settings/roles': m.roles_subtitle,
+ '/settings/diagnostics': m.diagnostics_description
+ };
+ const navOnlyCategories = $derived(
+ filterByPermissions(
+ navigationItems.settingsItems.find((item) => item.url === '/settings')?.items,
+ user ?? null,
+ environmentStore.selected?.id,
+ permissionsManifest
+ ).flatMap((item): NormalizedCategory[] => {
+ const description = navOnlyCardDescriptions[item.url];
+ if (!description) return [];
+ return [{ id: item.url, title: item.title, description: description(), icon: item.icon, href: item.url }];
+ })
+ );
+
+ const normalizedCategories = $derived([...settingsCategories.map(normalize), ...navOnlyCategories, accountPreferencesCategory]);
const searchAdapter = {
get searchQuery() {
return categorySearch.searchQuery;
diff --git a/frontend/src/routes/(app)/settings/activity/+page.svelte b/frontend/src/routes/(app)/settings/activity/+page.svelte
index bf9700fdb..747b84566 100644
--- a/frontend/src/routes/(app)/settings/activity/+page.svelte
+++ b/frontend/src/routes/(app)/settings/activity/+page.svelte
@@ -4,7 +4,9 @@
import { m } from '#lib/paraglide/messages.js';
import { SettingsPageLayout } from '#lib/layouts/index.js';
import { ActivityIcon } from '#lib/icons/index.js';
- import TextInputWithLabel from '#lib/components/form/text-input-with-label.svelte';
+ import { Input } from '#lib/components/ui/input/index.js';
+ import SettingsRow from '#lib/components/settings/settings-row.svelte';
+ import SettingsSection from '#lib/components/settings/settings-section.svelte';
import { createSettingsForm } from '#lib/utils/settings-form.js';
let { data } = $props();
@@ -45,51 +47,69 @@
>
{#snippet mainContent()}
<fieldset disabled={isReadOnly} class="relative space-y-8">
- <div class="space-y-4">
- <h3 class="text-base font-semibold">{m.activity_history_section_title()}</h3>
- <div class="grid gap-5 sm:grid-cols-2 lg:grid-cols-3">
- <TextInputWithLabel
- bind:value={formInputs.activityHistoryRetentionDays.value}
- error={formInputs.activityHistoryRetentionDays.error}
- label={m.activity_history_retention_days()}
- description={m.activity_history_retention_days_description()}
- placeholder={m.activity_history_retention_days_placeholder()}
- helpText={m.activity_history_retention_days_help()}
+ <SettingsSection title={m.activity_history_section_title()}>
+ <SettingsRow
+ for="activity-history-retention-days"
+ label={m.activity_history_retention_days()}
+ description={m.activity_history_retention_days_description()}
+ helpText={m.activity_history_retention_days_help()}
+ error={formInputs.activityHistoryRetentionDays.error}
+ >
+ <Input
+ id="activity-history-retention-days"
type="number"
+ placeholder={m.activity_history_retention_days_placeholder()}
+ bind:value={formInputs.activityHistoryRetentionDays.value}
+ aria-invalid={!!formInputs.activityHistoryRetentionDays.error}
/>
- <TextInputWithLabel
- bind:value={formInputs.activityHistoryMaxEntries.value}
- error={formInputs.activityHistoryMaxEntries.error}
- label={m.activity_history_max_entries()}
- description={m.activity_history_max_entries_description()}
- placeholder={m.activity_history_max_entries_placeholder()}
- helpText={m.activity_history_max_entries_help()}
+ </SettingsRow>
+ <SettingsRow
+ for="activity-history-max-entries"
+ label={m.activity_history_max_entries()}
+ description={m.activity_history_max_entries_description()}
+ helpText={m.activity_history_max_entries_help()}
+ error={formInputs.activityHistoryMaxEntries.error}
+ >
+ <Input
+ id="activity-history-max-entries"
type="number"
+ placeholder={m.activity_history_max_entries_placeholder()}
+ bind:value={formInputs.activityHistoryMaxEntries.value}
+ aria-invalid={!!formInputs.activityHistoryMaxEntries.error}
/>
- <TextInputWithLabel
- bind:value={formInputs.maxConcurrentActivities.value}
- error={formInputs.maxConcurrentActivities.error}
- label={m.activity_max_concurrent()}
- description={m.activity_max_concurrent_description()}
- placeholder={m.activity_max_concurrent_placeholder()}
- helpText={m.activity_max_concurrent_help()}
+ </SettingsRow>
+ <SettingsRow
+ for="activity-max-concurrent"
+ label={m.activity_max_concurrent()}
+ description={m.activity_max_concurrent_description()}
+ helpText={m.activity_max_concurrent_help()}
+ error={formInputs.maxConcurrentActivities.error}
+ >
+ <Input
+ id="activity-max-concurrent"
type="number"
+ placeholder={m.activity_max_concurrent_placeholder()}
+ bind:value={formInputs.maxConcurrentActivities.value}
+ aria-invalid={!!formInputs.maxConcurrentActivities.error}
/>
- </div>
- </div>
- <div class="space-y-4">
- <h3 class="text-base font-semibold">{m.upgrade_logs_section_title()}</h3>
- <div class="grid gap-5 sm:grid-cols-2 lg:grid-cols-3">
- <TextInputWithLabel
- bind:value={formInputs.upgradeLogRetentionDays.value}
- error={formInputs.upgradeLogRetentionDays.error}
- label={m.upgrade_log_retention_days()}
- description={m.upgrade_log_retention_days_description()}
- helpText={m.upgrade_log_retention_days_help()}
+ </SettingsRow>
+ </SettingsSection>
+ <SettingsSection title={m.upgrade_logs_section_title()}>
+ <SettingsRow
+ for="upgrade-log-retention-days"
+ label={m.upgrade_log_retention_days()}
+ description={m.upgrade_log_retention_days_description()}
+ helpText={m.upgrade_log_retention_days_help()}
+ error={formInputs.upgradeLogRetentionDays.error}
+ >
+ <Input
+ id="upgrade-log-retention-days"
type="number"
+ bind:value={formInputs.upgradeLogRetentionDays.value}
+ aria-invalid={!!formInputs.upgradeLogRetentionDays.error}
/>
- </div>
- </div>
+ </SettingsRow>
+ </SettingsSection>
</fieldset>
{/snippet}
</SettingsPageLayout>
diff --git a/frontend/src/routes/(app)/settings/authentication/+page.svelte b/frontend/src/routes/(app)/settings/authentication/+page.svelte
index 31e29de28..abcd32a97 100644
--- a/frontend/src/routes/(app)/settings/authentication/+page.svelte
+++ b/frontend/src/routes/(app)/settings/authentication/+page.svelte
@@ -5,8 +5,7 @@
import { untrack } from 'svelte';
import { ArcaneButton } from '#lib/components/arcane-button/index.js';
import { Switch } from '#lib/components/ui/switch/index.js';
- import TextInputWithLabel from '#lib/components/form/text-input-with-label.svelte';
- import SwitchWithLabel from '#lib/components/form/labeled-switch.svelte';
+ import { Input } from '#lib/components/ui/input/index.js';
import { toast } from 'svelte-sonner';
import type { Settings } from '#lib/types/settings.js';
import * as ArcaneTooltip from '#lib/components/arcane-tooltip/index.js';
@@ -19,8 +18,8 @@
import { createSettingsForm } from '#lib/utils/settings-form.js';
import { settingsService } from '#lib/services/settings-service.js';
import * as Alert from '#lib/components/ui/alert/index.js';
- import * as Collapsible from '#lib/components/ui/collapsible/index.js';
import SettingsRow from '#lib/components/settings/settings-row.svelte';
+ import SettingsSection from '#lib/components/settings/settings-section.svelte';
import { cn } from '#lib/utils.js';
import * as Tabs from '#lib/components/ui/tabs/index.js';
import { TabBar, type TabItem } from '#lib/components/tab-bar/index.js';
@@ -281,288 +280,290 @@
<Tabs.Content value="settings" class="mt-6">
<fieldset disabled={isReadOnly} class="relative space-y-8">
- <div class="space-y-4">
- <h3 class="text-base font-semibold">{m.authentication()}</h3>
-
+ <SettingsSection title={m.authentication()}>
{#if isAutoLoginEnabled}
- <Alert.Root variant="warning-subtle">
- <InfoIcon class="h-4 w-4 text-warning" />
- <Alert.Title>{m.security_auto_login_enabled_title()}</Alert.Title>
- <Alert.Description>
- {m.security_auto_login_enabled_description()}
- </Alert.Description>
- </Alert.Root>
+ <div class="px-5 py-4">
+ <Alert.Root variant="warning-subtle">
+ <InfoIcon class="h-4 w-4 text-warning" />
+ <Alert.Title>{m.security_auto_login_enabled_title()}</Alert.Title>
+ <Alert.Description>{m.security_auto_login_enabled_description()}</Alert.Description>
+ </Alert.Root>
+ </div>
{:else}
- <div class="divide-y divide-border/40 [&>*]:py-5 [&>*:first-child]:pt-0 [&>*:last-child]:pb-0">
+ <SettingsRow
+ for="localAuthSwitch"
+ label={m.security_local_auth_label()}
+ description={m.security_local_auth_description()}
+ layout="switch"
+ >
+ <Switch
+ id="localAuthSwitch"
+ bind:checked={formInputs.authLocalEnabled.value}
+ onCheckedChange={handleLocalSwitchChange}
+ />
+ </SettingsRow>
+
+ <SettingsRow
+ for="oidcEnabledSwitch"
+ label={m.security_oidc_auth_label()}
+ description={m.security_oidc_auth_description()}
+ layout="switch"
+ >
+ {#snippet labelExtra()}
+ {#if isOidcEnvForced}
+ <div class="mt-2">
+ <ArcaneTooltip.Root>
+ <ArcaneTooltip.Trigger>
+ <Badge variant="amber">
+ {#if isOidcForcedDisabled}
+ {m.security_server_disabled_via_server()}
+ {:else}
+ {m.security_server_configured()}
+ {/if}
+ </Badge>
+ </ArcaneTooltip.Trigger>
+ <ArcaneTooltip.Content side="top">
+ {#if isOidcForcedDisabled}
+ {m.security_oidc_forced_disabled_tooltip()}
+ {:else}
+ {m.security_oidc_forced_managed_tooltip()}
+ {/if}
+ </ArcaneTooltip.Content>
+ </ArcaneTooltip.Root>
+ </div>
+ {/if}
+ {/snippet}
+ <div class="flex flex-col items-end gap-2">
+ <Switch
+ id="oidcEnabledSwitch"
+ disabled={isOidcEnvForced}
+ bind:checked={formInputs.oidcEnabled.value}
+ onCheckedChange={handleOidcEnabledChange}
+ />
+ {#if showOidcDetails}
+ <button
+ type="button"
+ class="inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted/50 hover:text-foreground"
+ aria-expanded={oidcConfigOpen}
+ onclick={() => (oidcConfigOpen = !oidcConfigOpen)}
+ >
+ <span>{oidcConfigOpen ? m.common_hide() : m.common_show()} {m.common_configuration()}</span>
+ <ArrowDownIcon class={cn('size-3.5 transition-transform', oidcConfigOpen && 'rotate-180')} />
+ </button>
+ {/if}
+ </div>
+ </SettingsRow>
+
+ {#if showOidcDetails && oidcConfigOpen}
+ <SettingsRow for="oidcClientId" label={m.oidc_client_id_label()} error={formInputs.oidcClientId.error}>
+ <Input
+ id="oidcClientId"
+ placeholder={m.oidc_client_id_placeholder()}
+ disabled={isOidcEnvForced}
+ bind:value={formInputs.oidcClientId.value}
+ aria-invalid={!!formInputs.oidcClientId.error}
+ />
+ </SettingsRow>
<SettingsRow
- label={m.security_local_auth_label()}
- description={m.security_local_auth_description()}
- layout="inline"
+ for="oidcClientSecret"
+ label={m.oidc_client_secret_label()}
+ helpText={m.security_oidc_client_secret_help()}
+ error={formInputs.oidcClientSecret.error}
>
- <Switch
- id="localAuthSwitch"
- bind:checked={formInputs.authLocalEnabled.value}
- onCheckedChange={handleLocalSwitchChange}
+ <Input
+ id="oidcClientSecret"
+ type="password"
+ placeholder={m.oidc_client_secret_placeholder()}
+ disabled={isOidcEnvForced || formInputs.oidcClearClientSecret.value}
+ bind:value={formInputs.oidcClientSecret.value}
+ aria-invalid={!!formInputs.oidcClientSecret.error}
/>
</SettingsRow>
-
- <Collapsible.Root bind:open={oidcConfigOpen}>
- <SettingsRow
- label={m.security_oidc_auth_label()}
- description={m.security_oidc_auth_description()}
- layout="inline"
- >
- {#snippet labelExtra()}
- {#if isOidcEnvForced}
- <div class="mt-2">
- <ArcaneTooltip.Root>
- <ArcaneTooltip.Trigger>
- <Badge variant="amber">
- {#if isOidcForcedDisabled}
- {m.security_server_disabled_via_server()}
- {:else}
- {m.security_server_configured()}
- {/if}
- </Badge>
- </ArcaneTooltip.Trigger>
- <ArcaneTooltip.Content side="top">
- {#if isOidcForcedDisabled}
- {m.security_oidc_forced_disabled_tooltip()}
- {:else}
- {m.security_oidc_forced_managed_tooltip()}
- {/if}
- </ArcaneTooltip.Content>
- </ArcaneTooltip.Root>
- </div>
- {/if}
- {/snippet}
- <div class="flex flex-col items-end gap-2">
- <Switch
- id="oidcEnabledSwitch"
- disabled={isOidcEnvForced}
- bind:checked={formInputs.oidcEnabled.value}
- onCheckedChange={handleOidcEnabledChange}
- />
- {#if showOidcDetails}
- <Collapsible.Trigger>
- {#snippet child({ props })}
- <button
- {...props}
- type="button"
- class="inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted/50 hover:text-foreground"
- >
- <span>{oidcConfigOpen ? m.common_hide() : m.common_show()} {m.common_configuration()}</span>
- <ArrowDownIcon class={cn('size-3.5 transition-transform', oidcConfigOpen && 'rotate-180')} />
- </button>
- {/snippet}
- </Collapsible.Trigger>
- {/if}
- </div>
+ {#if hasStoredClientSecret && !isOidcEnvForced}
+ <SettingsRow for="clearOidcClientSecret" label={m.security_oidc_clear_client_secret()} layout="switch">
+ <Switch id="clearOidcClientSecret" bind:checked={formInputs.oidcClearClientSecret.value} />
</SettingsRow>
-
- {#if showOidcDetails}
- <Collapsible.Content class="mt-4">
- <div class="space-y-5 border-l-2 border-border/60 pl-5">
- <div class="grid gap-5 sm:grid-cols-2">
- <TextInputWithLabel
- id="oidcClientId"
- label={m.oidc_client_id_label()}
- placeholder={m.oidc_client_id_placeholder()}
- disabled={isOidcEnvForced}
- bind:value={formInputs.oidcClientId.value}
- error={formInputs.oidcClientId.error}
- />
- <TextInputWithLabel
- id="oidcClientSecret"
- type="password"
- label={m.oidc_client_secret_label()}
- placeholder={m.oidc_client_secret_placeholder()}
- disabled={isOidcEnvForced || formInputs.oidcClearClientSecret.value}
- bind:value={formInputs.oidcClientSecret.value}
- error={formInputs.oidcClientSecret.error}
- helpText={m.security_oidc_client_secret_help()}
- />
- </div>
-
- {#if hasStoredClientSecret && !isOidcEnvForced}
- <SwitchWithLabel
- id="clearOidcClientSecret"
- label={m.security_oidc_clear_client_secret()}
- bind:checked={formInputs.oidcClearClientSecret.value}
- />
- {/if}
-
- <TextInputWithLabel
- id="oidcIssuerUrl"
- label={m.oidc_issuer_url_label()}
- description={m.oidc_issuer_url_description()}
- placeholder={m.oidc_issuer_url_placeholder()}
- disabled={isOidcEnvForced}
- bind:value={formInputs.oidcIssuerUrl.value}
- error={formInputs.oidcIssuerUrl.error}
- />
-
- <div class="grid gap-5 sm:grid-cols-2">
- <TextInputWithLabel
- id="oidcProviderName"
- label={m.oidc_provider_name_label()}
- description={m.oidc_provider_name_description()}
- placeholder={m.oidc_provider_name_placeholder()}
- disabled={isOidcEnvForced}
- bind:value={formInputs.oidcProviderName.value}
- error={formInputs.oidcProviderName.error}
- />
- <TextInputWithLabel
- id="oidcProviderLogoUrl"
- label={m.oidc_provider_logo_url_label()}
- description={m.oidc_provider_logo_url_description()}
- placeholder={m.oidc_provider_logo_url_placeholder()}
- disabled={isOidcEnvForced}
- bind:value={formInputs.oidcProviderLogoUrl.value}
- error={formInputs.oidcProviderLogoUrl.error}
- />
- </div>
-
- <TextInputWithLabel
- id="oidcScopes"
- label={m.oidc_scopes_label()}
- placeholder={m.oidc_scopes_placeholder()}
- disabled={isOidcEnvForced}
- bind:value={formInputs.oidcScopes.value}
- error={formInputs.oidcScopes.error}
- />
-
- <TextInputWithLabel
- id="oidcGroupsClaim"
- label={m.oidc_groups_claim_label()}
- placeholder={m.oidc_groups_claim_placeholder()}
- disabled={isOidcEnvForced}
- bind:value={formInputs.oidcGroupsClaim.value}
- error={formInputs.oidcGroupsClaim.error}
- helpText={m.oidc_groups_claim_help()}
- />
-
- <div class="divide-y divide-border/40 pt-2 [&>*]:py-5 [&>*:first-child]:pt-0 [&>*:last-child]:pb-0">
- <SettingsRow
- label={m.security_oidc_merge_accounts_label()}
- description={m.security_oidc_merge_accounts_description()}
- layout="inline"
- >
- <Switch
- id="oidcMergeAccountsSwitch"
- disabled={isOidcEnvForced}
- bind:checked={formInputs.oidcMergeAccounts.value}
- onCheckedChange={handleMergeAccountsChange}
- />
- </SettingsRow>
-
- <SettingsRow
- label={m.oidc_skip_tls_verify_label()}
- description={m.oidc_skip_tls_verify_description()}
- layout="inline"
- >
- <Switch
- id="oidcSkipTlsVerifySwitch"
- disabled={isOidcEnvForced}
- bind:checked={formInputs.oidcSkipTlsVerify.value}
- />
- </SettingsRow>
-
- <SettingsRow
- label={m.oidc_auto_redirect_label()}
- description={m.oidc_auto_redirect_description()}
- layout="inline"
- >
- <Switch
- id="oidcAutoRedirectSwitch"
- disabled={isOidcEnvForced}
- bind:checked={formInputs.oidcAutoRedirectToProvider.value}
- />
- </SettingsRow>
- </div>
-
- <div class="rounded-lg border bg-muted/30 p-4">
- <div class="mb-2 flex items-center gap-2">
- <InfoIcon class="size-4 text-info" />
- <span class="text-sm font-medium">{m.oidc_redirect_uri_title()}</span>
- </div>
- <p class="mb-3 text-sm text-muted-foreground">{m.oidc_redirect_uri_description()}</p>
- <div class="flex items-center gap-2">
- <code class="flex-1 rounded bg-muted p-2 font-mono text-xs break-all">{redirectUri}</code>
- <CopyButton text={redirectUri} size="sm" variant="outline" class="shrink-0" title={m.common_copy()} />
- </div>
- </div>
- </div>
- </Collapsible.Content>
- {/if}
- </Collapsible.Root>
- </div>
-
- <IfPermitted adminOnly>
- <div class="space-y-4 border-t border-border/40 pt-6">
- <div class="flex items-start justify-between gap-4">
- <div>
- <h4 class="text-sm font-semibold">{m.oidc_role_mappings_title()}</h4>
- <p class="mt-0.5 text-xs text-muted-foreground">{m.oidc_role_mappings_description()}</p>
- </div>
- <ArcaneButton
- action="create"
- tone="outline"
- size="sm"
- onclick={openCreateMapping}
- customLabel={m.common_create_button({ resource: m.resource_oidc_mapping_cap() })}
- />
+ {/if}
+ <SettingsRow
+ for="oidcIssuerUrl"
+ label={m.oidc_issuer_url_label()}
+ description={m.oidc_issuer_url_description()}
+ error={formInputs.oidcIssuerUrl.error}
+ >
+ <Input
+ id="oidcIssuerUrl"
+ placeholder={m.oidc_issuer_url_placeholder()}
+ disabled={isOidcEnvForced}
+ bind:value={formInputs.oidcIssuerUrl.value}
+ aria-invalid={!!formInputs.oidcIssuerUrl.error}
+ />
+ </SettingsRow>
+ <SettingsRow
+ for="oidcProviderName"
+ label={m.oidc_provider_name_label()}
+ description={m.oidc_provider_name_description()}
+ error={formInputs.oidcProviderName.error}
+ >
+ <Input
+ id="oidcProviderName"
+ placeholder={m.oidc_provider_name_placeholder()}
+ disabled={isOidcEnvForced}
+ bind:value={formInputs.oidcProviderName.value}
+ aria-invalid={!!formInputs.oidcProviderName.error}
+ />
+ </SettingsRow>
+ <SettingsRow
+ for="oidcProviderLogoUrl"
+ label={m.oidc_provider_logo_url_label()}
+ description={m.oidc_provider_logo_url_description()}
+ error={formInputs.oidcProviderLogoUrl.error}
+ >
+ <Input
+ id="oidcProviderLogoUrl"
+ placeholder={m.oidc_provider_logo_url_placeholder()}
+ disabled={isOidcEnvForced}
+ bind:value={formInputs.oidcProviderLogoUrl.value}
+ aria-invalid={!!formInputs.oidcProviderLogoUrl.error}
+ />
+ </SettingsRow>
+ <SettingsRow for="oidcScopes" label={m.oidc_scopes_label()} error={formInputs.oidcScopes.error}>
+ <Input
+ id="oidcScopes"
+ placeholder={m.oidc_scopes_placeholder()}
+ disabled={isOidcEnvForced}
+ bind:value={formInputs.oidcScopes.value}
+ aria-invalid={!!formInputs.oidcScopes.error}
+ />
+ </SettingsRow>
+ <SettingsRow
+ for="oidcGroupsClaim"
+ label={m.oidc_groups_claim_label()}
+ helpText={m.oidc_groups_claim_help()}
+ error={formInputs.oidcGroupsClaim.error}
+ >
+ <Input
+ id="oidcGroupsClaim"
+ placeholder={m.oidc_groups_claim_placeholder()}
+ disabled={isOidcEnvForced}
+ bind:value={formInputs.oidcGroupsClaim.value}
+ aria-invalid={!!formInputs.oidcGroupsClaim.error}
+ />
+ </SettingsRow>
+ <SettingsRow
+ for="oidcMergeAccountsSwitch"
+ label={m.security_oidc_merge_accounts_label()}
+ description={m.security_oidc_merge_accounts_description()}
+ layout="switch"
+ >
+ <Switch
+ id="oidcMergeAccountsSwitch"
+ disabled={isOidcEnvForced}
+ bind:checked={formInputs.oidcMergeAccounts.value}
+ onCheckedChange={handleMergeAccountsChange}
+ />
+ </SettingsRow>
+ <SettingsRow
+ for="oidcSkipTlsVerifySwitch"
+ label={m.oidc_skip_tls_verify_label()}
+ description={m.oidc_skip_tls_verify_description()}
+ layout="switch"
+ >
+ <Switch
+ id="oidcSkipTlsVerifySwitch"
+ disabled={isOidcEnvForced}
+ bind:checked={formInputs.oidcSkipTlsVerify.value}
+ />
+ </SettingsRow>
+ <SettingsRow
+ for="oidcAutoRedirectSwitch"
+ label={m.oidc_auto_redirect_label()}
+ description={m.oidc_auto_redirect_description()}
+ layout="switch"
+ >
+ <Switch
+ id="oidcAutoRedirectSwitch"
+ disabled={isOidcEnvForced}
+ bind:checked={formInputs.oidcAutoRedirectToProvider.value}
+ />
+ </SettingsRow>
+ <SettingsRow label={m.oidc_redirect_uri_title()} description={m.oidc_redirect_uri_description()} layout="wide">
+ <div class="flex items-center gap-2">
+ <code class="flex-1 rounded-md bg-muted/60 p-2 font-mono text-xs break-all">{redirectUri}</code>
+ <CopyButton text={redirectUri} size="sm" variant="outline" class="shrink-0" title={m.common_copy()} />
</div>
- {#if oidcMappings.length > 0}
- <OidcMappingTable
- mappings={oidcMappings}
- roles={data.roles}
- environments={data.environments}
- onRefresh={refreshMappings}
- onEdit={openEditMapping}
- />
- {:else}
- <div class="rounded-lg border border-dashed border-border/40 bg-muted/20 p-6 text-center">
- <p class="text-sm text-muted-foreground">{m.oidc_mappings_empty_body()}</p>
- </div>
- {/if}
- </div>
- </IfPermitted>
+ </SettingsRow>
+ {/if}
{/if}
- </div>
-
- <div class="space-y-4">
- <h3 class="text-base font-semibold">{m.security_session_heading()}</h3>
- <div class="max-w-xs">
- <TextInputWithLabel
+ </SettingsSection>
+
+ {#if !isAutoLoginEnabled}
+ <IfPermitted adminOnly>
+ <SettingsSection
+ title={m.oidc_role_mappings_title()}
+ description={m.oidc_role_mappings_description()}
+ variant="plain"
+ >
+ {#snippet actions()}
+ <ArcaneButton
+ action="create"
+ tone="outline"
+ size="sm"
+ onclick={openCreateMapping}
+ customLabel={m.common_create_button({ resource: m.resource_oidc_mapping_cap() })}
+ />
+ {/snippet}
+ {#if oidcMappings.length > 0}
+ <OidcMappingTable
+ mappings={oidcMappings}
+ roles={data.roles}
+ environments={data.environments}
+ onRefresh={refreshMappings}
+ onEdit={openEditMapping}
+ />
+ {:else}
+ <div class="rounded-xl border border-dashed border-border/60 p-6 text-center">
+ <p class="text-sm text-muted-foreground">{m.oidc_mappings_empty_body()}</p>
+ </div>
+ {/if}
+ </SettingsSection>
+ </IfPermitted>
+ {/if}
+
+ <SettingsSection title={m.security_session_heading()}>
+ <SettingsRow
+ for="authSessionTimeout"
+ label={m.security_session_timeout_label()}
+ description={m.security_session_timeout_description()}
+ error={formInputs.authSessionTimeout.error}
+ >
+ <Input
id="authSessionTimeout"
type="number"
- label={m.security_session_timeout_label()}
- description={m.security_session_timeout_description()}
bind:value={formInputs.authSessionTimeout.value}
- error={formInputs.authSessionTimeout.error}
+ aria-invalid={!!formInputs.authSessionTimeout.error}
/>
- </div>
- </div>
-
- <div class="space-y-4">
- <h3 class="text-base font-semibold">{m.security_password_policy_label()}</h3>
- <SettingsRow label={m.security_password_policy_label()} description={m.security_password_policy_description()}>
- <div class="grid grid-cols-1 gap-2 sm:grid-cols-3 sm:gap-3" role="group" aria-labelledby="passwordPolicyLabel">
- {@render passwordPolicyOption('basic', m.common_basic(), m.security_password_policy_basic_tooltip())}
- {@render passwordPolicyOption(
- 'standard',
- m.security_password_policy_standard(),
- m.security_password_policy_standard_tooltip()
- )}
- {@render passwordPolicyOption(
- 'strong',
- m.security_password_policy_strong(),
- m.security_password_policy_strong_tooltip()
- )}
- </div>
</SettingsRow>
- </div>
+ </SettingsSection>
+
+ <SettingsSection title={m.security_password_policy_label()} description={m.security_password_policy_description()}>
+ <div
+ class="grid grid-cols-1 gap-2 px-5 py-4 sm:grid-cols-3 sm:gap-3"
+ role="group"
+ aria-label={m.security_password_policy_label()}
+ >
+ {@render passwordPolicyOption('basic', m.common_basic(), m.security_password_policy_basic_tooltip())}
+ {@render passwordPolicyOption(
+ 'standard',
+ m.security_password_policy_standard(),
+ m.security_password_policy_standard_tooltip()
+ )}
+ {@render passwordPolicyOption(
+ 'strong',
+ m.security_password_policy_strong(),
+ m.security_password_policy_strong_tooltip()
+ )}
+ </div>
+ </SettingsSection>
</fieldset>
</Tabs.Content>
diff --git a/frontend/src/routes/(app)/settings/authentication/components/federated-credentials-tab.svelte b/frontend/src/routes/(app)/settings/authentication/components/federated-credentials-tab.svelte
index 91cc6a477..c0226b4f3 100644
--- a/frontend/src/routes/(app)/settings/authentication/components/federated-credentials-tab.svelte
+++ b/frontend/src/routes/(app)/settings/authentication/components/federated-credentials-tab.svelte
@@ -121,9 +121,9 @@ steps:
<IfPermitted perm="federated:list">
<div class="space-y-4">
<div class="flex items-start justify-between gap-4">
- <div>
- <h3 class="text-base font-semibold">{m.federated_credential_page_title()}</h3>
- <p class="mt-1 text-sm text-muted-foreground">{m.federated_credential_page_description()}</p>
+ <div class="px-1">
+ <h3 class="text-sm font-semibold">{m.federated_credential_page_title()}</h3>
+ <p class="text-xs text-muted-foreground">{m.federated_credential_page_description()}</p>
</div>
<IfPermitted adminOnly>
<ArcaneButton
diff --git a/frontend/src/routes/(app)/settings/backups/+page.svelte b/frontend/src/routes/(app)/settings/backups/+page.svelte
index 6a2fd0323..7ea8fd18f 100644
--- a/frontend/src/routes/(app)/settings/backups/+page.svelte
+++ b/frontend/src/routes/(app)/settings/backups/+page.svelte
@@ -10,6 +10,8 @@
import settingsStore from '#lib/stores/config-store.svelte.js';
import { SettingsPageLayout } from '#lib/layouts/index.js';
import type { ActionButton } from '#lib/components/action-button-group/types.js';
+ import { EmptyState } from '#lib/components/states/index.js';
+ import SettingsSection from '#lib/components/settings/settings-section.svelte';
import { AlertIcon, BackupIcon, CloudStorageIcon, InfoIcon, LockIcon, ResetIcon, UploadIcon } from '#lib/icons/index.js';
import { openConfirmDialog } from '#lib/components/confirm-dialog/index.js';
import * as Alert from '#lib/components/ui/alert/index.js';
@@ -589,6 +591,17 @@
]);
</script>
+{#snippet backupsEmptyState()}
+ <EmptyState
+ variant="plain"
+ icon={BackupIcon}
+ title={m.system_backups_empty_title()}
+ description={m.system_backups_empty_description()}
+ actionLabel={isReadOnly ? undefined : m.common_create()}
+ onAction={() => openAction('create')}
+ />
+{/snippet}
+
{#snippet recoveryKeySummary()}
{#if !policyCollection.recoveryKeyStored}
<div class="flex items-center justify-between gap-3 rounded-md border border-warning/40 bg-warning/5 px-3 py-2">
@@ -868,11 +881,10 @@
{actionButtons}
>
{#snippet mainContent()}
- <div class="space-y-4">
+ <div class="space-y-8">
{@render recoveryKeySummary()}
- <div class="space-y-2">
- <h2 class="text-lg font-semibold">{m.system_backups_schedules()}</h2>
+ <SettingsSection title={m.system_backups_schedules()} variant="plain">
{#if policyCollection.policies.length || systemVolumePolicyCollection.policies.length}
<div class="grid grid-cols-1 gap-1.5 text-xs text-muted-foreground sm:grid-cols-2 xl:grid-cols-3">
{#each policyCollection.policies as policy (policy.id)}
@@ -896,7 +908,7 @@
{:else}
<p class="text-sm text-muted-foreground">{m.system_backups_no_schedules()}</p>
{/if}
- </div>
+ </SettingsSection>
{#each backupActivity.activeIds as activityId (activityId)}
<Alert.Root
@@ -913,6 +925,7 @@
{/each}
<SystemBackupTable
+ emptyState={backupsEmptyState}
bind:backups
bind:requestOptions
onChanged={(options) => systemBackupService.listHistory(options)}
diff --git a/frontend/src/routes/(app)/settings/backups/components/system-backup-table.svelte b/frontend/src/routes/(app)/settings/backups/components/system-backup-table.svelte
index 808e19758..1746173bf 100644
--- a/frontend/src/routes/(app)/settings/backups/components/system-backup-table.svelte
+++ b/frontend/src/routes/(app)/settings/backups/components/system-backup-table.svelte
@@ -1,4 +1,5 @@
<script lang="ts">
+ import type { Snippet } from 'svelte';
import RemoveMenuItem from '#lib/components/arcane-table/cells/remove-menu-item.svelte';
import { backupRunColumns, backupRunMobileFields } from '#lib/components/arcane-table/backup-columns.js';
import ArcaneTable from '#lib/components/arcane-table/arcane-table.svelte';
@@ -33,7 +34,8 @@
onRestoreVolume,
onUpload,
onDelete,
- onOpenVolume
+ onOpenVolume,
+ emptyState
}: {
backups: Paginated<BackupHistoryEntry>;
requestOptions: SearchPaginationSortRequest;
@@ -44,6 +46,7 @@
onUpload: (backup: BackupHistoryEntry) => void;
onDelete: (backup: BackupHistoryEntry) => void;
onOpenVolume: (backup: BackupHistoryEntry) => void;
+ emptyState?: Snippet;
} = $props();
let mobileFieldVisibility = $state<Record<string, boolean>>({});
@@ -140,6 +143,7 @@
{/snippet}
<ArcaneTable
+ {emptyState}
persistKey="arcane-system-backups-table"
items={backups}
bind:requestOptions
diff --git a/frontend/src/routes/(app)/settings/backups/components/system-volume-scope-fields.svelte b/frontend/src/routes/(app)/settings/backups/components/system-volume-scope-fields.svelte
index cc654fd63..617253a2e 100644
--- a/frontend/src/routes/(app)/settings/backups/components/system-volume-scope-fields.svelte
+++ b/frontend/src/routes/(app)/settings/backups/components/system-volume-scope-fields.svelte
@@ -1,10 +1,11 @@
<script lang="ts">
- import LabeledSwitch from '#lib/components/form/labeled-switch.svelte';
import SelectWithLabel from '#lib/components/form/select-with-label.svelte';
import { Input } from '#lib/components/ui/input/index.js';
import { ScrollArea } from '#lib/components/ui/scroll-area/index.js';
import * as Checkbox from '#lib/components/ui/checkbox/index.js';
- import { Label } from '#lib/components/ui/label/index.js';
+ import SettingsRow from '#lib/components/settings/settings-row.svelte';
+ import SettingsSection from '#lib/components/settings/settings-section.svelte';
+ import { Switch } from '#lib/components/ui/switch/index.js';
import { Badge } from '#lib/components/ui/badge/index.js';
import { LoadingSpinnerIcon } from '#lib/icons/index.js';
import type { SystemVolumeBackupOption, SystemVolumeBackupSelectionMode } from '#lib/types/system-backup.js';
@@ -64,63 +65,74 @@
}
</script>
-<div class="space-y-5 border-t pt-5">
- <SelectWithLabel
- id={`${idPrefix}-selection-mode`}
- value={selectionMode}
- onValueChange={(value) => onChange({ selectionMode: value as SystemVolumeBackupSelectionMode })}
+<SettingsSection class="pt-2">
+ <SettingsRow
+ for={`${idPrefix}-selection-mode`}
label={m.system_volume_backups_selection_mode()}
description={m.system_volume_backups_selection_description()}
- options={selectionOptions}
- />
+ >
+ <SelectWithLabel
+ id={`${idPrefix}-selection-mode`}
+ hideLabel
+ value={selectionMode}
+ onValueChange={(value) => onChange({ selectionMode: value as SystemVolumeBackupSelectionMode })}
+ label={m.system_volume_backups_selection_mode()}
+ options={selectionOptions}
+ />
+ </SettingsRow>
{#if selectionMode !== 'all'}
- <div class="space-y-2">
- <div>
- <Label>
- {selectionMode === 'allowlist'
- ? m.system_volume_backups_included_volumes()
- : m.system_volume_backups_excluded_volumes()}
- </Label>
- <p class="mt-0.5 text-xs text-muted-foreground">
- {selectionMode === 'allowlist' ? m.system_volume_backups_allowlist_help() : m.system_volume_backups_blocklist_help()}
- </p>
+ <SettingsRow
+ label={selectionMode === 'allowlist'
+ ? m.system_volume_backups_included_volumes()
+ : m.system_volume_backups_excluded_volumes()}
+ description={selectionMode === 'allowlist'
+ ? m.system_volume_backups_allowlist_help()
+ : m.system_volume_backups_blocklist_help()}
+ layout="wide"
+ >
+ <div class="space-y-2">
+ <Input bind:value={search} placeholder={m.system_volume_backups_search_volumes()} />
+ <div class="h-56 overflow-hidden rounded-md border">
+ <ScrollArea class="h-full">
+ {#if loading}
+ <div class="flex h-24 items-center justify-center"><LoadingSpinnerIcon class="size-5 animate-spin" /></div>
+ {:else}
+ <div class="divide-y divide-border/50">
+ {#each filteredOptions as option (option.name)}
+ <label class="flex cursor-pointer items-center gap-3 px-3 py-2.5 hover:bg-muted/40">
+ <Checkbox.Root
+ checked={volumeNames.includes(option.name)}
+ onCheckedChange={(value) => toggleVolume(option.name, value === true)}
+ />
+ <span class="min-w-0 flex-1 truncate text-sm">{option.name}</span>
+ {#if option.anonymous}<Badge variant="amber" size="sm">{m.system_volume_backups_anonymous()}</Badge>{/if}
+ {#if !option.available}<Badge variant="gray" size="sm">{m.system_volume_backups_unavailable()}</Badge>{/if}
+ </label>
+ {/each}
+ {#if filteredOptions.length === 0}
+ <p class="px-3 py-8 text-center text-sm text-muted-foreground">
+ {m.system_volume_backups_no_matching_volumes()}
+ </p>
+ {/if}
+ </div>
+ {/if}
+ </ScrollArea>
+ </div>
</div>
- <Input bind:value={search} placeholder={m.system_volume_backups_search_volumes()} />
- <div class="h-56 overflow-hidden rounded-md border">
- <ScrollArea class="h-full">
- {#if loading}
- <div class="flex h-24 items-center justify-center"><LoadingSpinnerIcon class="size-5 animate-spin" /></div>
- {:else}
- <div class="divide-y divide-border/50">
- {#each filteredOptions as option (option.name)}
- <label class="flex cursor-pointer items-center gap-3 px-3 py-2.5 hover:bg-muted/40">
- <Checkbox.Root
- checked={volumeNames.includes(option.name)}
- onCheckedChange={(value) => toggleVolume(option.name, value === true)}
- />
- <span class="min-w-0 flex-1 truncate text-sm">{option.name}</span>
- {#if option.anonymous}<Badge variant="amber" size="sm">{m.system_volume_backups_anonymous()}</Badge>{/if}
- {#if !option.available}<Badge variant="gray" size="sm">{m.system_volume_backups_unavailable()}</Badge>{/if}
- </label>
- {/each}
- {#if filteredOptions.length === 0}
- <p class="px-3 py-8 text-center text-sm text-muted-foreground">
- {m.system_volume_backups_no_matching_volumes()}
- </p>
- {/if}
- </div>
- {/if}
- </ScrollArea>
- </div>
- </div>
+ </SettingsRow>
{/if}
- <LabeledSwitch
- id={`${idPrefix}-ignore-anonymous`}
- checked={ignoreAnonymous}
- onCheckedChange={(value) => onChange({ ignoreAnonymous: value })}
+ <SettingsRow
+ for={`${idPrefix}-ignore-anonymous`}
label={m.system_volume_backups_ignore_anonymous()}
description={m.system_volume_backups_ignore_anonymous_description()}
- />
-</div>
+ layout="switch"
+ >
+ <Switch
+ id={`${idPrefix}-ignore-anonymous`}
+ checked={ignoreAnonymous}
+ onCheckedChange={(value) => onChange({ ignoreAnonymous: value })}
+ />
+ </SettingsRow>
+</SettingsSection>
diff --git a/frontend/src/routes/(app)/settings/backups/s3/+page.svelte b/frontend/src/routes/(app)/settings/backups/s3/+page.svelte
index 0587f46d6..b3462e35e 100644
--- a/frontend/src/routes/(app)/settings/backups/s3/+page.svelte
+++ b/frontend/src/routes/(app)/settings/backups/s3/+page.svelte
@@ -5,7 +5,8 @@
import settingsStore from '#lib/stores/config-store.svelte.js';
import { SettingsPageLayout } from '#lib/layouts/index.js';
import type { ActionButton } from '#lib/components/action-button-group/types.js';
- import { RemoteEnvironmentIcon } from '#lib/icons/index.js';
+ import { CloudStorageIcon, RemoteEnvironmentIcon } from '#lib/icons/index.js';
+ import { EmptyState } from '#lib/components/states/index.js';
import { openConfirmDialog } from '#lib/components/confirm-dialog/index.js';
import { s3DestinationService } from '#lib/services/s3-destination-service.js';
import { discoverDestinationBackups } from '#lib/utils/backups.js';
@@ -102,6 +103,17 @@
]);
</script>
+{#snippet destinationsEmptyState()}
+ <EmptyState
+ variant="plain"
+ icon={CloudStorageIcon}
+ title={m.s3_destinations_empty_title()}
+ description={m.s3_destinations_empty_description()}
+ actionLabel={isReadOnly ? undefined : m.s3_destination_add()}
+ onAction={openCreate}
+ />
+{/snippet}
+
<SettingsPageLayout
title={m.s3_destinations_title()}
description={m.s3_destinations_description()}
@@ -112,6 +124,7 @@
>
{#snippet mainContent()}
<S3DestinationTable
+ emptyState={destinationsEmptyState}
bind:destinations
bind:requestOptions
onDestinationsChanged={(options) => s3DestinationService.list(options)}
diff --git a/frontend/src/routes/(app)/settings/backups/s3/components/s3-destination-table.svelte b/frontend/src/routes/(app)/settings/backups/s3/components/s3-destination-table.svelte
index 26975d220..931609d4e 100644
--- a/frontend/src/routes/(app)/settings/backups/s3/components/s3-destination-table.svelte
+++ b/frontend/src/routes/(app)/settings/backups/s3/components/s3-destination-table.svelte
@@ -1,4 +1,5 @@
<script lang="ts">
+ import type { Snippet } from 'svelte';
import { tryCatch } from '#lib/utils/try-catch.js';
import RemoveMenuItem from '#lib/components/arcane-table/cells/remove-menu-item.svelte';
@@ -22,13 +23,15 @@
requestOptions = $bindable(),
onDestinationsChanged,
onEdit,
- onDelete
+ onDelete,
+ emptyState
}: {
destinations: Paginated<S3Destination>;
requestOptions: SearchPaginationSortRequest;
onDestinationsChanged: (options: SearchPaginationSortRequest) => Promise<Paginated<S3Destination>>;
onEdit: (destination: S3Destination) => void;
onDelete: (destination: S3Destination) => void;
+ emptyState?: Snippet;
} = $props();
const columns = [
@@ -154,6 +157,7 @@
{/snippet}
<ArcaneTable
+ {emptyState}
persistKey="arcane-s3-destinations-table"
items={destinations}
bind:requestOptions
diff --git a/frontend/src/routes/(app)/settings/builds/+page.svelte b/frontend/src/routes/(app)/settings/builds/+page.svelte
index 27edbe251..8d6d1d719 100644
--- a/frontend/src/routes/(app)/settings/builds/+page.svelte
+++ b/frontend/src/routes/(app)/settings/builds/+page.svelte
@@ -3,7 +3,9 @@
import settingsStore from '#lib/stores/config-store.svelte.js';
import { SettingsPageLayout } from '#lib/layouts/index.js';
import { CodeIcon } from '#lib/icons/index.js';
- import TextInputWithLabel from '#lib/components/form/text-input-with-label.svelte';
+ import { Input } from '#lib/components/ui/input/index.js';
+ import SettingsRow from '#lib/components/settings/settings-row.svelte';
+ import SettingsSection from '#lib/components/settings/settings-section.svelte';
import SelectWithLabel from '#lib/components/form/select-with-label.svelte';
import { m } from '#lib/paraglide/messages.js';
import { createSettingsForm } from '#lib/utils/settings-form.js';
@@ -83,7 +85,7 @@
</script>
<SettingsPageLayout
- title={m.build()}
+ title={m.builds()}
description={m.build_settings_page_description()}
icon={CodeIcon}
pageType="form"
@@ -91,59 +93,73 @@
>
{#snippet mainContent()}
<fieldset disabled={isReadOnly} class="relative space-y-8">
- <div class="space-y-4">
- <h3 class="text-base font-semibold">{m.build_workspace()}</h3>
- <div class="max-w-xl">
- <TextInputWithLabel
- bind:value={formInputs.buildsDirectory.value}
- error={formInputs.buildsDirectory.error}
- label={m.build_settings_directory_label()}
- description={m.build_settings_directory_description()}
+ <SettingsSection title={m.build_workspace()}>
+ <SettingsRow
+ for="builds-directory"
+ label={m.build_settings_directory_label()}
+ description={m.build_settings_directory_description()}
+ helpText={m.build_settings_directory_help()}
+ error={formInputs.buildsDirectory.error}
+ >
+ <Input
+ id="builds-directory"
placeholder={m.build_settings_directory_placeholder()}
- helpText={m.build_settings_directory_help()}
+ bind:value={formInputs.buildsDirectory.value}
+ aria-invalid={!!formInputs.buildsDirectory.error}
/>
- </div>
- </div>
+ </SettingsRow>
+ </SettingsSection>
- <div class="space-y-4">
- <h3 class="text-base font-semibold">{m.build_provider()}</h3>
- <div class="grid gap-5 sm:grid-cols-2">
- <div>
- <SelectWithLabel
- id="build-provider"
- name="buildProvider"
- bind:value={
- () => resolvedProvider,
- (value) => {
- if (value === 'depot' && depotCredentialsPresent) formInputs.buildProvider.value = 'depot';
- else formInputs.buildProvider.value = 'local';
- }
+ <SettingsSection title={m.build_provider()}>
+ <SettingsRow
+ for="build-provider"
+ label={m.build_settings_default_provider_label()}
+ description={m.build_settings_default_provider_description()}
+ error={formInputs.buildProvider.error}
+ helpText={!depotCredentialsPresent && !depotConfigured ? m.build_settings_depot_enable_hint() : undefined}
+ >
+ <SelectWithLabel
+ id="build-provider"
+ name="buildProvider"
+ hideLabel
+ bind:value={
+ () => resolvedProvider,
+ (value) => {
+ if (value === 'depot' && depotCredentialsPresent) formInputs.buildProvider.value = 'depot';
+ else formInputs.buildProvider.value = 'local';
}
- error={formInputs.buildProvider.error}
- label={m.build_settings_default_provider_label()}
- description={m.build_settings_default_provider_description()}
- options={providerOptions}
- />
- {#if !depotCredentialsPresent && !depotConfigured}
- <p class="mt-2 text-xs text-muted-foreground">{m.build_settings_depot_enable_hint()}</p>
- {/if}
- </div>
- <TextInputWithLabel
- bind:value={formInputs.buildTimeout.value}
- error={formInputs.buildTimeout.error}
- label={m.build_settings_timeout_label()}
- description={m.build_settings_timeout_description()}
- placeholder={m.build_settings_timeout_placeholder()}
- helpText={m.build_settings_timeout_help()}
+ }
+ label={m.build_settings_default_provider_label()}
+ options={providerOptions}
+ />
+ </SettingsRow>
+ <SettingsRow
+ for="build-timeout"
+ label={m.build_settings_timeout_label()}
+ description={m.build_settings_timeout_description()}
+ helpText={m.build_settings_timeout_help()}
+ error={formInputs.buildTimeout.error}
+ >
+ <Input
+ id="build-timeout"
type="number"
+ placeholder={m.build_settings_timeout_placeholder()}
+ bind:value={formInputs.buildTimeout.value}
+ aria-invalid={!!formInputs.buildTimeout.error}
/>
- </div>
- </div>
+ </SettingsRow>
+ </SettingsSection>
- <div class="space-y-4">
- <h3 class="text-base font-semibold">{m.depot()}</h3>
- <div class="grid gap-5 sm:grid-cols-2">
- <TextInputWithLabel
+ <SettingsSection title={m.depot()}>
+ <SettingsRow
+ for="depot-project-id"
+ label={m.build_settings_depot_project_id_label()}
+ description={m.build_settings_depot_project_id_description()}
+ error={formInputs.depotProjectId.error}
+ >
+ <Input
+ id="depot-project-id"
+ placeholder={m.build_settings_depot_project_id_placeholder()}
bind:value={
() => formInputs.depotProjectId.value,
(value) => {
@@ -151,12 +167,20 @@
if (!depotCredentialsPresent) formInputs.buildProvider.value = 'local';
}
}
- error={formInputs.depotProjectId.error}
- label={m.build_settings_depot_project_id_label()}
- description={m.build_settings_depot_project_id_description()}
- placeholder={m.build_settings_depot_project_id_placeholder()}
+ aria-invalid={!!formInputs.depotProjectId.error}
/>
- <TextInputWithLabel
+ </SettingsRow>
+ <SettingsRow
+ for="depot-token"
+ label={m.build_settings_depot_token_label()}
+ description={m.build_settings_depot_token_description()}
+ helpText={m.build_settings_depot_token_help()}
+ error={formInputs.depotToken.error}
+ >
+ <Input
+ id="depot-token"
+ type="password"
+ placeholder={m.build_settings_depot_token_placeholder()}
bind:value={
() => formInputs.depotToken.value,
(value) => {
@@ -164,15 +188,10 @@
if (!depotCredentialsPresent) formInputs.buildProvider.value = 'local';
}
}
- error={formInputs.depotToken.error}
- label={m.build_settings_depot_token_label()}
- description={m.build_settings_depot_token_description()}
- placeholder={m.build_settings_depot_token_placeholder()}
- type="password"
- helpText={m.build_settings_depot_token_help()}
+ aria-invalid={!!formInputs.depotToken.error}
/>
- </div>
- </div>
+ </SettingsRow>
+ </SettingsSection>
</fieldset>
{/snippet}
</SettingsPageLayout>
diff --git a/frontend/src/routes/(app)/settings/diagnostics/+page.svelte b/frontend/src/routes/(app)/settings/diagnostics/+page.svelte
index b10bceabe..936d7f72f 100644
--- a/frontend/src/routes/(app)/settings/diagnostics/+page.svelte
+++ b/frontend/src/routes/(app)/settings/diagnostics/+page.svelte
@@ -338,10 +338,10 @@
{/snippet}
{#snippet sectionHeading(title: string, description?: string)}
- <div class="space-y-1">
- <h3 class="text-base font-semibold">{title}</h3>
+ <div class="space-y-0.5 px-1">
+ <h3 class="text-sm font-semibold">{title}</h3>
{#if description}
- <p class="text-sm text-muted-foreground">{description}</p>
+ <p class="text-xs text-muted-foreground">{description}</p>
{/if}
</div>
{/snippet}
diff --git a/frontend/src/routes/(app)/settings/notifications/+page.svelte b/frontend/src/routes/(app)/settings/notifications/+page.svelte
index 67e66beec..9b113310b 100644
--- a/frontend/src/routes/(app)/settings/notifications/+page.svelte
+++ b/frontend/src/routes/(app)/settings/notifications/+page.svelte
@@ -2,9 +2,9 @@
import { getSettingsFormContext, hasSettingsFormContext } from '#lib/hooks/settings-form-context.js';
import * as Tabs from '#lib/components/ui/tabs/index.js';
import * as Dialog from '#lib/components/ui/dialog/index.js';
- import * as Alert from '#lib/components/ui/alert/index.js';
import { Switch } from '#lib/components/ui/switch/index.js';
import SettingsRow from '#lib/components/settings/settings-row.svelte';
+ import SettingsSection from '#lib/components/settings/settings-section.svelte';
import { ArcaneButton } from '#lib/components/arcane-button/index.js';
import { toast } from 'svelte-sonner';
import { onDestroy, onMount } from 'svelte';
@@ -15,7 +15,7 @@
import { useUrlTab } from '#lib/hooks/use-url-tab.svelte.js';
import { notificationService } from '#lib/services/notification-service.js';
import { type NotificationProviderKey, NOTIFICATION_PROVIDER_KEYS } from '#lib/types/notifications.js';
- import { AlertIcon, NotificationsIcon } from '#lib/icons/index.js';
+ import { NotificationsIcon } from '#lib/icons/index.js';
import { settingsService } from '#lib/services/settings-service.js';
import type { Settings } from '#lib/types/settings.js';
import { hasPermission } from '#lib/utils/auth.js';
@@ -282,11 +282,13 @@
</Tabs.Content>
{/each}
<Tabs.Content value="mobile" class="mt-4">
- <div class="space-y-4">
+ <SettingsSection>
<SettingsRow
+ for="apnsEnabled"
label={m.notifications_mobile_push_label()}
description={m.notifications_mobile_push_description()}
- layout="inline"
+ warningText={m.notifications_mobile_push_external_warning()}
+ layout="switch"
>
<Switch
id="apnsEnabled"
@@ -296,8 +298,7 @@
/>
</SettingsRow>
{#if mobilePushEnabled}
- <div class="space-y-2">
- <p class="text-sm font-medium">{m.notifications_mobile_devices()}</p>
+ <SettingsRow label={m.notifications_mobile_devices()} layout="wide">
{#if mobileDevices.length === 0}
<p class="text-xs text-muted-foreground">{m.notifications_mobile_devices_empty()}</p>
{:else}
@@ -323,13 +324,9 @@
{/each}
</ul>
{/if}
- </div>
+ </SettingsRow>
{/if}
- <Alert.Root variant="warning" size="sm">
- <AlertIcon class="size-4" />
- <Alert.Description>{m.notifications_mobile_push_external_warning()}</Alert.Description>
- </Alert.Root>
- </div>
+ </SettingsSection>
</Tabs.Content>
</Tabs.Root>
</fieldset>
diff --git a/frontend/src/routes/(app)/settings/notifications/components/providers/DynamicProviderFormBuilder.svelte b/frontend/src/routes/(app)/settings/notifications/components/providers/DynamicProviderFormBuilder.svelte
index a40850e83..11212b92d 100644
--- a/frontend/src/routes/(app)/settings/notifications/components/providers/DynamicProviderFormBuilder.svelte
+++ b/frontend/src/routes/(app)/settings/notifications/components/providers/DynamicProviderFormBuilder.svelte
@@ -1,9 +1,9 @@
<script lang="ts" generics="T extends object">
- import { Label } from '#lib/components/ui/label/index.js';
+ import { Input } from '#lib/components/ui/input/index.js';
import Textarea from '#lib/components/ui/textarea/textarea.svelte';
+ import { Switch } from '#lib/components/ui/switch/index.js';
import SelectWithLabel from '#lib/components/form/select-with-label.svelte';
- import SwitchWithLabel from '#lib/components/form/labeled-switch.svelte';
- import TextInputWithLabel from '#lib/components/form/text-input-with-label.svelte';
+ import SettingsRow from '#lib/components/settings/settings-row.svelte';
import type {
ProviderFieldKey,
ProviderFormField,
@@ -83,22 +83,21 @@
{#snippet renderField(field: ProviderFormField<T>)}
{#if field.kind === 'input'}
- <TextInputWithLabel
- id={getFieldId(field)}
- value={getInputValue(field.key)}
- onChange={(value) => setInputValue(field, value)}
- {disabled}
- label={field.label}
- placeholder={field.placeholder ?? ''}
- type={field.inputType ?? 'text'}
- autocomplete={field.autocomplete ?? 'off'}
- helpText={field.helpText}
- error={getFieldError(field)}
- required={field.required ?? false}
- />
+ <SettingsRow for={getFieldId(field)} label={field.label} helpText={field.helpText} error={getFieldError(field)}>
+ <Input
+ id={getFieldId(field)}
+ value={getInputValue(field.key)}
+ oninput={(event) => setInputValue(field, (event.currentTarget as HTMLInputElement).value)}
+ {disabled}
+ placeholder={field.placeholder ?? ''}
+ type={field.inputType ?? 'text'}
+ autocomplete={field.autocomplete ?? 'off'}
+ required={field.required ?? false}
+ aria-invalid={!!getFieldError(field)}
+ />
+ </SettingsRow>
{:else if field.kind === 'textarea'}
- <div class="space-y-2">
- <Label for={getFieldId(field)}>{field.label}</Label>
+ <SettingsRow for={getFieldId(field)} label={field.label} helpText={field.helpText} error={getFieldError(field)} layout="wide">
<Textarea
id={getFieldId(field)}
value={getStringValue(field.key)}
@@ -107,71 +106,45 @@
autocomplete={field.autocomplete ?? 'off'}
placeholder={field.placeholder ?? ''}
rows={field.rows ?? 2}
+ aria-invalid={!!getFieldError(field)}
/>
- {#if getFieldError(field)}
- <p class="text-sm text-destructive">{getFieldError(field)}</p>
- {:else if field.helpText}
- <p class="text-sm text-muted-foreground">{field.helpText}</p>
- {/if}
- </div>
+ </SettingsRow>
{:else if field.kind === 'switch'}
- <SwitchWithLabel
- id={getFieldId(field)}
- checked={getBooleanValue(field.key)}
- onCheckedChange={(value) => setBooleanValue(field.key, value)}
- {disabled}
+ <SettingsRow
+ for={getFieldId(field)}
label={field.label}
description={field.description}
error={getFieldError(field)}
- />
- {:else if field.kind === 'select'}
- <SelectWithLabel
- id={getFieldId(field)}
- value={getStringValue(field.key)}
- onValueChange={(value) => setSelectValue(field, value)}
- {disabled}
- label={field.label}
- placeholder={field.placeholder}
- description={field.description}
- error={getFieldError(field)}
- options={field.options}
- />
- {:else if field.kind === 'native-select'}
- <div class="space-y-2">
- <Label for={getFieldId(field)}>{field.label}</Label>
- <select
+ layout="switch"
+ >
+ <Switch
id={getFieldId(field)}
+ checked={getBooleanValue(field.key)}
+ onCheckedChange={(value) => setBooleanValue(field.key, value)}
+ {disabled}
+ />
+ </SettingsRow>
+ {:else if field.kind === 'select' || field.kind === 'native-select'}
+ <SettingsRow for={getFieldId(field)} label={field.label} description={field.description} error={getFieldError(field)}>
+ <SelectWithLabel
+ id={getFieldId(field)}
+ hideLabel
value={getStringValue(field.key)}
- onchange={(event) => setSelectValue(field, (event.target as HTMLSelectElement).value)}
+ onValueChange={(value) => setSelectValue(field, value)}
{disabled}
- class="flex h-10 rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm"
- >
- {#each field.options as option (option.value)}
- <option value={option.value}>{option.label}</option>
- {/each}
- </select>
- {#if getFieldError(field)}
- <p class="text-sm text-destructive">{getFieldError(field)}</p>
- {:else if field.description}
- <p class="text-sm text-muted-foreground">{field.description}</p>
- {/if}
- </div>
+ label={field.label}
+ placeholder={field.kind === 'select' ? field.placeholder : undefined}
+ options={field.options.map((option) => ({ ...option, value: String(option.value) }))}
+ />
+ </SettingsRow>
{/if}
{/snippet}
{#each schema as node, index (`${index}-${node.kind}`)}
{#if node.kind === 'row'}
- <div class={node.className ?? 'grid grid-cols-2 gap-4'}>
- {#each node.fields as field, fieldIndex (`${fieldIndex}-${field.key}`)}
- <div class={field.wrapperClass ?? ''}>
- {@render renderField(field)}
- </div>
- {/each}
- </div>
- {:else if node.wrapperClass}
- <div class={node.wrapperClass}>
- {@render renderField(node)}
- </div>
+ {#each node.fields as field, fieldIndex (`${fieldIndex}-${field.key}`)}
+ {@render renderField(field)}
+ {/each}
{:else}
{@render renderField(node)}
{/if}
diff --git a/frontend/src/routes/(app)/settings/notifications/components/providers/EventSubscriptions.svelte b/frontend/src/routes/(app)/settings/notifications/components/providers/EventSubscriptions.svelte
index 39cd727b9..b43dd359d 100644
--- a/frontend/src/routes/(app)/settings/notifications/components/providers/EventSubscriptions.svelte
+++ b/frontend/src/routes/(app)/settings/notifications/components/providers/EventSubscriptions.svelte
@@ -1,6 +1,6 @@
<script lang="ts">
- import { Label } from '#lib/components/ui/label/index.js';
- import SwitchWithLabel from '#lib/components/form/labeled-switch.svelte';
+ import SettingsRow from '#lib/components/settings/settings-row.svelte';
+ import { Switch } from '#lib/components/ui/switch/index.js';
import { m } from '#lib/paraglide/messages.js';
interface Props {
@@ -24,44 +24,44 @@
}: Props = $props();
</script>
-<div class="space-y-3 pt-2">
- <Label>{m.notifications_events_title()}</Label>
- <p class="text-xs text-muted-foreground">{m.notifications_events_description()}</p>
- <div class="space-y-2">
- <SwitchWithLabel
- id="{providerId}-event-image-update"
- bind:checked={eventImageUpdate}
- {disabled}
- label={m.notifications_event_image_update_label()}
- description={m.notifications_event_image_update_description()}
- />
- <SwitchWithLabel
- id="{providerId}-event-container-update"
- bind:checked={eventContainerUpdate}
- {disabled}
- label={m.notifications_event_container_update_label()}
- description={m.notifications_event_container_update_description()}
- />
- <SwitchWithLabel
- id="{providerId}-event-prune-report"
- bind:checked={eventPruneReport}
- {disabled}
- label={m.notifications_event_prune_report_label()}
- description={m.notifications_event_prune_report_description()}
- />
- <SwitchWithLabel
- id="{providerId}-event-vulnerability-found"
- bind:checked={eventVulnerabilityFound}
- {disabled}
- label={m.notifications_event_vulnerability_found_label()}
- description={m.notifications_event_vulnerability_found_description()}
- />
- <SwitchWithLabel
- id="{providerId}-event-auto-heal"
- bind:checked={eventAutoHeal}
- {disabled}
- label={m.notifications_event_auto_heal_label()}
- description={m.notifications_event_auto_heal_description()}
- />
- </div>
-</div>
+<!-- Rendered inside the provider section, so each event is its own row. -->
+<SettingsRow
+ for="{providerId}-event-image-update"
+ label={m.notifications_event_image_update_label()}
+ description={m.notifications_event_image_update_description()}
+ layout="switch"
+>
+ <Switch id="{providerId}-event-image-update" bind:checked={eventImageUpdate} {disabled} />
+</SettingsRow>
+<SettingsRow
+ for="{providerId}-event-container-update"
+ label={m.notifications_event_container_update_label()}
+ description={m.notifications_event_container_update_description()}
+ layout="switch"
+>
+ <Switch id="{providerId}-event-container-update" bind:checked={eventContainerUpdate} {disabled} />
+</SettingsRow>
+<SettingsRow
+ for="{providerId}-event-prune-report"
+ label={m.notifications_event_prune_report_label()}
+ description={m.notifications_event_prune_report_description()}
+ layout="switch"
+>
+ <Switch id="{providerId}-event-prune-report" bind:checked={eventPruneReport} {disabled} />
+</SettingsRow>
+<SettingsRow
+ for="{providerId}-event-vulnerability-found"
+ label={m.notifications_event_vulnerability_found_label()}
+ description={m.notifications_event_vulnerability_found_description()}
+ layout="switch"
+>
+ <Switch id="{providerId}-event-vulnerability-found" bind:checked={eventVulnerabilityFound} {disabled} />
+</SettingsRow>
+<SettingsRow
+ for="{providerId}-event-auto-heal"
+ label={m.notifications_event_auto_heal_label()}
+ description={m.notifications_event_auto_heal_description()}
+ layout="switch"
+>
+ <Switch id="{providerId}-event-auto-heal" bind:checked={eventAutoHeal} {disabled} />
+</SettingsRow>
diff --git a/frontend/src/routes/(app)/settings/notifications/components/providers/NotificationProviderTestMenu.svelte b/frontend/src/routes/(app)/settings/notifications/components/providers/NotificationProviderTestMenu.svelte
index 79d6bd45f..0510cab03 100644
--- a/frontend/src/routes/(app)/settings/notifications/components/providers/NotificationProviderTestMenu.svelte
+++ b/frontend/src/routes/(app)/settings/notifications/components/providers/NotificationProviderTestMenu.svelte
@@ -34,7 +34,7 @@
</script>
{#if onTest}
- <div class="pt-2">
+ <div class="flex justify-end px-5 py-4">
<DropdownMenu.Root>
<DropdownMenu.Trigger>
<ArcaneButton
diff --git a/frontend/src/routes/(app)/settings/notifications/components/providers/ProviderFormWrapper.svelte b/frontend/src/routes/(app)/settings/notifications/components/providers/ProviderFormWrapper.svelte
index 79afc3bb0..f8f7894c4 100644
--- a/frontend/src/routes/(app)/settings/notifications/components/providers/ProviderFormWrapper.svelte
+++ b/frontend/src/routes/(app)/settings/notifications/components/providers/ProviderFormWrapper.svelte
@@ -1,5 +1,6 @@
<script lang="ts">
import SettingsRow from '#lib/components/settings/settings-row.svelte';
+ import SettingsSection from '#lib/components/settings/settings-section.svelte';
import { Switch } from '#lib/components/ui/switch/index.js';
interface Props {
@@ -14,14 +15,12 @@
let { id, title, description, enabled = $bindable(), disabled = false, children }: Props = $props();
</script>
-<div class="space-y-4">
- <SettingsRow label={title} {description} layout="inline">
+<!-- The tab bar names the provider, so the enable row carries the title. -->
+<SettingsSection>
+ <SettingsRow for="{id}-enabled" label={title} {description} layout="switch">
<Switch id="{id}-enabled" bind:checked={enabled} {disabled} />
</SettingsRow>
-
{#if enabled && children}
- <div class="space-y-4 border-l-2 border-border/60 pl-5">
- {@render children()}
- </div>
+ {@render children()}
{/if}
-</div>
+</SettingsSection>
diff --git a/frontend/src/routes/(app)/settings/notifications/components/providers/TelegramDestinationsEditor.svelte b/frontend/src/routes/(app)/settings/notifications/components/providers/TelegramDestinationsEditor.svelte
index ba1394e33..7825144de 100644
--- a/frontend/src/routes/(app)/settings/notifications/components/providers/TelegramDestinationsEditor.svelte
+++ b/frontend/src/routes/(app)/settings/notifications/components/providers/TelegramDestinationsEditor.svelte
@@ -1,7 +1,7 @@
<script lang="ts">
import { ArcaneButton } from '#lib/components/arcane-button/index.js';
import TextInputWithLabel from '#lib/components/form/text-input-with-label.svelte';
- import { Label } from '#lib/components/ui/label/index.js';
+ import SettingsRow from '#lib/components/settings/settings-row.svelte';
import { m } from '#lib/paraglide/messages.js';
import { AddIcon, CloseIcon } from '#lib/icons/index.js';
import type { TelegramDestination } from '#lib/types/notifications.js';
@@ -25,11 +25,12 @@
}
</script>
-<div class="space-y-3">
- <div>
- <Label>{m.notifications_telegram_destinations_label()}</Label>
- <p class="text-sm text-muted-foreground">{m.notifications_telegram_destinations_help()}</p>
- </div>
+<SettingsRow
+ label={m.notifications_telegram_destinations_label()}
+ description={m.notifications_telegram_destinations_help()}
+ error={errors['destinations']}
+ layout="wide"
+>
{#each destinations as destination, index (destination)}
<div class="flex flex-col gap-2 sm:flex-row sm:items-start sm:gap-3">
<div class="flex-1">
@@ -66,9 +67,6 @@
/>
</div>
{/each}
- {#if errors['destinations']}
- <p class="text-sm text-destructive">{errors['destinations']}</p>
- {/if}
<ArcaneButton
action="base"
tone="outline"
@@ -79,4 +77,4 @@
icon={AddIcon}
customLabel={m.notifications_telegram_add_destination()}
/>
-</div>
+</SettingsRow>
diff --git a/frontend/src/routes/(app)/settings/timeouts/+page.svelte b/frontend/src/routes/(app)/settings/timeouts/+page.svelte
index ae7422755..9b1a759a6 100644
--- a/frontend/src/routes/(app)/settings/timeouts/+page.svelte
+++ b/frontend/src/routes/(app)/settings/timeouts/+page.svelte
@@ -4,7 +4,9 @@
import { m } from '#lib/paraglide/messages.js';
import { SettingsPageLayout } from '#lib/layouts/index.js';
import { ClockIcon } from '#lib/icons/index.js';
- import TextInputWithLabel from '#lib/components/form/text-input-with-label.svelte';
+ import { Input } from '#lib/components/ui/input/index.js';
+ import SettingsRow from '#lib/components/settings/settings-row.svelte';
+ import SettingsSection from '#lib/components/settings/settings-section.svelte';
import { createSettingsForm } from '#lib/utils/settings-form.js';
let { data } = $props();
@@ -55,107 +57,147 @@
>
{#snippet mainContent()}
<fieldset disabled={isReadOnly} class="relative space-y-8">
- <!-- Docker Operations -->
- <div class="space-y-4">
- <h3 class="text-base font-semibold">{m.timeouts_docker_operations()}</h3>
- <div class="grid gap-5 sm:grid-cols-2 lg:grid-cols-3">
- <TextInputWithLabel
- bind:value={formInputs.dockerApiTimeout.value}
- error={formInputs.dockerApiTimeout.error}
- label={m.docker_api_timeout()}
- description={m.docker_api_timeout_description()}
- placeholder="30"
- helpText="Timeout in seconds (1-3600)"
+ <SettingsSection title={m.timeouts_docker_operations()}>
+ <SettingsRow
+ for="docker-api-timeout"
+ label={m.docker_api_timeout()}
+ description={m.docker_api_timeout_description()}
+ helpText={m.timeouts_seconds_help({ range: '1-3600' })}
+ error={formInputs.dockerApiTimeout.error}
+ >
+ <Input
+ id="docker-api-timeout"
type="number"
+ placeholder="30"
+ bind:value={formInputs.dockerApiTimeout.value}
+ aria-invalid={!!formInputs.dockerApiTimeout.error}
/>
- <TextInputWithLabel
- bind:value={formInputs.dockerImagePullTimeout.value}
- error={formInputs.dockerImagePullTimeout.error}
- label={m.docker_image_pull_timeout()}
- description={m.docker_image_pull_timeout_description()}
- placeholder="600"
- helpText="Timeout in seconds (30-7200)"
+ </SettingsRow>
+ <SettingsRow
+ for="docker-image-pull-timeout"
+ label={m.docker_image_pull_timeout()}
+ description={m.docker_image_pull_timeout_description()}
+ helpText={m.timeouts_seconds_help({ range: '30-7200' })}
+ error={formInputs.dockerImagePullTimeout.error}
+ >
+ <Input
+ id="docker-image-pull-timeout"
type="number"
- />
- <TextInputWithLabel
- bind:value={formInputs.deployWaitTimeout.value}
- error={formInputs.deployWaitTimeout.error}
- label={m.deploy_wait_timeout()}
- description={m.deploy_wait_timeout_description()}
placeholder="600"
- helpText="Timeout in seconds (30-14400)"
- type="number"
+ bind:value={formInputs.dockerImagePullTimeout.value}
+ aria-invalid={!!formInputs.dockerImagePullTimeout.error}
/>
- <TextInputWithLabel
- bind:value={formInputs.trivyScanTimeout.value}
- error={formInputs.trivyScanTimeout.error}
- label={m.trivy_scan_timeout()}
- description={m.trivy_scan_timeout_description()}
- placeholder="900"
- helpText="Timeout in seconds (60-14400)"
+ </SettingsRow>
+ <SettingsRow
+ for="deploy-wait-timeout"
+ label={m.deploy_wait_timeout()}
+ description={m.deploy_wait_timeout_description()}
+ helpText={m.timeouts_seconds_help({ range: '30-14400' })}
+ error={formInputs.deployWaitTimeout.error}
+ >
+ <Input
+ id="deploy-wait-timeout"
type="number"
+ placeholder="600"
+ bind:value={formInputs.deployWaitTimeout.value}
+ aria-invalid={!!formInputs.deployWaitTimeout.error}
/>
- </div>
- </div>
-
- <!-- Git Operations -->
- <div class="space-y-4">
- <h3 class="text-base font-semibold">{m.timeouts_git_operations()}</h3>
- <div class="grid gap-5 sm:grid-cols-2 lg:grid-cols-3">
- <TextInputWithLabel
- bind:value={formInputs.gitOperationTimeout.value}
- error={formInputs.gitOperationTimeout.error}
- label={m.git_operation_timeout()}
- description={m.git_operation_timeout_description()}
- placeholder="300"
- helpText="Timeout in seconds (30-3600)"
+ </SettingsRow>
+ <SettingsRow
+ for="trivy-scan-timeout"
+ label={m.trivy_scan_timeout()}
+ description={m.trivy_scan_timeout_description()}
+ helpText={m.timeouts_seconds_help({ range: '60-14400' })}
+ error={formInputs.trivyScanTimeout.error}
+ >
+ <Input
+ id="trivy-scan-timeout"
type="number"
+ placeholder="900"
+ bind:value={formInputs.trivyScanTimeout.value}
+ aria-invalid={!!formInputs.trivyScanTimeout.error}
/>
- </div>
- </div>
-
- <!-- Network Operations -->
- <div class="space-y-4">
- <h3 class="text-base font-semibold">{m.timeouts_network_operations()}</h3>
- <div class="grid gap-5 sm:grid-cols-2 lg:grid-cols-3">
- <TextInputWithLabel
- bind:value={formInputs.httpClientTimeout.value}
- error={formInputs.httpClientTimeout.error}
- label={m.http_client_timeout()}
- description={m.http_client_timeout_description()}
- placeholder="30"
- helpText="Timeout in seconds (5-300)"
+ </SettingsRow>
+ </SettingsSection>
+ <SettingsSection title={m.timeouts_git_operations()}>
+ <SettingsRow
+ for="git-operation-timeout"
+ label={m.git_operation_timeout()}
+ description={m.git_operation_timeout_description()}
+ helpText={m.timeouts_seconds_help({ range: '30-3600' })}
+ error={formInputs.gitOperationTimeout.error}
+ >
+ <Input
+ id="git-operation-timeout"
type="number"
+ placeholder="300"
+ bind:value={formInputs.gitOperationTimeout.value}
+ aria-invalid={!!formInputs.gitOperationTimeout.error}
/>
- <TextInputWithLabel
- bind:value={formInputs.registryTimeout.value}
- error={formInputs.registryTimeout.error}
- label={m.registry_timeout()}
- description={m.registry_timeout_description()}
+ </SettingsRow>
+ </SettingsSection>
+ <SettingsSection title={m.timeouts_network_operations()}>
+ <SettingsRow
+ for="http-client-timeout"
+ label={m.http_client_timeout()}
+ description={m.http_client_timeout_description()}
+ helpText={m.timeouts_seconds_help({ range: '5-300' })}
+ error={formInputs.httpClientTimeout.error}
+ >
+ <Input
+ id="http-client-timeout"
+ type="number"
placeholder="30"
- helpText="Timeout in seconds (5-300)"
+ bind:value={formInputs.httpClientTimeout.value}
+ aria-invalid={!!formInputs.httpClientTimeout.error}
+ />
+ </SettingsRow>
+ <SettingsRow
+ for="registry-timeout"
+ label={m.registry_timeout()}
+ description={m.registry_timeout_description()}
+ helpText={m.timeouts_seconds_help({ range: '5-300' })}
+ error={formInputs.registryTimeout.error}
+ >
+ <Input
+ id="registry-timeout"
type="number"
+ placeholder="30"
+ bind:value={formInputs.registryTimeout.value}
+ aria-invalid={!!formInputs.registryTimeout.error}
/>
- <TextInputWithLabel
- bind:value={formInputs.registryTagTimeout.value}
- error={formInputs.registryTagTimeout.error}
- label={m.registry_tag_timeout()}
- description={m.registry_tag_timeout_description()}
- placeholder="120"
- helpText="Timeout in seconds (5-3600)"
+ </SettingsRow>
+ <SettingsRow
+ for="registry-tag-timeout"
+ label={m.registry_tag_timeout()}
+ description={m.registry_tag_timeout_description()}
+ helpText={m.timeouts_seconds_help({ range: '5-3600' })}
+ error={formInputs.registryTagTimeout.error}
+ >
+ <Input
+ id="registry-tag-timeout"
type="number"
+ placeholder="120"
+ bind:value={formInputs.registryTagTimeout.value}
+ aria-invalid={!!formInputs.registryTagTimeout.error}
/>
- <TextInputWithLabel
- bind:value={formInputs.proxyRequestTimeout.value}
- error={formInputs.proxyRequestTimeout.error}
- label={m.proxy_request_timeout()}
- description={m.proxy_request_timeout_description()}
- placeholder="60"
- helpText="Timeout in seconds (10-600)"
+ </SettingsRow>
+ <SettingsRow
+ for="proxy-request-timeout"
+ label={m.proxy_request_timeout()}
+ description={m.proxy_request_timeout_description()}
+ helpText={m.timeouts_seconds_help({ range: '10-600' })}
+ error={formInputs.proxyRequestTimeout.error}
+ >
+ <Input
+ id="proxy-request-timeout"
type="number"
+ placeholder="60"
+ bind:value={formInputs.proxyRequestTimeout.value}
+ aria-invalid={!!formInputs.proxyRequestTimeout.error}
/>
- </div>
- </div>
+ </SettingsRow>
+ </SettingsSection>
</fieldset>
{/snippet}
</SettingsPageLayout>
diff --git a/frontend/src/routes/(app)/settings/users/+page.svelte b/frontend/src/routes/(app)/settings/users/+page.svelte
index 802bf36d4..8f21aff57 100644
--- a/frontend/src/routes/(app)/settings/users/+page.svelte
+++ b/frontend/src/routes/(app)/settings/users/+page.svelte
@@ -18,6 +18,7 @@
import { SettingsPageLayout } from '#lib/layouts/index.js';
import type { ActionButton } from '#lib/components/action-button-group/types.js';
import SettingsRow from '#lib/components/settings/settings-row.svelte';
+ import SettingsSection from '#lib/components/settings/settings-section.svelte';
import { Switch } from '#lib/components/ui/switch/index.js';
import { Input } from '#lib/components/ui/input/index.js';
@@ -235,11 +236,12 @@
{actionButtons}
>
{#snippet mainContent()}
- <div class="mb-6 divide-y divide-border/40 border-b border-border/50 pb-6 [&>*]:py-5 [&>*:first-child]:pt-0">
+ <SettingsSection title={m.settings_section_avatars()} description={m.settings_section_avatars_description()} class="mb-8">
<SettingsRow
+ for="enableGravatar"
label={m.general_enable_gravatar_label()}
description={m.general_enable_gravatar_description()}
- layout="inline"
+ layout="switch"
>
<Switch
id="enableGravatar"
@@ -248,31 +250,26 @@
onCheckedChange={(checked) => void saveAvatarSettings({ enableGravatar: checked })}
/>
</SettingsRow>
-
<SettingsRow
+ for="avatarMaxUploadSizeMb"
label={m.general_avatar_upload_size_label()}
description={m.general_avatar_upload_size_description()}
helpText={m.general_avatar_upload_size_help()}
- layout="inline"
+ error={avatarSizeError}
>
- <div class="flex w-24 flex-col gap-1">
- <Input
- id="avatarMaxUploadSizeMb"
- type="number"
- min="1"
- max="50"
- bind:value={avatarSizeInput}
- placeholder="2"
- disabled={isReadOnly}
- aria-invalid={Boolean(avatarSizeError)}
- onblur={handleAvatarSizeCommit}
- />
- {#if avatarSizeError}
- <p class="text-xs font-medium text-destructive">{avatarSizeError}</p>
- {/if}
- </div>
+ <Input
+ id="avatarMaxUploadSizeMb"
+ type="number"
+ min="1"
+ max="50"
+ bind:value={avatarSizeInput}
+ placeholder="2"
+ disabled={isReadOnly}
+ aria-invalid={Boolean(avatarSizeError)}
+ onblur={handleAvatarSizeCommit}
+ />
</SettingsRow>
- </div>
+ </SettingsSection>
<UserTable
bind:users
diff --git a/frontend/src/routes/(app)/volumes/components/volume-table.svelte b/frontend/src/routes/(app)/volumes/components/volume-table.svelte
index b8ea06011..72fe02904 100644
--- a/frontend/src/routes/(app)/volumes/components/volume-table.svelte
+++ b/frontend/src/routes/(app)/volumes/components/volume-table.svelte
@@ -285,9 +285,13 @@
{:else if item.size > 0}
<span class="text-sm tabular-nums">{bytes.format(item.size)}</span>
{:else if sizesEnabled && sizesQuery.isError}
- <span class="text-sm text-muted-foreground" title={extractApiErrorMessage(sizesQuery.error)}>{m.common_unavailable()}</span>
+ <span
+ class="text-sm text-muted-foreground"
+ title={m.volumes_size_calculation_failed({ error: extractApiErrorMessage(sizesQuery.error) })}
+ >{m.common_unavailable()}</span
+ >
{:else}
- <span class="text-sm text-muted-foreground">-</span>
+ <span class="text-sm text-muted-foreground" title={sizesEnabled ? m.volumes_size_not_reported() : undefined}>-</span>
{/if}
{/snippet}
diff --git a/frontend/src/routes/(auth)/login/+page.svelte b/frontend/src/routes/(auth)/login/[[mode]]/+page.svelte
similarity index 98%
rename from frontend/src/routes/(auth)/login/+page.svelte
rename to frontend/src/routes/(auth)/login/[[mode]]/+page.svelte
index 10518c6ff..45e8499f4 100644
--- a/frontend/src/routes/(auth)/login/+page.svelte
+++ b/frontend/src/routes/(auth)/login/[[mode]]/+page.svelte
@@ -24,7 +24,7 @@
import { ArcaneButton } from '#lib/components/arcane-button/index.js';
import AuthAmbient from '#lib/components/auth/auth-ambient.svelte';
import MFAChallenge from '#lib/components/auth/mfa-challenge.svelte';
- import { onMount } from 'svelte';
+ import { onMount, untrack } from 'svelte';
import { createMutation, useQueryClient } from '@tanstack/svelte-query';
let { data }: PageProps = $props();
@@ -48,6 +48,7 @@
const showLocalLoginForm = $derived(localAuthEnabledBySettings);
const oidcAutoRedirect = $derived(data.settings?.oidcAutoRedirectToProvider === true);
+ const shouldAutoRedirect = $derived(oidcAutoRedirect && oidcEnabledBySettings && !data.error && !data.isBackupLogin);
const oidcProviderName = $derived(data.settings?.oidcProviderName || '');
const oidcProviderLogoUrl = $derived(data.settings?.oidcProviderLogoUrl || '');
@@ -117,8 +118,11 @@
onMount(() => {
passkeySupported = browserSupportsWebAuthn();
- if (oidcAutoRedirect && oidcEnabledBySettings && !data.error) {
- oidcLoginMutation.mutate();
+ });
+
+ $effect(() => {
+ if (shouldAutoRedirect) {
+ untrack(handleOidcLogin);
}
});
diff --git a/frontend/src/routes/(auth)/login/+page.ts b/frontend/src/routes/(auth)/login/[[mode]]/+page.ts
similarity index 83%
rename from frontend/src/routes/(auth)/login/+page.ts
rename to frontend/src/routes/(auth)/login/[[mode]]/+page.ts
index fd1f5d8c3..49d3c908d 100644
--- a/frontend/src/routes/(auth)/login/+page.ts
+++ b/frontend/src/routes/(auth)/login/[[mode]]/+page.ts
@@ -1,10 +1,15 @@
import { tryCatch } from '#lib/utils/try-catch.js';
-import { redirect } from '@sveltejs/kit';
+import { error as httpError, redirect } from '@sveltejs/kit';
import { browser } from '$app/env';
import { getEffectiveLandingPage } from '#lib/utils/navigation.js';
import { passkeyService } from '#lib/services/passkey-service.js';
+import type { PageLoad } from './$types';
+
+export const load: PageLoad = async ({ parent, url, params }) => {
+ if (params.mode !== undefined && params.mode !== 'backup') {
+ httpError(404);
+ }
-export const load = async ({ parent, url }) => {
const data = await parent();
// Only an explicit `redirect` param produces a target here. The account-level
@@ -32,6 +37,7 @@ export const load = async ({ parent, url }) => {
storedErrorMessage;
return {
+ isBackupLogin: params.mode === 'backup',
passkeyLoginAvailable: passkeyAvailability?.available === true,
settings: data.settings,
redirectTo,
diff --git a/frontend/src/routes/+layout.svelte b/frontend/src/routes/+layout.svelte
index 4013a3ea7..9d9117ea2 100644
--- a/frontend/src/routes/+layout.svelte
+++ b/frontend/src/routes/+layout.svelte
@@ -12,6 +12,7 @@
import { IsMobile } from '#lib/hooks/is-mobile.svelte.js';
import { IsTablet } from '#lib/hooks/is-tablet.svelte.js';
import { m } from '#lib/paraglide/messages.js';
+ import { getNavigationTitleForPath } from '#lib/config/navigation-config.js';
import { environmentStore } from '#lib/stores/environment.store.svelte.js';
import settingsStore from '#lib/stores/config-store.svelte.js';
import { cn } from '#lib/utils.js';
@@ -58,12 +59,36 @@
refreshAll();
}
+ const resourceName = $derived.by((): string | undefined => {
+ switch (page.route.id) {
+ case '/(app)/projects/[projectId]':
+ return page.data['project']?.name;
+ case '/(app)/containers/[containerId]':
+ return page.data['container']?.name?.replace(/^\/+/, '');
+ case '/(app)/volumes/[volumeName]':
+ return page.params['volumeName'];
+ case '/(app)/networks/[networkId]':
+ return page.data['network']?.name;
+ case '/(app)/images/[imageId]':
+ return page.data['image']?.repo;
+ default:
+ return undefined;
+ }
+ });
+
+ // Root layout owns the document title; nested <title> tags are never restored on unmount.
const pageTitle = $derived(
- environmentStore.selected ? `${m.layout_title()} | ${environmentStore.selected.name}` : m.layout_title()
+ [m.layout_title(), getNavigationTitleForPath(page.url.pathname), resourceName, environmentStore.selected?.name]
+ .filter(Boolean)
+ .join(' | ')
);
</script>
-<svelte:head><title>{pageTitle}</title></svelte:head>
+<svelte:head>
+ {#if !isAuthPage}
+ <title>{pageTitle}</title>
+ {/if}
+</svelte:head>
<QueryClientProvider client={data.queryClient}>
<div class={cn('flex min-h-dvh flex-col', 'bg-transparent')}>
diff --git a/frontend/src/routes/layout.css b/frontend/src/routes/layout.css
index d2464a581..298b9de3e 100644
--- a/frontend/src/routes/layout.css
+++ b/frontend/src/routes/layout.css
@@ -265,6 +265,7 @@ html.reduce-effects *::after {
--shadow-button-hover: var(--button-shadow-hover);
--grid-template-columns-content-action: minmax(0, 1fr) auto;
+ --grid-template-columns-settings-row: minmax(0, 1fr) minmax(16rem, 22rem);
--grid-template-columns-content-actions: minmax(0, 1fr) auto auto;
--grid-template-columns-index-content-action: 1.25rem minmax(0, 1fr) auto;
--grid-template-columns-icon-content-action: auto minmax(0, 1fr) auto;
diff --git a/tests/spec/backups.spec.ts b/tests/spec/backups.spec.ts
index e4ee7e41b..dceaa9f22 100644
--- a/tests/spec/backups.spec.ts
+++ b/tests/spec/backups.spec.ts
@@ -1092,7 +1092,7 @@ test.describe('S3 storage', () => {
try {
await page.goto('/settings/backups/s3');
- await page.getByRole('button', { name: 'Add destination', exact: true }).click();
+ await page.getByRole('button', { name: 'Add destination', exact: true }).first().click();
let dialog = page.getByRole('dialog');
await expect(dialog.getByRole('heading', { name: 'Add S3 destination' })).toBeVisible();
@@ -1541,7 +1541,7 @@ test.describe('System and volume restore', () => {
await expect(dialog).toBeHidden();
expect(mock.savedCollection().policies[0]?.volumeNames).toEqual([unavailableName, liveName]);
- await page.getByRole('button', { name: 'Create', exact: true }).click();
+ await page.getByRole('button', { name: 'Create', exact: true }).first().click();
await page.getByRole('menuitem', { name: 'Schedule' }).click();
const createSchedule = page.getByRole('dialog', { name: 'Create schedule' });
await createSchedule.getByLabel('Backup type').click();
@@ -1552,7 +1552,7 @@ test.describe('System and volume restore', () => {
expect(mock.savedCollection().policies).toHaveLength(2);
await expect(page.getByText('Volume', { exact: true })).toHaveCount(2);
- await page.getByRole('button', { name: 'Create', exact: true }).click();
+ await page.getByRole('button', { name: 'Create', exact: true }).first().click();
await page.getByRole('menuitem', { name: 'Backup' }).click();
const createBackup = page.getByRole('dialog', { name: 'Create Backup' });
const runningBackup = page.getByRole('alert').filter({ hasText: 'Backup in progress' });
@@ -1564,7 +1564,7 @@ test.describe('System and volume restore', () => {
await expect(createBackup).toBeHidden();
await expect(page.getByText('Backup started', { exact: true })).toBeVisible();
await expect(runningBackup).toBeVisible();
- await page.getByRole('button', { name: 'Create', exact: true }).click();
+ await page.getByRole('button', { name: 'Create', exact: true }).first().click();
await expect(page.getByRole('menuitem', { name: 'Backup', exact: true })).toBeDisabled();
await page.keyboard.press('Escape');
await page.reload();
@@ -1576,7 +1576,7 @@ test.describe('System and volume restore', () => {
await expect(page.getByRole('table').getByText('completed-batch-volume')).toBeVisible();
expect(mock.runRequests()).toContainEqual({ policyId: 'volume-nightly' });
- await page.getByRole('button', { name: 'Create', exact: true }).click();
+ await page.getByRole('button', { name: 'Create', exact: true }).first().click();
await page.getByRole('menuitem', { name: 'Backup' }).click();
const customBackup = page.getByRole('dialog', { name: 'Create Backup' });
await customBackup.getByLabel('Backup type').click();
diff --git a/tests/spec/customize.spec.ts b/tests/spec/customize.spec.ts
index ebca3d666..55cb64c66 100644
--- a/tests/spec/customize.spec.ts
+++ b/tests/spec/customize.spec.ts
@@ -485,7 +485,7 @@ test.describe('Registries', () => {
});
test('should open Add Registry dialog and validate required fields', async ({ page }) => {
- await page.getByRole('button', { name: 'Add Registry' }).click();
+ await page.getByRole('button', { name: 'Add Registry' }).first().click();
const dialog = page.getByRole('dialog');
await expect(dialog).toBeVisible();
@@ -527,7 +527,7 @@ test.describe('Registries', () => {
test('should create, test, edit, and delete a registry', async ({ page }) => {
// Create
- await page.getByRole('button', { name: 'Add Registry' }).click();
+ await page.getByRole('button', { name: 'Add Registry' }).first().click();
const dialog = page.getByRole('dialog');
await waitForDialogReady(dialog);
diff --git a/tests/spec/environments.spec.ts b/tests/spec/environments.spec.ts
index b83a10b18..b0caf2cda 100644
--- a/tests/spec/environments.spec.ts
+++ b/tests/spec/environments.spec.ts
@@ -453,7 +453,7 @@ test.describe('Settings', () => {
await page.locator('#api-url').press('Tab');
await expect(tokenInput).toHaveValue('');
await tokenInput.fill(apiKey);
- await page.getByRole('button', { name: 'Back to Environments', exact: true }).click();
+ await page.getByRole('link', { name: 'Back', exact: true }).first().click();
await expect(page).toHaveURL(/\/environments$/);
await expect(page.getByRole('heading', { name: 'Environments', exact: true })).toBeVisible();
await page.getByRole('button', { name: envName, exact: true }).click();
diff --git a/tests/spec/projects.spec.ts b/tests/spec/projects.spec.ts
index 8beb996e4..6ed4d4b6b 100644
--- a/tests/spec/projects.spec.ts
+++ b/tests/spec/projects.spec.ts
@@ -69,12 +69,13 @@ async function fetchProjectDetail(page: Page, projectId: string): Promise<Projec
async function fetchLatestProjectDeployActivity(
page: Page,
- projectId: string
+ projectId: string,
+ projectName: string
): Promise<Activity | null> {
const params = new URLSearchParams({
type: 'project_deploy',
resourceType: 'project',
- search: projectId,
+ search: projectName,
limit: '10'
});
const activities = await readApiData<Activity[]>(
@@ -87,15 +88,20 @@ async function fetchLatestProjectDeployActivity(
(activity) =>
activity.type === 'project_deploy' &&
activity.resourceType === 'project' &&
- (activity.resourceId === projectId || activity.resourceName === projectId)
+ activity.resourceId === projectId
) ?? null
);
}
-async function expectProjectDeployActivitySucceeded(page: Page, projectId: string) {
+async function expectProjectDeployActivitySucceeded(
+ page: Page,
+ projectId: string,
+ projectName: string
+) {
await expect
.poll(
- async () => (await fetchLatestProjectDeployActivity(page, projectId))?.status ?? 'missing',
+ async () =>
+ (await fetchLatestProjectDeployActivity(page, projectId, projectName))?.status ?? 'missing',
{
message: 'Expected project deploy activity to complete before reload',
timeout: 60000
@@ -656,7 +662,7 @@ test.describe('New Compose Project Page', () => {
timeout: 60000
})
.toBe('running');
- await expectProjectDeployActivitySucceeded(page, projectId);
+ await expectProjectDeployActivitySucceeded(page, projectId, projectName);
expect(projectPullRequestCount).toBe(0);
await expect(page.getByRole('button', { name: 'Down', exact: true })).toBeVisible({
diff --git a/tests/spec/security.spec.ts b/tests/spec/security.spec.ts
index 486060a90..819c91a50 100644
--- a/tests/spec/security.spec.ts
+++ b/tests/spec/security.spec.ts
@@ -186,7 +186,7 @@ test.describe('Security Page', () => {
}
);
- await page.getByRole('button', { name: 'Scan all images', exact: true }).click();
+ await page.getByRole('button', { name: 'Scan all images', exact: true }).first().click();
await expect(
page.getByText('Started 1 scans; 1 failed to start', { exact: true })