Skip to content

Commit

Permalink
Add Dashboard v2 max upload size
Browse files Browse the repository at this point in the history
  • Loading branch information
hardillb committed Dec 17, 2024
1 parent c3a1b52 commit 76a9baa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/runtimeSettings.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const path = require('path')
const bytes = require('bytes')
function getSettingsFile (settings) {
const projectSettings = {
credentialSecret: '',
Expand Down Expand Up @@ -71,6 +72,13 @@ function getSettingsFile (settings) {
} else if (!authMiddlewareRequired && settings.settings.dashboardIFrame) {
dashboardSettings.push('middleware: [ DashboardIFrameMiddleware ]')
}
if (settings.settings.apiMaxLength) {
try {
dashboardSettings.push(`maxHttpBufferSize: ${bytes(settings.settings.apiMaxLength)}`)
} catch (err) {
// failed to parse
}
}
projectSettings.dashboardUI = `ui: { ${dashboardSettings.join(', ')}},`
}
if (settings.settings.disableEditor !== undefined) {
Expand Down
1 change: 1 addition & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"@flowfuse/nr-project-nodes": "^0.7.4",
"@node-red/util": "^3.1.0",
"body-parser": "^1.20.2",
"bytes": "^3.1.2",
"command-line-args": "^5.2.1",
"express": "^4.21.0",
"express-session": "^1.18.0",
Expand Down

0 comments on commit 76a9baa

Please sign in to comment.