diff --git a/web/html/form/protocol/vless.html b/web/html/form/protocol/vless.html
index ad5b4265..46967ee3 100644
--- a/web/html/form/protocol/vless.html
+++ b/web/html/form/protocol/vless.html
@@ -75,23 +75,23 @@
- updateTestseed(0, val)" :min="0" :max="9999" :style="{ width: '100%' }" placeholder="900" addon-before="[0]">
+ inModal.updateTestseed(0, val)" :min="0" :max="9999" :style="{ width: '100%' }" placeholder="900" addon-before="[0]">
- updateTestseed(1, val)" :min="0" :max="9999" :style="{ width: '100%' }" placeholder="500" addon-before="[1]">
+ inModal.updateTestseed(1, val)" :min="0" :max="9999" :style="{ width: '100%' }" placeholder="500" addon-before="[1]">
- updateTestseed(2, val)" :min="0" :max="9999" :style="{ width: '100%' }" placeholder="900" addon-before="[2]">
+ inModal.updateTestseed(2, val)" :min="0" :max="9999" :style="{ width: '100%' }" placeholder="900" addon-before="[2]">
- updateTestseed(3, val)" :min="0" :max="9999" :style="{ width: '100%' }" placeholder="256" addon-before="[3]">
+ inModal.updateTestseed(3, val)" :min="0" :max="9999" :style="{ width: '100%' }" placeholder="256" addon-before="[3]">
-
+
Rand
-
+
Reset
diff --git a/web/html/modals/inbound_modal.html b/web/html/modals/inbound_modal.html
index 417e37ed..247da1c8 100644
--- a/web/html/modals/inbound_modal.html
+++ b/web/html/modals/inbound_modal.html
@@ -50,9 +50,37 @@
loading(loading = true) {
inModal.confirmLoading = loading;
},
+ // Vision Seed methods - always available regardless of Vue context
+ updateTestseed(index, value) {
+ // Ensure testseed is initialized
+ if (!this.inbound.settings.testseed || !Array.isArray(this.inbound.settings.testseed)) {
+ 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
+ this.inbound.settings.testseed[index] = value;
+ },
+ setRandomTestseed() {
+ // Ensure testseed is initialized
+ if (!this.inbound.settings.testseed || !Array.isArray(this.inbound.settings.testseed) || this.inbound.settings.testseed.length < 4) {
+ this.inbound.settings.testseed = [900, 500, 900, 256].slice();
+ }
+ // Create new array with random values
+ this.inbound.settings.testseed = [Math.floor(Math.random()*1000), Math.floor(Math.random()*1000), Math.floor(Math.random()*1000), Math.floor(Math.random()*1000)];
+ },
+ resetTestseed() {
+ // Reset testseed to default values
+ this.inbound.settings.testseed = [900, 500, 900, 256].slice();
+ }
};
- new Vue({
+ // Store Vue instance globally to ensure methods are always accessible
+ let inboundModalVueInstance = null;
+
+ inboundModalVueInstance = new Vue({
delimiters: ['[[', ']]'],
el: '#inbound-modal',
data: {
@@ -235,36 +263,7 @@
this.inbound.settings.encryption = 'none';
this.inbound.settings.selectedAuth = undefined;
},
- updateTestseed(index, value) {
- // Ensure testseed is initialized
- if (!inModal.inbound.settings.testseed || !Array.isArray(inModal.inbound.settings.testseed)) {
- inModal.inbound.settings.testseed = [900, 500, 900, 256];
- }
- // Ensure array has enough elements
- while (inModal.inbound.settings.testseed.length <= index) {
- inModal.inbound.settings.testseed.push(0);
- }
- // Update value using Vue.set for reactivity
- if (this.$set) {
- this.$set(inModal.inbound.settings.testseed, index, value);
- } else {
- inModal.inbound.settings.testseed[index] = value;
- }
- },
- setRandomTestseed() {
- // Ensure testseed is initialized
- if (!inModal.inbound.settings.testseed || !Array.isArray(inModal.inbound.settings.testseed) || inModal.inbound.settings.testseed.length < 4) {
- inModal.inbound.settings.testseed = [900, 500, 900, 256].slice();
- }
- // Create new array to ensure Vue reactivity
- const newSeed = [Math.floor(Math.random()*1000), Math.floor(Math.random()*1000), Math.floor(Math.random()*1000), Math.floor(Math.random()*1000)];
- inModal.inbound.settings.testseed = newSeed.slice();
- },
- resetTestseed() {
- // Reset testseed to default values - create new array for Vue reactivity
- inModal.inbound.settings.testseed = [900, 500, 900, 256].slice();
- }
- }
+ },
});