mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 08:23:15 +01:00
replace fetching->loading and reading->parsing in UI (#124)
This commit is contained in:
parent
70e673204c
commit
bfc5dd87af
@ -8,7 +8,6 @@ import (
|
|||||||
|
|
||||||
"github.com/anchore/stereoscope/pkg/file"
|
"github.com/anchore/stereoscope/pkg/file"
|
||||||
"github.com/anchore/stereoscope/pkg/image"
|
"github.com/anchore/stereoscope/pkg/image"
|
||||||
"github.com/anchore/syft/internal/log"
|
|
||||||
"github.com/anchore/syft/syft/scope/resolvers"
|
"github.com/anchore/syft/syft/scope/resolvers"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -45,7 +44,6 @@ func NewScope(userInput string, o Option) (Scope, func(), error) {
|
|||||||
return s, func() {}, nil
|
return s, func() {}, nil
|
||||||
|
|
||||||
case imageProtocol:
|
case imageProtocol:
|
||||||
log.Infof("Fetching image '%s'", userInput)
|
|
||||||
img, err := stereoscope.GetImage(userInput)
|
img, err := stereoscope.GetImage(userInput)
|
||||||
cleanup := func() {
|
cleanup := func() {
|
||||||
stereoscope.Cleanup()
|
stereoscope.Cleanup()
|
||||||
|
|||||||
@ -189,7 +189,7 @@ func FetchImageHandler(ctx context.Context, fr *frame.Frame, event partybus.Even
|
|||||||
|
|
||||||
formatter, spinner := startProcess()
|
formatter, spinner := startProcess()
|
||||||
stream := progress.Stream(ctx, prog, interval)
|
stream := progress.Stream(ctx, prog, interval)
|
||||||
title := tileFormat.Sprint("Fetching image")
|
title := tileFormat.Sprint("Loading image")
|
||||||
|
|
||||||
formatFn := func(p progress.Progress) {
|
formatFn := func(p progress.Progress) {
|
||||||
progStr, err := formatter.Format(p)
|
progStr, err := formatter.Format(p)
|
||||||
@ -211,7 +211,7 @@ func FetchImageHandler(ctx context.Context, fr *frame.Frame, event partybus.Even
|
|||||||
}
|
}
|
||||||
|
|
||||||
spin := color.Green.Sprint(completedStatus)
|
spin := color.Green.Sprint(completedStatus)
|
||||||
title = tileFormat.Sprint("Fetched image")
|
title = tileFormat.Sprint("Loaded image")
|
||||||
_, _ = io.WriteString(line, fmt.Sprintf(statusTitleTemplate, spin, title))
|
_, _ = io.WriteString(line, fmt.Sprintf(statusTitleTemplate, spin, title))
|
||||||
}()
|
}()
|
||||||
return err
|
return err
|
||||||
@ -232,7 +232,7 @@ func ReadImageHandler(ctx context.Context, fr *frame.Frame, event partybus.Event
|
|||||||
|
|
||||||
formatter, spinner := startProcess()
|
formatter, spinner := startProcess()
|
||||||
stream := progress.Stream(ctx, prog, interval)
|
stream := progress.Stream(ctx, prog, interval)
|
||||||
title := tileFormat.Sprint("Reading image")
|
title := tileFormat.Sprint("Parsing image")
|
||||||
|
|
||||||
formatFn := func(p progress.Progress) {
|
formatFn := func(p progress.Progress) {
|
||||||
progStr, err := formatter.Format(p)
|
progStr, err := formatter.Format(p)
|
||||||
@ -253,7 +253,7 @@ func ReadImageHandler(ctx context.Context, fr *frame.Frame, event partybus.Event
|
|||||||
}
|
}
|
||||||
|
|
||||||
spin := color.Green.Sprint(completedStatus)
|
spin := color.Green.Sprint(completedStatus)
|
||||||
title = tileFormat.Sprint("Read image")
|
title = tileFormat.Sprint("Parsed image")
|
||||||
_, _ = io.WriteString(line, fmt.Sprintf(statusTitleTemplate, spin, title))
|
_, _ = io.WriteString(line, fmt.Sprintf(statusTitleTemplate, spin, title))
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user