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,
|
primarySwatch: Colors.blue,
|
||||||
visualDensity: VisualDensity.adaptivePlatformDensity,
|
visualDensity: VisualDensity.adaptivePlatformDensity,
|
||||||
),
|
),
|
||||||
home: isWeb ? WebHomePage() : HomePage(),
|
home: !isAndroid ? WebHomePage() : HomePage(),
|
||||||
navigatorObservers: [
|
navigatorObservers: [
|
||||||
FirebaseAnalyticsObserver(analytics: analytics),
|
FirebaseAnalyticsObserver(analytics: analytics),
|
||||||
],
|
],
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import '../models/model.dart';
|
|||||||
import 'home_page.dart';
|
import 'home_page.dart';
|
||||||
import 'remote_page.dart';
|
import 'remote_page.dart';
|
||||||
import 'settings_page.dart';
|
import 'settings_page.dart';
|
||||||
|
import 'scan_page.dart';
|
||||||
|
|
||||||
class ConnectionPage extends StatefulWidget implements PageShape {
|
class ConnectionPage extends StatefulWidget implements PageShape {
|
||||||
ConnectionPage({Key? key}) : super(key: key);
|
ConnectionPage({Key? key}) : super(key: key);
|
||||||
@ -287,22 +288,36 @@ class _WebMenuState extends State<WebMenu> {
|
|||||||
return PopupMenuButton<String>(
|
return PopupMenuButton<String>(
|
||||||
icon: Icon(Icons.more_vert),
|
icon: Icon(Icons.more_vert),
|
||||||
itemBuilder: (context) {
|
itemBuilder: (context) {
|
||||||
return [
|
return (isIOS
|
||||||
PopupMenuItem(
|
? [
|
||||||
child: Text(translate('ID/Relay Server')),
|
PopupMenuItem(
|
||||||
value: "server",
|
child: Icon(Icons.qr_code_scanner, color: Colors.black),
|
||||||
),
|
value: "scan",
|
||||||
PopupMenuItem(
|
)
|
||||||
child: Text(username == null
|
]
|
||||||
? translate("Login")
|
: <PopupMenuItem<String>>[]) +
|
||||||
: translate("Logout") + ' ($username)'),
|
[
|
||||||
value: "login",
|
PopupMenuItem(
|
||||||
),
|
child: Text(translate('ID/Relay Server')),
|
||||||
PopupMenuItem(
|
value: "server",
|
||||||
child: Text(translate('About') + ' RustDesk'),
|
)
|
||||||
value: "about",
|
] +
|
||||||
)
|
(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) {
|
onSelected: (value) {
|
||||||
if (value == 'server') {
|
if (value == 'server') {
|
||||||
@ -318,6 +333,14 @@ class _WebMenuState extends State<WebMenu> {
|
|||||||
logout();
|
logout();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (value == 'scan') {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (BuildContext context) => ScanPage(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -234,6 +234,7 @@ void showServerSettingsWithValue(
|
|||||||
if (api != api0)
|
if (api != api0)
|
||||||
FFI.setByName(
|
FFI.setByName(
|
||||||
'option', '{"name": "api-server", "value": "$api"}');
|
'option', '{"name": "api-server", "value": "$api"}');
|
||||||
|
FFI.ffiModel.updateUser();
|
||||||
close();
|
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();
|
loadMainDartJs();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<script src="https://www.gstatic.com/firebasejs/8.10.1/firebase-app.js"></script>
|
<script src="assets/firebase-app.js?8.10.1"></script>
|
||||||
<script src="https://www.gstatic.com/firebasejs/8.10.1/firebase-analytics.js"></script>
|
<script src="assets/firebase-analytics.js?8.10.1"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// Your web app's Firebase configuration
|
// Your web app's Firebase configuration
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user