Add SPA UI for GARM
This change adds a single page application front-end to GARM. It uses a generated REST client, built from the swagger definitions, the websocket interface for live updates of entities and eager loading of everything except runners, as users may have many runners and we don't want to load hundreds of runners in memory. Proper pagination should be implemented in the API, in future commits, to avoid loading lots of elements for no reason. Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
parent
a811d129d0
commit
eec158b32c
230 changed files with 47324 additions and 2045 deletions
|
|
@ -193,7 +193,7 @@ func (s *sqlDatabase) ListEntityScaleSets(_ context.Context, entity params.Forge
|
|||
return ret, nil
|
||||
}
|
||||
|
||||
func (s *sqlDatabase) UpdateEntityScaleSet(_ context.Context, entity params.ForgeEntity, scaleSetID uint, param params.UpdateScaleSetParams, callback func(old, newSet params.ScaleSet) error) (updatedScaleSet params.ScaleSet, err error) {
|
||||
func (s *sqlDatabase) UpdateEntityScaleSet(ctx context.Context, entity params.ForgeEntity, scaleSetID uint, param params.UpdateScaleSetParams, callback func(old, newSet params.ScaleSet) error) (updatedScaleSet params.ScaleSet, err error) {
|
||||
defer func() {
|
||||
if err == nil {
|
||||
s.sendNotify(common.ScaleSetEntityType, common.UpdateOperation, updatedScaleSet)
|
||||
|
|
@ -225,6 +225,11 @@ func (s *sqlDatabase) UpdateEntityScaleSet(_ context.Context, entity params.Forg
|
|||
if err != nil {
|
||||
return params.ScaleSet{}, err
|
||||
}
|
||||
|
||||
updatedScaleSet, err = s.GetScaleSetByID(ctx, scaleSetID)
|
||||
if err != nil {
|
||||
return params.ScaleSet{}, err
|
||||
}
|
||||
return updatedScaleSet, nil
|
||||
}
|
||||
|
||||
|
|
@ -345,7 +350,17 @@ func (s *sqlDatabase) updateScaleSet(tx *gorm.DB, scaleSet ScaleSet, param param
|
|||
}
|
||||
|
||||
func (s *sqlDatabase) GetScaleSetByID(_ context.Context, scaleSet uint) (params.ScaleSet, error) {
|
||||
set, err := s.getScaleSetByID(s.conn, scaleSet, "Instances", "Enterprise", "Organization", "Repository")
|
||||
set, err := s.getScaleSetByID(
|
||||
s.conn,
|
||||
scaleSet,
|
||||
"Instances",
|
||||
"Enterprise",
|
||||
"Enterprise.Endpoint",
|
||||
"Organization",
|
||||
"Organization.Endpoint",
|
||||
"Repository",
|
||||
"Repository.Endpoint",
|
||||
)
|
||||
if err != nil {
|
||||
return params.ScaleSet{}, errors.Wrap(err, "fetching scale set by ID")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue