Skip to content

Commit 4963ee1

Browse files
author
root
committed
improve server detail
1 parent 0290b7b commit 4963ee1

212 files changed

Lines changed: 2388 additions & 1330 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

backend/domain/software/executor/ssh_executor.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,27 @@ func (e *SSHExecutor) verifySystemd(ctx context.Context, tpl software.ResolvedTe
379379
detail.SourceEvidence = detection.SourceEvidence
380380
detail.VerificationState = vState
381381
detail.ServiceName = svc
382+
if tpl.ComponentKey == software.ComponentKeyDocker {
383+
composeVersionOut, _ := executeSSHCommand(ctx, e.cfg, "docker compose version --short 2>/dev/null || true", verifyTimeout)
384+
composeVersion := strings.TrimSpace(firstLine(composeVersionOut))
385+
composeAvailable := composeVersion != ""
386+
if detection.InstalledState == software.InstalledStateInstalled && !composeAvailable {
387+
detail.VerificationState = software.VerificationStateDegraded
388+
}
389+
reason := ""
390+
if detection.InstalledState == software.InstalledStateInstalled && !composeAvailable {
391+
reason = "docker compose plugin not available"
392+
}
393+
detail.Verification = &software.SoftwareVerificationResult{
394+
State: detail.VerificationState,
395+
Reason: reason,
396+
Details: map[string]any{
397+
"engine_version": detection.DetectedVersion,
398+
"compose_available": composeAvailable,
399+
"compose_version": composeVersion,
400+
},
401+
}
402+
}
382403
return detail, nil
383404
}
384405

backend/domain/software/service/service.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"errors"
66
"fmt"
77
"strings"
8+
"time"
89

910
"github.com/hibiken/asynq"
1011
"github.com/pocketbase/pocketbase/core"
@@ -302,8 +303,11 @@ func (s *Service) buildComputedComponents(
302303
detail.Preflight = &preflight
303304

304305
verifiedDetail, verifyErr := executor.Verify(ctx, targetID, resolved)
305-
verification := &software.SoftwareVerificationResult{
306-
State: software.VerificationStateUnknown,
306+
verification := verifiedDetail.Verification
307+
if verification == nil {
308+
verification = &software.SoftwareVerificationResult{
309+
State: software.VerificationStateUnknown,
310+
}
307311
}
308312
if verifyErr == nil {
309313
if verifiedDetail.InstalledState != "" {
@@ -318,7 +322,7 @@ func (s *Service) buildComputedComponents(
318322
detail.VerificationState = verifiedDetail.VerificationState
319323
detail.ServiceName = verifiedDetail.ServiceName
320324
verification.State = verifiedDetail.VerificationState
321-
if verifiedDetail.VerificationState == software.VerificationStateDegraded {
325+
if verification.Reason == "" && verifiedDetail.VerificationState == software.VerificationStateDegraded {
322326
verification.Reason = "service verification returned degraded state"
323327
}
324328
} else {
@@ -327,6 +331,9 @@ func (s *Service) buildComputedComponents(
327331
verification.Reason = "component is not installed"
328332
}
329333
}
334+
if verification.CheckedAt == "" {
335+
verification.CheckedAt = time.Now().UTC().Format(time.RFC3339)
336+
}
330337
detail.Verification = verification
331338
summary.AvailableActions = deriveAvailableActions(entry.SupportedActions, detail.InstalledState, preflight, lastOp)
332339
detail.SoftwareComponentSummary = summary

specs/implementation-artifacts/story20.6-server-ui.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ Recommended tabs:
272272
2. `Connection`
273273
3. `Monitor`
274274
4. `Runtime`
275-
5. `Software`
275+
5. `Components`
276276

277277
### Tab responsibilities
278278

@@ -305,10 +305,12 @@ It must not be named `Setup`, because setup is only one part of the lifecycle.
305305

306306
Tunnel-specific runtime details, including mapped services, should live inside `Connection` rather than in a separate tab.
307307

308-
#### `Monitor`, `Runtime`, `Software`
308+
#### `Monitor`, `Runtime`, `Components`
309309

310310
These remain domain tabs. They must not duplicate the core `Connection` diagnosis or next-step guidance.
311311

312+
`Components` naming and information architecture are further refined in Story 20.7. This story only defines its position in the stable tab model.
313+
312314
## Connection Tab Information Architecture
313315

314316
The `Connection` tab should answer, in order:

0 commit comments

Comments
 (0)