mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-07-01 12:32:09 +00:00
fix bug - deleteBalancer
This commit is contained in:
parent
18af7047f8
commit
c74efa1d43
3 changed files with 9 additions and 6 deletions
|
@ -81,7 +81,7 @@
|
||||||
<template slot="title">
|
<template slot="title">
|
||||||
<span>{{ i18n "pages.inbounds.IPLimitlogDesc" }}</span>
|
<span>{{ i18n "pages.inbounds.IPLimitlogDesc" }}</span>
|
||||||
</template>
|
</template>
|
||||||
<span>{{ i18n "pages.inbounds.IPLimitlog" }}</span>
|
<span>{{ i18n "pages.inbounds.IPLimitlog" }} </span>
|
||||||
<a-icon type="question-circle"></a-icon>
|
<a-icon type="question-circle"></a-icon>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
:overlay-class-name="themeSwitcher.currentTheme"
|
:overlay-class-name="themeSwitcher.currentTheme"
|
||||||
ok-text='{{ i18n "reset"}}'
|
ok-text='{{ i18n "reset"}}'
|
||||||
cancel-text='{{ i18n "cancel"}}'>
|
cancel-text='{{ i18n "cancel"}}'>
|
||||||
<a-icon slot="icon" type="question-circle-o" :style="themeSwitcher.isDarkTheme ? 'color: #3c89e8' : 'color: blue'"></a-icon>
|
<a-icon slot="icon" type="question-circle-o" :style="themeSwitcher.isDarkTheme ? 'color: var(--color-primary-100)' : 'color: var(--color-primary-100)'"></a-icon>
|
||||||
<a-icon style="font-size: 24px; cursor: pointer;" class="normal-icon" type="retweet" v-if="client.email.length > 0"></a-icon>
|
<a-icon style="font-size: 24px; cursor: pointer;" class="normal-icon" type="retweet" v-if="client.email.length > 0"></a-icon>
|
||||||
</a-popconfirm>
|
</a-popconfirm>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
|
|
|
@ -1182,7 +1182,7 @@
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
deleteBalancer(index) {
|
deleteBalancer(index) {
|
||||||
newTemplateSettings = this.templateSettings;
|
let newTemplateSettings = { ...this.templateSettings };
|
||||||
|
|
||||||
// Remove from balancers
|
// Remove from balancers
|
||||||
const removedBalancer = this.balancersData.splice(index, 1)[0];
|
const removedBalancer = this.balancersData.splice(index, 1)[0];
|
||||||
|
@ -1192,9 +1192,12 @@
|
||||||
newTemplateSettings.routing.balancers.splice(realIndex, 1);
|
newTemplateSettings.routing.balancers.splice(realIndex, 1);
|
||||||
|
|
||||||
// Remove related routing rules
|
// Remove related routing rules
|
||||||
let rules = newTemplateSettings.routing.rules.filter((r) => !r.balancerTag || r.balancerTag !== removedBalancer.tag);
|
newTemplateSettings.routing.rules.forEach((rule) => {
|
||||||
newTemplateSettings.routing.rules = rules;
|
if (rule.balancerTag === removedBalancer.tag) {
|
||||||
|
delete rule.balancerTag;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Update balancers property to an empty array if there are no more balancers
|
// Update balancers property to an empty array if there are no more balancers
|
||||||
if (newTemplateSettings.routing.balancers.length === 0) {
|
if (newTemplateSettings.routing.balancers.length === 0) {
|
||||||
delete newTemplateSettings.routing.balancers;
|
delete newTemplateSettings.routing.balancers;
|
||||||
|
|
Loading…
Reference in a new issue