Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions cmd/admin/handlers/json-nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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),
Expand Down
29 changes: 21 additions & 8 deletions cmd/admin/static/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}
Expand All @@ -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;
}

Expand All @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion cmd/admin/templates/queries-logs.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
</thead>
<tbody>
<tr>
<td style="font-size: 1.5em; font-family: monospace; text-align: center; vertical-align: middle">
<td class="query-log">
<b>{{ .Query }}</b>
</td>
<td>
Expand Down
8 changes: 4 additions & 4 deletions cmd/admin/templates/queries.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<!DOCTYPE html>
<html lang="en">
{{ $metadata := .Metadata }}
{{ $leftmeta := .LeftMetadata }}
{{ template "page-head" . }}
{{ $metadata := .Metadata }} {{ $leftmeta := .LeftMetadata }} {{ template "page-head" . }}

<body class="app header-fixed sidebar-fixed sidebar-lg-show">
{{ template "page-header" . }}
Expand Down Expand Up @@ -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 '<div style="max-width:400px; white-space:normal; word-break:break-word;">' +
queryResultLink(data.link, data.query, "/query/{{ $leftmeta.EnvUUID }}/logs/" + data.name) +
'</div>';
} else {
return data;
}
Expand Down
1 change: 0 additions & 1 deletion pkg/nodes/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
Loading