relay server for android

This commit is contained in:
rustdesk 2022-03-24 21:31:47 +08:00
parent 9dadd76a8d
commit 4d64fee76d
2 changed files with 42 additions and 36 deletions

View File

@ -24,7 +24,7 @@ class ConnectionPage extends StatefulWidget implements PageShape {
PopupMenuButton<String>(itemBuilder: (context) { PopupMenuButton<String>(itemBuilder: (context) {
return [ return [
PopupMenuItem( PopupMenuItem(
child: Text(translate('ID Server')), child: Text(translate('ID/Relay Server')),
value: "server", value: "server",
), ),
PopupMenuItem( PopupMenuItem(

View File

@ -25,7 +25,7 @@ class SettingsPage extends StatelessWidget implements PageShape {
title: Text("Common"), title: Text("Common"),
tiles: [ tiles: [
SettingsTile.navigation( SettingsTile.navigation(
title: Text(translate('ID Server')), title: Text(translate('ID/Relay Server')),
leading: Icon(Icons.cloud), leading: Icon(Icons.cloud),
onPressed: (context) { onPressed: (context) {
showServer(); showServer();
@ -71,10 +71,12 @@ void showServer() {
var key = ''; var key = '';
DialogManager.show((setState, close) { DialogManager.show((setState, close) {
return CustomAlertDialog( return CustomAlertDialog(
title: Text(translate('ID Server')), title: Text(translate('ID/Relay Server')),
content: Form( content: Form(
key: formKey, key: formKey,
child: Column(mainAxisSize: MainAxisSize.min, children: <Widget>[ child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
TextFormField( TextFormField(
initialValue: id0, initialValue: id0,
decoration: InputDecoration( decoration: InputDecoration(
@ -84,19 +86,23 @@ void showServer() {
onSaved: (String? value) { onSaved: (String? value) {
if (value != null) id = value.trim(); if (value != null) id = value.trim();
}, },
), )
/* ] +
(isAndroid
? [
TextFormField( TextFormField(
initialValue: relay0, initialValue: relay0,
decoration: InputDecoration( decoration: InputDecoration(
labelText: translate('Relay Server'), labelText: translate('Relay Server'),
), ),
validator: validate, validator: validate,
onSaved: (String value) { onSaved: (String? value) {
relay = value.trim(); if (value != null) relay = value.trim();
}, },
), )
*/ ]
: []) +
[
TextFormField( TextFormField(
initialValue: key0, initialValue: key0,
decoration: InputDecoration( decoration: InputDecoration(