Skip to content

Commit

Permalink
Only load notebook cell when it is visible (#4027)
Browse files Browse the repository at this point in the history
This helps for very large notebooks with many cells. Previous behavior
was to load all the cells immediately but this can increase load on the
server and cause the connections to timeout.

This change allows cells to be loaded only when they are scrolled into
the view port.

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: snyk-bot <[email protected]>
  • Loading branch information
3 people authored Jan 23, 2025
1 parent cf6226c commit 1f8dca1
Show file tree
Hide file tree
Showing 8 changed files with 162 additions and 87 deletions.
17 changes: 7 additions & 10 deletions executor/nanny.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,16 +191,13 @@ func (self *NannyService) Start(

func NewNanny(
config_obj *config_proto.Config) *NannyService {
if config_obj.Client.NannyMaxConnectionDelay > 0 {
return &NannyService{
MaxMemoryHardLimit: config_obj.Client.MaxMemoryHardLimit,
last_check_time: utils.GetTime().Now(),
MaxConnectionDelay: time.Duration(
config_obj.Client.NannyMaxConnectionDelay) * time.Second,
Logger: logging.GetLogger(config_obj, &logging.ClientComponent),
}
return &NannyService{
MaxMemoryHardLimit: config_obj.Client.MaxMemoryHardLimit,
last_check_time: utils.GetTime().Now(),
MaxConnectionDelay: time.Duration(
config_obj.Client.NannyMaxConnectionDelay) * time.Second,
Logger: logging.GetLogger(config_obj, &logging.ClientComponent),
}
return nil
}

func StartNannyService(
Expand All @@ -212,7 +209,7 @@ func StartNannyService(
}

Nanny = NewNanny(config_obj)
if Nanny != nil {
if config_obj.Client.NannyMaxConnectionDelay > 0 {
Nanny.Start(ctx, wg)
}
return nil
Expand Down
132 changes: 76 additions & 56 deletions gui/velociraptor/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions gui/velociraptor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
"type": "module",
"dependencies": {
"@babel/runtime": "^7.26.0",
"@fortawesome/fontawesome-svg-core": "6.7.1",
"@fortawesome/fontawesome-svg-core": "6.7.2",
"@fortawesome/free-regular-svg-icons": "6.7.1",
"@fortawesome/free-solid-svg-icons": "^6.7.1",
"@fortawesome/react-fontawesome": "0.2.2",
"@popperjs/core": "^2.11.8",
"ace-builds": "1.36.5",
"ace-builds": "1.37.1",
"axios": ">=1.7.9",
"axios-retry": "3.9.1",
"bootstrap": "5.3.3",
"classnames": "^2.5.1",
"csv-parse": "4.16.3",
"csv-stringify": "5.6.5",
"dompurify": "3.2.2",
"dompurify": "3.2.3",
"env-cmd": "^10.1.0",
"hosted-git-info": "^2.8.9",
"html-react-parser": "^0.14.3",
Expand All @@ -34,7 +34,7 @@
"react": "^16.14.0",
"react-ace": "^9.5.0",
"react-autosuggest": "^10.1.0",
"react-bootstrap": "2.10.6",
"react-bootstrap": "2.10.7",
"react-calendar-timeline": "^0.28.0",
"react-contexify": "5.0.0",
"react-dom": "^16.14.0",
Expand All @@ -45,7 +45,7 @@
"react-simple-snackbar": "^1.1.11",
"react-split-pane": "^0.1.92",
"react-step-wizard": "^5.3.11",
"recharts": "^2.14.1",
"recharts": "^2.15.0",
"sprintf-js": "1.1.3",
"url-parse": "^1.5.10",
"webpack": "5.97.1"
Expand Down Expand Up @@ -95,7 +95,7 @@
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-react": "^7.32.2",
"vite": "^4.5.5",
"vite": "^4.5.9",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-eslint": "1.8.1"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@
.report-viewer .panel {
overflow-x: auto;
}

.cell-placeholder {
height: 100px;
}
Loading

0 comments on commit 1f8dca1

Please sign in to comment.