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
14 changes: 8 additions & 6 deletions cmd/admin/handlers/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -645,9 +645,10 @@ func (h *HandlersAdmin) QueryLogsHandler(w http.ResponseWriter, r *http.Request)
}
// Left metadata
leftMetadata := AsideLeftMetadata{
EnvUUID: env.UUID,
Query: true,
QueryName: query.Name,
EnvUUID: env.UUID,
Query: true,
QueryName: query.Name,
OsqueryValues: h.OsqueryValues,
}
// Prepare template data
templateData := QueryLogsTemplateData{
Expand Down Expand Up @@ -744,9 +745,10 @@ func (h *HandlersAdmin) CarvesDetailsHandler(w http.ResponseWriter, r *http.Requ
blocks[c.SessionID] = bs
}
leftMetadata := AsideLeftMetadata{
EnvUUID: env.UUID,
Carve: true,
CarveName: query.Name,
EnvUUID: env.UUID,
Carve: true,
CarveName: query.Name,
OsqueryValues: h.OsqueryValues,
}
// Get if the user is admin
user, err := h.Users.Get(ctx[sessions.CtxUser])
Expand Down
9 changes: 3 additions & 6 deletions cmd/admin/templates/carves-details.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@
<main class="main">
<div class="container-fluid">
<div class="animated fadeIn">
{{ if $leftmeta.Carve }} {{ $carveBlocks := .CarveBlocks }} {{ with .Query }}
{{ $carveBlocks := .CarveBlocks }} {{ if $leftmeta.Carve }} {{ with .Query }}
<div class="card mt-2">
<div class="card-header">
{{ if .Expired }}
<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 }}
<i class="fas fa-hourglass-half"></i> [ <b>QUERY ACTIVE</b> ] - {{ .Name }} -
<b>{{ inFutureTime .Expiration }}</b>
{{ end }} {{ end }}
<i class="fas fa-hourglass-half"></i> [ <b>QUERY ACTIVE</b> ] - {{ .Name }} - <b>{{ inFutureTime .Expiration }}</b>{{ end }} {{ end }}
<div class="card-header-actions">
<button class="btn btn-sm btn-outline-primary" data-tooltip="true" data-placement="bottom" title="Refresh details" onclick="refreshCarveDetails();">
<i class="fas fa-sync-alt"></i>
Expand Down Expand Up @@ -203,6 +201,7 @@ <h4 class="alert-heading"><i class="fas fa-exclamation-triangle"></i> Carve deta
</div>
</div>
</main>
{{ end }}

{{ if $metadata.Admin }} {{ template "page-aside-right" . }} {{ end }}
</div>
Expand All @@ -212,7 +211,6 @@ <h4 class="alert-heading"><i class="fas fa-exclamation-triangle"></i> Carve deta
<!-- custom JS -->
<script src="/static/js/carves.js"></script>
<script src="/static/js/tables.js"></script>
{{ with .Query }}
<script type="text/javascript">
$(document).ready(function () {
// Enable all tooltips
Expand All @@ -225,6 +223,5 @@ <h4 class="alert-heading"><i class="fas fa-exclamation-triangle"></i> Carve deta
}, 60000);
});
</script>
{{ end }}
</body>
</html>
Loading