diff --git a/frontend/src/layouts/modals/Client.vue b/frontend/src/layouts/modals/Client.vue
index b033009..528622a 100644
--- a/frontend/src/layouts/modals/Client.vue
+++ b/frontend/src/layouts/modals/Client.vue
@@ -85,7 +85,7 @@
chips
hide-details>
-
+
diff --git a/frontend/src/layouts/modals/QrCode.vue b/frontend/src/layouts/modals/QrCode.vue
index 5c42b9e..0753e1b 100644
--- a/frontend/src/layouts/modals/QrCode.vue
+++ b/frontend/src/layouts/modals/QrCode.vue
@@ -1,6 +1,6 @@
-
+
QrCode
@@ -9,7 +9,13 @@
-
+
+
{{ $t('setting.sub') }}
-
+
{{ $t('setting.jsonSub') }}
-
+
- SING-BOX
-
+ SING-BOX (scan only)
+
@@ -44,7 +50,7 @@
{{ l.remark?? $t('client.' + l.type) }}
-
+
@@ -62,13 +68,21 @@ import { i18n } from '@/locales'
import { push } from 'notivue'
export default {
- props: ['index', 'visible'],
+ props: ['id', 'visible'],
data() {
return {
tab: "sub",
+ client: {},
+ loading: false,
}
},
methods: {
+ async load() {
+ this.loading = true
+ const newData = await Data().loadClients(this.$props.id)
+ this.client = newData
+ this.loading = false
+ },
copyToClipboard(txt:string) {
const hiddenButton = document.createElement('button')
hiddenButton.className = 'clipboard-btn'
@@ -101,11 +115,6 @@ export default {
}
},
computed: {
- clients() { return Data().clients },
- client() {
- if ( typeof this.$props.index != 'number' ) return {}
- return this.clients[this.$props.index]
- },
clientSub() {
return Data().subURI + this.client.name
},
@@ -126,6 +135,7 @@ export default {
visible(v) {
if (v) {
this.tab = "sub"
+ this.load()
}
},
},
diff --git a/frontend/src/views/Clients.vue b/frontend/src/views/Clients.vue
index 9454aeb..8db55d9 100644
--- a/frontend/src/views/Clients.vue
+++ b/frontend/src/views/Clients.vue
@@ -20,7 +20,7 @@
{
const qrcode = ref({
visible: false,
- index: 0,
+ id: 0,
})
const showQrCode = (id: number) => {
- const clientIndex = clients.value.findIndex(c => c.id === id)
- qrcode.value.index = clientIndex
+ qrcode.value.id = id
qrcode.value.visible = true
}
const closeQrCode = () => {