diff --git a/backend/service/setting.go b/backend/service/setting.go index 34ce0b4..f3a2c8d 100644 --- a/backend/service/setting.go +++ b/backend/service/setting.go @@ -127,9 +127,9 @@ func (s *SettingService) getBool(key string) (bool, error) { return strconv.ParseBool(str) } -func (s *SettingService) setBool(key string, value bool) error { - return s.setString(key, strconv.FormatBool(value)) -} +// func (s *SettingService) setBool(key string, value bool) error { +// return s.setString(key, strconv.FormatBool(value)) +// } func (s *SettingService) getInt(key string) (int, error) { str, err := s.getString(key) diff --git a/frontend/src/components/InTLS.vue b/frontend/src/components/InTLS.vue index 87732a4..3da4bd7 100644 --- a/frontend/src/components/InTLS.vue +++ b/frontend/src/components/InTLS.vue @@ -191,7 +191,10 @@ export default { }, tlsEnable: { get() { return this.tls.enabled?? false }, - set(newValue: boolean) { this.$props.inbound.tls = newValue ? { enabled: true } : {} } + set(newValue: boolean) { + this.$props.inbound.tls = newValue ? { enabled: true } : {} + this.$props.tls_id.value = 0 + } }, tlsOptional(): boolean { return !['hysteria','hysteria2','tuic','naive'].includes(this.$props.inbound.type) diff --git a/frontend/src/layouts/modals/Inbound.vue b/frontend/src/layouts/modals/Inbound.vue index 086eccf..c9719bf 100644 --- a/frontend/src/layouts/modals/Inbound.vue +++ b/frontend/src/layouts/modals/Inbound.vue @@ -98,6 +98,7 @@ export default { else { const port = RandomUtil.randomIntRange(10000, 60000) this.inbound = createInbound("direct",{ tag: "direct-"+port ,listen: "::", listen_port: port }) + this.tls_id.value = 0 this.title = "add" } this.inboundStats = this.$props.stats