Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add qrcode to secret link modal #612

Merged
merged 2 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions src/components/drive/SecretLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,16 @@
</button>
</div>
<div v-if="showLink()" style="padding: 10px;">
<strong><a v-bind:href="this.href">{{ link.name }}</a></strong>
<input type="text" v-bind:value="this.href" style="display: none">
<button class="fa fa-clipboard" style="padding: 6px 12px; background-color:var(--bg);" @click="copyUrlToClipboard($event)">&nbsp;{{ translate("DRIVE.LINK.COPY") }}</button>
<button class="fa fa-envelope" style="padding: 6px 12px; background-color:var(--bg);" @click="email($event)">&nbsp;{{ translate("DRIVE.LINK.EMAIL") }}</button>
<img
style="width: 150px;"
v-if="base64QrCode"
:src="base64QrCode"
alt="qr-code"
/>
</div>
</p>
</div>
</div>
</div>
Expand Down Expand Up @@ -137,7 +141,8 @@ module.exports = {
autoOpen: false,
currentProps: null,
baseUrl:null,
href:null
href:null,
base64QrCode: "",
};
},
computed: {
Expand Down Expand Up @@ -193,7 +198,10 @@ module.exports = {
args += "&args=%7B%22filename%22:%22" + link.filename + "%22%7D";
}
}
return window.location.origin + "/" + this.baseUrl + args;
let href = window.location.origin + "/" + this.baseUrl + args;
let secretLinkQrCode = peergos.shared.SecretLinkQRCode.generate(href);
this.base64QrCode = secretLinkQrCode.getBase64Thumbnail();
return href;
},
showLink: function() {
return this.currentProps != null;
Expand Down Expand Up @@ -289,3 +297,8 @@ module.exports = {
}
}
</script>
<style>
.modal-body {
margin: 0px 0;
}
</style>
2 changes: 1 addition & 1 deletion src/i18n/en-GB.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ module.exports = {
"DRIVE.SHARE.COMPLETE":"Secure sharing complete",
"DRIVE.LINK.OPEN":"Auto Open",
"DRIVE.LINK.COPY":"Copy to clipboard",
"DRIVE.LINK.EMAIL":"Share via email",
"DRIVE.LINK.EMAIL":"via email",
"DRIVE.LINK.OK":"OK",
"DRIVE.LINK.UPDATE":"Update",
"DRIVE.LINK.VIEWEDIT":"View/Edit",
Expand Down
Loading