diff --git a/internal/web/adapters/db/accounts.go b/internal/web/adapters/db/accounts.go index 904ddc55..3e43a899 100644 --- a/internal/web/adapters/db/accounts.go +++ b/internal/web/adapters/db/accounts.go @@ -19,7 +19,7 @@ func (db *database) CreateAccount(ctx context.Context, account *models.Account) // GetAccount ... func (db *database) GetAccount(ctx context.Context, account *models.Account) error { - return db.conn.WithContext(ctx).Preload("SigningKeyGroups").Preload("SigningKeyGroups.Key").Preload("Key").First(account).Error + return db.conn.WithContext(ctx).Preload("SigningKeyGroups").Preload("SigningKeyGroups.Key").Preload("Key").Preload("Token").First(account).Error } // UpdateAccount ... diff --git a/internal/web/adapters/db/operators.go b/internal/web/adapters/db/operators.go index 34423ffc..4d7528b6 100644 --- a/internal/web/adapters/db/operators.go +++ b/internal/web/adapters/db/operators.go @@ -19,7 +19,7 @@ func (db *database) CreateOperator(ctx context.Context, operator *models.Operato // GetOperator ... func (db *database) GetOperator(ctx context.Context, operator *models.Operator) error { - return db.conn.WithContext(ctx).Preload("Accounts").Preload("SigningKeyGroups").Preload("SigningKeyGroups.Key").Preload("Key").First(operator).Error + return db.conn.WithContext(ctx).Preload("Accounts").Preload("SigningKeyGroups").Preload("SigningKeyGroups.Key").Preload("Key").Preload("Token").First(operator).Error } // UpdateOperator ... diff --git a/internal/web/controllers/accounts/show.go b/internal/web/controllers/accounts/show.go index f3f5c56e..beca5580 100644 --- a/internal/web/controllers/accounts/show.go +++ b/internal/web/controllers/accounts/show.go @@ -9,6 +9,7 @@ import ( "github.com/zeiss/fiber-htmx/components/cards" "github.com/zeiss/fiber-htmx/components/dropdowns" "github.com/zeiss/fiber-htmx/components/icons" + "github.com/zeiss/fiber-htmx/components/tooltips" "github.com/zeiss/typhoon/internal/api/models" "github.com/zeiss/typhoon/internal/utils" "github.com/zeiss/typhoon/internal/web/components" @@ -150,6 +151,45 @@ func (l *ShowAccountControllerImpl) Get() error { ), ), ), + cards.CardBordered( + cards.CardProps{}, + cards.Body( + cards.BodyProps{}, + cards.Title( + cards.TitleProps{}, + htmx.Text("Details"), + ), + htmx.Div( + htmx.ClassNames{ + "flex": true, + "flex-col": true, + "py-2": true, + }, + htmx.H4( + htmx.ClassNames{ + "text-gray-500": true, + }, + htmx.Text("Public NKey"), + tooltips.Tooltip( + tooltips.TooltipProps{ + ClassNames: htmx.ClassNames{ + "tooltip-right": true, + }, + DataTip: "Public NKey is the public key of the account", + }, + icons.InformationCircleOutline( + icons.IconProps{}, + ), + ), + ), + htmx.H3( + htmx.Text( + acc.Key.ID, + ), + ), + ), + ), + ), cards.CardBordered( cards.CardProps{}, cards.Body( diff --git a/internal/web/controllers/operators/show.go b/internal/web/controllers/operators/show.go index b9855407..d978ec97 100644 --- a/internal/web/controllers/operators/show.go +++ b/internal/web/controllers/operators/show.go @@ -154,7 +154,6 @@ func (l *ShowOperatorControllerImpl) Get() error { ), ), ), - cards.CardBordered( cards.CardProps{}, cards.Body( @@ -203,7 +202,6 @@ func (l *ShowOperatorControllerImpl) Get() error { ), ), ), - cards.CardBordered( cards.CardProps{}, cards.Body( diff --git a/internal/web/controllers/users/show.go b/internal/web/controllers/users/show.go index 4e35be3e..cc605d41 100644 --- a/internal/web/controllers/users/show.go +++ b/internal/web/controllers/users/show.go @@ -9,6 +9,7 @@ import ( "github.com/zeiss/fiber-htmx/components/cards" "github.com/zeiss/fiber-htmx/components/dropdowns" "github.com/zeiss/fiber-htmx/components/icons" + "github.com/zeiss/fiber-htmx/components/tooltips" "github.com/zeiss/typhoon/internal/api/models" "github.com/zeiss/typhoon/internal/web/components" "github.com/zeiss/typhoon/internal/web/ports" @@ -156,8 +157,46 @@ func (l *ShowUserControllerImpl) Get() error { ), ), ), + cards.CardBordered( + cards.CardProps{}, + cards.Body( + cards.BodyProps{}, + cards.Title( + cards.TitleProps{}, + htmx.Text("Details"), + ), + htmx.Div( + htmx.ClassNames{ + "flex": true, + "flex-col": true, + "py-2": true, + }, + htmx.H4( + htmx.ClassNames{ + "text-gray-500": true, + }, + htmx.Text("Public NKey"), + tooltips.Tooltip( + tooltips.TooltipProps{ + ClassNames: htmx.ClassNames{ + "tooltip-right": true, + }, + DataTip: "Public NKey is the public key of the user", + }, + icons.InformationCircleOutline( + icons.IconProps{}, + ), + ), + ), + htmx.H3( + htmx.Text( + user.Key.ID, + ), + ), + ), + ), + ), ), ), ) - }