mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-12-23 06:42:41 +00:00
fix:
This commit is contained in:
parent
ca4d2e1e90
commit
7c9204d183
2 changed files with 36 additions and 37 deletions
|
|
@ -75,23 +75,23 @@
|
||||||
<a-form-item label="Vision Seed">
|
<a-form-item label="Vision Seed">
|
||||||
<a-row :gutter="8">
|
<a-row :gutter="8">
|
||||||
<a-col :span="6">
|
<a-col :span="6">
|
||||||
<a-input-number :value="(inbound.settings.testseed && inbound.settings.testseed[0] !== undefined) ? inbound.settings.testseed[0] : 900" @change="(val) => updateTestseed(0, val)" :min="0" :max="9999" :style="{ width: '100%' }" placeholder="900" addon-before="[0]"></a-input-number>
|
<a-input-number :value="(inbound.settings.testseed && inbound.settings.testseed[0] !== undefined) ? inbound.settings.testseed[0] : 900" @change="(val) => inModal.updateTestseed(0, val)" :min="0" :max="9999" :style="{ width: '100%' }" placeholder="900" addon-before="[0]"></a-input-number>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="6">
|
<a-col :span="6">
|
||||||
<a-input-number :value="(inbound.settings.testseed && inbound.settings.testseed[1] !== undefined) ? inbound.settings.testseed[1] : 500" @change="(val) => updateTestseed(1, val)" :min="0" :max="9999" :style="{ width: '100%' }" placeholder="500" addon-before="[1]"></a-input-number>
|
<a-input-number :value="(inbound.settings.testseed && inbound.settings.testseed[1] !== undefined) ? inbound.settings.testseed[1] : 500" @change="(val) => inModal.updateTestseed(1, val)" :min="0" :max="9999" :style="{ width: '100%' }" placeholder="500" addon-before="[1]"></a-input-number>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="6">
|
<a-col :span="6">
|
||||||
<a-input-number :value="(inbound.settings.testseed && inbound.settings.testseed[2] !== undefined) ? inbound.settings.testseed[2] : 900" @change="(val) => updateTestseed(2, val)" :min="0" :max="9999" :style="{ width: '100%' }" placeholder="900" addon-before="[2]"></a-input-number>
|
<a-input-number :value="(inbound.settings.testseed && inbound.settings.testseed[2] !== undefined) ? inbound.settings.testseed[2] : 900" @change="(val) => inModal.updateTestseed(2, val)" :min="0" :max="9999" :style="{ width: '100%' }" placeholder="900" addon-before="[2]"></a-input-number>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="6">
|
<a-col :span="6">
|
||||||
<a-input-number :value="(inbound.settings.testseed && inbound.settings.testseed[3] !== undefined) ? inbound.settings.testseed[3] : 256" @change="(val) => updateTestseed(3, val)" :min="0" :max="9999" :style="{ width: '100%' }" placeholder="256" addon-before="[3]"></a-input-number>
|
<a-input-number :value="(inbound.settings.testseed && inbound.settings.testseed[3] !== undefined) ? inbound.settings.testseed[3] : 256" @change="(val) => inModal.updateTestseed(3, val)" :min="0" :max="9999" :style="{ width: '100%' }" placeholder="256" addon-before="[3]"></a-input-number>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
<a-space :size="8" :style="{ marginTop: '8px' }">
|
<a-space :size="8" :style="{ marginTop: '8px' }">
|
||||||
<a-button type="primary" @click="setRandomTestseed">
|
<a-button type="primary" @click="inModal.setRandomTestseed">
|
||||||
Rand
|
Rand
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-button @click="resetTestseed">
|
<a-button @click="inModal.resetTestseed">
|
||||||
Reset
|
Reset
|
||||||
</a-button>
|
</a-button>
|
||||||
</a-space>
|
</a-space>
|
||||||
|
|
|
||||||
|
|
@ -50,9 +50,37 @@
|
||||||
loading(loading = true) {
|
loading(loading = true) {
|
||||||
inModal.confirmLoading = loading;
|
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: ['[[', ']]'],
|
delimiters: ['[[', ']]'],
|
||||||
el: '#inbound-modal',
|
el: '#inbound-modal',
|
||||||
data: {
|
data: {
|
||||||
|
|
@ -235,36 +263,7 @@
|
||||||
this.inbound.settings.encryption = 'none';
|
this.inbound.settings.encryption = 'none';
|
||||||
this.inbound.settings.selectedAuth = undefined;
|
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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue