From d3670a8a6cafb5d7c2ddac4314c845732097db2b Mon Sep 17 00:00:00 2001 From: lolka1333 Date: Sun, 14 Dec 2025 13:54:17 +0100 Subject: [PATCH] refactor: update testseed methods for improved reactivity and binding in VLESS form --- web/html/form/protocol/vless.html | 12 ++++++------ web/html/modals/inbound_modal.html | 20 ++++++++++++++++---- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/web/html/form/protocol/vless.html b/web/html/form/protocol/vless.html index 46967ee3..ad5b4265 100644 --- a/web/html/form/protocol/vless.html +++ b/web/html/form/protocol/vless.html @@ -75,23 +75,23 @@ - + - + - + - + - + Rand - + Reset diff --git a/web/html/modals/inbound_modal.html b/web/html/modals/inbound_modal.html index 172ef144..c3883285 100644 --- a/web/html/modals/inbound_modal.html +++ b/web/html/modals/inbound_modal.html @@ -270,15 +270,27 @@ this.inbound.settings.encryption = 'none'; this.inbound.settings.selectedAuth = undefined; }, - // Wrapper methods for Vision Seed - delegate to inModal methods + // Vision Seed methods - must be in Vue methods for proper binding updateTestseed(index, value) { - inModal.updateTestseed(index, value); + // Ensure testseed is initialized + if (!this.inbound.settings.testseed || !Array.isArray(this.inbound.settings.testseed)) { + this.$set(this.inbound.settings, 'testseed', [900, 500, 900, 256]); + } + // Ensure array has enough elements + while (this.inbound.settings.testseed.length <= index) { + this.inbound.settings.testseed.push(0); + } + // Update value using Vue.set for reactivity + this.$set(this.inbound.settings.testseed, index, value); }, setRandomTestseed() { - inModal.setRandomTestseed(); + // Create new array with random values and use Vue.set for reactivity + const newSeed = [Math.floor(Math.random()*1000), Math.floor(Math.random()*1000), Math.floor(Math.random()*1000), Math.floor(Math.random()*1000)]; + this.$set(this.inbound.settings, 'testseed', newSeed); }, resetTestseed() { - inModal.resetTestseed(); + // Reset testseed to default values using Vue.set for reactivity + this.$set(this.inbound.settings, 'testseed', [900, 500, 900, 256]); } }, });