diff --git a/hosting/single/nginx/nginx-default-site.conf b/hosting/single/nginx/nginx-default-site.conf
index 3903c0647d..d2f8e229c6 100644
--- a/hosting/single/nginx/nginx-default-site.conf
+++ b/hosting/single/nginx/nginx-default-site.conf
@@ -22,6 +22,16 @@ server {
proxy_pass http://127.0.0.1:4001;
}
+ location /embed {
+ rewrite /embed/(.*) /app/$1 break;
+ proxy_pass http://127.0.0.1:4001;
+ proxy_redirect off;
+ proxy_set_header Host $host;
+ proxy_set_header x-budibase-embed "true";
+ add_header x-budibase-embed "true";
+ add_header Content-Security-Policy "frame-ancestors *";
+ }
+
location = / {
proxy_pass http://127.0.0.1:4001;
}
diff --git a/lerna.json b/lerna.json
index 37914856b9..13c61d054f 100644
--- a/lerna.json
+++ b/lerna.json
@@ -1,5 +1,5 @@
{
- "version": "2.8.3-alpha.3",
+ "version": "2.8.5",
"npmClient": "yarn",
"packages": [
"packages/*"
diff --git a/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/_components/panels/Queries/RestImportButton.svelte b/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/_components/panels/Queries/RestImportButton.svelte
index 682284adca..7f179d18b4 100644
--- a/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/_components/panels/Queries/RestImportButton.svelte
+++ b/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/_components/panels/Queries/RestImportButton.svelte
@@ -2,11 +2,12 @@
import { Button, Modal } from "@budibase/bbui"
import ImportQueriesModal from "./RestImportQueriesModal.svelte"
+ export let datasourceId
let importQueriesModal
-
+
diff --git a/packages/client/manifest.json b/packages/client/manifest.json
index 8784339971..ab8d61eebd 100644
--- a/packages/client/manifest.json
+++ b/packages/client/manifest.json
@@ -3223,6 +3223,46 @@
"key": "allowManualEntry",
"defaultValue": false
},
+ {
+ "type": "boolean",
+ "label": "Play sound on scan",
+ "key": "beepOnScan",
+ "defaultValue": false
+ },
+ {
+ "type": "select",
+ "label": "Sound pitch",
+ "key": "beepFrequency",
+ "dependsOn": "beepOnScan",
+ "defaultValue": 2637,
+ "options": [
+ {
+ "label": "Low",
+ "value": 2096
+ },
+ {
+ "label": "Regular",
+ "value": 2637
+ },
+ {
+ "label": "High",
+ "value": 3136
+ },
+ { "label": "Custom", "value": "custom" }
+ ]
+ },
+ {
+ "type": "number",
+ "label": "Sound frequency (Hz)",
+ "key": "customFrequency",
+ "defaultValue": 1046,
+ "min": 20,
+ "max": 8000,
+ "dependsOn": {
+ "setting": "beepFrequency",
+ "value": "custom"
+ }
+ },
{
"type": "validation/string",
"label": "Validation",
diff --git a/packages/client/src/components/app/forms/CodeScanner.svelte b/packages/client/src/components/app/forms/CodeScanner.svelte
index 5dff3a96fa..9895413446 100644
--- a/packages/client/src/components/app/forms/CodeScanner.svelte
+++ b/packages/client/src/components/app/forms/CodeScanner.svelte
@@ -8,6 +8,10 @@
export let disabled = false
export let allowManualEntry = false
export let scanButtonText = "Scan code"
+ export let beepOnScan = false
+ export let beepFrequency = 2637
+ export let customFrequency = 1046
+
const dispatch = createEventDispatcher()
let videoEle
@@ -21,8 +25,13 @@
fps: 25,
qrbox: { width: 250, height: 250 },
}
+ const audioCtx = new (window.AudioContext || window.webkitAudioContext)()
+
const onScanSuccess = decodedText => {
if (value != decodedText) {
+ if (beepOnScan) {
+ beep()
+ }
dispatch("change", decodedText)
}
}
@@ -84,6 +93,27 @@
}
camModal.hide()
}
+
+ const beep = () => {
+ const oscillator = audioCtx.createOscillator()
+ const gainNode = audioCtx.createGain()
+
+ oscillator.connect(gainNode)
+ gainNode.connect(audioCtx.destination)
+
+ const frequency =
+ beepFrequency === "custom" ? customFrequency : beepFrequency
+ oscillator.frequency.value = frequency
+ oscillator.type = "square"
+
+ const duration = 420
+ const endTime = audioCtx.currentTime + duration / 1000
+ gainNode.gain.setValueAtTime(1, audioCtx.currentTime)
+ gainNode.gain.exponentialRampToValueAtTime(0.001, endTime)
+
+ oscillator.start()
+ oscillator.stop(endTime)
+ }
diff --git a/packages/client/src/components/app/forms/CodeScannerField.svelte b/packages/client/src/components/app/forms/CodeScannerField.svelte
index 7e020aa9c7..c408f78d7c 100644
--- a/packages/client/src/components/app/forms/CodeScannerField.svelte
+++ b/packages/client/src/components/app/forms/CodeScannerField.svelte
@@ -11,6 +11,9 @@
export let onChange
export let allowManualEntry
export let scanButtonText
+ export let beepOnScan
+ export let beepFrequency
+ export let customFrequency
let fieldState
let fieldApi
@@ -42,6 +45,9 @@
disabled={fieldState.disabled}
{allowManualEntry}
scanButtonText={scanText}
+ {beepOnScan}
+ {beepFrequency}
+ {customFrequency}
/>
{/if}