Skip to content

Commit

Permalink
Merge branch 'feat/task-149601' into 'main'
Browse files Browse the repository at this point in the history
fix: create&edit service problem

See merge request hango/hango-web!8
  • Loading branch information
guoying06 committed Dec 14, 2023
2 parents 2efbb0b + 092956a commit 0843257
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
1 change: 0 additions & 1 deletion packages/ui/src/views/Router/Info.vue
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@ export default {
</script>
<style module>
.serviceCardHead {
height: 40px;
background: #fafcfe;
padding: 12px;
}
Expand Down
24 changes: 18 additions & 6 deletions packages/ui/src/views/Server/MoreConfig.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<v-switch
v-model="enableSessionState"
label="会话保持"
@change="enableSessionStateChange"
></v-switch>
</validation-provider>
<template v-if="enableSessionState">
Expand Down Expand Up @@ -62,6 +63,7 @@
<v-switch
v-model="enableSlowStartWindow"
label="服务预热"
@change="enableSlowStartWindowChange"
></v-switch>
</validation-provider>
<template v-if="enableSlowStartWindow">
Expand Down Expand Up @@ -249,10 +251,6 @@ const TEMPLATE_MODAL = {
HttpHeaderName: '',
UseSourceIp: true,
},
SlowStartWindow: '300',
},
SessionState: {
CookieTTL: '120',
},
ConnectionPool: {
HTTP: {
Expand Down Expand Up @@ -336,12 +334,12 @@ export default {
if (nV) {
if (JSON.stringify(nV) !== JSON.stringify(oV)) {
this.form = this.toDisplay(nV);
if (nV.SessionState && Object.keys(nV.SessionState).length && this.isEdit) {
if (nV.SessionState && Object.keys(nV.SessionState).length) {
this.enableSessionState = true;
} else {
this.enableSessionState = false;
}
if (nV.LoadBalancer.SlowStartWindow && this.isEdit) {
if (nV.LoadBalancer.SlowStartWindow) {
this.enableSlowStartWindow = true;
} else {
this.enableSlowStartWindow = false;
Expand Down Expand Up @@ -392,6 +390,20 @@ export default {
}
return data;
},
enableSessionStateChange() {
if (this.enableSessionState) {
this.$set(this.form, 'SessionState', {
CookieTTL: '120',
});
}
this.$emit('update', this.getData());
},
enableSlowStartWindowChange() {
if (this.enableSlowStartWindow) {
this.$set(this.form.LoadBalancer, 'SlowStartWindow', '300');
}
this.$emit('update', this.getData());
},
},
};
</script>
Expand Down

0 comments on commit 0843257

Please sign in to comment.