mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-12-20 06:18:56 +08:00
fix: Fixed issue with edit runtime port failed (#11096)
Refs https://github.com/1Panel-dev/1Panel/issues/11091
This commit is contained in:
parent
e32a11910e
commit
42f61f60fb
1 changed files with 9 additions and 1 deletions
|
|
@ -13,7 +13,11 @@
|
|||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-text>{{ $t('app.allowPort') }}</el-text>
|
||||
<el-switch class="ml-1" v-model="port.hostIP" :active-value="''" :inactive-value="'127.0.0.1'" />
|
||||
<el-switch
|
||||
class="ml-1"
|
||||
:model-value="port.hostIP === ''"
|
||||
@update:model-value="handleSwitchChange($event, index)"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<el-form-item>
|
||||
|
|
@ -47,6 +51,10 @@ const rules = reactive<FormRules>({
|
|||
port: [Rules.requiredInput, Rules.paramPort, checkNumberRange(1, 65535)],
|
||||
});
|
||||
|
||||
const handleSwitchChange = (value: boolean, index: number) => {
|
||||
props.exposedPorts[index].hostIP = value ? '' : '127.0.0.1';
|
||||
};
|
||||
|
||||
const addPort = () => {
|
||||
props.exposedPorts.push({
|
||||
hostPort: undefined,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue