diff --git a/cmd/admin/handlers/json-nodes.go b/cmd/admin/handlers/json-nodes.go index ddd59571..48163d2c 100644 --- a/cmd/admin/handlers/json-nodes.go +++ b/cmd/admin/handlers/json-nodes.go @@ -105,8 +105,8 @@ func (h *HandlersAdmin) JSONEnvironmentHandler(w http.ResponseWriter, r *http.Re Version: n.PlatformVersion, Osquery: n.OsqueryVersion, LastSeen: CreationTimes{ - Display: utils.PastFutureTimes(n.UpdatedAt), - Timestamp: utils.TimeTimestamp(n.UpdatedAt), + Display: utils.PastFutureTimes(n.LastSeen), + Timestamp: utils.TimeTimestamp(n.LastSeen), }, FirstSeen: CreationTimes{ Display: utils.PastFutureTimes(n.CreatedAt), @@ -207,8 +207,8 @@ func (h *HandlersAdmin) JSONEnvironmentPagingHandler(w http.ResponseWriter, r *h Version: n.PlatformVersion, Osquery: n.OsqueryVersion, LastSeen: CreationTimes{ - Display: utils.PastFutureTimes(n.UpdatedAt), - Timestamp: utils.TimeTimestamp(n.UpdatedAt), + Display: utils.PastFutureTimes(n.LastSeen), + Timestamp: utils.TimeTimestamp(n.LastSeen), }, FirstSeen: CreationTimes{ Display: utils.PastFutureTimes(n.CreatedAt), diff --git a/cmd/admin/static/css/custom.css b/cmd/admin/static/css/custom.css index 40077108..06c3b44c 100644 --- a/cmd/admin/static/css/custom.css +++ b/cmd/admin/static/css/custom.css @@ -46,15 +46,15 @@ th { border-left: 1px solid #c8ced3; } -input[type=text]#query { +input[type="text"]#query { font-family: monospace; } -input[type=text]#query-sql { +input[type="text"]#query-sql { font-family: monospace; } -input[type=text]#carve { +input[type="text"]#carve { font-family: monospace; } @@ -68,7 +68,7 @@ input[type=text]#carve { } body { - font-family: 'Bai Jamjuree', sans-serif; + font-family: "Bai Jamjuree", sans-serif; background-image: url("/background-image"); background-attachment: fixed; } @@ -77,14 +77,14 @@ body { padding: 0.5rem; margin-top: 0.5rem; margin-bottom: 0.5rem; - background-color: #F0F0F0; + background-color: #f0f0f0; -ms-overflow-style: -ms-autohiding-scrollbar; } .warning-back { padding: 0.5rem; margin-bottom: 0.5rem; - background-color: #F0F0F0; + background-color: #f0f0f0; -ms-overflow-style: -ms-autohiding-scrollbar; } @@ -102,11 +102,11 @@ body { right: 1rem; z-index: 10; display: block; - padding: .25rem .5rem; + padding: 0.25rem 0.5rem; cursor: pointer; background-color: transparent; border: 0; - border-radius: .25rem; + border-radius: 0.25rem; } .btn-clipboard:hover { @@ -162,6 +162,19 @@ button { .query-link { font-family: monospace; font-size: 1.3em; + max-width: 400px; + white-space: normal; + word-break: break-word; +} + +.query-log { + font-family: monospace; + font-size: 1.3em; + max-width: 400px; + white-space: normal; + word-break: break-word; + text-align: center; + vertical-align: middle; } .badge-prefix { diff --git a/cmd/admin/templates/queries-logs.html b/cmd/admin/templates/queries-logs.html index 31908fd3..8f447c2d 100644 --- a/cmd/admin/templates/queries-logs.html +++ b/cmd/admin/templates/queries-logs.html @@ -37,7 +37,7 @@ - + {{ .Query }} diff --git a/cmd/admin/templates/queries.html b/cmd/admin/templates/queries.html index b146e177..3708d5e5 100644 --- a/cmd/admin/templates/queries.html +++ b/cmd/admin/templates/queries.html @@ -1,8 +1,6 @@ - {{ $metadata := .Metadata }} - {{ $leftmeta := .LeftMetadata }} - {{ template "page-head" . }} + {{ $metadata := .Metadata }} {{ $leftmeta := .LeftMetadata }} {{ template "page-head" . }} {{ template "page-header" . }} @@ -113,7 +111,9 @@ data: 'query', render: function (data, type, row, meta) { if (type === 'display') { - return queryResultLink(data.link, data.query, "/query/{{ $leftmeta.EnvUUID }}/logs/" + data.name); + return '
' + + queryResultLink(data.link, data.query, "/query/{{ $leftmeta.EnvUUID }}/logs/" + data.name) + + '
'; } else { return data; } diff --git a/pkg/nodes/nodes.go b/pkg/nodes/nodes.go index 07b92ce5..cd113268 100644 --- a/pkg/nodes/nodes.go +++ b/pkg/nodes/nodes.go @@ -432,7 +432,6 @@ func (n *NodeManager) IncreaseBytes(node OsqueryNode, incBytes int) error { } func (n *NodeManager) RefreshLastSeenBatch(nodeID []uint) error { - return n.DB.Model(&OsqueryNode{}).Where("id IN ?", nodeID).UpdateColumn("last_seen", time.Now()).Error }