From 9ca7898e6ef6406ae748304b8c869b8a95494bbf Mon Sep 17 00:00:00 2001 From: buster Date: Sun, 15 Oct 2023 12:12:17 +0200 Subject: [PATCH] Disable QR code for url sharing (useful if PsiTransfer is only in intranet available) --- app/src/Upload.vue | 4 ++-- config.js | 2 ++ lib/endpoints.js | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/Upload.vue b/app/src/Upload.vue index 89a6f0b1..27a2350e 100644 --- a/app/src/Upload.vue +++ b/app/src/Upload.vue @@ -20,7 +20,7 @@ div(v-else-if="$root.configFetched") .well(v-show="state === 'uploaded'") .pull-right.btn-group.upload-success-btns - a.btn.btn-primary(@click.prevent="showQrCode" href="#" :title="$root.lang.showQrCode") + a.btn.btn-primary(v-if="!disableQrCode", @click.prevent="showQrCode" href="#" :title="$root.lang.showQrCode") icon.fa-fw(name="qrcode") | QR-Code a.btn.btn-primary(:href="mailLnk" :title="$root.lang.sendViaMail") @@ -90,7 +90,7 @@ computed: { ...mapState(['state']), - ...mapState('config', ['uploadPassRequired', 'uploadPass', 'requireBucketPassword']), + ...mapState('config', ['uploadPassRequired', 'uploadPass', 'requireBucketPassword', 'disableQrCode']), ...mapState('upload', ['sid', 'files', 'password']), ...mapGetters(['error', 'disabled']), ...mapGetters('upload', ['percentUploaded', 'shareUrl', 'bucketSize', 'bytesUploaded']), diff --git a/config.js b/config.js index f3a9917a..aaf62d64 100644 --- a/config.js +++ b/config.js @@ -60,6 +60,8 @@ const config = { "maxFileSize": null, // Math.pow(2, 30) * 2, // 2GB "maxBucketSize": null, // Math.pow(2, 30) * 2, // 10GB "plugins": ['file-downloaded-webhook', 'file-uploaded-webhook'], + // Disable the QR code button for download url sharing, set to true to disable + "disableQrCode": false, }; // Load NODE_ENV specific config diff --git a/lib/endpoints.js b/lib/endpoints.js index 1ede8d7f..945cbc46 100644 --- a/lib/endpoints.js +++ b/lib/endpoints.js @@ -109,6 +109,7 @@ app.get(`${ config.baseUrl }config.json`, (req, res) => { requireBucketPassword: config.requireBucketPassword, maxFileSize: config.maxFileSize, maxBucketSize: config.maxBucketSize, + disableQrCode: config.disableQrCode, }; eventBus.emit('getFrontendConfig', frontendConfig);