only show login for customized self host
This commit is contained in:
parent
cabb39005b
commit
51ad81e48f
@ -40,7 +40,7 @@ class App extends StatelessWidget {
|
||||
primarySwatch: Colors.blue,
|
||||
visualDensity: VisualDensity.adaptivePlatformDensity,
|
||||
),
|
||||
home: isWeb ? WebHomePage() : HomePage(),
|
||||
home: !isAndroid ? WebHomePage() : HomePage(),
|
||||
navigatorObservers: [
|
||||
FirebaseAnalyticsObserver(analytics: analytics),
|
||||
],
|
||||
|
@ -8,6 +8,7 @@ import '../models/model.dart';
|
||||
import 'home_page.dart';
|
||||
import 'remote_page.dart';
|
||||
import 'settings_page.dart';
|
||||
import 'scan_page.dart';
|
||||
|
||||
class ConnectionPage extends StatefulWidget implements PageShape {
|
||||
ConnectionPage({Key? key}) : super(key: key);
|
||||
@ -287,22 +288,36 @@ class _WebMenuState extends State<WebMenu> {
|
||||
return PopupMenuButton<String>(
|
||||
icon: Icon(Icons.more_vert),
|
||||
itemBuilder: (context) {
|
||||
return [
|
||||
PopupMenuItem(
|
||||
child: Text(translate('ID/Relay Server')),
|
||||
value: "server",
|
||||
),
|
||||
PopupMenuItem(
|
||||
child: Text(username == null
|
||||
? translate("Login")
|
||||
: translate("Logout") + ' ($username)'),
|
||||
value: "login",
|
||||
),
|
||||
PopupMenuItem(
|
||||
child: Text(translate('About') + ' RustDesk'),
|
||||
value: "about",
|
||||
)
|
||||
];
|
||||
return (isIOS
|
||||
? [
|
||||
PopupMenuItem(
|
||||
child: Icon(Icons.qr_code_scanner, color: Colors.black),
|
||||
value: "scan",
|
||||
)
|
||||
]
|
||||
: <PopupMenuItem<String>>[]) +
|
||||
[
|
||||
PopupMenuItem(
|
||||
child: Text(translate('ID/Relay Server')),
|
||||
value: "server",
|
||||
)
|
||||
] +
|
||||
(getUrl().contains('admin.rustdesk.com')
|
||||
? <PopupMenuItem<String>>[]
|
||||
: [
|
||||
PopupMenuItem(
|
||||
child: Text(username == null
|
||||
? translate("Login")
|
||||
: translate("Logout") + ' ($username)'),
|
||||
value: "login",
|
||||
)
|
||||
]) +
|
||||
[
|
||||
PopupMenuItem(
|
||||
child: Text(translate('About') + ' RustDesk'),
|
||||
value: "about",
|
||||
)
|
||||
];
|
||||
},
|
||||
onSelected: (value) {
|
||||
if (value == 'server') {
|
||||
@ -318,6 +333,14 @@ class _WebMenuState extends State<WebMenu> {
|
||||
logout();
|
||||
}
|
||||
}
|
||||
if (value == 'scan') {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (BuildContext context) => ScanPage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -234,6 +234,7 @@ void showServerSettingsWithValue(
|
||||
if (api != api0)
|
||||
FFI.setByName(
|
||||
'option', '{"name": "api-server", "value": "$api"}');
|
||||
FFI.ffiModel.updateUser();
|
||||
close();
|
||||
}
|
||||
},
|
||||
|
2
web/assets/firebase-analytics.js
Normal file
2
web/assets/firebase-analytics.js
Normal file
File diff suppressed because one or more lines are too long
2
web/assets/firebase-app.js
Normal file
2
web/assets/firebase-app.js
Normal file
File diff suppressed because one or more lines are too long
@ -154,8 +154,8 @@
|
||||
loadMainDartJs();
|
||||
}
|
||||
</script>
|
||||
<script src="https://www.gstatic.com/firebasejs/8.10.1/firebase-app.js"></script>
|
||||
<script src="https://www.gstatic.com/firebasejs/8.10.1/firebase-analytics.js"></script>
|
||||
<script src="assets/firebase-app.js?8.10.1"></script>
|
||||
<script src="assets/firebase-analytics.js?8.10.1"></script>
|
||||
|
||||
<script>
|
||||
// Your web app's Firebase configuration
|
||||
|
Loading…
x
Reference in New Issue
Block a user