add selinux tip

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2023-10-21 23:24:54 +08:00
parent 2408758360
commit f531cd23ee
43 changed files with 216 additions and 62 deletions

View File

@@ -37,7 +37,6 @@ class _ConnectionPageState extends State<ConnectionPage>
Timer? _updateTimer;
final RxBool _idInputFocused = false.obs;
final FocusNode _idFocusNode = FocusNode();
var svcStopped = Get.find<RxBool>(tag: 'stop-service');
var svcIsUsingPublicServer = true.obs;
@@ -334,8 +333,10 @@ class _ConnectionPageState extends State<ConnectionPage>
optionsViewBuilder: (BuildContext context, AutocompleteOnSelected<Peer> onSelected, Iterable<Peer> options) {
double maxHeight = 0;
for (var peer in options) {
if (maxHeight < 200)
maxHeight += 50; };
if (maxHeight < 200) {
maxHeight += 50;
}
}
return Align(
alignment: Alignment.topLeft,
child: ClipRRect(

View File

@@ -378,16 +378,36 @@ class _DesktopHomePageState extends State<DesktopHomePage>
// });
// }
} else if (Platform.isLinux) {
final LinuxCards = <Widget>[];
if (bind.mainCurrentIsWayland()) {
return buildInstallCard(
LinuxCards.add(buildInstallCard(
"Warning", "wayland_experiment_tip", "", () async {},
help: 'Help',
link: 'https://rustdesk.com/docs/en/manual/linux/#x11-required');
link: 'https://rustdesk.com/docs/en/manual/linux/#x11-required'));
} else if (bind.mainIsLoginWayland()) {
return buildInstallCard("Warning",
LinuxCards.add(buildInstallCard("Warning",
"Login screen using Wayland is not supported", "", () async {},
help: 'Help',
link: 'https://rustdesk.com/docs/en/manual/linux/#login-screen');
link: 'https://rustdesk.com/docs/en/manual/linux/#login-screen'));
}
if (bind.isSelinuxEnabled()) {
final keyShowSelinuxHelpTip = "show-selinux-help-tip";
if (bind.mainGetLocalOption(key: keyShowSelinuxHelpTip) != 'N') {
LinuxCards.add(buildInstallCard(
"Warning", "selinux_tip", "", () async {},
marginTop: LinuxCards.isEmpty ? 20.0 : 5.0,
help: 'Help',
link:
'https://rustdesk.com/docs/en/client/linux/#permissions-issue',
closeButton: true,
closeOption: keyShowSelinuxHelpTip,
));
}
}
if (LinuxCards.isNotEmpty) {
return Column(
children: LinuxCards,
);
}
}
return Container();
@@ -395,17 +415,26 @@ class _DesktopHomePageState extends State<DesktopHomePage>
Widget buildInstallCard(String title, String content, String btnText,
GestureTapCallback onPressed,
{String? help, String? link, bool? closeButton}) {
void closeCard() {
setState(() {
isCardClosed = true;
});
{double marginTop = 20.0, String? help, String? link, bool? closeButton, String? closeOption}) {
void closeCard() async {
if (closeOption != null) {
await bind.mainSetLocalOption(key: closeOption, value: 'N');
if (bind.mainGetLocalOption(key: closeOption) == 'N') {
setState(() {
isCardClosed = true;
});
}
} else {
setState(() {
isCardClosed = true;
});
}
}
return Stack(
children: [
Container(
margin: EdgeInsets.only(top: 20),
margin: EdgeInsets.only(top: marginTop),
child: Container(
decoration: BoxDecoration(
gradient: LinearGradient(