From 9b60111413a70c3c574c35827185cdec12c225d4 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Thu, 4 Jan 2024 09:42:33 +0000 Subject: [PATCH 01/12] Allow ndots to be configurable in the Helm chart. --- charts/budibase/templates/app-service-deployment.yaml | 6 ++++++ .../templates/automation-worker-service-deployment.yaml | 8 +++++++- charts/budibase/templates/proxy-service-deployment.yaml | 6 ++++++ charts/budibase/templates/worker-service-deployment.yaml | 6 ++++++ 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/charts/budibase/templates/app-service-deployment.yaml b/charts/budibase/templates/app-service-deployment.yaml index c6ded3cee2..c7c4481122 100644 --- a/charts/budibase/templates/app-service-deployment.yaml +++ b/charts/budibase/templates/app-service-deployment.yaml @@ -252,4 +252,10 @@ spec: {{ end }} restartPolicy: Always serviceAccountName: "" + {{ if .Values.services.apps.ndots }} + dnsConfig: + options: + - name: ndots + value: {{ .Values.services.apps.ndots | quote }} + {{ end }} status: {} diff --git a/charts/budibase/templates/automation-worker-service-deployment.yaml b/charts/budibase/templates/automation-worker-service-deployment.yaml index b7eece6b85..36c3a8ffbf 100644 --- a/charts/budibase/templates/automation-worker-service-deployment.yaml +++ b/charts/budibase/templates/automation-worker-service-deployment.yaml @@ -227,6 +227,7 @@ spec: resources: {{- toYaml . | nindent 10 }} {{ end }} + {{ if .Values.services.automationWorkers.command }} command: {{- toYaml .Values.services.automationWorkers.command | nindent 10 }} {{ end }} @@ -251,6 +252,11 @@ spec: {{ end }} restartPolicy: Always serviceAccountName: "" - {{ if .Values.services.automationWorkers.command }}} + {{ if .Values.services.automationWorkers.ndots }} + dnsConfig: + options: + - name: ndots + value: {{ .Values.services.automationWorkers.ndots | quote }} + {{ end }} status: {} {{- end }} \ No newline at end of file diff --git a/charts/budibase/templates/proxy-service-deployment.yaml b/charts/budibase/templates/proxy-service-deployment.yaml index 2e6217008b..233028cafe 100644 --- a/charts/budibase/templates/proxy-service-deployment.yaml +++ b/charts/budibase/templates/proxy-service-deployment.yaml @@ -109,4 +109,10 @@ spec: {{- toYaml .Values.services.proxy.args | nindent 8 }} {{ end }} volumes: + {{ if .Values.services.proxy.ndots }} + dnsConfig: + options: + - name: ndots + value: {{ .Values.services.proxy.ndots | quote }} + {{ end }} status: {} diff --git a/charts/budibase/templates/worker-service-deployment.yaml b/charts/budibase/templates/worker-service-deployment.yaml index 04791df869..2f97508ae3 100644 --- a/charts/budibase/templates/worker-service-deployment.yaml +++ b/charts/budibase/templates/worker-service-deployment.yaml @@ -238,4 +238,10 @@ spec: {{ end }} restartPolicy: Always serviceAccountName: "" + {{ if .Values.services.worker.ndots }} + dnsConfig: + options: + - name: ndots + value: {{ .Values.services.worker.ndots | quote }} + {{ end }} status: {} From 843f134165dfd0fc1acac8150b78ad24caa25cbf Mon Sep 17 00:00:00 2001 From: melohagan <101575380+melohagan@users.noreply.github.com> Date: Thu, 4 Jan 2024 10:05:05 +0000 Subject: [PATCH 02/12] Exclude custom options from update settings (#12648) * Exclude custom options from update settings * Custom options label * Remove unnecessary div --- .../design/settings/controls/OptionsEditor/OptionsEditor.svelte | 1 - packages/client/manifest.json | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/components/design/settings/controls/OptionsEditor/OptionsEditor.svelte b/packages/builder/src/components/design/settings/controls/OptionsEditor/OptionsEditor.svelte index c626081042..14144d006f 100644 --- a/packages/builder/src/components/design/settings/controls/OptionsEditor/OptionsEditor.svelte +++ b/packages/builder/src/components/design/settings/controls/OptionsEditor/OptionsEditor.svelte @@ -25,7 +25,6 @@
-
Define Options
diff --git a/packages/client/manifest.json b/packages/client/manifest.json index 3b99ddb7b5..b59f6d0fad 100644 --- a/packages/client/manifest.json +++ b/packages/client/manifest.json @@ -3295,6 +3295,7 @@ }, { "type": "options", + "label": "Custom options", "key": "customOptions", "dependsOn": { "setting": "optionsSource", @@ -3502,6 +3503,7 @@ }, { "type": "options", + "label": "Custom options", "key": "customOptions", "dependsOn": { "setting": "optionsSource", From 68468fadb349dd54f64f0cccca2e3b091c6374a6 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Thu, 4 Jan 2024 10:10:00 +0000 Subject: [PATCH 03/12] Add an extra JS execution time limit check to prevent creating unnecesary VM context. --- packages/backend-core/src/timers/timers.ts | 2 +- packages/server/src/jsRunner.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/backend-core/src/timers/timers.ts b/packages/backend-core/src/timers/timers.ts index 9de57af7f1..9121c576cd 100644 --- a/packages/backend-core/src/timers/timers.ts +++ b/packages/backend-core/src/timers/timers.ts @@ -50,7 +50,7 @@ export class ExecutionTimeTracker { return this.totalTimeMs } - private checkLimit() { + checkLimit() { if (this.totalTimeMs > this.limitMs) { throw new ExecutionTimeoutError( `Execution time limit of ${this.limitMs}ms exceeded: ${this.totalTimeMs}ms` diff --git a/packages/server/src/jsRunner.ts b/packages/server/src/jsRunner.ts index ab0381a399..a9dcd506d7 100644 --- a/packages/server/src/jsRunner.ts +++ b/packages/server/src/jsRunner.ts @@ -18,13 +18,16 @@ export function init() { bbCtx.jsExecutionTracker = timers.ExecutionTimeTracker.withLimit(perRequestLimit) } - track = bbCtx.jsExecutionTracker.track.bind(bbCtx.jsExecutionTracker) span?.addTags({ js: { limitMS: bbCtx.jsExecutionTracker.limitMs, elapsedMS: bbCtx.jsExecutionTracker.elapsedMS, }, }) + // We call checkLimit() here to prevent paying the cost of creating + // a new VM context below when we don't need to. + bbCtx.jsExecutionTracker.checkLimit() + track = bbCtx.jsExecutionTracker.track.bind(bbCtx.jsExecutionTracker) } } From 9f7b84c07ad14260c1594f5253ca1998eaf1cbfa Mon Sep 17 00:00:00 2001 From: melohagan <101575380+melohagan@users.noreply.github.com> Date: Thu, 4 Jan 2024 11:33:36 +0000 Subject: [PATCH 04/12] Focus the code editor on mount (#12628) * Focus the code editor on mount * Save drawer shortcut * Revert "Save drawer shortcut" This reverts commit 95860ea6b9be2e0edc881a9a4e2d63229a32b512. * Autofocus prop CodeEditor * autofocusEditor prop for JS binding --- .../src/components/common/CodeEditor/CodeEditor.svelte | 7 +++++++ .../src/components/common/bindings/BindingPanel.svelte | 3 +++ .../components/common/bindings/ClientBindingPanel.svelte | 2 ++ .../_components/Component/CustomStylesSection.svelte | 1 + yarn.lock | 9 +++++++++ 5 files changed, 22 insertions(+) diff --git a/packages/builder/src/components/common/CodeEditor/CodeEditor.svelte b/packages/builder/src/components/common/CodeEditor/CodeEditor.svelte index 76d7a58ef1..a39634f9a3 100644 --- a/packages/builder/src/components/common/CodeEditor/CodeEditor.svelte +++ b/packages/builder/src/components/common/CodeEditor/CodeEditor.svelte @@ -53,6 +53,7 @@ export let value = "" export let placeholder = null export let autocompleteEnabled = true + export let autofocus = false // Export a function to expose caret position export const getCaretPosition = () => { @@ -241,6 +242,12 @@ }) } + $: { + if (autofocus && isEditorInitialised) { + editor.focus() + } + } + $: editorHeight = typeof height === "number" ? `${height}px` : height // Init when all elements are ready diff --git a/packages/builder/src/components/common/bindings/BindingPanel.svelte b/packages/builder/src/components/common/bindings/BindingPanel.svelte index 4df26c5d03..548a71b483 100644 --- a/packages/builder/src/components/common/bindings/BindingPanel.svelte +++ b/packages/builder/src/components/common/bindings/BindingPanel.svelte @@ -45,6 +45,7 @@ export let valid export let allowJS = false export let allowHelpers = true + export let autofocusEditor = false const drawerActions = getContext("drawer-actions") const bindingDrawerActions = getContext("binding-drawer-actions") @@ -199,6 +200,7 @@ ]} placeholder="" height="100%" + autofocus={autofocusEditor} />