Skip to content

Commit 0fc7153

Browse files
fix: Fixed issue with edit runtime port failed
1 parent 747a0c4 commit 0fc7153

File tree

1 file changed

+9
-1
lines changed
  • frontend/src/views/website/runtime/components/port

1 file changed

+9
-1
lines changed

frontend/src/views/website/runtime/components/port/index.vue

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@
1313
</el-col>
1414
<el-col :span="7">
1515
<el-text>{{ $t('app.allowPort') }}</el-text>
16-
<el-switch class="ml-1" v-model="port.hostIP" :active-value="''" :inactive-value="'127.0.0.1'" />
16+
<el-switch
17+
class="ml-1"
18+
:model-value="port.hostIP === ''"
19+
@update:model-value="handleSwitchChange($event, index)"
20+
/>
1721
</el-col>
1822
<el-col :span="2">
1923
<el-form-item>
@@ -47,6 +51,10 @@ const rules = reactive<FormRules>({
4751
port: [Rules.requiredInput, Rules.paramPort, checkNumberRange(1, 65535)],
4852
});
4953
54+
const handleSwitchChange = (value: boolean, index: number) => {
55+
props.exposedPorts[index].hostIP = value ? '' : '127.0.0.1';
56+
};
57+
5058
const addPort = () => {
5159
props.exposedPorts.push({
5260
hostPort: undefined,

0 commit comments

Comments
 (0)