ios show login/logout
Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
parent
0c77d6d918
commit
c9423509a9
@ -211,25 +211,6 @@ class WebMenu extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _WebMenuState extends State<WebMenu> {
|
class _WebMenuState extends State<WebMenu> {
|
||||||
String url = "";
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
() async {
|
|
||||||
final urlRes = await bind.mainGetApiServer();
|
|
||||||
var update = false;
|
|
||||||
if (urlRes != url) {
|
|
||||||
url = urlRes;
|
|
||||||
update = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (update) {
|
|
||||||
setState(() {});
|
|
||||||
}
|
|
||||||
}();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
Provider.of<FfiModel>(context);
|
Provider.of<FfiModel>(context);
|
||||||
@ -251,16 +232,14 @@ class _WebMenuState extends State<WebMenu> {
|
|||||||
child: Text(translate('ID/Relay Server')),
|
child: Text(translate('ID/Relay Server')),
|
||||||
)
|
)
|
||||||
] +
|
] +
|
||||||
(url.contains('admin.rustdesk.com')
|
[
|
||||||
? <PopupMenuItem<String>>[]
|
|
||||||
: [
|
|
||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
value: "login",
|
value: "login",
|
||||||
child: Text(gFFI.userModel.userName.value.isEmpty
|
child: Text(gFFI.userModel.userName.value.isEmpty
|
||||||
? translate("Login")
|
? translate("Login")
|
||||||
: '${translate("Logout")} (${gFFI.userModel.userName.value})'),
|
: '${translate("Logout")} (${gFFI.userModel.userName.value})'),
|
||||||
)
|
)
|
||||||
]) +
|
] +
|
||||||
[
|
[
|
||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
value: "about",
|
value: "about",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user