From 7d441723ba02883c96e31eebe454623ca3b28759 Mon Sep 17 00:00:00 2001 From: Alireza Ahmadi Date: Sun, 30 Jun 2024 22:30:34 +0200 Subject: [PATCH] update qr-code with singbox --- frontend/src/layouts/modals/QrCode.vue | 72 +++++++++++++++++++++----- 1 file changed, 58 insertions(+), 14 deletions(-) diff --git a/frontend/src/layouts/modals/QrCode.vue b/frontend/src/layouts/modals/QrCode.vue index f5a977a..5c42b9e 100644 --- a/frontend/src/layouts/modals/QrCode.vue +++ b/frontend/src/layouts/modals/QrCode.vue @@ -9,19 +9,46 @@ - - - - {{ $t('setting.sub') }} - - - - - - {{ l.remark?? "-" }}
- -
-
+ + + {{ $t('setting.sub') }} + {{ $t('client.links') }} + + + + + + {{ $t('setting.sub') }}
+ +
+
+ + + {{ $t('setting.jsonSub') }}
+ +
+
+ + + SING-BOX
+ +
+
+
+ + + + {{ l.remark?? $t('client.' + l.type) }}
+ +
+
+
+
@@ -35,9 +62,10 @@ import { i18n } from '@/locales' import { push } from 'notivue' export default { - props: ['index'], + props: ['index', 'visible'], data() { return { + tab: "sub", } }, methods: { @@ -81,10 +109,26 @@ export default { clientSub() { return Data().subURI + this.client.name }, + singbox() { + const url = Data().subURI + this.client.name + "?format=json" + return "sing-box://import-remote-profile?url=" + encodeURIComponent(url) + "#" + this.client.name + }, clientLinks() { return this.client.links?? [] + }, + size() { + if (window.innerWidth > 380) return 300 + if (window.innerWidth > 330) return 280 + return 250 } }, + watch: { + visible(v) { + if (v) { + this.tab = "sub" + } + }, + }, components: { QrcodeVue } } \ No newline at end of file