feat(ui,judgement,system): unify nav, surface built-in guards, readiness and decision reasoning
This commit is contained in:
34 files changed
+548
-103
No files matched your search
@@ -84,8 +84,25 @@ func (m *Module) list(contract string) func(context.Context, *struct{}) (*httpap
|
||||
}
|
||||
}
|
||||
|
||||
// GuardInstallations lists every guard installation the caller can see,
|
||||
// running, disabled, or failed.
|
||||
func (m *Module) GuardInstallations(ctx context.Context) ([]ExtensionView, error) {
|
||||
if m.store == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return m.viewsFor(ctx, func(a store.Installed) bool { return a.Contract == store.ContractGuard })
|
||||
}
|
||||
|
||||
// listViews returns the installations the caller can see that keep accepts.
|
||||
func (m *Module) listViews(ctx context.Context, keep func(store.Installed) bool) (*httpapi.Reply[[]ExtensionView], error) {
|
||||
views, err := m.viewsFor(ctx, keep)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return httpapi.OK(views), nil
|
||||
}
|
||||
|
||||
func (m *Module) viewsFor(ctx context.Context, keep func(store.Installed) bool) ([]ExtensionView, error) {
|
||||
auth, err := authorityOf(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -116,7 +133,7 @@ func (m *Module) listViews(ctx context.Context, keep func(store.Installed) bool)
|
||||
}
|
||||
views = append(views, view)
|
||||
}
|
||||
return httpapi.OK(views), nil
|
||||
return views, nil
|
||||
}
|
||||
|
||||
// viewOf shows an installation. A caller who may not change it sees what it is
|
||||
|
||||
Reference in new issue
Block a user