Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ require (
github.com/ghodss/yaml v1.0.0
github.com/itchyny/gojq v0.12.16
github.com/kr/pretty v0.3.1
github.com/margo/sandbox v0.0.2-0.20260713102004-e833d1626525
github.com/margo/sandbox v1.0.0-rc.2.0.20260722140011-66d5b626db1d
github.com/princjef/mageutil v1.0.0
go.opentelemetry.io/otel/trace v1.44.0
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56
Expand Down
8 changes: 4 additions & 4 deletions api/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,10 @@ github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhn
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE=
github.com/magefile/mage v1.15.0 h1:BvGheCMAsG3bWUDbZ8AyXXpCNwU9u5CB6sM+HNb9HYg=
github.com/magefile/mage v1.15.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A=
github.com/margo/sandbox v0.0.2-0.20260629065027-6ceab8d33a5d h1:DXFdb1wuAd9pVcn3gALcBT6zrrrtzteyjVPfkyfFSus=
github.com/margo/sandbox v0.0.2-0.20260629065027-6ceab8d33a5d/go.mod h1:H2T/Otxoc7AyLqmRdzZQosbnl30j7tCM3JsTi5ULHf0=
github.com/margo/sandbox v0.0.2-0.20260713102004-e833d1626525 h1:qpAeGMpxRc69lkgQH9pP4loVF+G5QJgP5E2rVFMRxmQ=
github.com/margo/sandbox v0.0.2-0.20260713102004-e833d1626525/go.mod h1:H2T/Otxoc7AyLqmRdzZQosbnl30j7tCM3JsTi5ULHf0=
github.com/margo/sandbox v1.0.0-rc.2.0.20260717072648-226903403d67 h1:6iDtAEYq/ctgDx2GpaFN5KWCtMxXY2EySyPKGLs+7LQ=
github.com/margo/sandbox v1.0.0-rc.2.0.20260717072648-226903403d67/go.mod h1:H2T/Otxoc7AyLqmRdzZQosbnl30j7tCM3JsTi5ULHf0=
github.com/margo/sandbox v1.0.0-rc.2.0.20260722140011-66d5b626db1d h1:Sg218JELyvRaQIrv43M6ePc97Aupb14kX8f2wPmArKI=
github.com/margo/sandbox v1.0.0-rc.2.0.20260722140011-66d5b626db1d/go.mod h1:H2T/Otxoc7AyLqmRdzZQosbnl30j7tCM3JsTi5ULHf0=
github.com/matryer/is v1.3.0 h1:9qiso3jaJrOe6qBRJRBt2Ldht05qDiFP9le0JOIhRSI=
github.com/matryer/is v1.3.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA=
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
Expand Down
17 changes: 10 additions & 7 deletions cli/cmd/margo.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
nbi "github.com/margo/sandbox/non-standard/generatedCode/wfm/nbi"
margoCli "github.com/margo/sandbox/poc/wfm/cli"
"github.com/spf13/cobra"
"strings"
)

var (
Expand Down Expand Up @@ -558,7 +559,7 @@ func displayDevicesTable(resp nbi.DeviceListResp) {

// Set headers
t.AppendHeader(table.Row{
"ID", "Signature", "Capabilities", "Roles", "State", "CreatedAt",
"ID", "Signature", "Capabilities", "Deployment Type", "State", "CreatedAt",
})

// Add data rows
Expand All @@ -567,25 +568,27 @@ func displayDevicesTable(resp nbi.DeviceListResp) {
continue
}

var roles interface{}
roles = []string{}
var deploymentTypes interface{}
deploymentTypes = []string{}
capMap, exists := device.Spec.Capabilities.(map[string]interface{})
if exists {
properties, exists := capMap["properties"].(map[string]interface{})
if exists {
roles, exists = properties["roles"]
deploymentTypes, exists = properties["supportedDeploymentTypes"]
if !exists {
roles = []string{}
deploymentTypes = []string{}
}
}
}

deploymentTypeStr := strings.Trim(fmt.Sprint(deploymentTypes), "[]")

cap, _ := json.Marshal(device.Spec.Capabilities)
row := table.Row{
truncateString(*device.Id, 40),
truncateString(device.Spec.Signature, 28),
truncateString(string(cap), 28),
roles,
deploymentTypeStr,
string(device.State.Onboard),
formatTime(*device.Metadata.CreationTimestamp),
}
Expand All @@ -604,7 +607,7 @@ func displayDevicesTable(resp nbi.DeviceListResp) {
{Number: 1, WidthMax: 40}, // ID
{Number: 2, WidthMax: 28}, // Signature
{Number: 3, WidthMax: 28}, // Capabilities
{Number: 4, WidthMax: 28}, // Device Role
{Number: 4, WidthMax: 28}, // Deployment Type
{Number: 5, WidthMax: 12}, // State
{Number: 6, WidthMax: 16}, // CreatedAt
})
Expand Down
2 changes: 1 addition & 1 deletion cli/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ require (
github.com/cenkalti/backoff/v4 v4.3.0
github.com/eclipse-symphony/symphony/api v0.0.0-00010101000000-000000000000
github.com/ghodss/yaml v1.0.0
github.com/margo/sandbox v0.0.2-0.20260713102004-e833d1626525
github.com/margo/sandbox v1.0.0-rc.2.0.20260717072648-226903403d67
github.com/princjef/mageutil v1.0.0
)

Expand Down
6 changes: 2 additions & 4 deletions cli/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,8 @@ github.com/lestrrat-go/option v1.0.1 h1:oAzP2fvZGQKWkvHa1/SAcFolBEca1oN+mQ7eooNB
github.com/lestrrat-go/option v1.0.1/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I=
github.com/lestrrat-go/sfv v1.0.0 h1:+/VOs7lhUWAwNIklow4kPYlit0fPBC6HsF+GHKXrhGM=
github.com/lestrrat-go/sfv v1.0.0/go.mod h1:wawOORrbzB4Vh0QT7WtbWEbMuTbjS8OPxum1wZAYCiQ=
github.com/margo/sandbox v0.0.2-0.20260629065027-6ceab8d33a5d h1:DXFdb1wuAd9pVcn3gALcBT6zrrrtzteyjVPfkyfFSus=
github.com/margo/sandbox v0.0.2-0.20260629065027-6ceab8d33a5d/go.mod h1:H2T/Otxoc7AyLqmRdzZQosbnl30j7tCM3JsTi5ULHf0=
github.com/margo/sandbox v0.0.2-0.20260713102004-e833d1626525 h1:qpAeGMpxRc69lkgQH9pP4loVF+G5QJgP5E2rVFMRxmQ=
github.com/margo/sandbox v0.0.2-0.20260713102004-e833d1626525/go.mod h1:H2T/Otxoc7AyLqmRdzZQosbnl30j7tCM3JsTi5ULHf0=
github.com/margo/sandbox v1.0.0-rc.2.0.20260717072648-226903403d67 h1:6iDtAEYq/ctgDx2GpaFN5KWCtMxXY2EySyPKGLs+7LQ=
github.com/margo/sandbox v1.0.0-rc.2.0.20260717072648-226903403d67/go.mod h1:H2T/Otxoc7AyLqmRdzZQosbnl30j7tCM3JsTi5ULHf0=
github.com/matryer/is v1.3.0 h1:9qiso3jaJrOe6qBRJRBt2Ldht05qDiFP9le0JOIhRSI=
github.com/matryer/is v1.3.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA=
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
Expand Down