Skip to content

Commit ba6cf88

Browse files
authored
Merge pull request #733 from jmpsec/query-results-left
Fix for left side menus for query results and carves
2 parents 8268a3d + 8f132dc commit ba6cf88

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

cmd/admin/handlers/templates.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -645,9 +645,10 @@ func (h *HandlersAdmin) QueryLogsHandler(w http.ResponseWriter, r *http.Request)
645645
}
646646
// Left metadata
647647
leftMetadata := AsideLeftMetadata{
648-
EnvUUID: env.UUID,
649-
Query: true,
650-
QueryName: query.Name,
648+
EnvUUID: env.UUID,
649+
Query: true,
650+
QueryName: query.Name,
651+
OsqueryValues: h.OsqueryValues,
651652
}
652653
// Prepare template data
653654
templateData := QueryLogsTemplateData{
@@ -744,9 +745,10 @@ func (h *HandlersAdmin) CarvesDetailsHandler(w http.ResponseWriter, r *http.Requ
744745
blocks[c.SessionID] = bs
745746
}
746747
leftMetadata := AsideLeftMetadata{
747-
EnvUUID: env.UUID,
748-
Carve: true,
749-
CarveName: query.Name,
748+
EnvUUID: env.UUID,
749+
Carve: true,
750+
CarveName: query.Name,
751+
OsqueryValues: h.OsqueryValues,
750752
}
751753
// Get if the user is admin
752754
user, err := h.Users.Get(ctx[sessions.CtxUser])

cmd/admin/templates/carves-details.html

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,12 @@
1111
<main class="main">
1212
<div class="container-fluid">
1313
<div class="animated fadeIn">
14-
{{ if $leftmeta.Carve }} {{ $carveBlocks := .CarveBlocks }} {{ with .Query }}
14+
{{ $carveBlocks := .CarveBlocks }} {{ if $leftmeta.Carve }} {{ with .Query }}
1515
<div class="card mt-2">
1616
<div class="card-header">
1717
{{ if .Expired }}
1818
<i class="fas fa-stopwatch"></i> [ <b>QUERY EXPIRED</b> ] - {{ .Name }} {{ else }} {{ if .Completed }} <i class="fas fa-flag-checkered"></i> [ <b>QUERY COMPLETED</b> ] - {{ .Name }} {{ else }}
19-
<i class="fas fa-hourglass-half"></i> [ <b>QUERY ACTIVE</b> ] - {{ .Name }} -
20-
<b>{{ inFutureTime .Expiration }}</b>
21-
{{ end }} {{ end }}
19+
<i class="fas fa-hourglass-half"></i> [ <b>QUERY ACTIVE</b> ] - {{ .Name }} - <b>{{ inFutureTime .Expiration }}</b>{{ end }} {{ end }}
2220
<div class="card-header-actions">
2321
<button class="btn btn-sm btn-outline-primary" data-tooltip="true" data-placement="bottom" title="Refresh details" onclick="refreshCarveDetails();">
2422
<i class="fas fa-sync-alt"></i>
@@ -203,6 +201,7 @@ <h4 class="alert-heading"><i class="fas fa-exclamation-triangle"></i> Carve deta
203201
</div>
204202
</div>
205203
</main>
204+
{{ end }}
206205

207206
{{ if $metadata.Admin }} {{ template "page-aside-right" . }} {{ end }}
208207
</div>
@@ -212,7 +211,6 @@ <h4 class="alert-heading"><i class="fas fa-exclamation-triangle"></i> Carve deta
212211
<!-- custom JS -->
213212
<script src="/static/js/carves.js"></script>
214213
<script src="/static/js/tables.js"></script>
215-
{{ with .Query }}
216214
<script type="text/javascript">
217215
$(document).ready(function () {
218216
// Enable all tooltips
@@ -225,6 +223,5 @@ <h4 class="alert-heading"><i class="fas fa-exclamation-triangle"></i> Carve deta
225223
}, 60000);
226224
});
227225
</script>
228-
{{ end }}
229226
</body>
230227
</html>

0 commit comments

Comments
 (0)