Merge pull request #3137 from NicKoehler/master

Fixed text wrap bug
This commit is contained in:
RustDesk 2023-02-09 20:46:25 +08:00 committed by GitHub
commit 900d0e8be9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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),
),
]), ]),
); );
} }