commit
900d0e8be9
@ -179,36 +179,33 @@ class _PortForwardPageState extends State<PortForwardPage>
|
|||||||
buildTunnelInputCell(context,
|
buildTunnelInputCell(context,
|
||||||
controller: remotePortController,
|
controller: remotePortController,
|
||||||
inputFormatters: portInputFormatter),
|
inputFormatters: portInputFormatter),
|
||||||
SizedBox(
|
ElevatedButton(
|
||||||
width: _kColumn4Width,
|
style: ElevatedButton.styleFrom(
|
||||||
child: ElevatedButton(
|
elevation: 0, side: const BorderSide(color: MyTheme.border)),
|
||||||
style: ElevatedButton.styleFrom(
|
onPressed: () async {
|
||||||
elevation: 0, side: const BorderSide(color: MyTheme.border)),
|
int? localPort = int.tryParse(localPortController.text);
|
||||||
onPressed: () async {
|
int? remotePort = int.tryParse(remotePortController.text);
|
||||||
int? localPort = int.tryParse(localPortController.text);
|
if (localPort != null &&
|
||||||
int? remotePort = int.tryParse(remotePortController.text);
|
remotePort != null &&
|
||||||
if (localPort != null &&
|
(remoteHostController.text.isEmpty ||
|
||||||
remotePort != null &&
|
remoteHostController.text.trim().isNotEmpty)) {
|
||||||
(remoteHostController.text.isEmpty ||
|
await bind.sessionAddPortForward(
|
||||||
remoteHostController.text.trim().isNotEmpty)) {
|
id: 'pf_${widget.id}',
|
||||||
await bind.sessionAddPortForward(
|
localPort: localPort,
|
||||||
id: 'pf_${widget.id}',
|
remoteHost: remoteHostController.text.trim().isEmpty
|
||||||
localPort: localPort,
|
? 'localhost'
|
||||||
remoteHost: remoteHostController.text.trim().isEmpty
|
: remoteHostController.text.trim(),
|
||||||
? 'localhost'
|
remotePort: remotePort);
|
||||||
: remoteHostController.text.trim(),
|
localPortController.clear();
|
||||||
remotePort: remotePort);
|
remoteHostController.clear();
|
||||||
localPortController.clear();
|
remotePortController.clear();
|
||||||
remoteHostController.clear();
|
refreshTunnelConfig();
|
||||||
remotePortController.clear();
|
}
|
||||||
refreshTunnelConfig();
|
},
|
||||||
}
|
child: Text(
|
||||||
},
|
translate('Add'),
|
||||||
child: Text(
|
),
|
||||||
translate('Add'),
|
).marginAll(10),
|
||||||
),
|
|
||||||
).marginAll(10),
|
|
||||||
),
|
|
||||||
]),
|
]),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user