forked from x/icebergs
opt some
This commit is contained in:
parent
de6f46f718
commit
5b45314c69
@ -1,8 +1,6 @@
|
|||||||
package cli
|
package cli
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"strings"
|
|
||||||
|
|
||||||
ice "github.com/shylinux/icebergs"
|
ice "github.com/shylinux/icebergs"
|
||||||
kit "github.com/shylinux/toolkits"
|
kit "github.com/shylinux/toolkits"
|
||||||
|
|
||||||
@ -10,6 +8,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -90,11 +90,11 @@ func init() {
|
|||||||
m.Push("name", value["name"])
|
m.Push("name", value["name"])
|
||||||
m.Push("term", value["term"])
|
m.Push("term", value["term"])
|
||||||
ls := strings.Split(value["begin"], " (")
|
ls := strings.Split(value["begin"], " (")
|
||||||
t, _ := time.Parse("Jan 2 15:04", ls[0])
|
ls[0] = strings.Join(kit.Split(ls[0], " \t"), " ")
|
||||||
m.Push("begin", t.Format("2006-01-02 15:04:05"))
|
|
||||||
|
|
||||||
m.Push("ip", value["ip"])
|
t, _ := time.ParseInLocation("2006 Jan 2 15:04", "2020 "+ls[0], time.Local)
|
||||||
m.Push("duration", value["duration"])
|
m.Push("begin", t.Format("2006-01-02 15:04:05"))
|
||||||
|
m.Push("duration", time.Since(t).String())
|
||||||
})
|
})
|
||||||
}},
|
}},
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user