fix: storage cli: Output primary sector status correctly
This commit is contained in:
parent
c3cadcba0e
commit
c6bda0e5d4
@ -598,7 +598,7 @@ var storageListSectorsCmd = &cli.Command{
|
|||||||
ft storiface.SectorFileType
|
ft storiface.SectorFileType
|
||||||
urls string
|
urls string
|
||||||
|
|
||||||
primary, seal, store bool
|
primary, copy, main, seal, store bool
|
||||||
|
|
||||||
state api.SectorState
|
state api.SectorState
|
||||||
}
|
}
|
||||||
@ -626,8 +626,11 @@ var storageListSectorsCmd = &cli.Command{
|
|||||||
urls: strings.Join(info.URLs, ";"),
|
urls: strings.Join(info.URLs, ";"),
|
||||||
|
|
||||||
primary: info.Primary,
|
primary: info.Primary,
|
||||||
seal: info.CanSeal,
|
copy: !info.Primary && len(si) > 1,
|
||||||
store: info.CanStore,
|
main: !info.Primary && len(si) == 1, // only copy, but not primary
|
||||||
|
|
||||||
|
seal: info.CanSeal,
|
||||||
|
store: info.CanStore,
|
||||||
|
|
||||||
state: st.State,
|
state: st.State,
|
||||||
})
|
})
|
||||||
@ -680,7 +683,7 @@ var storageListSectorsCmd = &cli.Command{
|
|||||||
"Sector": e.id,
|
"Sector": e.id,
|
||||||
"Type": e.ft.String(),
|
"Type": e.ft.String(),
|
||||||
"State": color.New(stateOrder[sealing.SectorState(e.state)].col).Sprint(e.state),
|
"State": color.New(stateOrder[sealing.SectorState(e.state)].col).Sprint(e.state),
|
||||||
"Primary": maybeStr(e.seal, color.FgGreen, "primary"),
|
"Primary": maybeStr(e.primary, color.FgGreen, "primary") + maybeStr(e.copy, color.FgBlue, "copy") + maybeStr(e.main, color.FgRed, "main"),
|
||||||
"Path use": maybeStr(e.seal, color.FgMagenta, "seal ") + maybeStr(e.store, color.FgCyan, "store"),
|
"Path use": maybeStr(e.seal, color.FgMagenta, "seal ") + maybeStr(e.store, color.FgCyan, "store"),
|
||||||
"URLs": e.urls,
|
"URLs": e.urls,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user