This commit is contained in:
+7
-3
@@ -76,7 +76,7 @@ func WriteDeviceInfoTable(w io.Writer, devices []models.Device) {
|
||||
|
||||
func WriteHandlerInfoTable(w io.Writer, handlers []models.EventHandler) {
|
||||
table := tablewriter.NewWriter(w)
|
||||
table.SetHeader([]string{"ID", "EVENT NAME", "ONE SHOT", "PRIORITY", "CONDITIONS", "TARGET", "ACTION"})
|
||||
table.SetHeader([]string{"ID", "EVENT NAME", "PRIORITY", "CONDITIONS", "TARGET", "ACTION"})
|
||||
table.SetReflowDuringAutoWrap(false)
|
||||
|
||||
for _, h := range handlers {
|
||||
@@ -102,10 +102,14 @@ func WriteHandlerInfoTable(w io.Writer, handlers []models.EventHandler) {
|
||||
actionStr += fmt.Sprintf("fireEvent=%s ", (*h.Actions.FireEvent).Name)
|
||||
}
|
||||
|
||||
eventName := h.EventName
|
||||
if h.OneShot {
|
||||
eventName += " (one shot)"
|
||||
}
|
||||
|
||||
table.Append([]string{
|
||||
strconv.Itoa(h.ID),
|
||||
h.EventName,
|
||||
strconv.FormatBool(h.OneShot),
|
||||
eventName,
|
||||
strconv.Itoa(h.Priority),
|
||||
condStr,
|
||||
fmt.Sprintf("%s:%s", h.TargetKind, h.TargetValue),
|
||||
|
||||
Reference in New Issue
Block a user