List sessions CLI reports correct target id and status (#511)
* Including some missing session fields and improving reporting of sessions of CLI.
This commit is contained in:
1 parent
9bd6045c46
commit
d1d94c19c8
4 files changed
+14
-2
No files matched your search
@@ -33,7 +33,9 @@ func generateSessionTableOutput(in *sessions.Session) string {
|
||||
m := map[string]interface{}{
|
||||
"Status": state.Status,
|
||||
"Start Time": state.StartTime.Local().Format(time.RFC1123),
|
||||
"End Time": state.EndTime.Local().Format(time.RFC1123),
|
||||
}
|
||||
if !state.EndTime.IsZero() {
|
||||
m["End Time"] = state.EndTime.Local().Format(time.RFC1123)
|
||||
}
|
||||
statesMaps = append(statesMaps, m)
|
||||
}
|
||||
|
||||
@@ -170,11 +170,12 @@ func (c *Command) Run(args []string) int {
|
||||
}
|
||||
output = append(output,
|
||||
fmt.Sprintf(" ID: %s", t.Id),
|
||||
fmt.Sprintf(" Status: %s", t.Status),
|
||||
fmt.Sprintf(" Created Time: %s", t.CreatedTime.Local().Format(time.RFC3339)),
|
||||
fmt.Sprintf(" Expiration Time: %s", t.ExpirationTime.Local().Format(time.RFC3339)),
|
||||
fmt.Sprintf(" Updated Time: %s", t.UpdatedTime.Local().Format(time.RFC3339)),
|
||||
fmt.Sprintf(" User ID: %s", t.UserId),
|
||||
fmt.Sprintf(" Target ID: %s", t.UserId),
|
||||
fmt.Sprintf(" Target ID: %s", t.TargetId),
|
||||
)
|
||||
}
|
||||
c.UI.Output(base.WrapForHelpText(output))
|
||||
|
||||
Reference in new issue
Block a user