Skip to content

Modern Docker Management, Designed for Everyone

feat: better universal dashboard ui tweaks (#2761)

Kyle Mendell986333b4f59b
diff --git a/backend/api/handlers/dashboard.go b/backend/api/handlers/dashboard.go
index c46a78afd..4d95e2ce2 100644
--- a/backend/api/handlers/dashboard.go
+++ b/backend/api/handlers/dashboard.go
@@ -25,23 +25,6 @@ type GetDashboardOutput struct {
Body base.ApiResponse[dashboardtypes.Snapshot]
}
-type GetDashboardActionItemsInput struct {
- EnvironmentID string `path:"id" doc:"Environment ID"`
- DebugAllGood bool `query:"debugAllGood" default:"false" doc:"Debug mode: force an empty action item list"`
-}
-
-type GetDashboardActionItemsOutput struct {
- Body base.ApiResponse[dashboardtypes.ActionItems]
-}
-
-type GetDashboardEnvironmentsOverviewInput struct {
- DebugAllGood bool `query:"debugAllGood" default:"false" doc:"Debug mode: force empty action item lists"`
-}
-
-type GetDashboardEnvironmentsOverviewOutput struct {
- Body base.ApiResponse[dashboardtypes.EnvironmentsOverview]
-}
-
func RegisterDashboard(api huma.API, dashboardService *services.DashboardService) {
h := &DashboardHandler{dashboardService: dashboardService}
@@ -58,34 +41,6 @@ func RegisterDashboard(api huma.API, dashboardService *services.DashboardService
},
Middlewares: humamw.RequirePermission(api, authz.PermDashboardRead),
}, h.GetDashboard)
-
- huma.Register(api, huma.Operation{
- OperationID: "get-dashboard-action-items",
- Method: http.MethodGet,
- Path: "/environments/{id}/dashboard/action-items",
- Summary: "Get dashboard action items",
- Description: "Returns only dashboard action items that currently need attention",
- Tags: []string{"Dashboard"},
- Security: []map[string][]string{
- {"BearerAuth": {}},
- {"ApiKeyAuth": {}},
- },
- Middlewares: humamw.RequirePermission(api, authz.PermDashboardRead),
- }, h.GetActionItems)
-
- huma.Register(api, huma.Operation{
- OperationID: "get-dashboard-environments-overview",
- Method: http.MethodGet,
- Path: "/dashboard/environments",
- Summary: "Get aggregate environments dashboard overview",
- Description: "Returns dashboard summary data for all visible environments",
- Tags: []string{"Dashboard"},
- Security: []map[string][]string{
- {"BearerAuth": {}},
- {"ApiKeyAuth": {}},
- },
- Middlewares: humamw.RequirePermission(api, authz.PermDashboardRead),
- }, h.GetEnvironmentsOverview)
}
func (h *DashboardHandler) GetDashboard(ctx context.Context, input *GetDashboardInput) (*GetDashboardOutput, error) {
@@ -114,59 +69,3 @@ func (h *DashboardHandler) GetDashboard(ctx context.Context, input *GetDashboard
},
}, nil
}
-
-func (h *DashboardHandler) GetActionItems(ctx context.Context, input *GetDashboardActionItemsInput) (*GetDashboardActionItemsOutput, error) {
- if h.dashboardService == nil {
- return nil, huma.Error500InternalServerError("service not available")
- }
-
- // EnvironmentID is consumed by env proxy/auth middleware for routing/validation.
- _ = input.EnvironmentID
-
- actionItems, err := h.dashboardService.GetActionItems(ctx, services.DashboardActionItemsOptions{
- DebugAllGood: input.DebugAllGood,
- })
- if err != nil {
- return nil, huma.Error500InternalServerError(err.Error())
- }
-
- if actionItems == nil {
- actionItems = &dashboardtypes.ActionItems{Items: []dashboardtypes.ActionItem{}}
- } else if actionItems.Items == nil {
- actionItems.Items = []dashboardtypes.ActionItem{}
- }
-
- return &GetDashboardActionItemsOutput{
- Body: base.ApiResponse[dashboardtypes.ActionItems]{
- Success: true,
- Data: *actionItems,
- },
- }, nil
-}
-
-func (h *DashboardHandler) GetEnvironmentsOverview(
- ctx context.Context,
- input *GetDashboardEnvironmentsOverviewInput,
-) (*GetDashboardEnvironmentsOverviewOutput, error) {
- if h.dashboardService == nil {
- return nil, huma.Error500InternalServerError("service not available")
- }
-
- overview, err := h.dashboardService.GetEnvironmentsOverview(ctx, services.DashboardActionItemsOptions{
- DebugAllGood: input.DebugAllGood,
- })
- if err != nil {
- return nil, huma.Error500InternalServerError(err.Error())
- }
-
- if overview == nil {
- return nil, huma.Error500InternalServerError("dashboard environments overview not available")
- }
-
- return &GetDashboardEnvironmentsOverviewOutput{
- Body: base.ApiResponse[dashboardtypes.EnvironmentsOverview]{
- Success: true,
- Data: *overview,
- },
- }, nil
-}
diff --git a/backend/api/handlers/dashboard_test.go b/backend/api/handlers/dashboard_test.go
index 70b90ac3c..fd65304bb 100644
--- a/backend/api/handlers/dashboard_test.go
+++ b/backend/api/handlers/dashboard_test.go
@@ -132,39 +132,3 @@ func TestDashboardHandlerGetDashboardReturnsSnapshot(t *testing.T) {
{Kind: dashboardtypes.ActionItemKindExpiringKeys, Count: 1, Severity: dashboardtypes.ActionItemSeverityWarning},
}, snapshot.ActionItems.Items)
}
-
-func TestDashboardHandlerGetEnvironmentsOverviewReturnsAggregateSummary(t *testing.T) {
- db, settingsSvc := setupDashboardHandlerTestDB(t)
-
- require.NoError(t, db.WithContext(context.Background()).Create(&models.Environment{
- BaseModel: models.BaseModel{ID: "0", CreatedAt: time.Now()},
- Name: "Local Docker",
- ApiUrl: "http://local.test",
- Status: string(models.EnvironmentStatusOffline),
- Enabled: true,
- }).Error)
-
- handler := &DashboardHandler{
- dashboardService: services.NewDashboardService(
- db,
- nil,
- nil,
- nil,
- nil,
- settingsSvc,
- nil,
- services.NewEnvironmentService(db, http.DefaultClient, nil, nil, settingsSvc, nil),
- services.NewVersionService(nil, true, "1.2.3", "abcdef1234567890", nil, nil),
- ),
- }
-
- output, err := handler.GetEnvironmentsOverview(context.Background(), &GetDashboardEnvironmentsOverviewInput{})
- require.NoError(t, err)
- require.NotNil(t, output)
- require.True(t, output.Body.Success)
- require.Equal(t, 1, output.Body.Data.Summary.TotalEnvironments)
- require.Len(t, output.Body.Data.Environments, 1)
- require.Equal(t, "0", output.Body.Data.Environments[0].Environment.ID)
- require.Equal(t, dashboardtypes.EnvironmentSnapshotStateSkipped, output.Body.Data.Environments[0].SnapshotState)
- require.Nil(t, output.Body.Data.Environments[0].VersionInfo)
-}
diff --git a/backend/internal/services/dashboard_service.go b/backend/internal/services/dashboard_service.go
index 653ef8b09..81cba36c8 100644
--- a/backend/internal/services/dashboard_service.go
+++ b/backend/internal/services/dashboard_service.go
@@ -3,20 +3,16 @@ package services
import (
"context"
"fmt"
- "log/slog"
- "net/http"
"sort"
"time"
"github.com/getarcaneapp/arcane/backend/internal/database"
"github.com/getarcaneapp/arcane/backend/internal/models"
dockerutils "github.com/getarcaneapp/arcane/backend/pkg/dockerutil"
- "github.com/getarcaneapp/arcane/backend/pkg/libarcane"
libupdater "github.com/getarcaneapp/arcane/backend/pkg/libarcane/imageupdate"
"github.com/getarcaneapp/arcane/types/base"
containertypes "github.com/getarcaneapp/arcane/types/container"
dashboardtypes "github.com/getarcaneapp/arcane/types/dashboard"
- environmenttypes "github.com/getarcaneapp/arcane/types/environment"
imagetypes "github.com/getarcaneapp/arcane/types/image"
versiontypes "github.com/getarcaneapp/arcane/types/version"
dockercontainer "github.com/moby/moby/api/types/container"
@@ -25,8 +21,6 @@ import (
const defaultDashboardAPIKeyExpiryWindow = 14 * 24 * time.Hour
const dashboardSnapshotPreloadLimit = 50
-const defaultAggregateDashboardConcurrency = 4
-const defaultAggregateDashboardTimeout = 20 * time.Second
const localEnvironmentID = "0"
type DashboardService struct {
@@ -142,6 +136,11 @@ func (s *DashboardService) GetSnapshot(ctx context.Context, options DashboardAct
return nil, err
}
+ var versionInfo *versiontypes.Info
+ if s.versionService != nil {
+ versionInfo = s.versionService.GetAppVersionInfo(ctx)
+ }
+
return &dashboardtypes.Snapshot{
Containers: dashboardtypes.SnapshotContainers{
Data: containerPage,
@@ -155,150 +154,10 @@ func (s *DashboardService) GetSnapshot(ctx context.Context, options DashboardAct
ImageUsageCounts: imageUsageCounts,
ActionItems: *actionItems,
Settings: dashboardtypes.SnapshotSettings{},
+ VersionInfo: versionInfo,
}, nil
}
-func (s *DashboardService) GetActionItems(ctx context.Context, options DashboardActionItemsOptions) (*dashboardtypes.ActionItems, error) {
- if options.DebugAllGood {
- return &dashboardtypes.ActionItems{Items: []dashboardtypes.ActionItem{}}, nil
- }
-
- var (
- stoppedContainers int
- pendingResourceUpdates int
- actionableVulnerabilities int
- expiringAPIKeys int
- )
-
- g, groupCtx := errgroup.WithContext(ctx)
-
- g.Go(func() error {
- count, err := s.getStoppedContainersCountInternal(groupCtx)
- if err != nil {
- return err
- }
- stoppedContainers = count
- return nil
- })
-
- g.Go(func() error {
- count, err := s.getPendingResourceUpdatesCountInternal(groupCtx)
- if err != nil {
- return err
- }
- pendingResourceUpdates = count
- return nil
- })
-
- g.Go(func() error {
- count, err := s.getActionableVulnerabilitiesCountInternal(groupCtx)
- if err != nil {
- return err
- }
- actionableVulnerabilities = count
- return nil
- })
-
- g.Go(func() error {
- count, err := s.getExpiringAPIKeysCountInternal(groupCtx)
- if err != nil {
- return err
- }
- expiringAPIKeys = count
- return nil
- })
-
- if err := g.Wait(); err != nil {
- return nil, err
- }
-
- actionItems := make([]dashboardtypes.ActionItem, 0, 4)
-
- if stoppedContainers > 0 {
- actionItems = append(actionItems, dashboardtypes.ActionItem{
- Kind: dashboardtypes.ActionItemKindStoppedContainers,
- Count: stoppedContainers,
- Severity: dashboardtypes.ActionItemSeverityWarning,
- })
- }
-
- if pendingResourceUpdates > 0 {
- actionItems = append(actionItems, dashboardtypes.ActionItem{
- Kind: dashboardtypes.ActionItemKindImageUpdates,
- Count: pendingResourceUpdates,
- Severity: dashboardtypes.ActionItemSeverityWarning,
- })
- }
-
- if actionableVulnerabilities > 0 {
- actionItems = append(actionItems, dashboardtypes.ActionItem{
- Kind: dashboardtypes.ActionItemKindActionableVulnerabilities,
- Count: actionableVulnerabilities,
- Severity: dashboardtypes.ActionItemSeverityCritical,
- })
- }
-
- if expiringAPIKeys > 0 {
- actionItems = append(actionItems, dashboardtypes.ActionItem{
- Kind: dashboardtypes.ActionItemKindExpiringKeys,
- Count: expiringAPIKeys,
- Severity: dashboardtypes.ActionItemSeverityWarning,
- })
- }
-
- return &dashboardtypes.ActionItems{Items: actionItems}, nil
-}
-
-func (s *DashboardService) GetEnvironmentsOverview(
- ctx context.Context,
- options DashboardActionItemsOptions,
-) (*dashboardtypes.EnvironmentsOverview, error) {
- if s.environmentService == nil {
- return nil, fmt.Errorf("environment service not available")
- }
-
- environments, err := s.environmentService.ListVisibleEnvironments(ctx)
- if err != nil {
- return nil, fmt.Errorf("failed to list environments: %w", err)
- }
-
- overview := &dashboardtypes.EnvironmentsOverview{
- Environments: make([]dashboardtypes.EnvironmentOverview, len(environments)),
- }
-
- g, groupCtx := errgroup.WithContext(ctx)
- g.SetLimit(defaultAggregateDashboardConcurrency)
-
- for i := range environments {
- index := i
- env := environments[i]
-
- g.Go(func() error {
- overview.Environments[index] = s.buildEnvironmentOverviewInternal(groupCtx, env, options)
- return nil
- })
- }
-
- if err := g.Wait(); err != nil {
- return nil, fmt.Errorf("failed to build environments overview: %w", err)
- }
-
- sort.SliceStable(overview.Environments, func(i, j int) bool {
- left := overview.Environments[i].Environment
- right := overview.Environments[j].Environment
- if left.ID == localEnvironmentID {
- return true
- }
- if right.ID == localEnvironmentID {
- return false
- }
- return left.Name < right.Name
- })
-
- overview.Summary = summarizeEnvironmentOverviewInternal(overview.Environments)
- return overview, nil
-}
-
func (s *DashboardService) buildActionItemsForSnapshotInternal(
ctx context.Context,
options DashboardActionItemsOptions,
@@ -401,209 +260,6 @@ func buildDashboardActionItemsInternal(
return &dashboardtypes.ActionItems{Items: actionItems}
}
-func (s *DashboardService) buildEnvironmentOverviewInternal(
- ctx context.Context,
- env environmenttypes.Environment,
- options DashboardActionItemsOptions,
-) dashboardtypes.EnvironmentOverview {
- overview := dashboardtypes.EnvironmentOverview{
- Environment: env,
- Containers: containertypes.StatusCounts{},
- ImageUsageCounts: imagetypes.UsageCounts{},
- ActionItems: dashboardtypes.ActionItems{Items: []dashboardtypes.ActionItem{}},
- Settings: dashboardtypes.SnapshotSettings{},
- SnapshotState: dashboardtypes.EnvironmentSnapshotStateSkipped,
- }
-
- if !env.Enabled || !shouldFetchEnvironmentSnapshotInternal(env) {
- return overview
- }
-
- var (
- snapshot *dashboardtypes.Snapshot
- snapshotErr error
- versionInfo *versiontypes.Info
- )
-
- g, groupCtx := errgroup.WithContext(ctx)
-
- g.Go(func() error {
- snapshot, snapshotErr = s.getSnapshotForEnvironmentInternal(groupCtx, env, options)
- return nil
- })
-
- g.Go(func() error {
- versionInfo = s.getVersionInfoForEnvironmentInternal(groupCtx, env)
- return nil
- })
-
- _ = g.Wait()
-
- if versionInfo != nil {
- overview.VersionInfo = versionInfo
- }
-
- if snapshotErr != nil {
- overview.SnapshotState = dashboardtypes.EnvironmentSnapshotStateError
- overview.SnapshotError = new(snapshotErr.Error())
- return overview
- }
-
- overview.Containers = snapshot.Containers.Counts
- overview.ImageUsageCounts = snapshot.ImageUsageCounts
- overview.ActionItems = snapshot.ActionItems
- overview.Settings = snapshot.Settings
- overview.SnapshotState = dashboardtypes.EnvironmentSnapshotStateReady
-
- return overview
-}
-
-func shouldFetchEnvironmentSnapshotInternal(env environmenttypes.Environment) bool {
- switch env.Status {
- case string(models.EnvironmentStatusOnline), string(models.EnvironmentStatusStandby):
- return true
- default:
- return false
- }
-}
-
-func (s *DashboardService) getSnapshotForEnvironmentInternal(
- ctx context.Context,
- env environmenttypes.Environment,
- options DashboardActionItemsOptions,
-) (*dashboardtypes.Snapshot, error) {
- reqCtx, cancel := context.WithTimeout(ctx, defaultAggregateDashboardTimeout)
- defer cancel()
-
- if env.ID == localEnvironmentID {
- return s.GetSnapshot(reqCtx, options)
- }
-
- var response base.ApiResponse[dashboardtypes.Snapshot]
- if err := s.environmentService.ProxyJSONRequest(
- reqCtx,
- env.ID,
- http.MethodGet,
- buildEnvironmentDashboardProxyPathInternal(options),
- nil,
- &response,
- ); err != nil {
- return nil, fmt.Errorf("failed to proxy dashboard snapshot: %w", err)
- }
- if !response.Success {
- return nil, fmt.Errorf("dashboard snapshot request was not successful")
- }
-
- return &response.Data, nil
-}
-
-func buildEnvironmentDashboardProxyPathInternal(options DashboardActionItemsOptions) string {
- if options.DebugAllGood {
- return fmt.Sprintf("/api/environments/%s/dashboard?debugAllGood=true", localEnvironmentID)
- }
-
- return fmt.Sprintf("/api/environments/%s/dashboard", localEnvironmentID)
-}
-
-func (s *DashboardService) getVersionInfoForEnvironmentInternal(
- ctx context.Context,
- env environmenttypes.Environment,
-) *versiontypes.Info {
- if s.versionService == nil {
- return nil
- }
-
- reqCtx, cancel := context.WithTimeout(ctx, defaultAggregateDashboardTimeout)
- defer cancel()
-
- if env.ID == localEnvironmentID {
- return s.versionService.GetAppVersionInfo(reqCtx)
- }
-
- if s.environmentService == nil {
- return nil
- }
-
- var versionInfo versiontypes.Info
- if err := s.environmentService.ProxyJSONRequest(
- reqCtx,
- env.ID,
- http.MethodGet,
- "/api/app-version",
- nil,
- &versionInfo,
- ); err != nil {
- slog.DebugContext(reqCtx, "Failed to fetch environment version info for dashboard", "environment_id", env.ID, "error", err)
- return nil
- }
-
- return &versionInfo
-}
-
-func (s *DashboardService) getStoppedContainersCountInternal(ctx context.Context) (int, error) {
- if s.dockerService == nil {
- return 0, nil
- }
-
- containers, _, _, _, err := s.dockerService.GetAllContainers(ctx)
- if err != nil {
- return 0, fmt.Errorf("failed to load container counts: %w", err)
- }
-
- stoppedCount := 0
- for _, container := range containers {
- if libarcane.IsInternalContainer(container.Labels) {
- continue
- }
-
- if container.State != "running" {
- stoppedCount++
- }
- }
-
- return stoppedCount, nil
-}
-
-func summarizeEnvironmentOverviewInternal(items []dashboardtypes.EnvironmentOverview) dashboardtypes.EnvironmentsSummary {
- summary := dashboardtypes.EnvironmentsSummary{}
-
- for _, item := range items {
- summary.TotalEnvironments++
-
- if !item.Environment.Enabled {
- summary.DisabledEnvironments++
- } else {
- switch item.Environment.Status {
- case string(models.EnvironmentStatusOnline):
- summary.OnlineEnvironments++
- case string(models.EnvironmentStatusStandby):
- summary.StandbyEnvironments++
- case string(models.EnvironmentStatusPending):
- summary.PendingEnvironments++
- case string(models.EnvironmentStatusError):
- summary.ErrorEnvironments++
- default:
- summary.OfflineEnvironments++
- }
- }
-
- summary.Containers.RunningContainers += item.Containers.RunningContainers
- summary.Containers.StoppedContainers += item.Containers.StoppedContainers
- summary.Containers.TotalContainers += item.Containers.TotalContainers
-
- summary.ImageUsageCounts.Inuse += item.ImageUsageCounts.Inuse
- summary.ImageUsageCounts.Unused += item.ImageUsageCounts.Unused
- summary.ImageUsageCounts.Total += item.ImageUsageCounts.Total
- summary.ImageUsageCounts.TotalSize += item.ImageUsageCounts.TotalSize
-
- if len(item.ActionItems.Items) > 0 {
- summary.EnvironmentsWithActionItems++
- }
- }
-
- return summary
-}
-
func (s *DashboardService) getPendingResourceUpdatesCountInternal(ctx context.Context) (int, error) {
if s.db == nil || s.dockerService == nil {
return 0, nil
diff --git a/backend/internal/services/dashboard_service_test.go b/backend/internal/services/dashboard_service_test.go
index d78720b08..47563991d 100644
--- a/backend/internal/services/dashboard_service_test.go
+++ b/backend/internal/services/dashboard_service_test.go
@@ -14,16 +14,11 @@ import (
"github.com/getarcaneapp/arcane/backend/internal/config"
"github.com/getarcaneapp/arcane/backend/internal/database"
"github.com/getarcaneapp/arcane/backend/internal/models"
- "github.com/getarcaneapp/arcane/types/base"
- containertypes "github.com/getarcaneapp/arcane/types/container"
dashboardtypes "github.com/getarcaneapp/arcane/types/dashboard"
- imagetypes "github.com/getarcaneapp/arcane/types/image"
- versiontypes "github.com/getarcaneapp/arcane/types/version"
glsqlite "github.com/glebarez/sqlite"
dockercontainer "github.com/moby/moby/api/types/container"
dockerimage "github.com/moby/moby/api/types/image"
"github.com/moby/moby/client"
- "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gorm.io/gorm"
)
@@ -52,11 +47,6 @@ func createDashboardTestImageUpdateRecord(t *testing.T, db *database.DB, record
require.NoError(t, db.WithContext(context.Background()).Create(&record).Error)
}
-func createDashboardTestEnvironment(t *testing.T, db *database.DB, env models.Environment) {
- t.Helper()
- require.NoError(t, db.WithContext(context.Background()).Create(&env).Error)
-}
-
func newDashboardTestDockerService(
t *testing.T,
settingsSvc *SettingsService,
@@ -94,74 +84,6 @@ func newDashboardTestDockerService(
}
}
-func newDashboardTestVersionServiceInternal() *VersionService {
- return NewVersionService(nil, true, "1.2.3", "abcdef1234567890", nil, nil)
-}
-
-func TestDashboardService_GetActionItems_IncludesExpiringAPIKeys(t *testing.T) {
- db, settingsSvc := setupDashboardServiceTestDB(t)
- svc := NewDashboardService(db, nil, nil, nil, nil, settingsSvc, nil, nil, nil)
-
- now := time.Now()
- createDashboardTestAPIKey(t, db, models.ApiKey{
- Name: "expiring-soon",
- KeyHash: "hash-soon",
- KeyPrefix: "arc_test_s",
- UserID: new("user-1"),
- ExpiresAt: new(now.Add(24 * time.Hour)),
- })
- createDashboardTestAPIKey(t, db, models.ApiKey{
- Name: "already-expired",
- KeyHash: "hash-expired",
- KeyPrefix: "arc_test_e",
- UserID: new("user-1"),
- ExpiresAt: new(now.Add(-24 * time.Hour)),
- })
- createDashboardTestAPIKey(t, db, models.ApiKey{
- Name: "future",
- KeyHash: "hash-future",
- KeyPrefix: "arc_test_f",
- UserID: new("user-1"),
- ExpiresAt: new(now.Add(45 * 24 * time.Hour)),
- })
- createDashboardTestAPIKey(t, db, models.ApiKey{
- Name: "never-expires",
- KeyHash: "hash-never",
- KeyPrefix: "arc_test_n",
- UserID: new("user-1"),
- })
-
- actionItems, err := svc.GetActionItems(context.Background(), DashboardActionItemsOptions{})
- require.NoError(t, err)
- require.NotNil(t, actionItems)
- require.Len(t, actionItems.Items, 1)
-
- item := actionItems.Items[0]
- require.Equal(t, dashboardtypes.ActionItemKindExpiringKeys, item.Kind)
- require.Equal(t, 2, item.Count)
- require.Equal(t, dashboardtypes.ActionItemSeverityWarning, item.Severity)
-}
-
-func TestDashboardService_GetActionItems_DebugAllGoodReturnsNoItems(t *testing.T) {
- db, settingsSvc := setupDashboardServiceTestDB(t)
- svc := NewDashboardService(db, nil, nil, nil, nil, settingsSvc, nil, nil, nil)
-
- createDashboardTestAPIKey(t, db, models.ApiKey{
- Name: "expiring-soon",
- KeyHash: "hash-soon",
- KeyPrefix: "arc_test_d",
- UserID: new("user-1"),
- ExpiresAt: new(time.Now().Add(2 * time.Hour)),
- })
-
- actionItems, err := svc.GetActionItems(context.Background(), DashboardActionItemsOptions{
- DebugAllGood: true,
- })
- require.NoError(t, err)
- require.NotNil(t, actionItems)
- require.Empty(t, actionItems.Items)
-}
-
func TestDashboardService_GetSnapshot_ReturnsDashboardSnapshot(t *testing.T) {
db, settingsSvc := setupDashboardServiceTestDB(t)
@@ -296,289 +218,3 @@ func TestDashboardService_GetSnapshot_DebugAllGoodOnlyClearsActionItems(t *testi
require.Equal(t, 1, snapshot.ImageUsageCounts.Inuse)
require.Empty(t, snapshot.ActionItems.Items)
}
-
-func TestDashboardService_GetEnvironmentsOverview_ReturnsLocalAndRemoteSummaries(t *testing.T) {
- db, settingsSvc := setupDashboardServiceTestDB(t)
-
- containers := []dockercontainer.Summary{
- {
- ID: "local-running",
- Names: []string{"/local-running"},
- Image: "repo/local:stable",
- ImageID: "sha256:local-image",
- Created: 1700000000,
- State: "running",
- Status: "Up 1 hour",
- Labels: map[string]string{},
- },
- }
- images := []dockerimage.Summary{
- {ID: "sha256:local-image", RepoTags: []string{"repo/local:stable"}, Created: 1710000000, Size: 150},
- }
-
- remoteSnapshot := base.ApiResponse[dashboardtypes.Snapshot]{
- Success: true,
- Data: dashboardtypes.Snapshot{
- Containers: dashboardtypes.SnapshotContainers{
- Counts: containertypes.StatusCounts{
- RunningContainers: 2,
- StoppedContainers: 1,
- TotalContainers: 3,
- },
- },
- ImageUsageCounts: imagetypes.UsageCounts{
- Inuse: 2,
- Unused: 3,
- Total: 5,
- TotalSize: 900,
- },
- ActionItems: dashboardtypes.ActionItems{
- Items: []dashboardtypes.ActionItem{
- {Kind: dashboardtypes.ActionItemKindStoppedContainers, Count: 1, Severity: dashboardtypes.ActionItemSeverityWarning},
- },
- },
- },
- }
-
- remoteVersion := versiontypes.Info{
- CurrentVersion: "v2.4.0",
- DisplayVersion: "v2.4.0",
- Revision: "1234567890abcdef",
- ShortRevision: "12345678",
- GoVersion: "go1.24.0",
- IsSemverVersion: true,
- UpdateAvailable: true,
- NewestVersion: "v2.5.0",
- ReleaseURL: "https://github.com/getarcaneapp/arcane/releases/tag/v2.5.0",
- }
-
- remoteServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- switch r.URL.Path {
- case "/api/environments/0/dashboard":
- require.NoError(t, json.NewEncoder(w).Encode(remoteSnapshot))
- case "/api/app-version":
- require.NoError(t, json.NewEncoder(w).Encode(remoteVersion))
- default:
- http.NotFound(w, r)
- }
- }))
- t.Cleanup(remoteServer.Close)
-
- createDashboardTestEnvironment(t, db, models.Environment{
- BaseModel: models.BaseModel{ID: "0", CreatedAt: time.Now()},
- Name: "Local Docker",
- ApiUrl: "http://local.test",
- Status: string(models.EnvironmentStatusOnline),
- Enabled: true,
- })
- createDashboardTestEnvironment(t, db, models.Environment{
- BaseModel: models.BaseModel{ID: "env-remote", CreatedAt: time.Now()},
- Name: "Remote Alpha",
- ApiUrl: remoteServer.URL,
- Status: string(models.EnvironmentStatusOnline),
- Enabled: true,
- })
-
- dockerSvc := newDashboardTestDockerService(t, settingsSvc, containers, images)
- envSvc := NewEnvironmentService(db, remoteServer.Client(), nil, nil, settingsSvc, nil)
- svc := NewDashboardService(db, dockerSvc, nil, nil, nil, settingsSvc, nil, envSvc, newDashboardTestVersionServiceInternal())
-
- overview, err := svc.GetEnvironmentsOverview(context.Background(), DashboardActionItemsOptions{})
- require.NoError(t, err)
- require.NotNil(t, overview)
- require.Len(t, overview.Environments, 2)
-
- require.Equal(t, 2, overview.Summary.TotalEnvironments)
- require.Equal(t, 2, overview.Summary.OnlineEnvironments)
- require.Equal(t, 4, overview.Summary.Containers.TotalContainers)
- require.Equal(t, 6, overview.Summary.ImageUsageCounts.Total)
- require.Equal(t, 1, overview.Summary.EnvironmentsWithActionItems)
-
- require.Equal(t, "0", overview.Environments[0].Environment.ID)
- require.Equal(t, dashboardtypes.EnvironmentSnapshotStateReady, overview.Environments[0].SnapshotState)
- require.Equal(t, 1, overview.Environments[0].Containers.TotalContainers)
- require.NotNil(t, overview.Environments[0].VersionInfo)
- require.Equal(t, "v1.2.3", overview.Environments[0].VersionInfo.CurrentVersion)
-
- require.Equal(t, "env-remote", overview.Environments[1].Environment.ID)
- require.Equal(t, dashboardtypes.EnvironmentSnapshotStateReady, overview.Environments[1].SnapshotState)
- require.Equal(t, 3, overview.Environments[1].Containers.TotalContainers)
- require.Len(t, overview.Environments[1].ActionItems.Items, 1)
- require.NotNil(t, overview.Environments[1].VersionInfo)
- require.Equal(t, "v2.5.0", overview.Environments[1].VersionInfo.NewestVersion)
-}
-
-func TestDashboardService_GetEnvironmentsOverview_HandlesRemoteSnapshotFailure(t *testing.T) {
- db, settingsSvc := setupDashboardServiceTestDB(t)
-
- createDashboardTestEnvironment(t, db, models.Environment{
- BaseModel: models.BaseModel{ID: "env-offline", CreatedAt: time.Now()},
- Name: "Offline Env",
- ApiUrl: "http://offline.test",
- Status: string(models.EnvironmentStatusOffline),
- Enabled: true,
- })
- createDashboardTestEnvironment(t, db, models.Environment{
- BaseModel: models.BaseModel{ID: "env-error", CreatedAt: time.Now()},
- Name: "Broken Env",
- ApiUrl: "http://127.0.0.1:1",
- Status: string(models.EnvironmentStatusOnline),
- Enabled: true,
- })
-
- envSvc := NewEnvironmentService(db, http.DefaultClient, nil, nil, settingsSvc, nil)
- svc := NewDashboardService(db, nil, nil, nil, nil, settingsSvc, nil, envSvc, newDashboardTestVersionServiceInternal())
-
- overview, err := svc.GetEnvironmentsOverview(context.Background(), DashboardActionItemsOptions{})
- require.NoError(t, err)
- require.NotNil(t, overview)
- require.Len(t, overview.Environments, 2)
-
- byID := make(map[string]dashboardtypes.EnvironmentOverview, len(overview.Environments))
- for _, item := range overview.Environments {
- byID[item.Environment.ID] = item
- }
-
- require.Equal(t, dashboardtypes.EnvironmentSnapshotStateSkipped, byID["env-offline"].SnapshotState)
- require.Nil(t, byID["env-offline"].SnapshotError)
- require.Nil(t, byID["env-offline"].VersionInfo)
-
- require.Equal(t, dashboardtypes.EnvironmentSnapshotStateError, byID["env-error"].SnapshotState)
- require.NotNil(t, byID["env-error"].SnapshotError)
- require.Contains(t, *byID["env-error"].SnapshotError, "failed to proxy dashboard snapshot")
- require.Nil(t, byID["env-error"].VersionInfo)
-}
-
-func TestDashboardService_GetEnvironmentsOverview_OmitsVersionInfoWhenFetchFails(t *testing.T) {
- db, settingsSvc := setupDashboardServiceTestDB(t)
-
- remoteSnapshot := base.ApiResponse[dashboardtypes.Snapshot]{
- Success: true,
- Data: dashboardtypes.Snapshot{
- Containers: dashboardtypes.SnapshotContainers{
- Counts: containertypes.StatusCounts{
- RunningContainers: 1,
- StoppedContainers: 0,
- TotalContainers: 1,
- },
- },
- ImageUsageCounts: imagetypes.UsageCounts{
- Inuse: 1,
- Unused: 0,
- Total: 1,
- TotalSize: 128,
- },
- ActionItems: dashboardtypes.ActionItems{Items: []dashboardtypes.ActionItem{}},
- },
- }
-
- remoteServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- switch r.URL.Path {
- case "/api/environments/0/dashboard":
- require.NoError(t, json.NewEncoder(w).Encode(remoteSnapshot))
- case "/api/app-version":
- http.Error(w, "version unavailable", http.StatusInternalServerError)
- default:
- http.NotFound(w, r)
- }
- }))
- t.Cleanup(remoteServer.Close)
-
- createDashboardTestEnvironment(t, db, models.Environment{
- BaseModel: models.BaseModel{ID: "env-remote", CreatedAt: time.Now()},
- Name: "Remote Alpha",
- ApiUrl: remoteServer.URL,
- Status: string(models.EnvironmentStatusOnline),
- Enabled: true,
- })
-
- envSvc := NewEnvironmentService(db, remoteServer.Client(), nil, nil, settingsSvc, nil)
- svc := NewDashboardService(db, nil, nil, nil, nil, settingsSvc, nil, envSvc, newDashboardTestVersionServiceInternal())
-
- overview, err := svc.GetEnvironmentsOverview(context.Background(), DashboardActionItemsOptions{})
- require.NoError(t, err)
- require.NotNil(t, overview)
- require.Len(t, overview.Environments, 1)
-
- require.Equal(t, dashboardtypes.EnvironmentSnapshotStateReady, overview.Environments[0].SnapshotState)
- require.Equal(t, 1, overview.Environments[0].Containers.TotalContainers)
- require.Nil(t, overview.Environments[0].VersionInfo)
-}
-
-func TestDashboardService_GetActionItems_CountsAffectedResources(t *testing.T) {
- db, settingsSvc := setupDashboardServiceTestDB(t)
- ctx := context.Background()
-
- containers := []dockercontainer.Summary{
- {
- ID: "container-updated",
- Names: []string{"/updated-app"},
- Image: "repo/app:latest",
- ImageID: "sha256:image-a",
- Created: 1700000000,
- State: "running",
- Status: "Up 2 hours",
- Labels: map[string]string{},
- },
- {
- ID: "compose-updated",
- Names: []string{"/compose-app"},
- Image: "repo/compose:latest",
- ImageID: "sha256:image-compose",
- Created: 1700000001,
- State: "running",
- Status: "Up 2 hours",
- Labels: map[string]string{
- "com.docker.compose.project": "compose-demo",
- },
- },
- }
- images := []dockerimage.Summary{
- {ID: "sha256:image-a", RepoTags: []string{"repo/app:latest"}, Created: 1710000000, Size: 100},
- {ID: "sha256:image-unused", RepoTags: []string{"repo/unused:latest"}, Created: 1710000001, Size: 50},
- }
-
- createDashboardTestImageUpdateRecord(t, db, models.ImageUpdateRecord{
- ID: "sha256:image-a",
- Repository: "docker.io/repo/app",
- Tag: "latest",
- HasUpdate: true,
- })
- createDashboardTestImageUpdateRecord(t, db, models.ImageUpdateRecord{
- ID: "sha256:image-unused",
- Repository: "docker.io/repo/unused",
- Tag: "latest",
- HasUpdate: true,
- })
- createDashboardTestImageUpdateRecord(t, db, models.ImageUpdateRecord{
- ID: "sha256:image-compose",
- Repository: "docker.io/repo/compose",
- Tag: "latest",
- HasUpdate: true,
- })
-
- projectsDir := t.TempDir()
- t.Setenv("PROJECTS_DIRECTORY", projectsDir)
- require.NoError(t, settingsSvc.SetStringSetting(ctx, "projectsDirectory", projectsDir))
- projectPath := createComposeProjectDir(t, projectsDir, "project-with-update")
- require.NoError(t, os.WriteFile(filepath.Join(projectPath, "compose.yaml"), []byte("services:\n app:\n image: repo/app:latest\n"), 0o644))
- require.NoError(t, db.WithContext(ctx).Create(&models.Project{
- BaseModel: models.BaseModel{ID: "project-with-update"},
- Name: "project-with-update",
- DirName: ptr("project-with-update"),
- Path: projectPath,
- Status: models.ProjectStatusStopped,
- }).Error)
-
- dockerSvc := newDashboardTestDockerService(t, settingsSvc, containers, images)
- projectSvc := NewProjectService(db, settingsSvc, nil, &ImageService{db: db}, nil, nil, config.Load())
- svc := NewDashboardService(db, dockerSvc, nil, projectSvc, nil, settingsSvc, nil, nil, nil)
-
- actionItems, err := svc.GetActionItems(ctx, DashboardActionItemsOptions{})
- require.NoError(t, err)
- require.NotNil(t, actionItems)
-
- require.Len(t, actionItems.Items, 1)
- assert.Equal(t, dashboardtypes.ActionItemKindImageUpdates, actionItems.Items[0].Kind)
- assert.Equal(t, 2, actionItems.Items[0].Count)
-}
diff --git a/cli/internal/types/endpoints.go b/cli/internal/types/endpoints.go
index 6f603d035..4e55c50d5 100644
--- a/cli/internal/types/endpoints.go
+++ b/cli/internal/types/endpoints.go
@@ -144,7 +144,7 @@ type ArcaneApiEndpoints struct {
TemplateFetchEndpoint string
// Dashboard
- DashboardActionItemsEndpoint string
+ DashboardEndpoint string
// Assets
AppImagesFaviconEndpoint string
@@ -313,7 +313,7 @@ var Endpoints = ArcaneApiEndpoints{ //nolint:gosec // static endpoint paths; aut
TemplateFetchEndpoint: "/api/templates/fetch",
// Dashboard
- DashboardActionItemsEndpoint: "/api/environments/%s/dashboard/action-items",
+ DashboardEndpoint: "/api/environments/%s/dashboard",
// Assets
AppImagesFaviconEndpoint: "/api/app-images/favicon",
@@ -657,8 +657,8 @@ func (e ArcaneApiEndpoints) TemplateDownload(id string) string {
func (e ArcaneApiEndpoints) TemplateFetch() string { return e.TemplateFetchEndpoint }
// Dashboard endpoints
-func (e ArcaneApiEndpoints) DashboardActionItems(envID string) string {
- return fmt.Sprintf(e.DashboardActionItemsEndpoint, envID)
+func (e ArcaneApiEndpoints) Dashboard(envID string) string {
+ return fmt.Sprintf(e.DashboardEndpoint, envID)
}
// GitOps Sync endpoints
diff --git a/cli/pkg/alerts/cmd.go b/cli/pkg/alerts/cmd.go
deleted file mode 100644
index f76876be9..000000000
--- a/cli/pkg/alerts/cmd.go
+++ /dev/null
@@ -1,101 +0,0 @@
-package alerts
-
-import (
- "fmt"
- "net/url"
- "strings"
-
- "github.com/getarcaneapp/arcane/cli/internal/cmdutil"
- "github.com/getarcaneapp/arcane/cli/internal/output"
- "github.com/getarcaneapp/arcane/cli/internal/types"
- "github.com/getarcaneapp/arcane/types/base"
- dashboardtypes "github.com/getarcaneapp/arcane/types/dashboard"
- "github.com/spf13/cobra"
-)
-
-var debugAllGood bool
-
-// AlertsCmd shows dashboard alerts/action items.
-var AlertsCmd = &cobra.Command{
- Use: "alerts",
- Aliases: []string{"alert", "actionitems"},
- Short: "Show dashboard alerts",
- SilenceUsage: true,
- RunE: func(cmd *cobra.Command, args []string) error {
- c, err := cmdutil.ClientFromCommand(cmd)
- if err != nil {
- return err
- }
-
- path := types.Endpoints.DashboardActionItems(c.EnvID())
- if debugAllGood {
- parsed, err := url.Parse(path)
- if err != nil {
- return fmt.Errorf("failed to parse endpoint path: %w", err)
- }
- q := parsed.Query()
- q.Set("debugAllGood", "true")
- parsed.RawQuery = q.Encode()
- path = parsed.String()
- }
-
- resp, err := c.Get(cmd.Context(), path)
- if err != nil {
- return fmt.Errorf("failed to get dashboard alerts: %w", err)
- }
- defer func() { _ = resp.Body.Close() }()
-
- var result base.ApiResponse[dashboardtypes.ActionItems]
- if err := cmdutil.DecodeJSON(resp, &result); err != nil {
- return fmt.Errorf("failed to parse response: %w", err)
- }
-
- if cmdutil.JSONOutputEnabled(cmd) {
- return cmdutil.PrintJSON(result.Data)
- }
-
- items := result.Data.Items
- if len(items) == 0 {
- output.Success("No alerts. Environment is good.")
- return nil
- }
-
- output.Header("Dashboard Alerts")
- headers := []string{"KIND", "COUNT", "SEVERITY"}
- rows := make([][]string, 0, len(items))
- for _, item := range items {
- rows = append(rows, []string{
- formatActionItemKind(item.Kind),
- fmt.Sprintf("%d", item.Count),
- strings.ToUpper(string(item.Severity)),
- })
- }
- output.Table(headers, rows)
- output.Info("Total: %d alert(s)", len(items))
- return nil
- },
-}
-
-func formatActionItemKind(kind dashboardtypes.ActionItemKind) string {
- switch kind {
- case dashboardtypes.ActionItemKindStoppedContainers:
- return "Stopped Containers"
- case dashboardtypes.ActionItemKindImageUpdates:
- return "Image Updates"
- case dashboardtypes.ActionItemKindActionableVulnerabilities:
- return "Actionable Vulnerabilities"
- case dashboardtypes.ActionItemKindExpiringKeys:
- return "Expiring Keys"
- default:
- value := strings.TrimSpace(string(kind))
- if value == "" {
- return "-"
- }
- return strings.ReplaceAll(value, "_", " ")
- }
-}
-
-func init() {
- AlertsCmd.Flags().Bool("json", false, "Output in JSON format")
- AlertsCmd.Flags().BoolVar(&debugAllGood, "debug-all-good", false, "Force no alerts (debug mode)")
-}
diff --git a/cli/pkg/root.go b/cli/pkg/root.go
index 2e1f1a493..97c4e71e5 100644
--- a/cli/pkg/root.go
+++ b/cli/pkg/root.go
@@ -21,7 +21,6 @@
// # Command Groups
//
// - admin: Administration & platform management
-// - alerts: Show dashboard alerts
// - auth: Authentication operations
// - config: Manage CLI configuration
// - containers: Manage containers
@@ -48,7 +47,6 @@ import (
"github.com/getarcaneapp/arcane/cli/internal/runstate"
runtimectx "github.com/getarcaneapp/arcane/cli/internal/runtime"
"github.com/getarcaneapp/arcane/cli/pkg/admin"
- "github.com/getarcaneapp/arcane/cli/pkg/alerts"
"github.com/getarcaneapp/arcane/cli/pkg/auth"
"github.com/getarcaneapp/arcane/cli/pkg/completion"
configClient "github.com/getarcaneapp/arcane/cli/pkg/config"
@@ -256,7 +254,6 @@ func init() {
rootCmd.AddCommand(generate.GenerateCmd)
rootCmd.AddCommand(version.VersionCmd)
rootCmd.AddCommand(auth.AuthCmd)
- rootCmd.AddCommand(alerts.AlertsCmd)
rootCmd.AddCommand(containers.ContainersCmd)
rootCmd.AddCommand(images.ImagesCmd)
rootCmd.AddCommand(volumes.VolumesCmd)
diff --git a/docs/rbac.md b/docs/rbac.md
deleted file mode 100644
index 17711c862..000000000
--- a/docs/rbac.md
+++ /dev/null
@@ -1,180 +0,0 @@
-# Role-Based Access Control
-
-Arcane uses a role-based access control (RBAC) system to govern what users and API keys can do. Every action — starting a container, deploying a project, editing settings — is gated by a specific permission. Permissions are bundled into roles, and roles are assigned to users (optionally scoped to a specific environment).
-
-If you're upgrading from an earlier version of Arcane, see the [Upgrade & Migration](#upgrade--migration) section below.
-
-## The mental model
-
-There are four moving parts:
-
-- **Permissions** are fine-grained strings of the form `<resource>:<action>` — for example `containers:start`, `projects:deploy`, `users:create`. You don't pick these one-by-one; you bundle them into roles.
-- **Roles** are named permission sets. Arcane ships with four built-in roles (Admin, Editor, Deployer, Viewer) and lets admins create custom ones.
-- **Role assignments** bind a user to a role, optionally scoped to a single environment. A user can hold many assignments — for example *Admin globally*, or *Editor on production + Viewer on staging*.
-- **OIDC mappings** translate SSO group claims into role assignments automatically on every login.
-
-Permissions split into two scopes:
-
-- **Org-level permissions** apply across the whole instance. Settings, users, registries, templates, environments management — these are all org-level. To get an org-level permission you need a **globally-scoped** role assignment.
-- **Env-scoped permissions** apply to one environment at a time. Containers, projects, images, volumes, networks, swarm, GitOps — these are all env-scoped. You can hold a different role on each environment.
-
-A user with `Editor on production` can manage Docker resources on that environment, but cannot change settings (org-level), and has no access at all on other environments.
-
-## Built-in roles
-
-The six built-in roles cover the common access patterns. They are immutable — you can't edit or delete them, but you can clone one as a starting point for a custom role.
-
-| Role | Intended use | What it can do |
-| -------------------- | ------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| **Admin** | Full instance operators | Everything. Manages users, roles, settings, registries, and every Docker resource on every environment. |
-| **Editor** | Day-to-day Docker management | Read+write on containers, projects, images, volumes, networks, swarm resources, GitOps syncs, webhooks, jobs, notifications, vulnerabilities. Read-only on settings/users. |
-| **No-Shell Editor** | Editor without `exec` access | Same as Editor, but cannot open an interactive shell inside a running container. |
-| **Deployer** | CI/CD service accounts and on-call responders | Deploy projects, restart/start/stop/redeploy containers, sync GitOps, pull images. Cannot create or delete resources, cannot manage settings or users. |
-| **Monitor** | Observability and on-call read access | Read Docker resources, view container/project/service logs, dashboards, events. No mutations, no exec, no settings access. |
-| **Viewer** | Auditors and read-only stakeholders | Read-only access to every Docker resource and to most org-level pages. Cannot view logs, start, stop, change, or delete anything. |
-
-You must have at least one user holding **Admin** globally at all times. Arcane will refuse role-assignment edits, OIDC mapping changes, and user deletions that would leave the system with zero global admins.
-
-## Custom roles
-
-> **Admin-only:** creating, editing, and deleting roles — and assigning roles to users — is reserved for global admins. The same applies to OIDC group mappings. These actions are intentionally not delegatable as fine-grained permissions; the matching API routes return 403 to non-admins.
-
-Admins can create custom roles to fit narrower job functions — for example, "Database Operator" that can manage only volumes and backups, or "Security Reviewer" that can read vulnerability scans but trigger nothing.
-
-To create a custom role:
-
-1. Open **Settings → Roles**.
-2. Click **Create role**.
-3. Name the role, optionally add a description.
-4. In the permission picker on the right, expand each resource group and check the actions this role should grant. A "select all" checkbox at the top of each group is handy for full-read or full-write roles.
-5. Save.
-
-Custom roles can be edited and deleted at any time. Built-in roles show a badge and the editor is read-only — use the **Clone as custom role** button to start a new role pre-populated with a built-in's permissions.
-
-When you delete a custom role, every assignment of it is also removed. The global-admin guard still applies — if removing the role would orphan the last global Admin, the deletion is refused.
-
-## Assigning roles to users
-
-From **Settings → Users**, open a user. The **Role assignments** section shows every role they hold, with a scope label (Global or a specific environment name). You can:
-
-- Add a row to grant a new role on an environment (or globally).
-- Remove a row to revoke that grant.
-- Use the **Global** scope to grant org-level permissions.
-
-A user with no assignments at all can authenticate but cannot read or do anything — they'll land on a "no access" screen until an admin grants them a role.
-
-### OIDC users
-
-If a user authenticated via OIDC matches an OIDC role mapping, their assignments come from the mapping table and are managed there. The user editor will be read-only for those assignments and link to **Settings → OIDC Mappings**. Manual assignments on OIDC users (for groups that have no mapping) still work and are preserved across logins.
-
-## OIDC group mappings
-
-For SSO-only deployments, role assignment can be driven entirely from your IdP. Map an OIDC group claim value to a role and an optional environment scope; on every login Arcane reads the user's group claim and re-syncs their `source=oidc` assignments to match.
-
-### Setup
-
-1. Confirm your IdP issues a groups claim. By default Arcane reads it from the `groups` claim — you can change this in **Settings → Settings** under **OIDC Groups Claim**. Common alternatives are `realm_access.roles` (Keycloak), `memberOf` (Azure AD), or a custom claim path.
-2. Open **Settings → OIDC Mappings**.
-3. Click **Add mapping** and fill in:
- - **Claim value**: the exact string that appears in the user's groups claim (e.g. `docker-admins`)
- - **Role**: the role to grant when this claim is present
- - **Environment scope**: `Global` for org-level role, or a specific environment
-4. Save.
-
-A user who is a member of multiple mapped groups receives the **union** of the matching assignments. A user demoted in the IdP loses their OIDC-sourced assignments on next login; their manual assignments (if any) remain.
-
-The legacy `OidcAdminClaim` / `OidcAdminValue` settings continue to work as an implicit "matching claim grants Admin globally" mapping. New deployments should configure mappings explicitly and leave those settings empty.
-
-### Declaring mappings via env (GitOps / IaC)
-
-For deployments that prefer to keep everything in source control, mappings can be declared via the `OIDC_ROLE_MAPPINGS` env var. The value is a JSON array of `{claimValue, roleId, environmentId?}` entries; reconciliation runs at every boot and is fully declarative — adding an entry creates it, removing one deletes it, editing one updates it. Manual mappings created in the UI are never touched.
-
-```
-OIDC_ROLE_MAPPINGS='[
- {"claimValue": "docker-admins", "roleId": "role_admin"},
- {"claimValue": "devops", "roleId": "role_editor", "environmentId": "env-prod"}
-]'
-```
-
-Env-managed rows are flagged with a `ENV` badge in the UI and are read-only — the Edit/Delete actions are disabled, and the API returns 409 if you try to mutate them. To change one, edit the env var and restart. Set `OIDC_ROLE_MAPPINGS='[]'` to wipe every env-managed row. The matching `OIDC_ROLE_MAPPINGS_FILE` env var works for Docker secret files.
-
-## API keys
-
-Every API key now carries its own permission set, independent of the owning user. This means you can issue narrow-scoped keys for CI/CD ("can deploy projects on prod, nothing else") without granting the owning user the same scope.
-
-### Creating a scoped API key
-
-1. Open **Settings → API Keys** and click **Create API key**.
-2. Fill in name, description, optional expiration.
-3. In the **Permissions** section, check the permissions this key should hold. Use environment scope just like role assignments.
-4. Save and copy the key value — it is shown only once.
-
-You cannot grant a key permissions you don't have yourself. Server-side validation rejects creating a key whose permission set exceeds the creator's effective permission set.
-
-### What happens to existing keys on upgrade
-
-Existing API keys created before this release inherit a snapshot of their owner's current effective permissions at upgrade time, scoped per the key's environment binding. If an owner's permissions change later, their existing keys are *not* automatically re-scoped — admins should review and re-issue keys after large permission changes.
-
-## The permission catalog
-
-Permissions follow `<resource>:<action>`. You don't usually pick them individually — the role editor groups them by resource — but here's the catalog for reference.
-
-### Org-level (require global-scope role)
-
-- **users**: `list`, `read`, `create`, `update`, `delete`
-- **roles**: `list`, `read` *(creating, editing, deleting, and assigning roles are admin-only — not delegatable)*
-- **apikeys**: `list`, `read`, `create`, `update`, `delete`
-- **settings**: `read`, `write`
-- **environments**: `list`, `read`, `create`, `update`, `delete`, `pair`, `sync`
-- **registries** (container registries): `list`, `read`, `create`, `update`, `delete`, `test`
-- **templates**: `list`, `read`, `create`, `update`, `delete`
-- **git-repositories**: `list`, `read`, `create`, `update`, `delete`, `test`, `sync`
-- **events**: `read`
-- **customize**: `manage`
-
-### Env-scoped (per environment)
-
-- **containers**: `list`, `read`, `logs`, `create`, `start`, `stop`, `restart`, `redeploy`, `delete`, `exec`, `autoupdate`
-- **projects**: `list`, `read`, `logs`, `create`, `update`, `deploy`, `down`, `restart`, `delete`, `archive`
-- **images**: `list`, `read`, `pull`, `push`, `build`, `prune`, `delete`, `upload`
-- **volumes**: `list`, `read`, `create`, `delete`, `prune`, `browse`, `upload`, `backup`
-- **networks**: `list`, `read`, `create`, `delete`, `prune`
-- **swarm**: `read`, `init`, `join`, `leave`, `spec`, `nodes`, `services`, `services:logs`, `stacks`, `configs`, `secrets`, `unlock`
-- **gitops**: `list`, `read`, `create`, `update`, `delete`, `sync`
-- **webhooks**: `list`, `create`, `update`, `delete`
-- **jobs**: `manage`
-- **notifications**: `manage`
-- **dashboard**: `read`
-- **system**: `read`, `prune`, `upgrade`
-- **image-updates**: `read`, `check`
-- **vulnerabilities**: `read`, `scan`, `manage`
-- **build-workspaces**: `manage`
-
-## Upgrade & migration
-
-When you upgrade from a pre-RBAC release of Arcane, the migration runs automatically the first time the new server starts:
-
-- Every user that held the legacy `admin` role gets a **global Admin** assignment.
-- Every other user gets a single **global Viewer** assignment (read-only across everything, including the Settings area).
-- Existing API keys inherit a snapshot of their owner's effective permissions.
-
-If for some reason the migration would leave no global admins, Arcane refuses to start and logs an error — restore from backup and investigate before retrying.
-
-After the upgrade you should:
-
-1. **Review your admins.** `Settings → Users` shows every user and their assignments at a glance.
-2. **Right-size non-admins.** Defaulting everyone to global Viewer is safe but very restrictive (read-only, no logs). Promote individual users to Editor / No-Shell Editor / Deployer / Monitor on the environments they actually use.
-3. **Map OIDC groups, if you use SSO.** Set the `OIDC Groups Claim` and add mappings under `Settings → OIDC Mappings`. Existing legacy `OidcAdminClaim` / `OidcAdminValue` settings keep working, but mappings give you finer control.
-4. **Review API keys.** Each key now carries its own permissions; the upgrade gives them a snapshot of the owner's permissions, which is the most permissive safe default. Tighten down CI/CD keys to least privilege.
-
-## Troubleshooting
-
-**"permission denied: ..." errors after upgrade.** Find the permission string in the error, look it up in the catalog above, and check whether the caller's role grants it on the right environment. Admins can audit a user's effective permissions from `Settings → Users`.
-
-**A user has no access at all.** They probably have no role assignments. Open them in `Settings → Users` and add at least one assignment (typically `Viewer` on every environment they should see).
-
-**Last-admin guard tripped (`at least one user must retain a global Admin role assignment`).** You tried to remove, demote, or OIDC-resync away the last globally-scoped Admin. Add another global Admin first, then retry.
-
-**OIDC user lost their access on login.** Their group claim no longer matches any mapping. Check the IdP-side group membership and the mapping table; OIDC-sourced assignments are re-evaluated on every login.
-
-**API key fails with permission denied.** Keys carry their own permissions, not the owner's current permissions. If you changed the owner's role, the key still has whatever it was provisioned with. Re-issue the key with the desired scope.
diff --git a/frontend/messages/en.json b/frontend/messages/en.json
index 82490a840..c031475c5 100644
--- a/frontend/messages/en.json
+++ b/frontend/messages/en.json
@@ -1961,12 +1961,40 @@
"docker_info_ipv4_forwarding": "IPv4 Forwarding",
"docker_info_http_proxy": "HTTP Proxy",
"docker_info_https_proxy": "HTTPS Proxy",
- "docker_info_no_proxy": "No Proxy",
- "docker_info_bridge_ip": "Bridge IP",
- "docker_info_plugins_section": "Plugins",
+ "docker_info_no_proxy": "No Proxy", "docker_info_plugins_section": "Plugins",
"docker_info_logs_plugin": "Logs",
"docker_info_security_options": "Security Options",
"docker_info_runtimes": "Runtimes",
+ "docker_info_warnings_section": "Warnings",
+ "docker_info_capabilities_section": "Runtime Capabilities",
+ "docker_info_storage_details_section": "Storage Driver Details",
+ "docker_info_swarm_section": "Swarm",
+ "docker_info_labels_section": "Engine Labels",
+ "docker_info_os_version_label": "OS Version",
+ "docker_info_debug_label": "Debug Mode",
+ "docker_info_live_restore_label": "Live Restore",
+ "docker_info_index_server_label": "Index Server",
+ "docker_info_product_license_label": "Product License",
+ "docker_info_containerd_commit_label": "containerd",
+ "docker_info_runc_commit_label": "runc",
+ "docker_info_init_commit_label": "init",
+ "docker_info_memory_limit_label": "Memory Limit",
+ "docker_info_swap_limit_label": "Swap Limit",
+ "docker_info_kernel_memory_tcp_label": "Kernel Memory TCP",
+ "docker_info_cpu_cfs_period_label": "CPU CFS Period",
+ "docker_info_cpu_cfs_quota_label": "CPU CFS Quota",
+ "docker_info_cpu_shares_label": "CPU Shares",
+ "docker_info_cpu_set_label": "CPUSet",
+ "docker_info_pids_limit_label": "PIDs Limit",
+ "docker_info_oom_kill_disable_label": "OOM Kill Disable",
+ "docker_info_event_listeners_label": "Event Listeners",
+ "docker_info_address_pools_label": "Address Pools",
+ "docker_info_authorization_plugin": "Authorization",
+ "docker_info_swarm_state_label": "Node State",
+ "docker_info_swarm_node_id_label": "Node ID",
+ "docker_info_swarm_manager_label": "Is Manager",
+ "docker_info_swarm_managers_label": "Managers",
+ "docker_info_swarm_nodes_label": "Nodes",
"_comment_sidebar": "=== SIDEBAR ===",
"sidebar_environment_label": "Environment",
"sidebar_select_environment": "Select Environment",
diff --git a/frontend/src/app.css b/frontend/src/app.css
index 10eb108cf..56c773809 100644
--- a/frontend/src/app.css
+++ b/frontend/src/app.css
@@ -45,7 +45,6 @@
--glass-base: var(--bg-surface);
--glass-tint: var(--primary);
--glass-shadow-color: oklch(0 0 0 / 0.12);
- --glass-noise-opacity: 0.03;
}
.dark {
@@ -121,7 +120,6 @@
--glass-base: var(--surface);
--glass-tint: var(--primary);
--glass-shadow-color: oklch(0.11 0.012 264.4 / 0.12);
- --glass-noise-opacity: 0.018;
}
:root.dark[data-app-theme='graphite'] {
@@ -155,7 +153,6 @@
--glass-base: var(--surface);
--glass-tint: var(--primary);
--glass-shadow-color: oklch(0 0 0 / 0.38);
- --glass-noise-opacity: 0.018;
}
:root[data-app-theme='ocean'] {
@@ -189,7 +186,6 @@
--glass-base: var(--surface);
--glass-tint: var(--primary);
--glass-shadow-color: oklch(0.13 0.02 246.1 / 0.12);
- --glass-noise-opacity: 0.02;
}
:root.dark[data-app-theme='ocean'] {
@@ -223,7 +219,6 @@
--glass-base: var(--surface);
--glass-tint: var(--primary);
--glass-shadow-color: oklch(0 0 0 / 0.36);
- --glass-noise-opacity: 0.02;
}
:root[data-app-theme='amber'] {
@@ -257,7 +252,6 @@
--glass-base: var(--surface);
--glass-tint: var(--primary);
--glass-shadow-color: oklch(0.16 0.024 63.6 / 0.12);
- --glass-noise-opacity: 0.022;
}
:root.dark[data-app-theme='amber'] {
@@ -291,7 +285,6 @@
--glass-base: var(--surface);
--glass-tint: var(--primary);
--glass-shadow-color: oklch(0 0 0 / 0.34);
- --glass-noise-opacity: 0.02;
}
:root[data-app-theme='github'] {
@@ -325,7 +318,6 @@
--glass-base: var(--surface);
--glass-tint: var(--primary);
--glass-shadow-color: oklch(0.12 0.008 248.2 / 0.1);
- --glass-noise-opacity: 0.012;
}
:root.dark[data-app-theme='github'] {
@@ -359,7 +351,6 @@
--glass-base: var(--surface);
--glass-tint: var(--primary);
--glass-shadow-color: oklch(0 0 0 / 0.34);
- --glass-noise-opacity: 0.012;
}
:root[data-app-theme='nord'] {
@@ -393,7 +384,6 @@
--glass-base: var(--surface);
--glass-tint: var(--primary);
--glass-shadow-color: oklch(0.16 0.02 258.6 / 0.1);
- --glass-noise-opacity: 0.018;
}
:root.dark[data-app-theme='nord'] {
@@ -427,7 +417,6 @@
--glass-base: var(--surface);
--glass-tint: var(--primary);
--glass-shadow-color: oklch(0 0 0 / 0.33);
- --glass-noise-opacity: 0.018;
}
:root[data-app-theme='everforest'] {
@@ -461,7 +450,6 @@
--glass-base: var(--surface);
--glass-tint: var(--primary);
--glass-shadow-color: oklch(0.18 0.022 156.1 / 0.1);
- --glass-noise-opacity: 0.018;
}
:root.dark[data-app-theme='everforest'] {
@@ -495,7 +483,6 @@
--glass-base: var(--surface);
--glass-tint: var(--primary);
--glass-shadow-color: oklch(0 0 0 / 0.34);
- --glass-noise-opacity: 0.018;
}
:root[data-app-theme='rosepine'] {
@@ -529,7 +516,6 @@
--glass-base: var(--surface);
--glass-tint: var(--primary);
--glass-shadow-color: oklch(0.19 0.024 313.7 / 0.1);
- --glass-noise-opacity: 0.016;
}
:root.dark[data-app-theme='rosepine'] {
@@ -563,7 +549,6 @@
--glass-base: var(--surface);
--glass-tint: var(--primary);
--glass-shadow-color: oklch(0 0 0 / 0.34);
- --glass-noise-opacity: 0.016;
}
/* OLED dark mode — only activates for the default application theme */
@@ -583,7 +568,6 @@
--bg-surface: oklch(0.02 0.001 285);
--glass-base: oklch(0.02 0.001 285);
--glass-shadow-color: oklch(0 0 0 / 0.6);
- --glass-noise-opacity: 0.015;
}
@theme inline {
@@ -703,49 +687,12 @@
}
}
-body.glass-enabled {
- background-color: var(--background);
-}
-
-body.glass-enabled::before {
- display: none !important;
-}
-
-@media (prefers-reduced-motion: reduce) {
- body.glass-enabled::before {
- animation: none;
- }
-}
-
-body::after {
- content: '';
- position: fixed;
- inset: 0;
- z-index: -1;
- background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNDAiIGhlaWdodD0iMTQwIiB2aWV3Qm94PSIwIDAgMTQwIDE0MCI+PGZpbHRlciBpZD0ibiI+PGZlVHVyYnVsZW5jZSB0eXBlPSJmcmFjdGFsTm9pc2UiIGJhc2VGcmVxdWVuY3k9IjAuOSIgbnVtT2N0YXZlcz0iNCIgc3RpdGNoVGlsZXM9InN0aXRjaCIvPjwvZmlsdGVyPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbHRlcj0idXJsKCNuKSIgb3BhY2l0eT0iMC4wNCIvPjwvc3ZnPg==');
- background-size: 200px 200px;
- opacity: var(--glass-noise-opacity);
- pointer-events: none;
- backface-visibility: hidden;
- transform: translateZ(0);
- will-change: transform;
-}
-
-@keyframes ambient-float {
- 0% {
- transform: translate3d(-1.5%, -1%, 0) scale(1);
- }
- 100% {
- transform: translate3d(1.5%, 1%, 0) scale(1.02);
- }
-}
-
@layer utilities {
.bubble {
background:
radial-gradient(
120% 100% at 10% 0%,
- color-mix(in oklch, var(--glass-tint, var(--primary)) 10%, transparent) 0%,
+ color-mix(in oklch, var(--glass-tint, var(--primary)) 7%, transparent) 0%,
transparent 60%
),
radial-gradient(
@@ -754,10 +701,8 @@ body::after {
transparent 60%
);
background-color: color-mix(in oklch, var(--glass-base, var(--bg-surface)) 92%, transparent);
- border-radius: var(--radius-xl);
- box-shadow:
- 0 8px 24px -8px color-mix(in oklch, var(--glass-shadow-color) 70%, transparent),
- 0 1px 0 0 color-mix(in oklch, var(--glass-base, var(--bg-surface)) 30%, transparent) inset;
+ border-radius: var(--radius-lg);
+ box-shadow: 0 2px 8px -4px color-mix(in oklch, var(--glass-shadow-color) 50%, transparent);
}
.bubble-pill {
@@ -767,15 +712,11 @@ body::after {
}
.bubble-shadow {
- box-shadow:
- 0 8px 30px -12px color-mix(in oklch, var(--glass-shadow-color) 70%, transparent),
- 0 1px 0 0 color-mix(in oklch, var(--glass-base, var(--bg-surface)) 30%, transparent) inset;
+ box-shadow: 0 1px 2px -1px color-mix(in oklch, var(--glass-shadow-color) 60%, transparent);
}
.bubble-shadow-lg {
- box-shadow:
- 0 14px 40px -14px color-mix(in oklch, var(--glass-shadow-color) 80%, transparent),
- 0 1px 0 0 color-mix(in oklch, var(--glass-base, var(--bg-surface)) 35%, transparent) inset;
+ box-shadow: 0 6px 20px -10px color-mix(in oklch, var(--glass-shadow-color) 60%, transparent);
}
.hover-lift {
@@ -785,7 +726,7 @@ body::after {
}
.hover-lift:hover {
- transform: translateY(-2px) translateZ(0);
+ transform: translateZ(0);
}
@media (prefers-reduced-motion: reduce) {
@@ -804,38 +745,6 @@ body::after {
border: 1px solid transparent;
border-radius: var(--radius-lg);
}
-
- /* Floating blob utility for accent backgrounds on sections */
- .blob-floating {
- position: relative;
- isolation: isolate;
- }
- .blob-floating::before {
- content: '';
- position: absolute;
- inset: -20%;
- z-index: -1;
- background:
- radial-gradient(
- 40% 40% at 20% 20%,
- color-mix(in oklch, var(--glass-tint, var(--primary)) 20%, transparent) 0%,
- transparent 60%
- ),
- radial-gradient(40% 50% at 80% 30%, color-mix(in oklch, var(--chart-2) 14%, transparent) 0%, transparent 60%);
- filter: blur(60px) saturate(105%);
- opacity: 0.22;
- animation: blob-float var(--blob-speed, 18s) ease-in-out infinite alternate;
- will-change: transform;
- }
-
- @keyframes blob-float {
- 0% {
- transform: translate3d(-2%, 0, 0) scale(1);
- }
- 100% {
- transform: translate3d(2%, 1%, 0) scale(1.05);
- }
- }
}
.version-collapsed {
diff --git a/frontend/src/app.html b/frontend/src/app.html
index 214370ae1..d5eec4082 100644
--- a/frontend/src/app.html
+++ b/frontend/src/app.html
@@ -14,7 +14,7 @@
<meta name="theme-color" content="oklch(0.141 0.005 285.823)" media="(prefers-color-scheme: dark)" />
%sveltekit.head%
</head>
- <body data-sveltekit-preload-data="hover" class="glass-enabled">
+ <body data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div>
</body>
</html>
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 4a97d858a..f7863ceef 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
@@ -214,7 +214,7 @@
<div class="flex items-center justify-end" data-row-select-ignore>
<div
class={cn(
- 'border-border/40 bg-background pointer-events-auto flex items-center gap-1 rounded-full border px-2 py-1 shadow-sm',
+ 'border-border/40 bg-background pointer-events-auto flex items-center gap-1 rounded-md border px-2 py-1',
unstyled && 'border-transparent bg-transparent shadow-none'
)}
>
diff --git a/frontend/src/lib/components/badges/port-badge.svelte b/frontend/src/lib/components/badges/port-badge.svelte
index 057119bca..40d1c135b 100644
--- a/frontend/src/lib/components/badges/port-badge.svelte
+++ b/frontend/src/lib/components/badges/port-badge.svelte
@@ -91,7 +91,7 @@
<ArcaneTooltip.Root interactive>
<ArcaneTooltip.Trigger>
<a
- class="ring-offset-background focus-visible:ring-ring bg-background/70 inline-flex items-center gap-1 rounded-lg border border-sky-700/20 px-2 py-1 text-[11px] shadow-sm transition-colors hover:border-sky-700/40 hover:bg-sky-500/10 hover:shadow-md focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none dark:border-sky-400/40 dark:bg-sky-500/20 dark:text-sky-100 dark:hover:border-sky-300/60 dark:hover:bg-sky-500/30"
+ class="ring-offset-background focus-visible:ring-ring bg-background/70 inline-flex items-center gap-1 rounded-md border border-sky-700/20 px-2 py-1 text-[11px] transition-colors hover:border-sky-700/40 hover:bg-sky-500/10 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none dark:border-sky-400/40 dark:bg-sky-500/20 dark:text-sky-100 dark:hover:border-sky-300/60 dark:hover:bg-sky-500/30"
href={toPortHref(p.hostPort!, baseServerUrl)}
target="_blank"
rel="noopener noreferrer"
@@ -113,7 +113,7 @@
<ArcaneTooltip.Root>
<ArcaneTooltip.Trigger>
<span
- class="bg-background/50 inline-flex items-center gap-1 rounded-lg border border-gray-600/30 px-2 py-1 text-[11px] text-gray-400 shadow-sm dark:border-slate-400/40 dark:bg-slate-500/20 dark:text-slate-200"
+ class="bg-background/50 inline-flex items-center gap-1 rounded-md border border-gray-600/30 px-2 py-1 text-[11px] text-gray-400 dark:border-slate-400/40 dark:bg-slate-500/20 dark:text-slate-200"
>
<span class="tabular-nums">{p.containerPort}</span>
{#if p.proto}
@@ -133,7 +133,7 @@
<ArcaneTooltip.Trigger>
<button
onclick={() => (expanded = !expanded)}
- class="bg-muted hover:bg-muted/80 text-muted-foreground inline-flex cursor-pointer items-center rounded-lg border px-2 py-1 text-[11px] font-medium shadow-sm transition-colors"
+ class="bg-muted hover:bg-muted/80 text-muted-foreground inline-flex cursor-pointer items-center rounded-md border px-2 py-1 text-[11px] font-medium transition-colors"
>
{expanded ? '−' : `+${hiddenCount}`}
</button>
diff --git a/frontend/src/lib/components/badges/status-badge.svelte b/frontend/src/lib/components/badges/status-badge.svelte
index 35cca6670..8750a9a6e 100644
--- a/frontend/src/lib/components/badges/status-badge.svelte
+++ b/frontend/src/lib/components/badges/status-badge.svelte
@@ -86,7 +86,7 @@
const badgeClasses = $derived(
cn(
'inline-flex shrink-0 items-center justify-center whitespace-nowrap rounded-[var(--radius)] font-semibold tracking-tight',
- 'border transition-all duration-300',
+ 'border transition-colors',
sizeStyles[size as Size],
variantStyles[variant as Variant],
minWidthClasses[minWidth as MinWidth],
diff --git a/frontend/src/lib/components/dialogs/docker-info-dialog.svelte b/frontend/src/lib/components/dialogs/docker-info-dialog.svelte
index d68ff5cf9..1342c4d24 100644
--- a/frontend/src/lib/components/dialogs/docker-info-dialog.svelte
+++ b/frontend/src/lib/components/dialogs/docker-info-dialog.svelte
@@ -26,6 +26,17 @@
if (!timeStr) return '-';
return formatDateTimeShort(timeStr) || timeStr;
}
+
+ function shortCommit(commit: { ID?: string } | undefined | null): string {
+ const id = commit?.ID;
+ if (!id) return '-';
+ return id.length > 12 ? id.slice(0, 12) : id;
+ }
+
+ function swarmActive(info: DockerInfo): boolean {
+ const state = (info.Swarm as { LocalNodeState?: string } | undefined)?.LocalNodeState;
+ return !!state && state !== 'inactive';
+ }
</script>
<ResponsiveDialog
@@ -65,26 +76,48 @@
</ResponsiveDialog>
{#snippet dialogBody(info: DockerInfo)}
- <div class="space-y-6 pt-4">
- <div class="grid gap-6">
- {@render statsSection(info)}
- {@render resourcesSection(info)}
- </div>
+ <div class="space-y-4 pt-2">
+ {#if info.Warnings && info.Warnings.length > 0}
+ {@render warningsCard(info.Warnings)}
+ {/if}
- <div class="grid gap-6 lg:grid-cols-2 xl:grid-cols-3">
+ {@render statsSection(info)}
+ {@render resourcesSection(info)}
+
+ <div class="columns-1 gap-3 sm:columns-2 lg:columns-3 [&>*]:mb-3 [&>*]:break-inside-avoid">
{@render systemSection(info)}
{@render versionSection(info)}
{@render configurationSection(info)}
- </div>
-
- <div class="grid gap-6 lg:grid-cols-2 xl:grid-cols-3">
- {@render networkSection(info)}
+ {@render capabilitiesSection(info)}
+ {#if info.DriverStatus && info.DriverStatus.length > 0}
+ {@render storageDetailsSection(info)}
+ {/if}
{@render securitySection(info)}
{@render pluginsSection(info)}
+ {#if swarmActive(info)}
+ {@render swarmSection(info)}
+ {/if}
+ {#if info.Labels && info.Labels.length > 0}
+ {@render labelsSection(info)}
+ {/if}
+ {@render networkSection(info)}
</div>
</div>
{/snippet}
+{#snippet warningsCard(warnings: string[])}
+ <div class="space-y-1.5 rounded-lg border border-amber-500/30 bg-amber-500/5 p-3">
+ <h3 class="text-xs font-semibold tracking-wider text-amber-600 uppercase dark:text-amber-400">
+ {m.docker_info_warnings_section()}
+ </h3>
+ <ul class="space-y-1">
+ {#each warnings as warning, i (i)}
+ <li class="text-xs [overflow-wrap:anywhere] text-amber-700 dark:text-amber-300">{warning}</li>
+ {/each}
+ </ul>
+ </div>
+{/snippet}
+
{#snippet statsSection(info: DockerInfo)}
<div>
<h3 class="text-muted-foreground mb-2 text-xs font-semibold tracking-wider uppercase">
@@ -99,20 +132,51 @@
</div>
{/snippet}
+{#snippet resourcesSection(info: DockerInfo)}
+ <div>
+ <h3 class="text-muted-foreground mb-2 text-xs font-semibold tracking-wider uppercase">
+ {m.docker_info_resources_section()}
+ </h3>
+ <div class="grid gap-3 sm:grid-cols-4">
+ <div class="rounded-lg border p-3">
+ <div class="text-muted-foreground mb-1 text-[10px] tracking-tight uppercase">{m.common_cpus()}</div>
+ <div class="flex items-center gap-2">
+ <Badge variant="outline" class="text-sm font-semibold">{info.NCPU ?? 0}</Badge>
+ <span class="text-muted-foreground text-[10px]">cores</span>
+ </div>
+ </div>
+ <div class="rounded-lg border p-3">
+ <div class="text-muted-foreground mb-1 text-[10px] tracking-tight uppercase">{m.docker_info_memory_label()}</div>
+ <Badge variant="outline" class="text-sm font-semibold">{info.MemTotal ? bytes.format(info.MemTotal) : '-'}</Badge>
+ </div>
+ <div class="rounded-lg border p-3">
+ <div class="text-muted-foreground mb-1 text-[10px] tracking-tight uppercase">{m.docker_info_goroutines()}</div>
+ <Badge variant="outline" class="text-sm font-semibold">{info.NGoroutines ?? 0}</Badge>
+ </div>
+ <div class="rounded-lg border p-3">
+ <div class="text-muted-foreground mb-1 text-[10px] tracking-tight uppercase">{m.docker_info_file_descriptors()}</div>
+ <Badge variant="outline" class="text-sm font-semibold">{info.NFd ?? 0}</Badge>
+ </div>
+ </div>
+ </div>
+{/snippet}
+
{#snippet systemSection(info: DockerInfo)}
<div class="space-y-2">
<h3 class="text-muted-foreground text-xs font-semibold tracking-wider uppercase">
{m.docker_info_system_section()}
</h3>
- <div class="space-y-1.5 rounded-lg border p-3">
+ <div class="space-y-1 rounded-lg border p-2.5">
{@render infoRow(m.common_name(), info.Name)}
{@render infoRow(m.common_id(), info.ID, true)}
{@render infoRow(m.docker_info_os_label(), info.OperatingSystem)}
+ {@render infoRow(m.docker_info_os_version_label(), info.OSVersion)}
{@render infoRow(m.docker_info_os_type_label(), info.OSType)}
{@render infoRow(m.common_architecture(), info.Architecture)}
{@render infoRow(m.docker_info_kernel_version_label(), info.KernelVersion)}
{@render infoRow(m.docker_info_system_time(), formatTime(info.SystemTime), false)}
{@render infoRow(m.docker_info_root_dir(), info.DockerRootDir, true)}
+ {@render infoRow(m.docker_info_index_server_label(), info.IndexServerAddress, true)}
</div>
</div>
{/snippet}
@@ -122,13 +186,13 @@
<h3 class="text-muted-foreground text-xs font-semibold tracking-wider uppercase">
{m.docker_info_version_section()}
</h3>
- <div class="space-y-1.5 rounded-lg border p-3">
+ <div class="space-y-1 rounded-lg border p-2.5">
{@render infoRow(m.docker_info_server_version_label(), info.ServerVersion)}
{@render infoRow(m.docker_info_api_version_label(), info.apiVersion)}
{@render infoRow(m.docker_info_go_version_label(), info.goVersion)}
- <div class="flex items-center justify-between gap-4">
- <span class="text-muted-foreground text-xs">{m.docker_info_git_commit_label()}</span>
- <div class="flex items-center gap-2">
+ <div class="grid grid-cols-[minmax(112px,38%)_minmax(0,1fr)] items-start gap-x-4 gap-y-1">
+ <span class="text-muted-foreground text-[10px] tracking-tight uppercase">{m.docker_info_git_commit_label()}</span>
+ <div class="flex items-center justify-end gap-2">
<code class="bg-muted rounded px-1.5 py-0.5 text-xs">{info.gitCommit?.slice(0, 8) ?? '-'}</code>
{#if info.gitCommit}
<CopyButton text={info.gitCommit} size="icon" class="size-6" title="Copy full commit hash" />
@@ -137,35 +201,12 @@
</div>
{@render infoRow(m.docker_info_build_time_label(), formatTime(info.buildTime), false)}
{@render infoRow(m.docker_info_experimental(), info.ExperimentalBuild ? m.common_yes() : m.common_no(), false)}
- </div>
- </div>
-{/snippet}
-
-{#snippet resourcesSection(info: DockerInfo)}
- <div>
- <h3 class="text-muted-foreground mb-2 text-xs font-semibold tracking-wider uppercase">
- {m.docker_info_resources_section()}
- </h3>
- <div class="grid gap-3 sm:grid-cols-4">
- <div class="rounded-lg border p-3">
- <div class="text-muted-foreground mb-1 text-[10px] tracking-tight uppercase">{m.common_cpus()}</div>
- <div class="flex items-center gap-2">
- <Badge variant="outline" class="text-sm font-semibold">{info.NCPU ?? 0}</Badge>
- <span class="text-muted-foreground text-[10px]">cores</span>
- </div>
- </div>
- <div class="rounded-lg border p-3">
- <div class="text-muted-foreground mb-1 text-[10px] tracking-tight uppercase">{m.docker_info_memory_label()}</div>
- <Badge variant="outline" class="text-sm font-semibold">{info.MemTotal ? bytes.format(info.MemTotal) : '-'}</Badge>
- </div>
- <div class="rounded-lg border p-3">
- <div class="text-muted-foreground mb-1 text-[10px] tracking-tight uppercase">{m.docker_info_goroutines()}</div>
- <Badge variant="outline" class="text-sm font-semibold">{info.NGoroutines ?? 0}</Badge>
- </div>
- <div class="rounded-lg border p-3">
- <div class="text-muted-foreground mb-1 text-[10px] tracking-tight uppercase">{m.docker_info_file_descriptors()}</div>
- <Badge variant="outline" class="text-sm font-semibold">{info.NFd ?? 0}</Badge>
- </div>
+ {@render infoRow(m.docker_info_containerd_commit_label(), shortCommit(info.ContainerdCommit), true)}
+ {@render infoRow(m.docker_info_runc_commit_label(), shortCommit(info.RuncCommit), true)}
+ {@render infoRow(m.docker_info_init_commit_label(), shortCommit(info.InitCommit), true)}
+ {#if info.ProductLicense}
+ {@render infoRow(m.docker_info_product_license_label(), info.ProductLicense, false)}
+ {/if}
</div>
</div>
{/snippet}
@@ -175,7 +216,7 @@
<h3 class="text-muted-foreground text-xs font-semibold tracking-wider uppercase">
{m.common_configuration()}
</h3>
- <div class="space-y-1.5 rounded-lg border p-3">
+ <div class="space-y-1 rounded-lg border p-2.5">
{@render infoRow(m.docker_info_storage_driver_label(), info.Driver)}
{@render infoRow(m.docker_info_logging_driver_label(), info.LoggingDriver)}
{@render infoRow(m.docker_info_cgroup_driver_label(), info.CgroupDriver)}
@@ -183,6 +224,41 @@
{@render infoRow(m.docker_info_isolation(), info.Isolation)}
{@render infoRow(m.docker_info_init_binary(), info.InitBinary)}
{@render infoRow(m.docker_info_default_runtime(), info.DefaultRuntime)}
+ {@render infoRow(m.docker_info_debug_label(), info.Debug ? m.common_yes() : m.common_no(), false)}
+ {@render infoRow(m.docker_info_live_restore_label(), info.LiveRestoreEnabled ? m.common_yes() : m.common_no(), false)}
+ {@render infoRow(m.docker_info_event_listeners_label(), info.NEventsListener ?? 0, false)}
+ </div>
+ </div>
+{/snippet}
+
+{#snippet capabilitiesSection(info: DockerInfo)}
+ <div class="space-y-2">
+ <h3 class="text-muted-foreground text-xs font-semibold tracking-wider uppercase">
+ {m.docker_info_capabilities_section()}
+ </h3>
+ <div class="space-y-1 rounded-lg border p-2.5">
+ {@render capRow(m.docker_info_memory_limit_label(), info.MemoryLimit)}
+ {@render capRow(m.docker_info_swap_limit_label(), info.SwapLimit)}
+ {@render capRow(m.docker_info_kernel_memory_tcp_label(), info.KernelMemoryTCP)}
+ {@render capRow(m.docker_info_cpu_cfs_period_label(), info.CpuCfsPeriod)}
+ {@render capRow(m.docker_info_cpu_cfs_quota_label(), info.CpuCfsQuota)}
+ {@render capRow(m.docker_info_cpu_shares_label(), info.CPUShares)}
+ {@render capRow(m.docker_info_cpu_set_label(), info.CPUSet)}
+ {@render capRow(m.docker_info_pids_limit_label(), info.PidsLimit)}
+ {@render capRow(m.docker_info_oom_kill_disable_label(), info.OomKillDisable)}
+ </div>
+ </div>
+{/snippet}
+
+{#snippet storageDetailsSection(info: DockerInfo)}
+ <div class="space-y-2">
+ <h3 class="text-muted-foreground text-xs font-semibold tracking-wider uppercase">
+ {m.docker_info_storage_details_section()}
+ </h3>
+ <div class="space-y-1 rounded-lg border p-2.5">
+ {#each info.DriverStatus ?? [] as entry, i (i)}
+ {@render infoRow(entry[0] ?? '', entry[1], false)}
+ {/each}
</div>
</div>
{/snippet}
@@ -192,12 +268,33 @@
<h3 class="text-muted-foreground text-xs font-semibold tracking-wider uppercase">
{m.resource_networks_cap()} & {m.docker_info_proxy_label()}
</h3>
- <div class="space-y-1.5 rounded-lg border p-3">
+ <div class="space-y-1 rounded-lg border p-2.5">
{@render infoRow(m.docker_info_ipv4_forwarding(), info.IPv4Forwarding ? m.common_enabled() : m.common_disabled(), false)}
{@render infoRow(m.docker_info_http_proxy(), info.HttpProxy)}
{@render infoRow(m.docker_info_https_proxy(), info.HttpsProxy)}
{@render infoRow(m.docker_info_no_proxy(), info.NoProxy)}
- {@render infoRow(m.docker_info_bridge_ip(), info.DefaultAddressPools?.[0]?.Base)}
+ {#if info.DefaultAddressPools && info.DefaultAddressPools.length > 0}
+ <div>
+ <div class="text-muted-foreground mb-1 text-[10px] tracking-tight uppercase">{m.docker_info_address_pools_label()}</div>
+ <div class="flex flex-wrap gap-1">
+ {#each info.DefaultAddressPools as pool, i (i)}
+ <Badge variant="outline" class="px-1.5 py-0 font-mono text-[10px]">{pool.Base}/{pool.Size}</Badge>
+ {/each}
+ </div>
+ </div>
+ {/if}
+ </div>
+ </div>
+{/snippet}
+
+{#snippet securitySection(info: DockerInfo)}
+ <div class="space-y-2">
+ <h3 class="text-muted-foreground text-xs font-semibold tracking-wider uppercase">
+ {m.security_title()} & {m.docker_info_runtimes()}
+ </h3>
+ <div class="space-y-2 rounded-lg border p-2.5">
+ {@render tagGroup(m.docker_info_security_options(), info.SecurityOptions)}
+ {@render tagGroup(m.docker_info_runtimes(), Object.keys(info.Runtimes ?? {}))}
</div>
</div>
{/snippet}
@@ -207,66 +304,47 @@
<h3 class="text-muted-foreground text-xs font-semibold tracking-wider uppercase">
{m.docker_info_plugins_section()}
</h3>
- <div class="space-y-3 rounded-lg border p-3">
- <div>
- <div class="text-muted-foreground mb-1 text-[10px] tracking-tight uppercase">{m.resource_volumes_cap()}</div>
- <div class="flex flex-wrap gap-1">
- {#each info.Plugins?.Volume ?? [] as plugin}
- <Badge variant="outline" class="px-1.5 py-0 text-[10px]">{plugin}</Badge>
- {:else}
- <span class="text-muted-foreground text-xs">-</span>
- {/each}
- </div>
- </div>
- <div>
- <div class="text-muted-foreground mb-1 text-[10px] tracking-tight uppercase">{m.resource_networks_cap()}</div>
- <div class="flex flex-wrap gap-1">
- {#each info.Plugins?.Network ?? [] as plugin}
- <Badge variant="outline" class="px-1.5 py-0 text-[10px]">{plugin}</Badge>
- {:else}
- <span class="text-muted-foreground text-xs">-</span>
- {/each}
- </div>
- </div>
- <div>
- <div class="text-muted-foreground mb-1 text-[10px] tracking-tight uppercase">{m.docker_info_logs_plugin()}</div>
- <div class="flex flex-wrap gap-1">
- {#each info.Plugins?.Log ?? [] as plugin}
- <Badge variant="outline" class="px-1.5 py-0 text-[10px]">{plugin}</Badge>
- {:else}
- <span class="text-muted-foreground text-xs">-</span>
- {/each}
- </div>
- </div>
+ <div class="space-y-2 rounded-lg border p-2.5">
+ {@render tagGroup(m.resource_volumes_cap(), info.Plugins?.Volume)}
+ {@render tagGroup(m.resource_networks_cap(), info.Plugins?.Network)}
+ {@render tagGroup(m.docker_info_logs_plugin(), info.Plugins?.Log)}
+ {@render tagGroup(m.docker_info_authorization_plugin(), info.Plugins?.Authorization)}
</div>
</div>
{/snippet}
-{#snippet securitySection(info: DockerInfo)}
+{#snippet swarmSection(info: DockerInfo)}
+ {@const swarm = info.Swarm as {
+ LocalNodeState?: string;
+ ControlAvailable?: boolean;
+ NodeID?: string;
+ Managers?: number;
+ Nodes?: number;
+ }}
<div class="space-y-2">
<h3 class="text-muted-foreground text-xs font-semibold tracking-wider uppercase">
- {m.security_title()} & {m.docker_info_runtimes()}
+ {m.docker_info_swarm_section()}
</h3>
- <div class="space-y-3 rounded-lg border p-3">
- <div>
- <div class="text-muted-foreground mb-1 text-[10px] tracking-tight uppercase">{m.docker_info_security_options()}</div>
- <div class="flex flex-wrap gap-1">
- {#each info.SecurityOptions ?? [] as opt}
- <Badge variant="outline" class="px-1.5 py-0 text-[10px]">{opt}</Badge>
- {:else}
- <span class="text-muted-foreground text-xs">-</span>
- {/each}
- </div>
- </div>
- <div>
- <div class="text-muted-foreground mb-1 text-[10px] tracking-tight uppercase">{m.docker_info_runtimes()}</div>
- <div class="flex flex-wrap gap-1">
- {#each Object.keys(info.Runtimes ?? {}) as runtime}
- <Badge variant="outline" class="px-1.5 py-0 text-[10px]">{runtime}</Badge>
- {:else}
- <span class="text-muted-foreground text-xs">-</span>
- {/each}
- </div>
+ <div class="space-y-1 rounded-lg border p-2.5">
+ {@render infoRow(m.docker_info_swarm_state_label(), swarm.LocalNodeState, false)}
+ {@render infoRow(m.docker_info_swarm_manager_label(), swarm.ControlAvailable ? m.common_yes() : m.common_no(), false)}
+ {@render infoRow(m.docker_info_swarm_node_id_label(), swarm.NodeID, true)}
+ {@render infoRow(m.docker_info_swarm_managers_label(), swarm.Managers ?? 0, false)}
+ {@render infoRow(m.docker_info_swarm_nodes_label(), swarm.Nodes ?? 0, false)}
+ </div>
+ </div>
+{/snippet}
+
+{#snippet labelsSection(info: DockerInfo)}
+ <div class="space-y-2">
+ <h3 class="text-muted-foreground text-xs font-semibold tracking-wider uppercase">
+ {m.docker_info_labels_section()}
+ </h3>
+ <div class="rounded-lg border p-3">
+ <div class="flex flex-wrap gap-1">
+ {#each info.Labels ?? [] as label, i (i)}
+ <Badge variant="outline" class="px-1.5 py-0 font-mono text-[10px]">{label}</Badge>
+ {/each}
</div>
</div>
</div>
@@ -303,11 +381,33 @@
</div>
{/snippet}
-{#snippet infoRow(label: string, value: string | undefined | null, mono: boolean = true)}
+{#snippet tagGroup(label: string, items: string[] | undefined)}
+ <div>
+ <div class="text-muted-foreground mb-1 text-[10px] tracking-tight uppercase">{label}</div>
+ <div class="flex flex-wrap gap-1">
+ {#each items ?? [] as item, i (i)}
+ <Badge variant="outline" class="px-1.5 py-0 text-[10px]">{item}</Badge>
+ {:else}
+ <span class="text-muted-foreground text-xs">-</span>
+ {/each}
+ </div>
+ </div>
+{/snippet}
+
+{#snippet capRow(label: string, value: boolean | undefined)}
+ <div class="flex items-center justify-between gap-2">
+ <span class="text-muted-foreground text-[10px] tracking-tight uppercase [overflow-wrap:anywhere]">{label}</span>
+ <span class="text-[10px] font-medium {value ? 'text-emerald-600 dark:text-emerald-400' : 'text-muted-foreground'}">
+ {value ? m.common_yes() : m.common_no()}
+ </span>
+ </div>
+{/snippet}
+
+{#snippet infoRow(label: string, value: string | number | undefined | null, mono: boolean = true)}
<div class="grid grid-cols-[minmax(112px,38%)_minmax(0,1fr)] items-start gap-x-4 gap-y-1">
<span class="text-muted-foreground text-[10px] tracking-tight uppercase">{label}</span>
<span class="text-right text-xs [overflow-wrap:anywhere] {mono ? 'font-mono' : ''}">
- {value || '-'}
+ {value === undefined || value === null || value === '' ? '-' : value}
</span>
</div>
{/snippet}
diff --git a/frontend/src/lib/components/header-card.svelte b/frontend/src/lib/components/header-card.svelte
index 38f2156ef..f443f35c8 100644
--- a/frontend/src/lib/components/header-card.svelte
+++ b/frontend/src/lib/components/header-card.svelte
@@ -12,13 +12,10 @@
<div
class={cn(
- 'from-background/60 via-background/40 to-background/60 relative overflow-hidden rounded-xl border bg-linear-to-br p-4 shadow-sm sm:p-6',
+ 'bg-card/60 backdrop-blur-md border-border/70 relative overflow-hidden rounded-xl border p-4 shadow-xs sm:p-5',
className
)}
>
- <div class="bg-primary/10 pointer-events-none absolute -top-10 -right-10 size-40 rounded-full blur-3xl"></div>
- <div class="bg-muted/40 pointer-events-none absolute -bottom-10 -left-10 size-40 rounded-full blur-3xl"></div>
-
<div class="relative">
{@render children()}
</div>
diff --git a/frontend/src/lib/components/quick-actions.svelte b/frontend/src/lib/components/quick-actions.svelte
index b3c27fbbd..41eb9f5ad 100644
--- a/frontend/src/lib/components/quick-actions.svelte
+++ b/frontend/src/lib/components/quick-actions.svelte
@@ -3,7 +3,6 @@
import { ActionButtonGroup, type ActionButton } from '$lib/components/action-button-group/index.js';
import { IsTablet } from '$lib/hooks/is-tablet.svelte.js';
import { m } from '$lib/paraglide/messages';
- import { StartIcon, StopIcon, TrashIcon } from '$lib/icons';
import { cn } from '$lib/utils';
import { hasAnyPermission, hasPermission } from '$lib/utils/auth';
import { environmentStore } from '$lib/stores/environment.store.svelte';
@@ -45,7 +44,6 @@
const canStartAll = $derived(hasPermission('containers:start', currentEnvId));
const canStopAll = $derived(hasPermission('containers:stop', currentEnvId));
const canPrune = $derived(hasAnyPermission(['images:prune', 'volumes:prune', 'networks:prune'], currentEnvId));
- const hasAnyQuickAction = $derived(canStartAll || canStopAll || canPrune);
const actionButtons: ActionButton[] = $derived(
[
@@ -115,100 +113,5 @@
{:else}
<ActionButtonGroup buttons={actionButtons} />
{/if}
- {:else if hasAnyQuickAction}
- <h2 class="mb-3 text-lg font-semibold tracking-tight">{m.quick_actions_title()}</h2>
-
- <div class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
- {#if canStartAll}
- <div class="group hover-lift rounded-2xl bg-gradient-to-br from-emerald-500/20 to-emerald-500/0 p-[1px]">
- <ArcaneButton
- action="start_all"
- size="card"
- tone="outline-success"
- class="bg-card/90 bubble bubble-shadow backdrop-blur-sm"
- onclick={onStartAll}
- loading={isLoading.starting}
- disabled={stoppedContainers === 0 || isAnyActionLoading}
- icon={null}
- showLabel={false}
- >
- <div class="relative">
- <div class="flex size-10 items-center justify-center rounded-lg bg-emerald-500/10 ring-1 ring-emerald-500/30">
- <StartIcon class="size-5 text-emerald-400" />
- </div>
- <div
- class="pointer-events-none absolute -inset-1 rounded-lg bg-emerald-500/20 opacity-0 blur-lg transition-opacity group-hover:opacity-40"
- ></div>
- </div>
- <div class="flex-1 text-left">
- <div class="text-sm font-medium">{m.quick_actions_start_all()}</div>
- <div class="text-muted-foreground text-xs">
- <span class="rounded-full border px-1.5 py-0.5">{m.quick_actions_containers({ count: stoppedContainers })}</span>
- </div>
- </div>
- </ArcaneButton>
- </div>
- {/if}
-
- {#if canStopAll}
- <div class="group hover-lift rounded-2xl bg-gradient-to-br from-sky-500/20 to-sky-500/0 p-[1px]">
- <ArcaneButton
- action="stop_all"
- size="card"
- tone="outline-info"
- class="bg-card/90 bubble bubble-shadow backdrop-blur-sm"
- onclick={onStopAll}
- loading={isLoading.stopping}
- disabled={runningContainers === 0 || isAnyActionLoading}
- icon={null}
- showLabel={false}
- >
- <div class="relative">
- <div class="flex size-10 items-center justify-center rounded-lg bg-sky-500/10 ring-1 ring-sky-500/30">
- <StopIcon class="size-5 text-sky-400" />
- </div>
- <div
- class="pointer-events-none absolute -inset-1 rounded-lg bg-sky-500/20 opacity-0 blur-lg transition-opacity group-hover:opacity-40"
- ></div>
- </div>
- <div class="flex-1 text-left">
- <div class="text-sm font-medium">{m.quick_actions_stop_all()}</div>
- <div class="text-muted-foreground text-xs">
- <span class="rounded-full border px-1.5 py-0.5">{m.quick_actions_containers({ count: runningContainers })}</span>
- </div>
- </div>
- </ArcaneButton>
- </div>
- {/if}
-
- {#if canPrune}
- <div class="group hover-lift rounded-2xl bg-gradient-to-br from-red-500/20 to-red-500/0 p-[1px]">
- <ArcaneButton
- action="prune"
- size="card"
- tone="outline-destructive"
- class="bg-card/90 bubble bubble-shadow backdrop-blur-sm"
- onclick={onOpenPruneDialog}
- loading={isLoading.pruning}
- disabled={isAnyActionLoading}
- icon={null}
- showLabel={false}
- >
- <div class="relative">
- <div class="flex size-10 items-center justify-center rounded-lg bg-red-500/10 ring-1 ring-red-500/30">
- <TrashIcon class="size-5 text-red-400" />
- </div>
- <div
- class="pointer-events-none absolute -inset-1 rounded-lg bg-red-500/20 opacity-0 blur-lg transition-opacity group-hover:opacity-40"
- ></div>
- </div>
- <div class="flex-1 text-left">
- <div class="text-sm font-medium">{m.quick_actions_prune_system()}</div>
- <div class="text-muted-foreground text-xs">{m.quick_actions_prune_description()}</div>
- </div>
- </ArcaneButton>
- </div>
- {/if}
- </div>
{/if}
</section>
diff --git a/frontend/src/lib/components/stat-card.svelte b/frontend/src/lib/components/stat-card.svelte
index bbed1bf49..0240ea18d 100644
--- a/frontend/src/lib/components/stat-card.svelte
+++ b/frontend/src/lib/components/stat-card.svelte
@@ -38,7 +38,7 @@
<span class="text-sm leading-none font-semibold tabular-nums">
{value}
</span>
- <span class="text-muted-foreground text-[10px] leading-none font-medium tracking-wider whitespace-nowrap uppercase">
+ <span class="text-muted-foreground text-[11px] leading-none font-medium tracking-[0.08em] whitespace-nowrap uppercase">
{title}
</span>
</div>
@@ -66,22 +66,17 @@
{:else}
<div
class={cn(
- 'bg-card group relative overflow-hidden rounded-2xl border p-6 transition-all duration-300 hover:-translate-y-1 hover:shadow-lg',
+ 'bg-card/60 backdrop-blur-md border-border/70 group relative overflow-hidden rounded-xl border p-4 transition-colors',
iconColor,
className
)}
- style="--stat-hover-tint: currentColor;"
>
- <div
- class="pointer-events-none absolute inset-0 bg-linear-to-br from-(--stat-hover-tint)/5 via-transparent to-transparent opacity-0 transition-opacity duration-500 group-hover:opacity-100"
- ></div>
-
<div class="relative flex items-start justify-between">
<div class="space-y-2">
<p class="text-muted-foreground text-sm font-medium tracking-wide">
{title}
</p>
- <h3 class="text-3xl font-semibold tracking-tight tabular-nums">
+ <h3 class="text-2xl font-semibold tracking-tight tabular-nums">
{value}
</h3>
{#if subtitle}
@@ -89,14 +84,8 @@
{/if}
</div>
- <div
- class={cn(
- 'flex size-10 items-center justify-center rounded-full transition-colors duration-300',
- bgColor,
- 'group-hover:bg-(--stat-hover-tint)/10'
- )}
- >
- <Icon class={cn('size-6 transition-transform duration-300 group-hover:scale-110', iconColor)} />
+ <div class={cn('flex size-9 items-center justify-center rounded-md transition-colors', bgColor)}>
+ <Icon class={cn('size-5', iconColor)} />
</div>
</div>
</div>
diff --git a/frontend/src/lib/components/tab-bar/tab-bar.svelte b/frontend/src/lib/components/tab-bar/tab-bar.svelte
index 5fbe1f6d0..7cbaecd0b 100644
--- a/frontend/src/lib/components/tab-bar/tab-bar.svelte
+++ b/frontend/src/lib/components/tab-bar/tab-bar.svelte
@@ -28,7 +28,7 @@
{item.label}
{#if item.badge !== undefined}
<span
- class="bg-primary text-primary-foreground ml-1 inline-flex min-w-[18px] items-center justify-center rounded-full px-1 text-[10px] font-medium"
+ class="bg-primary text-primary-foreground ml-1 inline-flex min-w-[18px] items-center justify-center rounded-full px-1 text-[11px] font-medium"
>
{item.badge}
</span>
diff --git a/frontend/src/lib/components/ui/card/card-header.svelte b/frontend/src/lib/components/ui/card/card-header.svelte
index 206f9400e..582e2673a 100644
--- a/frontend/src/lib/components/ui/card/card-header.svelte
+++ b/frontend/src/lib/components/ui/card/card-header.svelte
@@ -2,7 +2,6 @@
import { cn, type WithElementRef } from '$lib/utils.js';
import type { HTMLAttributes } from 'svelte/elements';
import { Spinner } from '$lib/components/ui/spinner/index.js';
- import { mode } from 'mode-watcher';
let {
ref = $bindable(null),
@@ -25,25 +24,17 @@
> = $props();
const iconVariantClasses = {
- primary: 'from-primary to-primary/80 shadow-primary/25 border border-primary/20',
- emerald: 'from-emerald-500 to-emerald-600 shadow-emerald-500/25 border border-emerald-400/20',
- red: 'from-red-500 to-red-600 shadow-red-500/25 border border-red-400/20',
- amber: 'from-amber-500 to-amber-600 shadow-amber-500/25 border border-amber-400/20',
- blue: 'from-blue-500 to-blue-600 shadow-blue-500/25 border border-blue-400/20',
- purple: 'from-purple-500 to-purple-600 shadow-purple-500/25 border border-purple-400/20',
- cyan: 'from-cyan-500 to-cyan-600 shadow-cyan-500/25 border border-cyan-400/20',
- orange: 'from-orange-500 to-orange-600 shadow-orange-500/25 border border-orange-400/20',
- indigo: 'from-indigo-500 to-indigo-600 shadow-indigo-500/25 border border-indigo-400/20',
- pink: 'from-pink-500 to-pink-600 shadow-pink-500/25 border border-pink-400/20'
+ primary: 'bg-primary/10 text-primary ring-1 ring-primary/20',
+ emerald: 'bg-emerald-500/10 text-emerald-600 ring-1 ring-emerald-500/20 dark:text-emerald-400',
+ red: 'bg-red-500/10 text-red-600 ring-1 ring-red-500/20 dark:text-red-400',
+ amber: 'bg-amber-500/10 text-amber-600 ring-1 ring-amber-500/20 dark:text-amber-400',
+ blue: 'bg-blue-500/10 text-blue-600 ring-1 ring-blue-500/20 dark:text-blue-400',
+ purple: 'bg-purple-500/10 text-purple-600 ring-1 ring-purple-500/20 dark:text-purple-400',
+ cyan: 'bg-cyan-500/10 text-cyan-600 ring-1 ring-cyan-500/20 dark:text-cyan-400',
+ orange: 'bg-orange-500/10 text-orange-600 ring-1 ring-orange-500/20 dark:text-orange-400',
+ indigo: 'bg-indigo-500/10 text-indigo-600 ring-1 ring-indigo-500/20 dark:text-indigo-400',
+ pink: 'bg-pink-500/10 text-pink-600 ring-1 ring-pink-500/20 dark:text-pink-400'
};
-
- const isDarkMode = $derived(mode.current === 'dark');
-
- const headerHoverClass = $derived(
- isDarkMode
- ? 'group-[&:not(:has(button:hover,a:hover,[role=button]:hover))]:hover:from-primary/8 group-[&:not(:has(button:hover,a:hover,[role=button]:hover))]:hover:to-primary/2'
- : 'group-[&:not(:has(button:hover,a:hover,[role=button]:hover))]:hover:from-primary/6 group-[&:not(:has(button:hover,a:hover,[role=button]:hover))]:hover:to-primary/2'
- );
</script>
<div
@@ -51,35 +42,24 @@
data-slot="card-header"
class={cn(
'@container/card-header relative grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-[[data-slot=card-action]]:grid-cols-[1fr_auto]',
- 'from-muted/60 to-muted/20 dark:from-muted/20 bg-linear-to-b dark:to-transparent',
icon && 'flex flex-row items-start space-y-0',
icon && compact ? 'gap-2 p-2' : icon ? 'gap-3 p-4' : 'py-5',
- icon && enableHover && `transition-colors ${headerHoverClass}`,
+ icon && enableHover && 'transition-colors group-[&:not(:has(button:hover,a:hover,[role=button]:hover))]:hover:bg-muted/30',
className
)}
{...restProps}
>
- <!-- Top highlight for edge definition -->
- <div class="pointer-events-none absolute inset-x-0 top-0 h-px bg-white/15 dark:bg-white/5"></div>
-
- <!-- Subtle inner shadow for depth -->
- <div
- class="pointer-events-none absolute inset-x-0 top-0 h-12 bg-linear-to-b from-black/[0.03] to-transparent dark:from-black/[0.15]"
- ></div>
-
{#if icon}
{@const IconComponent = loading ? Spinner : icon}
<div class="relative shrink-0">
<div
class={cn(
- 'relative flex items-center justify-center rounded-xl bg-linear-to-br shadow-[0_1px_2px_rgba(0,0,0,0.1),0_4px_12px_-2px_rgba(0,0,0,0.15)] ring-1 ring-black/10 transition-all duration-300 group-[&:not(:has(button:hover,a:hover,[role=button]:hover))]:hover:scale-105 dark:ring-white/20',
+ 'relative flex items-center justify-center rounded-md transition-colors',
iconVariantClasses[iconVariant],
compact ? 'size-8 sm:size-10' : 'size-10'
)}
>
- <!-- Inner bevel for the icon container -->
- <div class="pointer-events-none absolute inset-0 rounded-xl border-t border-white/20"></div>
- <IconComponent class={cn('text-white drop-shadow-md', compact ? 'size-4 sm:size-5' : 'size-5')} />
+ <IconComponent class={cn(compact ? 'size-4 sm:size-5' : 'size-5')} />
</div>
</div>
{/if}
diff --git a/frontend/src/lib/components/ui/card/card.svelte b/frontend/src/lib/components/ui/card/card.svelte
index d82d23516..9e8678a02 100644
--- a/frontend/src/lib/components/ui/card/card.svelte
+++ b/frontend/src/lib/components/ui/card/card.svelte
@@ -28,13 +28,13 @@
function getVariantClasses(variant: 'default' | 'subtle' | 'outlined') {
switch (variant) {
case 'default':
- return 'backdrop-blur-sm bg-white/10 shadow-sm dark:bg-surface/10';
+ return 'backdrop-blur-md bg-card/60 shadow-xs dark:bg-surface/40';
case 'subtle':
- return 'backdrop-blur-sm bg-white/10 dark:bg-surface/10';
+ return 'bg-muted/40 dark:bg-surface/30';
case 'outlined':
- return 'backdrop-blur-sm bg-white/10 dark:bg-surface/10 border border-border/60';
+ return 'bg-card/50 backdrop-blur-md border-border/70';
default:
- return 'backdrop-blur-sm bg-white/10 shadow-sm dark:bg-surface/10';
+ return 'backdrop-blur-md bg-card/60 shadow-xs dark:bg-surface/40';
}
}
</script>
@@ -43,10 +43,10 @@
bind:this={ref}
data-slot="card"
class={cn(
- 'text-card-foreground group dark:border-border/80 relative isolate gap-0 overflow-hidden rounded-xl border border-white/80 p-0 transition-all duration-300',
+ 'text-card-foreground group border-border/70 relative isolate gap-0 overflow-hidden rounded-xl border p-0 transition-colors duration-200',
getVariantClasses(variant),
onclick
- ? '[&:not(:has(button:hover,a:hover,[role=button]:hover))]:hover:bg-muted/60 cursor-pointer [&:not(:has(button:hover,a:hover,[role=button]:hover))]:hover:shadow-md'
+ ? '[&:not(:has(button:hover,a:hover,[role=button]:hover))]:hover:bg-muted/60 cursor-pointer [&:not(:has(button:hover,a:hover,[role=button]:hover))]:hover:shadow-sm'
: '',
className
)}
diff --git a/frontend/src/lib/components/ui/drawer/drawer-content.svelte b/frontend/src/lib/components/ui/drawer/drawer-content.svelte
index e2d594bb1..8e66a5b78 100644
--- a/frontend/src/lib/components/ui/drawer/drawer-content.svelte
+++ b/frontend/src/lib/components/ui/drawer/drawer-content.svelte
@@ -20,7 +20,7 @@
bind:ref
data-slot="drawer-content"
class={cn(
- 'group/drawer-content text-foreground dark:bg-surface/10 dark:border-border/80 fixed z-50 flex h-auto flex-col border-white/80 bg-white/10 backdrop-blur-md',
+ 'group/drawer-content text-foreground dark:bg-surface/10 fixed z-50 flex h-auto flex-col border-border/70 bg-white/10 backdrop-blur-md',
'data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b',
'data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t',
'data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm',
diff --git a/frontend/src/lib/components/ui/sheet/sheet-content.svelte b/frontend/src/lib/components/ui/sheet/sheet-content.svelte
index dfa10d5e7..b000b6d9a 100644
--- a/frontend/src/lib/components/ui/sheet/sheet-content.svelte
+++ b/frontend/src/lib/components/ui/sheet/sheet-content.svelte
@@ -1,7 +1,7 @@
<script lang="ts" module>
import { tv, type VariantProps } from 'tailwind-variants';
export const sheetVariants = tv({
- base: 'text-foreground bg-white dark:bg-surface/10 backdrop-blur-md border border-white/80 dark:border-border/80 shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500',
+ base: 'text-foreground bg-white dark:bg-surface/10 backdrop-blur-md border border-border/70 shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500',
variants: {
side: {
top: 'data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto rounded-b-2xl',
diff --git a/frontend/src/lib/components/ui/tabs/tabs-list.svelte b/frontend/src/lib/components/ui/tabs/tabs-list.svelte
index f037747ae..a8c7b0cfd 100644
--- a/frontend/src/lib/components/ui/tabs/tabs-list.svelte
+++ b/frontend/src/lib/components/ui/tabs/tabs-list.svelte
@@ -8,7 +8,7 @@
<TabsPrimitive.List
bind:ref
class={cn(
- 'text-muted-foreground inline-flex h-10 items-center justify-center rounded-full border border-black/5 bg-black/5 p-1 shadow-sm backdrop-blur-xl backdrop-saturate-150 dark:border-white/10 dark:bg-white/5',
+ 'text-muted-foreground border-border/60 bg-muted/40 inline-flex items-center justify-start gap-1 rounded-lg border p-1',
className
)}
{...restProps}
diff --git a/frontend/src/lib/components/ui/tabs/tabs-trigger.svelte b/frontend/src/lib/components/ui/tabs/tabs-trigger.svelte
index 3bd6b0fd0..651a8d05a 100644
--- a/frontend/src/lib/components/ui/tabs/tabs-trigger.svelte
+++ b/frontend/src/lib/components/ui/tabs/tabs-trigger.svelte
@@ -8,7 +8,7 @@
<TabsPrimitive.Trigger
bind:ref
class={cn(
- 'ring-offset-background focus-visible:ring-ring hover:bg-primary/5 data-[state=active]:bg-primary/15 data-[state=active]:text-primary inline-flex items-center justify-center rounded-full px-3 py-1.5 text-sm font-medium whitespace-nowrap transition-all focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm',
+ 'ring-offset-background focus-visible:ring-ring text-muted-foreground hover:text-foreground data-[state=active]:bg-primary/15 data-[state=active]:text-primary data-[state=active]:ring-primary/30 inline-flex items-center justify-center gap-1.5 rounded-md px-3 py-1.5 text-sm font-medium whitespace-nowrap transition-colors focus-visible:ring-2 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=active]:ring-1',
className
)}
{...restProps}
diff --git a/frontend/src/lib/layouts/resource-detail-layout.svelte b/frontend/src/lib/layouts/resource-detail-layout.svelte
index 652aa3924..4f1700c4e 100644
--- a/frontend/src/lib/layouts/resource-detail-layout.svelte
+++ b/frontend/src/lib/layouts/resource-detail-layout.svelte
@@ -48,10 +48,10 @@
class="animate-in fade-in slide-in-from-top-2 fixed top-4 left-1/2 z-40 w-[calc(100%-2rem)] max-w-fit -translate-x-1/2 px-2 duration-200 sm:w-auto sm:px-0"
>
<div
- class="bg-popover/95 supports-backdrop-filter:bg-popover/85 border-border/60 flex items-center gap-3 rounded-full border px-4 py-2 shadow-lg backdrop-blur-lg"
+ class="bg-popover/95 supports-backdrop-filter:bg-popover/85 border-border/60 bubble-shadow-lg flex items-center gap-3 rounded-lg border px-4 py-2 backdrop-blur-md"
>
{#if backUrl}
- <ArcaneButton action="base" tone="ghost" href={backUrl} class="size-8 rounded-full p-0">
+ <ArcaneButton action="base" tone="ghost" href={backUrl} class="size-8 rounded-md p-0">
<ArrowLeftIcon class="size-4" />
</ArcaneButton>
@@ -140,7 +140,7 @@
<div class="flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between">
<div class="min-w-0 flex-1 space-y-2">
- <h1 class="text-2xl font-semibold tracking-tight break-all sm:text-3xl">{title}</h1>
+ <h1 class="text-xl font-semibold tracking-tight break-all sm:text-2xl">{title}</h1>
{#if subtitle}
<p class="text-muted-foreground text-sm">{subtitle}</p>
{/if}
diff --git a/frontend/src/lib/layouts/resource-page-layout.svelte b/frontend/src/lib/layouts/resource-page-layout.svelte
index 2b60e1034..3844c2e16 100644
--- a/frontend/src/lib/layouts/resource-page-layout.svelte
+++ b/frontend/src/lib/layouts/resource-page-layout.svelte
@@ -47,9 +47,9 @@
}: Props = $props();
</script>
-<div class={cn('space-y-6 pt-3 md:space-y-10 md:pt-5', className)}>
- <header class="relative flex items-center justify-between gap-4">
- <div class="flex min-w-0 flex-1 items-center gap-3 sm:gap-4">
+<div class={cn('space-y-5 pt-3 md:space-y-7 md:pt-5', className)}>
+ <header class="flex items-start justify-between gap-4">
+ <div class="flex min-w-0 flex-1 items-start gap-3 sm:gap-4">
{#if Icon}
<div
class="bg-primary/10 text-primary ring-primary/20 flex size-8 shrink-0 items-center justify-center rounded-lg ring-1 sm:size-10"
@@ -58,20 +58,12 @@
</div>
{/if}
<div class="min-w-0">
- <h1 class="text-2xl font-semibold tracking-tight sm:text-3xl">{title}</h1>
+ <h1 class="text-xl font-semibold tracking-tight sm:text-2xl">{title}</h1>
{#if subtitle}
<p class="text-muted-foreground mt-1 text-sm">{subtitle}</p>
{/if}
- </div>
- </div>
-
- {#if statCards && statCards.length > 0}
- <div
- class="pointer-events-none absolute top-1/2 left-1/2 z-10 hidden -translate-x-1/2 -translate-y-1/2 items-center justify-center transition-[margin-left] duration-200 ease-out md:flex"
- style="margin-left: calc(var(--sidebar-gap-width, 0px) / -2);"
- >
- <div class="border-border/50 bg-muted/30 pointer-events-auto relative overflow-hidden rounded-xl border backdrop-blur-sm">
- <div class="flex flex-wrap items-center justify-center gap-x-4 gap-y-2 px-4 py-2">
+ {#if statCards && statCards.length > 0}
+ <div class="mt-2 flex flex-wrap items-center gap-x-4 gap-y-1">
{#each statCards as card, i (card.title ?? i)}
<StatCard
variant="mini"
@@ -85,9 +77,9 @@
/>
{/each}
</div>
- </div>
+ {/if}
</div>
- {/if}
+ </div>
<ActionButtonGroup buttons={actionButtons} />
</header>
diff --git a/frontend/src/lib/layouts/settings-page-layout.svelte b/frontend/src/lib/layouts/settings-page-layout.svelte
index d55dd02a5..6f2e18c06 100644
--- a/frontend/src/lib/layouts/settings-page-layout.svelte
+++ b/frontend/src/lib/layouts/settings-page-layout.svelte
@@ -50,7 +50,7 @@
<div class={cn('px-2 py-4 pb-5 sm:px-6 sm:py-6 sm:pb-10 lg:px-8', className)}>
<div class="border-border/50 border-b pb-4 sm:pb-6">
<div class="flex items-center justify-between gap-4">
- <div class="flex flex-1 items-center gap-3 sm:gap-4">
+ <div class="flex flex-1 items-start gap-3 sm:gap-4">
{#if Icon}
<div
class="bg-primary/10 text-primary ring-primary/20 flex size-8 shrink-0 items-center justify-center rounded-lg ring-1 sm:size-10"
@@ -59,18 +59,12 @@
</div>
{/if}
<div class="min-w-0">
- <h1 class="text-xl font-semibold tracking-tight sm:text-3xl">{title}</h1>
+ <h1 class="text-xl font-semibold tracking-tight sm:text-2xl">{title}</h1>
{#if description}
<p class="text-muted-foreground mt-1 hidden text-sm sm:block sm:text-base">{@html description}</p>
{/if}
- </div>
- </div>
-
- {#if pageType === 'management' && statCards && statCards.length > 0}
- <div class="hidden flex-1 items-center justify-center md:flex">
- <div class="border-border/50 relative overflow-hidden rounded-full border">
- <div class="bg-muted/50 absolute inset-0"></div>
- <div class="relative flex items-center gap-4 px-4 py-1.5 backdrop-blur-md">
+ {#if pageType === 'management' && statCards && statCards.length > 0}
+ <div class="mt-2 flex flex-wrap items-center gap-x-4 gap-y-1">
{#each statCards as card, i}
{#if i > 0}
<div class="bg-border/50 h-4 w-px"></div>
@@ -85,9 +79,9 @@
/>
{/each}
</div>
- </div>
+ {/if}
</div>
- {/if}
+ </div>
<div class="flex flex-1 items-center justify-end gap-2">
{#if showReadOnlyTag}
diff --git a/frontend/src/lib/layouts/tabbed-page-layout.svelte b/frontend/src/lib/layouts/tabbed-page-layout.svelte
index 8b5fd4e22..3558e188a 100644
--- a/frontend/src/lib/layouts/tabbed-page-layout.svelte
+++ b/frontend/src/lib/layouts/tabbed-page-layout.svelte
@@ -86,7 +86,7 @@
{#if showFloatingHeader}
<div class="fixed top-4 left-1/2 z-30 -translate-x-1/2 transition-all duration-300 ease-in-out">
<div
- class="bg-popover/90 supports-backdrop-filter:bg-popover/80 bubble-shadow-lg border-border/50 rounded-xl border px-4 py-3 backdrop-blur-md"
+ class="bg-popover/90 supports-backdrop-filter:bg-popover/80 bubble-shadow-lg border-border/50 rounded-lg border px-4 py-3 backdrop-blur-md"
>
<div class="flex items-center gap-4">
<div class="min-w-0">
diff --git a/frontend/src/lib/query/query-keys.ts b/frontend/src/lib/query/query-keys.ts
index 26ea15136..415b8900f 100644
--- a/frontend/src/lib/query/query-keys.ts
+++ b/frontend/src/lib/query/query-keys.ts
@@ -77,13 +77,6 @@ export const queryKeys = {
versionInfo: (environmentId: string) => ['system', 'version-info', environmentId] as const,
dockerInfo: (environmentId: string) => ['system', 'docker-info', environmentId] as const
},
- dashboard: {
- snapshot: (environmentId: string, debugAllGood = false) =>
- ['dashboard', 'snapshot', environmentId, debugAllGood ? 'debug-all-good' : 'normal'] as const,
- actionItems: (environmentId: string, debugAllGood = false) =>
- ['dashboard', 'action-items', environmentId, debugAllGood ? 'debug-all-good' : 'normal'] as const,
- environments: (debugAllGood = false) => ['dashboard', 'environments', debugAllGood ? 'debug-all-good' : 'normal'] as const
- },
containers: {
all: ['containers'] as const,
list: (environmentId: string, options: SearchPaginationSortRequest) =>
diff --git a/frontend/src/lib/services/dashboard-service.ts b/frontend/src/lib/services/dashboard-service.ts
index b375f8391..9dad8f0cd 100644
--- a/frontend/src/lib/services/dashboard-service.ts
+++ b/frontend/src/lib/services/dashboard-service.ts
@@ -1,39 +1,15 @@
import BaseAPIService from './api-service';
-import { environmentStore } from '$lib/stores/environment.store.svelte';
-import type { DashboardActionItems, DashboardEnvironmentsOverview, DashboardSnapshot } from '$lib/types/shared';
+import type { DashboardSnapshot } from '$lib/types/shared';
-interface GetDashboardActionItemsOptions {
+interface GetDashboardOptions {
debugAllGood?: boolean;
}
export class DashboardService extends BaseAPIService {
- async getDashboard(options?: GetDashboardActionItemsOptions): Promise<DashboardSnapshot> {
- const envId = await environmentStore.getCurrentEnvironmentId();
- return this.getDashboardForEnvironment(envId, options);
- }
-
- async getDashboardForEnvironment(environmentId: string, options?: GetDashboardActionItemsOptions): Promise<DashboardSnapshot> {
+ async getDashboardForEnvironment(environmentId: string, options?: GetDashboardOptions): Promise<DashboardSnapshot> {
const params = options?.debugAllGood ? { debugAllGood: 'true' } : undefined;
return this.handleResponse(this.api.get(`/environments/${environmentId}/dashboard`, { params }));
}
-
- async getActionItems(): Promise<DashboardActionItems> {
- const envId = await environmentStore.getCurrentEnvironmentId();
- return this.getActionItemsForEnvironment(envId);
- }
-
- async getActionItemsForEnvironment(
- environmentId: string,
- options?: GetDashboardActionItemsOptions
- ): Promise<DashboardActionItems> {
- const params = options?.debugAllGood ? { debugAllGood: 'true' } : undefined;
- return this.handleResponse(this.api.get(`/environments/${environmentId}/dashboard/action-items`, { params }));
- }
-
- async getDashboardEnvironmentsOverview(options?: GetDashboardActionItemsOptions): Promise<DashboardEnvironmentsOverview> {
- const params = options?.debugAllGood ? { debugAllGood: 'true' } : undefined;
- return this.handleResponse(this.api.get('/dashboard/environments', { params }));
- }
}
export const dashboardService = new DashboardService();
diff --git a/frontend/src/lib/types/shared.ts b/frontend/src/lib/types/shared.ts
index ba62b5a77..b1d1d1301 100644
--- a/frontend/src/lib/types/shared.ts
+++ b/frontend/src/lib/types/shared.ts
@@ -194,6 +194,7 @@ export interface DashboardSnapshot {
imageUsageCounts: ImageUsageCounts;
actionItems: DashboardActionItems;
settings: DashboardSnapshotSettings;
+ versionInfo?: AppVersionInformation;
}
export type EnvironmentDashboardSnapshotState = 'ready' | 'skipped' | 'error';
@@ -209,24 +210,6 @@ export interface DashboardEnvironmentOverview {
snapshotError?: string;
}
-export interface DashboardEnvironmentsSummary {
- totalEnvironments: number;
- onlineEnvironments: number;
- standbyEnvironments: number;
- offlineEnvironments: number;
- pendingEnvironments: number;
- errorEnvironments: number;
- disabledEnvironments: number;
- containers: ContainerStatusCounts;
- imageUsageCounts: ImageUsageCounts;
- environmentsWithActionItems: number;
-}
-
-export interface DashboardEnvironmentsOverview {
- summary: DashboardEnvironmentsSummary;
- environments: DashboardEnvironmentOverview[];
-}
-
export interface DashboardOverviewSummary {
totalEnvironments: number;
reachableEnvironments: number;
diff --git a/frontend/src/routes/(app)/dashboard/+page.svelte b/frontend/src/routes/(app)/dashboard/+page.svelte
index 264409e25..5ddc00cdb 100644
--- a/frontend/src/routes/(app)/dashboard/+page.svelte
+++ b/frontend/src/routes/(app)/dashboard/+page.svelte
@@ -1,224 +1,28 @@
<script lang="ts">
- import * as Tabs from '$lib/components/ui/tabs/index.js';
- import { TabBar, type TabItem } from '$lib/components/tab-bar';
- import { page } from '$app/state';
- import { toast } from 'svelte-sonner';
- import PruneConfirmationDialog from '$lib/components/dialogs/prune-confirmation-dialog.svelte';
- import DockerInfoDialog from '$lib/components/dialogs/docker-info-dialog.svelte';
- import * as Card from '$lib/components/ui/card/index.js';
- import { ArcaneButton } from '$lib/components/arcane-button/index.js';
- import { handleApiResultWithCallbacks } from '$lib/utils/api';
- import { tryCatch } from '$lib/utils/api';
- import { activityToastOptions, extractActivityId } from '$lib/utils/activity-toast';
- import { openConfirmDialog } from '$lib/components/confirm-dialog';
- import { environmentStore } from '$lib/stores/environment.store.svelte';
- import userStore from '$lib/stores/user-store';
- import { createStatsWebSocket } from '$lib/utils/ws';
- import type { ReconnectingWebSocket } from '$lib/utils/ws';
- import type { User } from '$lib/types/auth';
- import QuickActions from '$lib/components/quick-actions.svelte';
- import type { SystemStats } from '$lib/types/shared';
- import DashboardActionCard from './dash-action-card.svelte';
- import DashboardMetricTile from './dash-metric-tile.svelte';
- import DashboardContainerTable from './dash-container-table.svelte';
- import DashboardImageTable from './dash-image-table.svelte';
+ import { createSubscriber } from 'svelte/reactivity';
+ import { get } from 'svelte/store';
import DashboardAllEnvironmentsView from './dashboard-all-environments-view.svelte';
+ import userStore from '$lib/stores/user-store';
import { m } from '$lib/paraglide/messages';
- import { goto, invalidateAll } from '$app/navigation';
- import { systemService } from '$lib/services/system-service';
- import { bytes } from '$lib/utils/formatting';
- import type { DockerInfo } from '$lib/types/docker';
- import type { DashboardSnapshot } from '$lib/types/shared';
- import type { SystemPruneRequest, PruneType } from '$lib/types/automation';
- import {
- CpuIcon,
- MemoryStickIcon,
- StatsIcon,
- UpdateIcon,
- AlertTriangleIcon,
- VolumesIcon,
- ContainersIcon,
- ImagesIcon,
- GpuIcon,
- InfoIcon,
- ApiKeyIcon,
- CheckIcon
- } from '$lib/icons';
let { data }: PageProps = $props();
- const emptyDashboard: DashboardSnapshot = {
- containers: {
- data: [],
- counts: { runningContainers: 0, stoppedContainers: 0, totalContainers: 0 },
- pagination: { totalPages: 1, totalItems: 0, currentPage: 1, itemsPerPage: 50, grandTotalItems: 0 }
- },
- images: {
- data: [],
- pagination: { totalPages: 1, totalItems: 0, currentPage: 1, itemsPerPage: 50, grandTotalItems: 0 }
- },
- imageUsageCounts: { imagesInuse: 0, imagesUnused: 0, totalImages: 0, totalImageSize: 0 },
- actionItems: { items: [] },
- settings: {}
- };
-
- let activeView = $derived(data.view === 'current' ? 'current' : 'all');
- let currentDashboard = $derived(data.dashboard ?? emptyDashboard);
- let containers = $derived(currentDashboard.containers);
- let images = $derived(currentDashboard.images);
- let settings = $derived(data.settings ?? null);
- let containerStatusCounts = $derived(
- currentDashboard.containers.counts ?? { runningContainers: 0, stoppedContainers: 0, totalContainers: 0 }
- );
- let imageUsageCounts = $derived(currentDashboard.imageUsageCounts);
- let dashboardActionItems = $derived(currentDashboard.actionItems);
- let debugAllGood = $derived(data.debugAllGood ?? false);
- let debugUpgrade = $state(false);
- let currentUser = $state<User | null>(null);
- const viewTabs = $derived.by((): TabItem[] => [
- { value: 'all', label: m.common_all(), icon: ContainersIcon },
- { value: 'current', label: m.common_current(), icon: StatsIcon }
- ]);
-
- let systemStats = $state<SystemStats | null>(null);
- let isPruneDialogOpen = $state(false);
- let dockerInfoDialogOpen = $state(false);
- let dockerInfo = $state<DockerInfo | null>(null);
- let dockerInfoPromise = $state<Promise<DockerInfo> | null>(null);
- let dockerInfoError = $state<string | null>(null);
- let isLoading = $state({
- starting: false,
- stopping: false,
- refreshing: false,
- pruning: false,
- loadingStats: true
- });
-
- let statsWSClient: ReconnectingWebSocket<SystemStats> | null = null;
- let hasInitialStatsLoaded = $state(false);
-
- const stoppedContainers = $derived(containerStatusCounts.stoppedContainers);
- const runningContainers = $derived(containerStatusCounts.runningContainers);
- const totalContainers = $derived(containerStatusCounts.totalContainers);
- const currentStats = $derived(systemStats);
- const dashboardAttentionCounts = $derived.by(() => {
- const counts = {
- stoppedContainers: 0,
- imageUpdates: 0,
- actionableVulnerabilities: 0,
- expiringApiKeys: 0
- };
+ const debugAllGood = $derived(data.debugAllGood ?? false);
- for (const item of dashboardActionItems?.items ?? []) {
- if (item.kind === 'stopped_containers') {
- counts.stoppedContainers = item.count;
- } else if (item.kind === 'image_updates') {
- counts.imageUpdates = item.count;
- } else if (item.kind === 'actionable_vulnerabilities') {
- counts.actionableVulnerabilities = item.count;
- } else if (item.kind === 'expiring_keys') {
- counts.expiringApiKeys = item.count;
+ const subscribeToUser = createSubscriber((update) => {
+ let initialized = false;
+ return userStore.subscribe(() => {
+ if (initialized) {
+ update();
}
- }
-
- return counts;
- });
-
- const stoppedContainersAttentionCount = $derived(dashboardAttentionCounts.stoppedContainers);
- const imageUpdatesAttentionCount = $derived(dashboardAttentionCounts.imageUpdates);
- const actionableVulnerabilitiesAttentionCount = $derived(dashboardAttentionCounts.actionableVulnerabilities);
- const expiringApiKeysAttentionCount = $derived(dashboardAttentionCounts.expiringApiKeys);
-
- const imagesInUseCount = $derived(imageUsageCounts?.imagesInuse ?? 0);
- const imagesUnusedCount = $derived(imageUsageCounts?.imagesUnused ?? 0);
-
- const diskUsagePercent = $derived.by(() => {
- if (!currentStats?.diskTotal || currentStats.diskTotal <= 0 || currentStats.diskUsage === undefined) return null;
- return (currentStats.diskUsage / currentStats.diskTotal) * 100;
- });
- const diskRisk = $derived.by(() => {
- if (diskUsagePercent === null) return 'unknown';
- if (diskUsagePercent >= 90) return 'critical';
- if (diskUsagePercent >= 80) return 'high';
- if (diskUsagePercent >= 65) return 'moderate';
- return 'healthy';
- });
- const diskRiskLabel = $derived.by(() => {
- if (diskRisk === 'critical') return m.vuln_severity_critical();
- if (diskRisk === 'high') return m.vuln_severity_high();
- if (diskRisk === 'moderate') return m.vuln_severity_medium();
- if (diskRisk === 'healthy') return m.vuln_clean();
- return m.common_unknown();
- });
- const diskRiskBadgeVariant = $derived.by(() => {
- if (diskRisk === 'critical') return 'red';
- if (diskRisk === 'high') return 'orange';
- if (diskRisk === 'moderate') return 'amber';
- if (diskRisk === 'healthy') return 'green';
- return 'gray';
- });
- const hasDiskPressureAlert = $derived(!debugAllGood && (diskRisk === 'critical' || diskRisk === 'high'));
- const attentionItemsCount = $derived(
- debugAllGood
- ? 0
- : (stoppedContainersAttentionCount > 0 ? 1 : 0) +
- (imageUpdatesAttentionCount > 0 ? 1 : 0) +
- (actionableVulnerabilitiesAttentionCount > 0 ? 1 : 0) +
- (expiringApiKeysAttentionCount > 0 ? 1 : 0) +
- (hasDiskPressureAlert ? 1 : 0)
- );
- const stoppedContainersBadgeText = $derived(`${stoppedContainersAttentionCount} ${m.common_stopped()}`);
- const imageUpdatesBadgeText = $derived(`${imageUpdatesAttentionCount} ${m.common_pending()}`);
- const actionableVulnerabilitiesBadgeText = $derived(`${m.vuln_severity_critical()} + ${m.vuln_severity_high()}`);
- const expiringApiKeysBadgeText = $derived(`${expiringApiKeysAttentionCount} ${m.common_pending()}`);
- const imageUsageLabel = $derived(`${imagesInUseCount} ${m.common_in_use()} · ${imagesUnusedCount} ${m.common_unused()}`);
- const diskPressureValue = $derived(diskUsagePercent === null ? '--' : `${diskUsagePercent.toFixed(1)}%`);
- const diskPressureDescription = $derived.by(() => {
- if (currentStats?.diskUsage !== undefined && currentStats?.diskTotal) {
- return `${bytes.format(currentStats.diskUsage, { unitSeparator: ' ' }) ?? '-'} / ${bytes.format(currentStats.diskTotal, { unitSeparator: ' ' }) ?? '-'}`;
- }
- return m.common_loading();
- });
-
- const cpuMetric = $derived.by(() => {
- if (isLoading.loadingStats || !hasInitialStatsLoaded) return null;
- return currentStats?.cpuUsage ?? null;
- });
- const memoryMetric = $derived.by(() => {
- if (isLoading.loadingStats || !hasInitialStatsLoaded) return null;
- if (currentStats?.memoryUsage === undefined || !currentStats.memoryTotal) return null;
- return (currentStats.memoryUsage / currentStats.memoryTotal) * 100;
- });
- const diskMetric = $derived.by(() => {
- if (isLoading.loadingStats || !hasInitialStatsLoaded) return null;
- return diskUsagePercent;
+ initialized = true;
+ });
});
- const gpuMetric = $derived.by(() => {
- if (isLoading.loadingStats || !hasInitialStatsLoaded) return null;
- const gpus = currentStats?.gpus?.filter((gpu) => gpu.memoryTotal > 0) ?? [];
- if (gpus.length === 0) return null;
- const totalPercent = gpus.reduce((sum, gpu) => sum + (gpu.memoryUsed / gpu.memoryTotal) * 100, 0);
- return totalPercent / gpus.length;
+ const currentUser = $derived.by(() => {
+ subscribeToUser();
+ return get(userStore);
});
- const cpuMetricLabel = $derived.by(() => `${currentStats?.cpuCount ?? 0} ${m.common_cpus()}`);
- const memoryMetricLabel = $derived.by(() => {
- if (currentStats?.memoryUsage === undefined || !currentStats.memoryTotal) return '--';
- return `${bytes.format(currentStats.memoryUsage, { unitSeparator: ' ' }) ?? '-'} / ${bytes.format(currentStats.memoryTotal, { unitSeparator: ' ' }) ?? '-'}`;
- });
- const diskMetricLabel = $derived.by(() => {
- if (currentStats?.diskUsage === undefined || !currentStats.diskTotal) return '--';
- return `${bytes.format(currentStats.diskUsage, { unitSeparator: ' ' }) ?? '-'} / ${bytes.format(currentStats.diskTotal, { unitSeparator: ' ' }) ?? '-'}`;
- });
- const gpuMetricLabel = $derived.by(() => {
- const count = currentStats?.gpuCount ?? 0;
- return count > 0 ? `${count} ${count === 1 ? m.dashboard_meter_gpu_device() : m.dashboard_meter_gpu_devices()}` : '--';
- });
- const overviewHost = $derived(currentStats?.hostname?.trim() || dockerInfo?.Name || m.common_unknown());
- const overviewPlatform = $derived(currentStats?.platform ?? dockerInfo?.OperatingSystem ?? '-');
- const overviewArchitecture = $derived(currentStats?.architecture ?? dockerInfo?.Architecture ?? '-');
- const currentEnvironmentName = $derived(environmentStore.selected?.name?.trim() || m.common_unknown());
- const dashboardUser = $derived.by(() => currentUser ?? data.user ?? null);
const greetingBase = $derived.by(() => {
const hour = new Date().getHours();
if (hour >= 5 && hour < 12) return m.dashboard_greeting_morning();
@@ -226,445 +30,12 @@
if (hour >= 18 && hour < 23) return m.dashboard_greeting_evening();
return m.dashboard_greeting_welcome_back();
});
- const greetingUserName = $derived.by(() => {
- const name = dashboardUser?.displayName?.trim() || dashboardUser?.username?.trim() || '';
- return name;
- });
+ const greetingUserName = $derived.by(() => currentUser?.displayName?.trim() || currentUser?.username?.trim() || '');
const dashboardHeroGreeting = $derived.by(() =>
greetingUserName
? m.dashboard_greeting_with_name({ greeting: greetingBase, name: greetingUserName })
: m.dashboard_greeting_without_name({ greeting: greetingBase })
);
-
- async function handleViewChange(nextView: string) {
- if (nextView === activeView) return;
-
- const nextUrl = new URL(page.url);
- if (nextView === 'current') {
- nextUrl.searchParams.set('view', 'current');
- } else {
- nextUrl.searchParams.delete('view');
- }
-
- await goto(nextUrl.toString(), { keepFocus: true });
- }
-
- function formatPercent(value: number | null): string {
- return value === null ? '--' : `${value.toFixed(1)}%`;
- }
-
- async function refreshData() {
- isLoading.refreshing = true;
- await invalidateAll();
- isLoading.refreshing = false;
- }
-
- $effect(() => {
- if (activeView !== 'current') {
- closeStatsWS();
- return;
- }
-
- let mounted = true;
- let currentEnvId: string | null = null;
- const unsubscribeUser = userStore.subscribe((user) => {
- currentUser = user;
- });
- const unsubscribeEnvironment = environmentStore.subscribeSelected((environment) => {
- const nextEnvId = environment?.id ?? '0';
- if (!mounted || nextEnvId === currentEnvId) {
- return;
- }
-
- currentEnvId = nextEnvId;
- resetStats();
- setupStatsWS(nextEnvId);
- void refreshData();
- });
-
- (async () => {
- await environmentStore.ready;
-
- if (mounted && currentEnvId === null) {
- currentEnvId = environmentStore.selected?.id ?? '0';
- setupStatsWS(currentEnvId);
- }
- })();
-
- return () => {
- mounted = false;
- unsubscribeUser();
- unsubscribeEnvironment();
- closeStatsWS();
- };
- });
-
- function resetStats() {
- systemStats = null;
- hasInitialStatsLoaded = false;
- dockerInfo = null;
- dockerInfoPromise = null;
- dockerInfoError = null;
- }
-
- function closeStatsWS() {
- if (statsWSClient) {
- statsWSClient.close();
- statsWSClient = null;
- }
- }
-
- function setupStatsWS(envId: string) {
- closeStatsWS();
- statsWSClient = createStatsWebSocket({
- getEnvId: () => envId,
- onOpen: () => {
- if (!hasInitialStatsLoaded) {
- isLoading.loadingStats = true;
- }
- },
- onMessage: (data) => {
- systemStats = data;
- hasInitialStatsLoaded = true;
- isLoading.loadingStats = false;
- },
- onError: (e) => {
- console.error('Stats websocket error:', e);
- }
- });
- statsWSClient.connect();
- }
-
- async function loadDockerInfo(): Promise<DockerInfo> {
- try {
- const envId = await environmentStore.getCurrentEnvironmentId();
- const info = await systemService.getDockerInfoForEnvironment(envId);
- dockerInfo = info;
- return info;
- } catch (error) {
- console.error('Failed to load docker info:', error);
- dockerInfoError = m.common_failed();
- toast.error(dockerInfoError);
- throw error;
- } finally {
- dockerInfoPromise = null;
- }
- }
-
- function openDockerInfoDialog() {
- dockerInfoDialogOpen = true;
- if (dockerInfo || dockerInfoPromise) return;
-
- dockerInfoError = null;
- dockerInfoPromise = loadDockerInfo();
- }
-
- async function handleStartAll() {
- if (isLoading.starting || stoppedContainers === 0) return;
- isLoading.starting = true;
- handleApiResultWithCallbacks({
- result: await tryCatch(systemService.startAllStoppedContainers()),
- message: m.dashboard_start_all_failed(),
- setLoadingState: (value) => (isLoading.starting = value),
- onSuccess: async (data) => {
- toast.success(m.dashboard_start_all_success(), activityToastOptions(extractActivityId(data)));
- await refreshData();
- }
- });
- }
-
- async function handleStopAll() {
- if (isLoading.stopping || runningContainers === 0) return;
- openConfirmDialog({
- title: m.dashboard_stop_all_title(),
- message: m.dashboard_stop_all_confirm(),
- confirm: {
- label: m.common_confirm(),
- destructive: false,
- action: async () => {
- handleApiResultWithCallbacks({
- result: await tryCatch(systemService.stopAllContainers()),
- message: m.dashboard_stop_all_failed(),
- setLoadingState: (value) => (isLoading.stopping = value),
- onSuccess: async (data) => {
- toast.success(m.dashboard_stop_all_success(), activityToastOptions(extractActivityId(data)));
- await refreshData();
- }
- });
- }
- }
- });
- }
-
- async function confirmPrune(pruneRequest: SystemPruneRequest) {
- const selectedTypes = Object.keys(pruneRequest) as PruneType[];
- if (isLoading.pruning || selectedTypes.length === 0) return;
- isLoading.pruning = true;
-
- const typeLabels: Record<PruneType, string> = {
- containers: m.prune_stopped_containers(),
- images: m.prune_unused_images(),
- networks: m.prune_unused_networks(),
- volumes: m.prune_unused_volumes(),
- buildCache: m.build_cache()
- };
- const typesString = selectedTypes.map((t) => typeLabels[t]).join(', ');
-
- handleApiResultWithCallbacks({
- result: await tryCatch(systemService.pruneAll(pruneRequest)),
- message: m.dashboard_prune_failed({ types: typesString }),
- setLoadingState: (value) => (isLoading.pruning = value),
- onSuccess: async (data) => {
- isPruneDialogOpen = false;
- if (selectedTypes.length === 1) {
- toast.success(m.dashboard_prune_success_one({ types: typesString }), activityToastOptions(extractActivityId(data)));
- } else {
- toast.success(m.dashboard_prune_success_many({ types: typesString }), activityToastOptions(extractActivityId(data)));
- }
- await refreshData();
- }
- });
- }
</script>
-<Tabs.Root value={activeView} class="w-full">
- <div class="pt-3 md:pt-4">
- <TabBar items={viewTabs} value={activeView} onValueChange={handleViewChange} />
- </div>
-
- {#if activeView === 'all'}
- <Tabs.Content value="all">
- <DashboardAllEnvironmentsView heroGreeting={dashboardHeroGreeting} {debugAllGood} {debugUpgrade} />
- </Tabs.Content>
- {:else}
- <Tabs.Content value="current">
- <div class="flex h-full min-h-0 flex-col gap-4 overflow-hidden pt-3 md:gap-5 md:pt-4">
- <header
- class="dark:border-surface/80 dark:bg-surface/10 shrink-0 rounded-xl border border-white/80 bg-white/10 p-4 shadow-sm backdrop-blur-sm sm:p-5"
- >
- <div class="relative flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between">
- <div class="space-y-1.5">
- <p class="text-muted-foreground text-[11px] font-semibold tracking-[0.14em] uppercase">{m.dashboard_title()}</p>
- <h1 class="text-2xl font-semibold tracking-tight sm:text-3xl">{currentEnvironmentName}</h1>
- </div>
-
- <QuickActions
- class="w-full justify-start lg:w-auto lg:justify-end"
- compact
- {stoppedContainers}
- {runningContainers}
- isLoading={{ starting: isLoading.starting, stopping: isLoading.stopping, pruning: isLoading.pruning }}
- onStartAll={handleStartAll}
- onStopAll={handleStopAll}
- onOpenPruneDialog={() => (isPruneDialogOpen = true)}
- onRefresh={refreshData}
- refreshing={isLoading.refreshing}
- />
- </div>
- </header>
-
- <section class="shrink-0 space-y-3">
- {#if attentionItemsCount > 0}
- <div class="flex flex-col gap-1">
- <h2 class="text-lg font-semibold tracking-tight">{m.dashboard_action_items_title()}</h2>
- </div>
- <div class="grid grid-cols-1 gap-3 md:grid-cols-2 xl:grid-cols-4">
- {#if stoppedContainersAttentionCount > 0}
- <DashboardActionCard
- title={m.containers_title()}
- icon={ContainersIcon}
- badgeText={stoppedContainersBadgeText}
- badgeVariant="red"
- value={`${runningContainers}/${totalContainers}`}
- description={m.common_running()}
- ctaLabel={m.common_view_all()}
- href="/containers"
- />
- {/if}
-
- {#if imageUpdatesAttentionCount > 0}
- <DashboardActionCard
- title={m.images_updates()}
- icon={UpdateIcon}
- badgeText={imageUpdatesBadgeText}
- badgeVariant="amber"
- value={imageUpdatesAttentionCount}
- description={m.image_update_tag_description()}
- ctaLabel={m.common_view_all()}
- href="/updates"
- />
- {/if}
-
- {#if actionableVulnerabilitiesAttentionCount > 0}
- <DashboardActionCard
- title={m.security_title()}
- icon={AlertTriangleIcon}
- badgeText={actionableVulnerabilitiesBadgeText}
- badgeVariant="red"
- value={actionableVulnerabilitiesAttentionCount}
- description={m.security_subtitle()}
- ctaLabel={m.common_view()}
- href="/images/vulnerabilities"
- />
- {/if}
-
- {#if hasDiskPressureAlert}
- <DashboardActionCard
- title={m.dashboard_meter_disk()}
- icon={VolumesIcon}
- badgeText={diskRiskLabel}
- badgeVariant={diskRiskBadgeVariant}
- value={diskPressureValue}
- description={diskPressureDescription}
- ctaLabel={m.common_view_all()}
- href="/volumes"
- />
- {/if}
-
- {#if expiringApiKeysAttentionCount > 0}
- <DashboardActionCard
- title={m.api_key_page_title()}
- icon={ApiKeyIcon}
- badgeText={expiringApiKeysBadgeText}
- badgeVariant="orange"
- value={expiringApiKeysAttentionCount}
- description={m.api_key_expires_at_description()}
- ctaLabel={m.common_view_all()}
- href="/settings/api-keys"
- />
- {/if}
- </div>
- {:else}
- <Card.Root variant="outlined" class="border-emerald-500/30 bg-emerald-500/5 shadow-sm">
- <Card.Content class="space-y-2.5 p-4">
- <div class="space-y-2.5">
- <div class="flex items-center gap-2 text-sm font-semibold text-emerald-700 dark:text-emerald-300">
- <CheckIcon class="size-4" />
- <span>{m.progress_deploy_service_healthy({ service: m.environments_title() })}</span>
- </div>
- <p class="text-muted-foreground text-xs leading-relaxed">{m.dashboard_no_actionable_events()}</p>
- </div>
- </Card.Content>
- </Card.Root>
- {/if}
- </section>
-
- <header class="shrink-0">
- <Card.Root class="overflow-hidden">
- <Card.Header icon={StatsIcon} class="items-start">
- <div class="flex w-full min-w-0 flex-col gap-2">
- <h2 class="text-lg font-semibold tracking-tight">{m.common_overview()}</h2>
- <p class="text-muted-foreground text-sm">{m.dashboard_overview_caption()}</p>
- </div>
- </Card.Header>
- <Card.Content class="space-y-2.5 pt-0 pb-3">
- <div
- class={`grid grid-cols-2 gap-1 md:grid-cols-3 md:gap-1.5 ${gpuMetric !== null ? 'xl:grid-cols-4' : 'xl:grid-cols-3'}`}
- >
- <DashboardMetricTile
- title={m.dashboard_meter_cpu()}
- icon={CpuIcon}
- value={formatPercent(cpuMetric)}
- label={cpuMetricLabel}
- meterValue={cpuMetric}
- />
-
- <DashboardMetricTile
- title={m.dashboard_meter_memory()}
- icon={MemoryStickIcon}
- value={formatPercent(memoryMetric)}
- label={memoryMetricLabel}
- labelClass="truncate"
- meterValue={memoryMetric}
- />
-
- <DashboardMetricTile
- title={m.dashboard_meter_disk()}
- icon={VolumesIcon}
- value={formatPercent(diskMetric)}
- label={diskMetricLabel}
- labelClass="truncate"
- meterValue={diskMetric}
- />
-
- {#if gpuMetric !== null}
- <DashboardMetricTile
- title={m.dashboard_meter_gpu()}
- icon={GpuIcon}
- value={formatPercent(gpuMetric)}
- label={gpuMetricLabel}
- meterValue={gpuMetric}
- />
- {/if}
- </div>
-
- <div class="mt-1 flex flex-col gap-2 border-t pt-3 md:flex-row md:items-center md:justify-between">
- <div class="min-w-0 space-y-1">
- <div class="text-sm font-medium">{m.docker_engine_title({ engine: overviewHost })}</div>
- <div class="text-muted-foreground flex flex-wrap items-center gap-2 text-xs">
- <span class="inline-flex items-center gap-1.5">
- <ContainersIcon class="size-3" />
- <span class="font-medium text-emerald-600">{runningContainers}</span>
- <span class="text-muted-foreground/70">/</span>
- <span>{totalContainers}</span>
- </span>
- <span class="text-muted-foreground/50">•</span>
- <span class="inline-flex items-center gap-1.5">
- <ImagesIcon class="size-3" />
- <span>{images.pagination.totalItems}</span>
- <span class="text-muted-foreground/70">{m.images_title()}</span>
- </span>
- <span class="text-muted-foreground/50">•</span>
- <span>{imageUsageLabel}</span>
- <span class="text-muted-foreground/50">•</span>
- <span class="font-mono">{overviewPlatform} / {overviewArchitecture}</span>
- </div>
- </div>
-
- <ArcaneButton
- action="base"
- tone="ghost"
- size="sm"
- icon={InfoIcon}
- showLabel={false}
- customLabel={m.common_inspect()}
- class="h-7 px-2.5 text-xs"
- loading={!!dockerInfoPromise}
- onclick={openDockerInfoDialog}
- />
- </div>
- </Card.Content>
- </Card.Root>
- </header>
-
- <section class="flex flex-col lg:min-h-0 lg:flex-1 lg:overflow-hidden">
- <div class="mb-3 flex items-center justify-between gap-3">
- <h2 class="text-lg font-semibold tracking-tight">{m.dashboard_resource_tables_title()}</h2>
- <div class="hidden items-center gap-2 md:flex">
- <ArcaneButton action="base" tone="ghost" size="sm" href="/containers">
- {m.containers_title()}
- </ArcaneButton>
- <ArcaneButton action="base" tone="ghost" size="sm" href="/images">
- {m.images_title()}
- </ArcaneButton>
- </div>
- </div>
- <div class="grid grid-cols-1 gap-4 lg:min-h-0 lg:flex-1 lg:grid-cols-2 lg:overflow-hidden">
- <DashboardContainerTable bind:containers isLoading={false} />
- <DashboardImageTable bind:images isLoading={false} />
- </div>
- </section>
-
- <DockerInfoDialog bind:open={dockerInfoDialogOpen} {dockerInfo} {dockerInfoPromise} errorMessage={dockerInfoError} />
-
- <PruneConfirmationDialog
- bind:open={isPruneDialogOpen}
- defaults={settings}
- isPruning={isLoading.pruning}
- onConfirm={confirmPrune}
- onCancel={() => (isPruneDialogOpen = false)}
- />
- </div>
- </Tabs.Content>
- {/if}
-</Tabs.Root>
+<DashboardAllEnvironmentsView heroGreeting={dashboardHeroGreeting} {debugAllGood} />
diff --git a/frontend/src/routes/(app)/dashboard/+page.ts b/frontend/src/routes/(app)/dashboard/+page.ts
index 3b2b70710..080f0f6cd 100644
--- a/frontend/src/routes/(app)/dashboard/+page.ts
+++ b/frontend/src/routes/(app)/dashboard/+page.ts
@@ -1,44 +1,9 @@
-import { dashboardService } from '$lib/services/dashboard-service';
-import { settingsService } from '$lib/services/settings-service';
-import { queryKeys } from '$lib/query/query-keys';
-import { environmentStore } from '$lib/stores/environment.store.svelte';
-import { throwPageLoadError } from '$lib/utils/api';
import type { PageLoad } from './$types';
-export const load: PageLoad = async ({ parent, url }) => {
- const { queryClient } = await parent();
+export const load: PageLoad = async ({ url }) => {
const debugAllGood = url.searchParams.get('debugAllGood') === 'true';
- const requestedView = url.searchParams.get('view');
- const view = requestedView === 'current' ? 'current' : 'all';
- try {
- if (view === 'all') {
- return {
- view,
- dashboard: null,
- debugAllGood
- };
- }
-
- const envId = await environmentStore.getCurrentEnvironmentId();
- const [dashboard, settings] = await Promise.all([
- queryClient.fetchQuery({
- queryKey: queryKeys.dashboard.snapshot(envId, debugAllGood),
- queryFn: () => dashboardService.getDashboardForEnvironment(envId, { debugAllGood })
- }),
- queryClient.fetchQuery({
- queryKey: queryKeys.settings.byEnvironment(envId),
- queryFn: () => settingsService.getSettingsForEnvironmentMerged(envId)
- })
- ]);
-
- return {
- view,
- dashboard,
- settings,
- debugAllGood
- };
- } catch (err) {
- throwPageLoadError(err, 'Failed to load dashboard data');
- }
+ return {
+ debugAllGood
+ };
};
diff --git a/frontend/src/routes/(app)/dashboard/dash-action-card.svelte b/frontend/src/routes/(app)/dashboard/dash-action-card.svelte
index 8be482fa2..3cf40264c 100644
--- a/frontend/src/routes/(app)/dashboard/dash-action-card.svelte
+++ b/frontend/src/routes/(app)/dashboard/dash-action-card.svelte
@@ -37,7 +37,7 @@
let { title, value, description, icon: Icon, badgeText, badgeVariant = 'red', ctaLabel, href }: Props = $props();
</script>
-<Card.Root variant="outlined" class="shadow-sm">
+<Card.Root variant="outlined">
<Card.Content class="space-y-2.5 p-4">
<div class="flex items-center justify-between gap-2">
<div class="text-foreground/80 flex items-center gap-2 text-sm font-medium">
diff --git a/frontend/src/routes/(app)/dashboard/dashboard-all-environments-view.svelte b/frontend/src/routes/(app)/dashboard/dashboard-all-environments-view.svelte
index b4af2dfec..ee40e475c 100644
--- a/frontend/src/routes/(app)/dashboard/dashboard-all-environments-view.svelte
+++ b/frontend/src/routes/(app)/dashboard/dashboard-all-environments-view.svelte
@@ -2,12 +2,14 @@
import { goto, invalidateAll } from '$app/navigation';
import { resolve } from '$app/paths';
import { formatDistanceToNow } from 'date-fns';
- import { onDestroy } from 'svelte';
+ import { onDestroy, untrack } from 'svelte';
import { toast } from 'svelte-sonner';
- import { ActionButtonGroup, type ActionButton } from '$lib/components/action-button-group/index.js';
+ import { type ActionButton } from '$lib/components/action-button-group/index.js';
+ import { cn } from '$lib/utils';
import { ArcaneButton } from '$lib/components/arcane-button/index.js';
import StatusBadge from '$lib/components/badges/status-badge.svelte';
import PruneConfirmationDialog from '$lib/components/dialogs/prune-confirmation-dialog.svelte';
+ import DockerInfoDialog from '$lib/components/dialogs/docker-info-dialog.svelte';
import { Skeleton } from '$lib/components/ui/skeleton';
import * as Card from '$lib/components/ui/card/index.js';
import { m } from '$lib/paraglide/messages';
@@ -24,6 +26,7 @@
DashboardSnapshot
} from '$lib/types/shared';
import type { Environment } from '$lib/types/environment';
+ import type { DockerInfo } from '$lib/types/docker';
import type { PruneType, SystemPruneRequest } from '$lib/types/automation';
import { extractApiErrorMessage, handleApiResultWithCallbacks } from '$lib/utils/api';
import { capitalizeFirstLetter } from '$lib/utils/formatting';
@@ -36,7 +39,9 @@
ContainersIcon,
CpuIcon,
EnvironmentsIcon,
+ GpuIcon,
ImagesIcon,
+ InfoIcon,
InspectIcon,
MemoryStickIcon,
RefreshIcon,
@@ -75,6 +80,24 @@
let upgradeDialogOpenById = $state<Record<string, boolean>>({});
let upgradeDialogUpgradingById = $state<Record<string, boolean>>({});
+ type EnvironmentSnapshotState = {
+ snapshot: DashboardSnapshot | null;
+ loading: boolean;
+ hasLoaded: boolean;
+ error: string | null;
+ };
+
+ const dashboardSnapshotPollInterval = 15000;
+ let snapshotByEnvironmentId = $state<Record<string, EnvironmentSnapshotState>>({});
+ let snapshotPollers: Record<string, ReturnType<typeof setInterval>> = {};
+
+ let dockerInfoOpen = $state(false);
+ let dockerInfoData = $state<DockerInfo | null>(null);
+ let dockerInfoPromise = $state<Promise<DockerInfo> | null>(null);
+ let dockerInfoError = $state<string | null>(null);
+ let dockerInfoByEnvironmentId = $state<Record<string, DockerInfo | undefined>>({});
+ let dockerInfoPromiseByEnvironmentId = $state<Record<string, Promise<DockerInfo> | undefined>>({});
+
const availableEnvironments = $derived(environmentStore.available);
const currentEnvironmentId = $derived(environmentStore.selected?.id ?? null);
@@ -112,33 +135,6 @@
return 2;
}
- function buildEnvironmentLoadPromise(
- environment: Environment,
- currentDebugFlag: boolean
- ): Promise<DashboardEnvironmentOverview> {
- return dashboardService
- .getDashboardForEnvironment(environment.id, {
- debugAllGood: currentDebugFlag
- })
- .then((snapshot) => ({
- environment,
- containers: snapshot.containers.counts ?? { runningContainers: 0, stoppedContainers: 0, totalContainers: 0 },
- imageUsageCounts: snapshot.imageUsageCounts,
- actionItems: snapshot.actionItems,
- settings: snapshot.settings,
- snapshotState: 'ready' as const
- }))
- .catch((error) => ({
- environment,
- containers: { runningContainers: 0, stoppedContainers: 0, totalContainers: 0 },
- imageUsageCounts: { imagesInuse: 0, imagesUnused: 0, totalImages: 0, totalImageSize: 0 },
- actionItems: { items: [] },
- settings: emptySnapshotSettings,
- snapshotState: 'error' as const,
- snapshotError: extractApiErrorMessage(error)
- }));
- }
-
function buildOverviewSummaryFromItemsInternal(settledEnvironments: DashboardEnvironmentOverview[]): DashboardOverviewSummary {
return {
totalEnvironments: settledEnvironments.length,
@@ -159,22 +155,6 @@
};
}
- function mapOverviewSummary(summary: import('$lib/types/shared').DashboardEnvironmentsSummary): DashboardOverviewSummary {
- return {
- totalEnvironments: summary.totalEnvironments,
- reachableEnvironments: summary.onlineEnvironments + summary.standbyEnvironments,
- unavailableEnvironments: summary.offlineEnvironments + summary.pendingEnvironments + summary.errorEnvironments,
- disabledEnvironments: summary.disabledEnvironments,
- totalContainers: summary.containers.totalContainers,
- runningContainers: summary.containers.runningContainers,
- stoppedContainers: summary.containers.stoppedContainers,
- totalImages: summary.imageUsageCounts.totalImages,
- imagesInUse: summary.imageUsageCounts.imagesInuse,
- imagesUnused: summary.imageUsageCounts.imagesUnused,
- totalImageSize: summary.imageUsageCounts.totalImageSize
- };
- }
-
function createEmptyLiveStatsState(): EnvironmentLiveStatsState {
return {
stats: null,
@@ -239,6 +219,95 @@
}
}
+ async function fetchEnvironmentSnapshot(environment: Environment) {
+ if (!snapshotByEnvironmentId[environment.id]) {
+ return;
+ }
+
+ const result = await tryCatch(dashboardService.getDashboardForEnvironment(environment.id, { debugAllGood }));
+ const state = snapshotByEnvironmentId[environment.id];
+ if (!state) {
+ return;
+ }
+
+ if (result.error) {
+ state.error = extractApiErrorMessage(result.error);
+ } else {
+ state.snapshot = result.data;
+ state.error = null;
+ state.hasLoaded = true;
+ }
+ state.loading = false;
+ }
+
+ function ensureEnvironmentSnapshot(environment: Environment) {
+ if (!shouldLoadEnvironment(environment)) {
+ removeEnvironmentSnapshot(environment.id);
+ return;
+ }
+
+ if (!snapshotByEnvironmentId[environment.id]) {
+ snapshotByEnvironmentId[environment.id] = { snapshot: null, loading: true, hasLoaded: false, error: null };
+ }
+
+ if (snapshotPollers[environment.id]) {
+ return;
+ }
+
+ void fetchEnvironmentSnapshot(environment);
+ snapshotPollers[environment.id] = setInterval(() => {
+ void fetchEnvironmentSnapshot(environment);
+ }, dashboardSnapshotPollInterval);
+ }
+
+ function removeEnvironmentSnapshot(environmentId: string) {
+ const poller = snapshotPollers[environmentId];
+ if (poller) {
+ clearInterval(poller);
+ delete snapshotPollers[environmentId];
+ }
+ delete snapshotByEnvironmentId[environmentId];
+ }
+
+ function cleanupEnvironmentSnapshots() {
+ for (const environmentId of Object.keys(snapshotPollers)) {
+ removeEnvironmentSnapshot(environmentId);
+ }
+ }
+
+ async function loadDockerInfo(environment: Environment): Promise<DockerInfo> {
+ try {
+ const info = await systemService.getDockerInfoForEnvironment(environment.id);
+ dockerInfoByEnvironmentId[environment.id] = info;
+ dockerInfoData = info;
+ return info;
+ } finally {
+ delete dockerInfoPromiseByEnvironmentId[environment.id];
+ dockerInfoPromise = null;
+ }
+ }
+
+ function openDockerInfo(environment: Environment) {
+ dockerInfoError = null;
+ dockerInfoOpen = true;
+ dockerInfoData = dockerInfoByEnvironmentId[environment.id] ?? null;
+ if (dockerInfoData) {
+ dockerInfoPromise = null;
+ return;
+ }
+
+ dockerInfoPromise = dockerInfoPromiseByEnvironmentId[environment.id] ?? null;
+ if (dockerInfoPromise) {
+ return;
+ }
+
+ dockerInfoPromise = loadDockerInfo(environment).catch((error) => {
+ dockerInfoError = extractApiErrorMessage(error);
+ throw error;
+ });
+ dockerInfoPromiseByEnvironmentId[environment.id] = dockerInfoPromise;
+ }
+
const environmentCards = $derived.by((): DashboardEnvironmentCardState[] => {
const refreshNonce = reloadVersion;
void refreshNonce;
@@ -258,65 +327,112 @@
})
.map(({ environment }) => ({ environment }));
});
-
- const environmentBoardStatePromise = $derived.by(
- async (): Promise<{
- overviewById: Map<string, DashboardEnvironmentOverview>;
- summary: DashboardOverviewSummary;
- }> => {
- void reloadVersion;
-
- const currentEnvironmentCards = environmentCards;
- const result = await tryCatch(dashboardService.getDashboardEnvironmentsOverview({ debugAllGood }));
- if (!result.error) {
- return {
- overviewById: new Map(result.data.environments.map((item) => [item.environment.id, item])),
- summary: mapOverviewSummary(result.data.summary)
+ const loadableEnvironmentCards = $derived(environmentCards.filter(({ environment }) => shouldLoadEnvironment(environment)));
+ const loadableEnvironmentIds = $derived.by(() => new Set(loadableEnvironmentCards.map(({ environment }) => environment.id)));
+
+ const boardState = $derived.by(() => {
+ void reloadVersion;
+
+ const overviewById = new Map<string, DashboardEnvironmentOverview>();
+ const items: DashboardEnvironmentOverview[] = [];
+
+ for (const { environment } of environmentCards) {
+ const state = snapshotByEnvironmentId[environment.id];
+ let item: DashboardEnvironmentOverview;
+
+ if (state?.snapshot) {
+ const snapshot = state.snapshot;
+ item = {
+ environment,
+ containers: snapshot.containers.counts ?? { runningContainers: 0, stoppedContainers: 0, totalContainers: 0 },
+ imageUsageCounts: snapshot.imageUsageCounts,
+ actionItems: snapshot.actionItems,
+ settings: snapshot.settings,
+ versionInfo: snapshot.versionInfo,
+ snapshotState: 'ready'
};
+ } else if (state?.error) {
+ item = {
+ ...createBaseEnvironmentOverview(environment),
+ snapshotState: 'error',
+ snapshotError: state.error
+ };
+ } else {
+ item = createBaseEnvironmentOverview(environment);
}
- const fallbackItems = await Promise.all(
- currentEnvironmentCards.map((item) =>
- shouldLoadEnvironment(item.environment)
- ? buildEnvironmentLoadPromise(item.environment, debugAllGood)
- : Promise.resolve(createBaseEnvironmentOverview(item.environment))
- )
- );
+ overviewById.set(environment.id, item);
+ items.push(item);
+ }
- return {
- overviewById: new Map(fallbackItems.map((item) => [item.environment.id, item])),
- summary: buildOverviewSummaryFromItemsInternal(fallbackItems)
- };
+ return {
+ overviewById,
+ summary: buildOverviewSummaryFromItemsInternal(items)
+ };
+ });
+
+ function isEnvironmentSnapshotLoading(environmentId: string): boolean {
+ const state = snapshotByEnvironmentId[environmentId];
+ return Boolean(state && state.loading && !state.hasLoaded);
+ }
+
+ const boardSummaryLoading = $derived.by(() => {
+ let hasReachable = false;
+ for (const { environment } of environmentCards) {
+ if (!shouldLoadEnvironment(environment)) {
+ continue;
+ }
+ hasReachable = true;
+ if (snapshotByEnvironmentId[environment.id]?.hasLoaded) {
+ return false;
+ }
}
- );
+ return hasReachable;
+ });
$effect(() => {
- const reachableEnvironmentIds: string[] = [];
+ const environmentsToLoad = loadableEnvironmentCards.map(({ environment }) => environment);
- for (const item of environmentCards) {
- if (!shouldLoadEnvironment(item.environment)) {
- continue;
+ untrack(() => {
+ for (const environment of environmentsToLoad) {
+ ensureEnvironmentLiveStats(environment);
+ ensureEnvironmentSnapshot(environment);
}
+ });
+ });
- reachableEnvironmentIds.push(item.environment.id);
- ensureEnvironmentLiveStats(item.environment);
- }
+ $effect(() => {
+ const reachableEnvironmentIds = loadableEnvironmentIds;
- for (const environmentId of Object.keys(liveStatsByEnvironmentId)) {
- if (!reachableEnvironmentIds.includes(environmentId)) {
- removeEnvironmentLiveStats(environmentId);
+ untrack(() => {
+ for (const environmentId of Object.keys(liveStatsByEnvironmentId)) {
+ if (!reachableEnvironmentIds.has(environmentId)) {
+ removeEnvironmentLiveStats(environmentId);
+ }
}
- }
+
+ for (const environmentId of Object.keys(snapshotByEnvironmentId)) {
+ if (!reachableEnvironmentIds.has(environmentId)) {
+ removeEnvironmentSnapshot(environmentId);
+ }
+ }
+ });
});
onDestroy(() => {
cleanupEnvironmentLiveStats();
+ cleanupEnvironmentSnapshots();
});
async function refreshOverview() {
isRefreshing = true;
try {
await invalidateAll();
+ await Promise.all(
+ environmentCards
+ .filter(({ environment }) => shouldLoadEnvironment(environment))
+ .map(({ environment }) => fetchEnvironmentSnapshot(environment))
+ );
reloadVersion += 1;
} finally {
isRefreshing = false;
@@ -482,6 +598,18 @@
return `${bytes.format(used, { unitSeparator: ' ' }) ?? '-'} / ${bytes.format(total, { unitSeparator: ' ' }) ?? '-'}`;
}
+ function getGpuMetric(stats: SystemStats | null): number | null {
+ const gpus = stats?.gpus?.filter((gpu) => gpu.memoryTotal > 0) ?? [];
+ if (gpus.length === 0) return null;
+ const totalPercent = gpus.reduce((sum, gpu) => sum + (gpu.memoryUsed / gpu.memoryTotal) * 100, 0);
+ return totalPercent / gpus.length;
+ }
+
+ function getGpuMetricLabel(stats: SystemStats | null): string {
+ const count = stats?.gpuCount ?? 0;
+ return count > 0 ? `${count} ${count === 1 ? m.dashboard_meter_gpu_device() : m.dashboard_meter_gpu_devices()}` : '--';
+ }
+
function canPruneEnvironment(item: DashboardEnvironmentOverview): boolean {
return (
canPruneInEnvironment(item.environment.id) &&
@@ -494,18 +622,6 @@
function getEnvironmentActionButtons(item: DashboardEnvironmentOverview, isCurrent: boolean): ActionButton[] {
const buttons: ActionButton[] = [];
- if (canPruneInEnvironment(item.environment.id)) {
- buttons.push({
- id: `${item.environment.id}-prune`,
- action: 'prune',
- label: m.quick_actions_prune_system(),
- loading: pruningEnvironmentId === item.environment.id,
- disabled: !canPruneEnvironment(item) || !!pruningEnvironmentId,
- onclick: () => openPruneDialog(item),
- icon: TrashIcon
- });
- }
-
buttons.push({
id: `${item.environment.id}-use`,
action: 'base',
@@ -523,6 +639,27 @@
icon: InspectIcon
});
+ buttons.push({
+ id: `${item.environment.id}-docker-info`,
+ action: 'base',
+ label: m.common_inspect(),
+ disabled: !shouldLoadEnvironment(item.environment),
+ onclick: () => openDockerInfo(item.environment),
+ icon: InfoIcon
+ });
+
+ if (canPruneInEnvironment(item.environment.id)) {
+ buttons.push({
+ id: `${item.environment.id}-prune`,
+ action: 'prune',
+ label: m.quick_actions_prune_system(),
+ loading: pruningEnvironmentId === item.environment.id,
+ disabled: !canPruneEnvironment(item) || !!pruningEnvironmentId,
+ onclick: () => openPruneDialog(item),
+ icon: TrashIcon
+ });
+ }
+
return buttons;
}
@@ -635,9 +772,7 @@
</script>
<div class="flex h-full min-h-0 flex-col gap-3 overflow-hidden pt-2 md:gap-4 md:pt-3">
- <header
- class="dark:border-surface/80 dark:bg-surface/10 shrink-0 rounded-xl border border-white/80 bg-white/10 p-3 shadow-sm backdrop-blur-sm sm:p-4"
- >
+ <header class="bg-card/60 backdrop-blur-md border-border/70 shrink-0 rounded-xl border p-3 shadow-xs sm:p-4">
<div class="relative flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between">
<div class="space-y-1">
<p class="text-muted-foreground text-[11px] font-semibold tracking-[0.14em] uppercase">{m.dashboard_title()}</p>
@@ -658,7 +793,7 @@
<section class="shrink-0 space-y-2">
<h2 class="text-base font-semibold tracking-tight">{m.common_overview()}</h2>
- {#await environmentBoardStatePromise}
+ {#if boardSummaryLoading}
<div class="grid grid-cols-1 gap-2 md:grid-cols-2 xl:grid-cols-4">
{#each [1, 2, 3, 4] as tile (tile)}
<div class="border-border/50 bg-background/50 rounded-xl border p-3">
@@ -668,7 +803,7 @@
</div>
{/each}
</div>
- {:then boardState}
+ {:else}
{@const summary = boardState.summary}
<div class="grid grid-cols-1 gap-2 md:grid-cols-2 xl:grid-cols-4">
<div class="border-border/50 bg-background/50 rounded-xl border p-3">
@@ -707,7 +842,7 @@
<div class="text-muted-foreground mt-0.5 text-xs">{formatStorageOverviewLabel(summary)}</div>
</div>
</div>
- {/await}
+ {/if}
</section>
<section class="flex min-h-0 flex-1 flex-col overflow-hidden">
@@ -735,13 +870,14 @@
{@const cpuMetric = getCpuMetric(systemStats)}
{@const memoryMetric = getMemoryMetric(systemStats)}
{@const diskMetric = getDiskMetric(systemStats)}
+ {@const gpuMetric = getGpuMetric(systemStats)}
<Card.Root
variant="outlined"
class={`dashboard-environment-card [container-type:inline-size] overflow-hidden border transition-colors ${isCurrent ? 'border-blue-500/40 bg-blue-500/5' : 'border-border/60'}`}
>
- <Card.Content class="space-y-4 p-4">
- <div class="grid grid-cols-[minmax(0,1fr)_auto] gap-x-3 gap-y-3">
+ <Card.Content class="space-y-5 p-5">
+ <div class="border-border/60 flex flex-col gap-3 border-b pb-4 sm:flex-row sm:items-start sm:justify-between">
<div class="min-w-0 space-y-2">
<div class="flex min-w-0 flex-wrap items-center gap-2">
<div class="min-w-0 max-w-full break-words text-base font-semibold tracking-tight">{environment.name}</div>
@@ -755,7 +891,7 @@
minWidth="none"
/>
<StatusBadge text={transportBadge.text} variant={transportBadge.variant} size="sm" minWidth="none" />
- {#await environmentBoardStatePromise then boardState}
+ {#if boardState}
{@const loadedItem = boardState.overviewById.get(environment.id) ?? baseItem}
{@const vInfo =
loadedItem.versionInfo ||
@@ -815,33 +951,43 @@
/>
{/if}
{/if}
- {/await}
+ {/if}
</div>
- <div class="text-muted-foreground flex flex-wrap items-center gap-x-3 gap-y-1 text-xs">
+ <div class="text-muted-foreground/70 mt-1 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-[11px]">
<span class="font-mono">{environment.apiUrl}</span>
<span>•</span>
<span title={activity.title}>{activity.label}: {activity.value}</span>
</div>
</div>
- <div class="flex min-w-0 items-start justify-end pt-1">
- {#await environmentBoardStatePromise}
- <ActionButtonGroup
- buttons={getEnvironmentActionButtons(baseItem, isCurrent)}
- size="sm"
- inlineClass="dashboard-environment-card-action-inline"
- menuClass="dashboard-environment-card-action-menu"
- />
- {:then boardState}
- {@const loadedItem = boardState.overviewById.get(environment.id) ?? baseItem}
- <ActionButtonGroup
- buttons={getEnvironmentActionButtons(loadedItem, isCurrent)}
- size="sm"
- inlineClass="dashboard-environment-card-action-inline"
- menuClass="dashboard-environment-card-action-menu"
- />
- {/await}
+ <div class="flex shrink-0 items-center gap-1 pt-1 sm:pt-0">
+ {#each getEnvironmentActionButtons(boardState.overviewById.get(environment.id) ?? baseItem, isCurrent) as btn (btn.id)}
+ {@const isActiveEnv = isCurrent && btn.id === `${environment.id}-use`}
+ <ArcaneTooltip.Root>
+ <ArcaneTooltip.Trigger>
+ {#snippet child({ props })}
+ <ArcaneButton
+ {...props}
+ action={btn.action}
+ size="icon"
+ tone="ghost"
+ icon={btn.icon}
+ customLabel={btn.label}
+ loading={btn.loading}
+ disabled={btn.disabled}
+ onclick={btn.onclick}
+ class={cn(
+ 'size-8',
+ btn.action === 'prune' && 'text-destructive hover:bg-destructive/10 hover:text-destructive',
+ isActiveEnv && 'disabled:opacity-100 [&_svg]:text-blue-600! dark:[&_svg]:text-blue-500!'
+ )}
+ />
+ {/snippet}
+ </ArcaneTooltip.Trigger>
+ <ArcaneTooltip.Content>{isActiveEnv ? m.common_current() : btn.label}</ArcaneTooltip.Content>
+ </ArcaneTooltip.Root>
+ {/each}
</div>
</div>
@@ -851,12 +997,12 @@
<div class="text-muted-foreground text-[11px] font-semibold tracking-wide uppercase">
{m.containers_title()}
</div>
- {#await environmentBoardStatePromise}
+ {#if isEnvironmentSnapshotLoading(environment.id)}
<div class="mt-2 space-y-2">
<Skeleton class="h-6 w-20" />
<Skeleton class="h-3 w-24" />
</div>
- {:then boardState}
+ {:else}
{@const loadedItem = boardState.overviewById.get(environment.id) ?? baseItem}
<div class="mt-1 text-lg font-semibold">
{loadedItem.containers.runningContainers}/{loadedItem.containers.totalContainers}
@@ -865,17 +1011,17 @@
{loadedItem.containers.stoppedContainers}
{m.common_stopped()}
</div>
- {/await}
+ {/if}
</div>
<div class="border-border/50 bg-background/50 rounded-lg border p-3">
<div class="text-muted-foreground text-[11px] font-semibold tracking-wide uppercase">{m.images_title()}</div>
- {#await environmentBoardStatePromise}
+ {#if isEnvironmentSnapshotLoading(environment.id)}
<div class="mt-2 space-y-2">
<Skeleton class="h-6 w-14" />
<Skeleton class="h-3 w-28" />
</div>
- {:then boardState}
+ {:else}
{@const loadedItem = boardState.overviewById.get(environment.id) ?? baseItem}
<div class="mt-1 text-lg font-semibold">{loadedItem.imageUsageCounts.totalImages}</div>
<div class="text-muted-foreground text-xs">
@@ -883,23 +1029,23 @@
{m.common_in_use()} · {loadedItem.imageUsageCounts.imagesUnused}
{m.common_unused()}
</div>
- {/await}
+ {/if}
</div>
<div class="border-border/50 bg-background/50 rounded-lg border p-3">
<div class="text-muted-foreground text-[11px] font-semibold tracking-wide uppercase">
{m.dashboard_action_items_title()}
</div>
- {#await environmentBoardStatePromise}
+ {#if isEnvironmentSnapshotLoading(environment.id)}
<div class="mt-2 space-y-2">
<Skeleton class="h-6 w-12" />
<Skeleton class="h-3 w-32" />
</div>
- {:then boardState}
+ {:else}
{@const loadedItem = boardState.overviewById.get(environment.id) ?? baseItem}
<div class="mt-1 text-lg font-semibold">{loadedItem.actionItems.items.length}</div>
<div class="text-muted-foreground text-xs">{getActionSummary(loadedItem)}</div>
- {/await}
+ {/if}
</div>
</div>
{:else}
@@ -910,8 +1056,8 @@
{/if}
{#if shouldLoadEnvironment(environment)}
- <div class="border-border/50 bg-background/40 rounded-xl border p-1">
- <div class="grid grid-cols-1 gap-1 sm:grid-cols-3">
+ <div class="pt-1">
+ <div class="grid grid-cols-1 gap-1 {gpuMetric !== null ? 'sm:grid-cols-2 lg:grid-cols-4' : 'sm:grid-cols-3'}">
{#if liveStatsLoading}
{#each [1, 2, 3] as tile (tile)}
<div class="min-w-0 px-2.5 py-2.5">
@@ -949,19 +1095,29 @@
labelClass="truncate"
meterValue={diskMetric}
/>
+
+ {#if gpuMetric !== null}
+ <DashboardMetricTile
+ title={m.dashboard_meter_gpu()}
+ icon={GpuIcon}
+ value={formatPercent(gpuMetric)}
+ label={getGpuMetricLabel(systemStats)}
+ meterValue={gpuMetric}
+ />
+ {/if}
{/if}
</div>
</div>
{/if}
- {#await environmentBoardStatePromise then boardState}
+ {#if boardState}
{@const loadedItem = boardState.overviewById.get(environment.id) ?? baseItem}
{#if loadedItem.snapshotState === 'error' && loadedItem.snapshotError}
<div class="rounded-lg border border-red-500/20 bg-red-500/5 px-3 py-2 text-xs text-red-700 dark:text-red-300">
{m.dashboard_all_summary_unavailable({ error: loadedItem.snapshotError })}
</div>
{/if}
- {/await}
+ {/if}
</Card.Content>
</Card.Root>
{/each}
@@ -977,24 +1133,4 @@
onCancel={closePruneDialog}
/>
-<style>
- @container (max-width: 47.999rem) {
- :global(.dashboard-environment-card-action-inline) {
- display: none;
- }
-
- :global(.dashboard-environment-card-action-menu) {
- display: flex;
- }
- }
-
- @container (min-width: 48rem) {
- :global(.dashboard-environment-card-action-inline) {
- display: flex;
- }
-
- :global(.dashboard-environment-card-action-menu) {
- display: none;
- }
- }
-</style>
+<DockerInfoDialog bind:open={dockerInfoOpen} dockerInfo={dockerInfoData} {dockerInfoPromise} errorMessage={dockerInfoError} />
diff --git a/frontend/src/routes/(app)/settings/+page.svelte b/frontend/src/routes/(app)/settings/+page.svelte
index d284212fe..2eb8ed562 100644
--- a/frontend/src/routes/(app)/settings/+page.svelte
+++ b/frontend/src/routes/(app)/settings/+page.svelte
@@ -132,7 +132,7 @@
}
</script>
-<div class="space-y-8 pb-5 md:space-y-10 md:pb-5">
+<div class="space-y-6 pb-5 md:space-y-8 md:pb-5">
<HeaderCard>
<div class="flex items-center justify-between gap-4">
<div class="flex min-w-64 flex-1 items-center gap-3 sm:gap-4">
@@ -190,7 +190,7 @@
<div class="grid grid-cols-1 gap-4 sm:grid-cols-2 sm:gap-6 xl:grid-cols-3">
{#each settingsCategories as category (category.id)}
{@const Icon = getIconComponent(category.icon)}
- <Card class="hover:border-primary/20 group cursor-pointer transition-all duration-200 hover:shadow-md">
+ <Card class="hover:border-primary/30 group cursor-pointer transition-colors duration-200">
<button onclick={() => navigateToCategory(category.url)} class="w-full p-4 text-left sm:p-6">
<div class="flex items-start justify-between gap-3">
<div class="flex min-w-0 flex-1 items-start gap-3 sm:gap-4">
@@ -233,7 +233,7 @@
<div class="space-y-4 sm:space-y-6">
{#each searchResults as result (result.id)}
{@const Icon = getIconComponent(result.icon)}
- <div class="bg-background/40 rounded-lg border shadow-sm">
+ <div class="bg-background/40 rounded-lg border">
<div class="border-b p-4 sm:p-6">
<div class="flex items-center justify-between">
<div class="flex items-center gap-3">
diff --git a/tests/spec/dashboard-system-stats.spec.ts b/tests/spec/dashboard-system-stats.spec.ts
index 883921b08..c37b3561e 100644
--- a/tests/spec/dashboard-system-stats.spec.ts
+++ b/tests/spec/dashboard-system-stats.spec.ts
@@ -1,7 +1,6 @@
import { test, expect, type Page } from '@playwright/test';
const defaultDashboardPath = '/dashboard';
-const currentDashboardPath = '/dashboard?view=current';
const mockedStats = {
cpuUsage: 12.3,
@@ -126,7 +125,6 @@ test.describe('Dashboard system stats websocket', () => {
await page.goto(defaultDashboardPath);
await page.waitForLoadState('load');
- await expect(page.getByRole('tab', { name: 'All' })).toHaveAttribute('data-state', 'active');
await expect(page.getByRole('heading', { name: 'Overview' })).toBeVisible();
await expect(page.getByRole('heading', { name: 'Environment Board' })).toBeVisible();
await expect(page.getByText('12.3%', { exact: true })).toBeVisible();
@@ -135,13 +133,11 @@ test.describe('Dashboard system stats websocket', () => {
await expect(page.getByText('7 CPUs', { exact: true })).toBeVisible();
await expect(page.getByText('512 MB / 1 GB', { exact: true })).toBeVisible();
await expect(page.getByText('256 MB / 1 GB', { exact: true })).toBeVisible();
- await expect(page.getByText('Current', { exact: true }).first()).toBeVisible();
+ await expect(page.locator('main').getByText('Local Docker', { exact: true })).toBeVisible();
await expect(page.getByText('HTTP', { exact: true }).first()).toBeVisible();
});
- test('loads dashboard content from the aggregated overview endpoint without dashboard REST fan-out', async ({
- page
- }) => {
+ test('loads dashboard content without eagerly loading docker info', async ({ page }) => {
await mockDashboardStatsWebSocket(page);
const requestPaths = collectDashboardRequestPaths(page);
@@ -149,18 +145,7 @@ test.describe('Dashboard system stats websocket', () => {
await page.waitForLoadState('load');
await expect(page.getByRole('heading', { name: 'Environment Board' })).toBeVisible();
- await expect.poll(() => requestPaths).toContain('/api/dashboard/environments');
-
- for (const blockedPattern of [
- /\/api\/environments\/[^/]+\/dashboard$/,
- /\/api\/environments\/[^/]+\/containers$/,
- /\/api\/environments\/[^/]+\/containers\/counts$/,
- /\/api\/environments\/[^/]+\/images$/,
- /\/api\/environments\/[^/]+\/images\/counts$/,
- /\/api\/environments\/[^/]+\/dashboard\/action-items$/
- ]) {
- expect(countMatchingRequests(requestPaths, blockedPattern)).toBe(0);
- }
+ await expect.poll(() => requestPaths).toContain('/api/environments/0/dashboard');
expect(
countMatchingRequests(requestPaths, /\/api\/environments\/[^/]+\/system\/docker\/info$/)
@@ -175,9 +160,7 @@ test.describe('Dashboard system stats websocket', () => {
await page.goto(defaultDashboardPath);
await page.waitForLoadState('load');
- await page.getByRole('tab', { name: 'Current' }).click();
- await expect(page).toHaveURL(currentDashboardPath);
- await page.waitForLoadState('load');
+ await expect(page.getByRole('heading', { name: 'Environment Board' })).toBeVisible();
expect(
countMatchingRequests(requestPaths, /\/api\/environments\/[^/]+\/system\/docker\/info$/)
diff --git a/types/dashboard/dashboard.go b/types/dashboard/dashboard.go
index 776b4ac9a..fb5a71bde 100644
--- a/types/dashboard/dashboard.go
+++ b/types/dashboard/dashboard.go
@@ -3,7 +3,6 @@ package dashboard
import (
"github.com/getarcaneapp/arcane/types/base"
containertypes "github.com/getarcaneapp/arcane/types/container"
- environmenttypes "github.com/getarcaneapp/arcane/types/environment"
imagetypes "github.com/getarcaneapp/arcane/types/image"
versiontypes "github.com/getarcaneapp/arcane/types/version"
dockercontainer "github.com/moby/moby/api/types/container"
@@ -115,118 +114,9 @@ type Snapshot struct {
//
// Required: true
Settings SnapshotSettings `json:"settings"`
-}
-
-type EnvironmentSnapshotState string
-
-const (
- EnvironmentSnapshotStateReady EnvironmentSnapshotState = "ready"
- EnvironmentSnapshotStateSkipped EnvironmentSnapshotState = "skipped"
- EnvironmentSnapshotStateError EnvironmentSnapshotState = "error"
-)
-
-type EnvironmentOverview struct {
- // Environment is the normalized runtime environment record.
- //
- // Required: true
- Environment environmenttypes.Environment `json:"environment"`
-
- // Containers is the summarized container status for the environment.
- //
- // Required: true
- Containers containertypes.StatusCounts `json:"containers"`
-
- // ImageUsageCounts is the summarized image usage for the environment.
- //
- // Required: true
- ImageUsageCounts imagetypes.UsageCounts `json:"imageUsageCounts"`
-
- // ActionItems is the environment attention summary.
- //
- // Required: true
- ActionItems ActionItems `json:"actionItems"`
-
- // Settings is the minimal dashboard settings payload needed for per-environment actions.
- //
- // Required: true
- Settings SnapshotSettings `json:"settings"`
// VersionInfo is the environment application version metadata when available.
//
// Required: false
VersionInfo *versiontypes.Info `json:"versionInfo,omitempty"`
-
- // SnapshotState indicates whether the environment snapshot was fetched.
- //
- // Required: true
- SnapshotState EnvironmentSnapshotState `json:"snapshotState"`
-
- // SnapshotError contains a non-fatal snapshot retrieval error.
- //
- // Required: false
- SnapshotError *string `json:"snapshotError,omitempty"`
-}
-
-type EnvironmentsSummary struct {
- // TotalEnvironments is the number of visible environments.
- //
- // Required: true
- TotalEnvironments int `json:"totalEnvironments"`
-
- // OnlineEnvironments is the number of online environments.
- //
- // Required: true
- OnlineEnvironments int `json:"onlineEnvironments"`
-
- // StandbyEnvironments is the number of standby environments.
- //
- // Required: true
- StandbyEnvironments int `json:"standbyEnvironments"`
-
- // OfflineEnvironments is the number of offline environments.
- //
- // Required: true
- OfflineEnvironments int `json:"offlineEnvironments"`
-
- // PendingEnvironments is the number of pending environments.
- //
- // Required: true
- PendingEnvironments int `json:"pendingEnvironments"`
-
- // ErrorEnvironments is the number of error environments.
- //
- // Required: true
- ErrorEnvironments int `json:"errorEnvironments"`
-
- // DisabledEnvironments is the number of disabled environments.
- //
- // Required: true
- DisabledEnvironments int `json:"disabledEnvironments"`
-
- // Containers is the aggregated container status counts.
- //
- // Required: true
- Containers containertypes.StatusCounts `json:"containers"`
-
- // ImageUsageCounts is the aggregated image usage.
- //
- // Required: true
- ImageUsageCounts imagetypes.UsageCounts `json:"imageUsageCounts"`
-
- // EnvironmentsWithActionItems is the number of environments with attention items.
- //
- // Required: true
- EnvironmentsWithActionItems int `json:"environmentsWithActionItems"`
-}
-
-type EnvironmentsOverview struct {
- // Summary is the aggregated fleet summary.
- //
- // Required: true
- Summary EnvironmentsSummary `json:"summary"`
-
- // Environments contains per-environment overview rows.
- //
- // Required: true
- Environments []EnvironmentOverview `json:"environments"`
}