mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
manage network state for both user info and user group
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
@@ -10,12 +10,13 @@ import 'package:http/http.dart' as http;
|
||||
import '../common.dart';
|
||||
|
||||
class AbModel {
|
||||
var abLoading = false.obs;
|
||||
var abError = "".obs;
|
||||
var tags = [].obs;
|
||||
var peers = List<Peer>.empty(growable: true).obs;
|
||||
final abLoading = false.obs;
|
||||
final abError = "".obs;
|
||||
final tags = [].obs;
|
||||
final RxBool fromServer = false.obs;
|
||||
final peers = List<Peer>.empty(growable: true).obs;
|
||||
|
||||
var selectedTags = List<String>.empty(growable: true).obs;
|
||||
final selectedTags = List<String>.empty(growable: true).obs;
|
||||
|
||||
WeakReference<FFI> parent;
|
||||
|
||||
@@ -49,8 +50,10 @@ class AbModel {
|
||||
}
|
||||
}
|
||||
}
|
||||
fromServer.value = true;
|
||||
return resp.body;
|
||||
} else {
|
||||
fromServer.value = true;
|
||||
return "";
|
||||
}
|
||||
} catch (err) {
|
||||
|
||||
@@ -6,6 +6,8 @@ import 'package:get/get.dart';
|
||||
|
||||
import '../consts.dart';
|
||||
|
||||
enum SvcStatus { notReady, connecting, ready }
|
||||
|
||||
class StateGlobal {
|
||||
int _windowId = -1;
|
||||
bool _fullscreen = false;
|
||||
@@ -16,6 +18,7 @@ class StateGlobal {
|
||||
final RxDouble _windowBorderWidth = RxDouble(kWindowBorderWidth);
|
||||
final RxBool showRemoteToolBar = false.obs;
|
||||
final RxInt displaysCount = 0.obs;
|
||||
final svcStatus = SvcStatus.notReady.obs;
|
||||
|
||||
// Use for desktop -> remote toolbar -> resolution
|
||||
final Map<String, Map<int, String?>> _lastResolutionGroupValues = {};
|
||||
|
||||
@@ -14,7 +14,6 @@ import 'platform_model.dart';
|
||||
class UserModel {
|
||||
final RxString userName = ''.obs;
|
||||
final RxBool isAdmin = false.obs;
|
||||
final RxBool fromServer = false.obs;
|
||||
WeakReference<FFI> parent;
|
||||
|
||||
UserModel(this.parent);
|
||||
@@ -85,7 +84,6 @@ class UserModel {
|
||||
_parseAndUpdateUser(UserPayload user) {
|
||||
userName.value = user.name;
|
||||
isAdmin.value = user.isAdmin;
|
||||
fromServer.value = true;
|
||||
}
|
||||
|
||||
Future<void> _updateOtherModels() async {
|
||||
|
||||
Reference in New Issue
Block a user