Skip to content

Commit

Permalink
Only show refresh button when a refresh function is set (#1101)
Browse files Browse the repository at this point in the history
  • Loading branch information
scudette committed Jun 9, 2021
1 parent 296d508 commit 00a58d6
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 7 deletions.
8 changes: 8 additions & 0 deletions README.md
Expand Up @@ -26,6 +26,14 @@ machine) as normal.
Once you are ready for a full deployment, check out the various deployment options at
https://www.velocidex.com/docs/getting-started

## Training

We have our complete training course (7 sessions x 2 hours each) on
YouTube here
https://www.youtube.com/playlist?list=PLz4xB83Y3Vbjtqr_ttOkBWZZ_ewEVVPXQ

The course covers many aspects of Velociraptor in detail.

## Running Velociraptor via Docker

To run a Velociraptor server via Docker, follow the instructions here:
Expand Down
11 changes: 8 additions & 3 deletions gui/velociraptor/src/components/core/paged-table.js
Expand Up @@ -246,11 +246,16 @@ class VeloPagedTable extends Component {
}

if (_.isEmpty(this.state.columns)) {
if (this.props.refresh) {
return <div className="no-content">
<div>No Data Available.</div>
<Button variant="default" onClick={this.props.refresh}>
Recalculate <FontAwesomeIcon icon="sync"/>
</Button>
</div>;
}
return <div className="no-content">
<div>No Data Available.</div>
<Button variant="default" onClick={this.props.refresh}>
Recalculate <FontAwesomeIcon icon="sync"/>
</Button>
</div>;
}

Expand Down
1 change: 0 additions & 1 deletion gui/velociraptor/src/components/flows/flow-logs.js
@@ -1,4 +1,3 @@
import _ from 'lodash';
import React from 'react';
import PropTypes from 'prop-types';

Expand Down
14 changes: 11 additions & 3 deletions reporting/notebooks.go
Expand Up @@ -29,7 +29,7 @@ var (
`<grr-csv-viewer base-url="'v1/GetTable'" params='([^']+)' />`)

imageRegex = regexp.MustCompile(
`<img src=\"/notebooks/(?P<NotebookId>N.[^/]+)/(?P<Attachment>NA.[^.]+.png)\" alt=\"image.png\"/>`)
`<img src=\"/notebooks/(?P<NotebookId>N.[^/]+)/(?P<Attachment>NA.[^.]+.png)\" (?P<Extra>[^>]*)>`)
)

const (
Expand Down Expand Up @@ -304,6 +304,14 @@ func ExportNotebookToHTML(
file_store_factory := file_store.GetFileStore(config_obj)

submatches := imageRegex.FindStringSubmatch(in)
if len(submatches) < 3 {
return in
}
extra := ""
if len(submatches) > 3 {
extra = submatches[3]
}

item_path := notebook_path_manager.Cell("").Item(submatches[2])
fd, err := file_store_factory.ReadFile(item_path)
if err != nil {
Expand All @@ -315,8 +323,8 @@ func ExportNotebookToHTML(
return in
}

return fmt.Sprintf(`<img src="data:image/jpg;base64,%v">`,
base64.StdEncoding.EncodeToString(data))
return fmt.Sprintf(`<img src="data:image/jpg;base64,%v" %s>`,
base64.StdEncoding.EncodeToString(data), extra)
})

// Expand tables
Expand Down

0 comments on commit 00a58d6

Please sign in to comment.