Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHo3ein <ho3ein.sanaei@gmail.com>2023-05-31 09:17:02 +0300
committerGitHub <noreply@github.com>2023-05-31 09:17:02 +0300
commit94fad02737d82817ca69f1f05872b49e769a0cb4 (patch)
tree55e7ead217c5a3e82791c0edae6ad44de1ba524f /web/html/common
parent8442836512d82b705e404bc1749e3000115ba550 (diff)
parentd694e6eafccad246c63264714897316f671d6428 (diff)
Merge pull request #545 from hamid-gh98/main
🔀 New Feature + Fix URLs + Some Improvements 🛠️🌐
Diffstat (limited to 'web/html/common')
-rw-r--r--web/html/common/qrcode_modal.html30
1 files changed, 13 insertions, 17 deletions
diff --git a/web/html/common/qrcode_modal.html b/web/html/common/qrcode_modal.html
index e6b7b998..8edfa2de 100644
--- a/web/html/common/qrcode_modal.html
+++ b/web/html/common/qrcode_modal.html
@@ -68,8 +68,8 @@
qrModal: qrModal,
},
methods: {
- copyToClipboard(elmentId,content) {
- this.qrModal.clipboard = new ClipboardJS('#'+elmentId, {
+ copyToClipboard(elmentId, content) {
+ this.qrModal.clipboard = new ClipboardJS('#' + elmentId, {
text: () => content,
});
this.qrModal.clipboard.on('success', () => {
@@ -77,29 +77,25 @@
this.qrModal.clipboard.destroy();
});
},
- setQrCode(elmentId,content) {
+ setQrCode(elmentId, content) {
new QRious({
- element: document.querySelector('#'+elmentId),
- size: 260,
- value: content,
- });
+ element: document.querySelector('#' + elmentId),
+ size: 260,
+ value: content,
+ });
},
genSubLink(subID) {
- protocol = app.subSettings.tls ? "https://" : "http://";
- hostName = app.subSettings.domain === "" ? window.location.hostname : app.subSettings.domain;
- subPort = app.subSettings.port;
- port = (subPort === 443 && app.subSettings.tls) || (subPort === 80 && !app.subSettings.tls) ? "" : ":" + String(subPort);
- subPath = app.subSettings.path;
- return protocol + hostName + port + subPath + subID;
+ const { domain: host, port, tls: isTLS, path: base } = app.subSettings;
+ return buildURL({ host, port, isTLS, base, path: subID });
}
},
updated() {
- if (qrModal.client.subId){
+ if (qrModal.client && qrModal.client.subId) {
qrModal.subId = qrModal.client.subId;
- this.setQrCode("qrCode-sub",this.genSubLink(qrModal.subId));
+ this.setQrCode("qrCode-sub", this.genSubLink(qrModal.subId));
}
- qrModal.qrcodes.forEach((element,index) => {
- this.setQrCode("qrCode-"+index, element.link);
+ qrModal.qrcodes.forEach((element, index) => {
+ this.setQrCode("qrCode-" + index, element.link);
});
}
});