mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-09 00:21:28 +03:00
web menu
This commit is contained in:
@@ -7,6 +7,7 @@ import '../common.dart';
|
||||
import '../models/model.dart';
|
||||
import 'home_page.dart';
|
||||
import 'remote_page.dart';
|
||||
import 'settings_page.dart';
|
||||
|
||||
class ConnectionPage extends StatefulWidget implements PageShape {
|
||||
ConnectionPage({Key? key}) : super(key: key);
|
||||
@@ -18,7 +19,29 @@ class ConnectionPage extends StatefulWidget implements PageShape {
|
||||
final title = translate("Connection");
|
||||
|
||||
@override
|
||||
final appBarActions = [];
|
||||
final appBarActions = isWeb
|
||||
? <Widget>[
|
||||
PopupMenuButton<String>(itemBuilder: (context) {
|
||||
return [
|
||||
PopupMenuItem(
|
||||
child: Text(translate('ID Server')),
|
||||
value: "server",
|
||||
),
|
||||
PopupMenuItem(
|
||||
child: Text(translate('About') + ' RustDesk'),
|
||||
value: "about",
|
||||
)
|
||||
];
|
||||
}, onSelected: (value) {
|
||||
if (value == 'server') {
|
||||
showServer();
|
||||
}
|
||||
if (value == 'about') {
|
||||
showAbout();
|
||||
}
|
||||
}),
|
||||
]
|
||||
: [];
|
||||
|
||||
@override
|
||||
_ConnectionPageState createState() => _ConnectionPageState();
|
||||
|
||||
@@ -147,3 +147,40 @@ String? validate(value) {
|
||||
final res = FFI.getByName('test_if_valid_server', value);
|
||||
return res.isEmpty ? null : res;
|
||||
}
|
||||
|
||||
void showAbout() {
|
||||
DialogManager.show((setState, close) {
|
||||
return CustomAlertDialog(
|
||||
title: Text(translate('About') + ' RustDesk'),
|
||||
content: Wrap(direction: Axis.vertical, spacing: 12, children: [
|
||||
Text('Version: $version'),
|
||||
InkWell(
|
||||
onTap: () async {
|
||||
const url = 'https://rustdesk.com/';
|
||||
if (await canLaunch(url)) {
|
||||
await launch(url);
|
||||
}
|
||||
},
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 8),
|
||||
child: Text('Support',
|
||||
style: TextStyle(
|
||||
decoration: TextDecoration.underline,
|
||||
)),
|
||||
)),
|
||||
]),
|
||||
actions: [
|
||||
TextButton(
|
||||
style: flatButtonStyle,
|
||||
onPressed: () {
|
||||
close();
|
||||
},
|
||||
child: Text(translate('OK')),
|
||||
)
|
||||
],
|
||||
onWillPop: () async {
|
||||
return true;
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user