mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
commit
fb02334b46
@ -1078,25 +1078,32 @@ Color str2color(String str, [alpha = 0xFF]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Color str2color2(String str, [alpha = 0xFF]) {
|
Color str2color2(String str, [alpha = 0xFF]) {
|
||||||
List<Color> colorList = [
|
Map<String, Color> colorMap = {
|
||||||
Colors.red,
|
"red": Colors.red,
|
||||||
Colors.green,
|
"green": Colors.green,
|
||||||
Colors.blue,
|
"blue": Colors.blue,
|
||||||
Colors.orange,
|
"orange": Colors.orange,
|
||||||
Colors.yellow,
|
"purple": Colors.purple,
|
||||||
Colors.purple,
|
"grey": Colors.grey,
|
||||||
Colors.grey,
|
"cyan": Colors.cyan,
|
||||||
Colors.cyan,
|
"lime": Colors.lime,
|
||||||
Colors.lime,
|
"teal": Colors.teal,
|
||||||
Colors.teal,
|
"pink": Colors.pink[200]!,
|
||||||
Colors.pink,
|
"indigo": Colors.indigo,
|
||||||
Colors.indigo,
|
"brown": Colors.brown,
|
||||||
Colors.brown,
|
};
|
||||||
];
|
final color = colorMap[str.toLowerCase()];
|
||||||
|
if (color != null) {
|
||||||
|
return color.withAlpha(alpha);
|
||||||
|
}
|
||||||
|
if (str.toLowerCase() == 'yellow') {
|
||||||
|
return Colors.yellow.withAlpha(alpha);
|
||||||
|
}
|
||||||
var hash = 0;
|
var hash = 0;
|
||||||
for (var i = 0; i < str.length; i++) {
|
for (var i = 0; i < str.length; i++) {
|
||||||
hash += str.codeUnitAt(i);
|
hash += str.codeUnitAt(i);
|
||||||
}
|
}
|
||||||
|
List<Color> colorList = colorMap.values.toList();
|
||||||
hash = hash % colorList.length;
|
hash = hash % colorList.length;
|
||||||
return colorList[hash].withAlpha(alpha);
|
return colorList[hash].withAlpha(alpha);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -45,12 +45,17 @@ class _AddressBookState extends State<AddressBook> {
|
|||||||
child: CircularProgressIndicator(),
|
child: CircularProgressIndicator(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (gFFI.abModel.abError.isNotEmpty) {
|
|
||||||
return _buildShowError(gFFI.abModel.abError.value);
|
|
||||||
}
|
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
_buildLoadingHavingPeers(),
|
_buildNotEmptyLoading(),
|
||||||
|
_buildErrorBanner(
|
||||||
|
err: gFFI.abModel.pullError,
|
||||||
|
retry: null,
|
||||||
|
close: () => gFFI.abModel.pullError.value = ''),
|
||||||
|
_buildErrorBanner(
|
||||||
|
err: gFFI.abModel.pushError,
|
||||||
|
retry: () => gFFI.abModel.pushAb(),
|
||||||
|
close: () => gFFI.abModel.pushError.value = ''),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: isDesktop
|
child: isDesktop
|
||||||
? _buildAddressBookDesktop()
|
? _buildAddressBookDesktop()
|
||||||
@ -60,22 +65,62 @@ class _AddressBookState extends State<AddressBook> {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Widget _buildShowError(String error) {
|
Widget _buildErrorBanner(
|
||||||
return Center(
|
{required RxString err,
|
||||||
child: Column(
|
required Function? retry,
|
||||||
|
required Function close}) {
|
||||||
|
const double height = 25;
|
||||||
|
return Obx(() => Offstage(
|
||||||
|
offstage: !(!gFFI.abModel.abLoading.value && err.value.isNotEmpty),
|
||||||
|
child: Center(
|
||||||
|
child: Container(
|
||||||
|
height: height,
|
||||||
|
color: Color.fromARGB(255, 253, 238, 235),
|
||||||
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Text(translate(error)),
|
FittedBox(
|
||||||
TextButton(
|
child: Icon(
|
||||||
onPressed: () {
|
Icons.info,
|
||||||
gFFI.abModel.pullAb();
|
color: Color.fromARGB(255, 249, 81, 81),
|
||||||
|
),
|
||||||
|
).marginAll(4),
|
||||||
|
Flexible(
|
||||||
|
child: Align(
|
||||||
|
alignment: Alignment.centerLeft,
|
||||||
|
child: Tooltip(
|
||||||
|
message: translate(err.value),
|
||||||
|
child: Text(
|
||||||
|
translate(err.value),
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
|
)).marginSymmetric(vertical: 2),
|
||||||
|
),
|
||||||
|
if (retry != null)
|
||||||
|
InkWell(
|
||||||
|
onTap: () {
|
||||||
|
retry.call();
|
||||||
},
|
},
|
||||||
child: Text(translate("Retry")))
|
child: Text(
|
||||||
|
translate("Retry"),
|
||||||
|
style: TextStyle(color: MyTheme.accent),
|
||||||
|
)).marginSymmetric(horizontal: 5),
|
||||||
|
FittedBox(
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () {
|
||||||
|
close.call();
|
||||||
|
},
|
||||||
|
child: Icon(Icons.close).marginSymmetric(horizontal: 5),
|
||||||
|
),
|
||||||
|
).marginAll(4)
|
||||||
],
|
],
|
||||||
|
),
|
||||||
|
)).marginOnly(bottom: 14),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildLoadingHavingPeers() {
|
Widget _buildNotEmptyLoading() {
|
||||||
double size = 15;
|
double size = 15;
|
||||||
return Obx(() => Offstage(
|
return Obx(() => Offstage(
|
||||||
offstage: !(gFFI.abModel.abLoading.value && !gFFI.abModel.emtpy),
|
offstage: !(gFFI.abModel.abLoading.value && !gFFI.abModel.emtpy),
|
||||||
@ -301,6 +346,7 @@ class _AddressBookState extends State<AddressBook> {
|
|||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double marginBottom = 4;
|
||||||
return CustomAlertDialog(
|
return CustomAlertDialog(
|
||||||
title: Text(translate("Add ID")),
|
title: Text(translate("Add ID")),
|
||||||
content: Column(
|
content: Column(
|
||||||
@ -322,7 +368,7 @@ class _AddressBookState extends State<AddressBook> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
).marginOnly(bottom: marginBottom),
|
||||||
TextField(
|
TextField(
|
||||||
controller: idController,
|
controller: idController,
|
||||||
inputFormatters: [IDTextInputFormatter()],
|
inputFormatters: [IDTextInputFormatter()],
|
||||||
@ -334,7 +380,7 @@ class _AddressBookState extends State<AddressBook> {
|
|||||||
translate('Alias'),
|
translate('Alias'),
|
||||||
style: style,
|
style: style,
|
||||||
),
|
),
|
||||||
).marginOnly(top: 8, bottom: 2),
|
).marginOnly(top: 8, bottom: marginBottom),
|
||||||
TextField(
|
TextField(
|
||||||
controller: aliasController,
|
controller: aliasController,
|
||||||
),
|
),
|
||||||
@ -344,8 +390,9 @@ class _AddressBookState extends State<AddressBook> {
|
|||||||
translate('Tags'),
|
translate('Tags'),
|
||||||
style: style,
|
style: style,
|
||||||
),
|
),
|
||||||
).marginOnly(top: 8),
|
).marginOnly(top: 8, bottom: marginBottom),
|
||||||
Container(
|
Align(
|
||||||
|
alignment: Alignment.centerLeft,
|
||||||
child: Wrap(
|
child: Wrap(
|
||||||
children: tags
|
children: tags
|
||||||
.map((e) => AddressBookTag(
|
.map((e) => AddressBookTag(
|
||||||
|
|||||||
@ -159,7 +159,6 @@ class _PeerCardState extends State<_PeerCard>
|
|||||||
final greyStyle = TextStyle(
|
final greyStyle = TextStyle(
|
||||||
fontSize: 11,
|
fontSize: 11,
|
||||||
color: Theme.of(context).textTheme.titleLarge?.color?.withOpacity(0.6));
|
color: Theme.of(context).textTheme.titleLarge?.color?.withOpacity(0.6));
|
||||||
final alias = bind.mainGetPeerOptionSync(id: peer.id, key: 'alias');
|
|
||||||
final child = Obx(
|
final child = Obx(
|
||||||
() => Container(
|
() => Container(
|
||||||
foregroundDecoration: deco.value,
|
foregroundDecoration: deco.value,
|
||||||
@ -196,7 +195,9 @@ class _PeerCardState extends State<_PeerCard>
|
|||||||
getOnline(8, peer.online),
|
getOnline(8, peer.online),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
alias.isEmpty ? formatID(peer.id) : alias,
|
peer.alias.isEmpty
|
||||||
|
? formatID(peer.id)
|
||||||
|
: peer.alias,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: Theme.of(context).textTheme.titleSmall,
|
style: Theme.of(context).textTheme.titleSmall,
|
||||||
)),
|
)),
|
||||||
@ -229,6 +230,7 @@ class _PeerCardState extends State<_PeerCard>
|
|||||||
: '',
|
: '',
|
||||||
child: Stack(children: [
|
child: Stack(children: [
|
||||||
child,
|
child,
|
||||||
|
if (colors.isNotEmpty)
|
||||||
Positioned(
|
Positioned(
|
||||||
top: 2,
|
top: 2,
|
||||||
right: 10,
|
right: 10,
|
||||||
@ -329,6 +331,7 @@ class _PeerCardState extends State<_PeerCard>
|
|||||||
: '',
|
: '',
|
||||||
child: Stack(children: [
|
child: Stack(children: [
|
||||||
child,
|
child,
|
||||||
|
if (colors.isNotEmpty)
|
||||||
Positioned(
|
Positioned(
|
||||||
top: 4,
|
top: 4,
|
||||||
right: 12,
|
right: 12,
|
||||||
@ -649,9 +652,14 @@ abstract class BasePeerCard extends StatelessWidget {
|
|||||||
oldName: oldName,
|
oldName: oldName,
|
||||||
onSubmit: (String newName) async {
|
onSubmit: (String newName) async {
|
||||||
if (newName != oldName) {
|
if (newName != oldName) {
|
||||||
|
if (tab == PeerTabIndex.ab) {
|
||||||
|
gFFI.abModel.changeAlias(id: id, alias: newName);
|
||||||
|
gFFI.abModel.pushAb();
|
||||||
|
} else {
|
||||||
await bind.mainSetPeerAlias(id: id, alias: newName);
|
await bind.mainSetPeerAlias(id: id, alias: newName);
|
||||||
_update();
|
_update();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
padding: menuPadding,
|
padding: menuPadding,
|
||||||
@ -1048,6 +1056,11 @@ class AddressBookPeerCard extends BasePeerCard {
|
|||||||
dismissOnClicked: true,
|
dismissOnClicked: true,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@protected
|
||||||
|
@override
|
||||||
|
Future<String> _getAlias(String id) async =>
|
||||||
|
gFFI.abModel.find(id)?.alias ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
class MyGroupPeerCard extends BasePeerCard {
|
class MyGroupPeerCard extends BasePeerCard {
|
||||||
|
|||||||
@ -125,6 +125,7 @@ void runMainApp(bool startService) async {
|
|||||||
bind.pluginSyncUi(syncTo: kAppTypeMain);
|
bind.pluginSyncUi(syncTo: kAppTypeMain);
|
||||||
bind.pluginListReload();
|
bind.pluginListReload();
|
||||||
}
|
}
|
||||||
|
gFFI.abModel.loadCache();
|
||||||
gFFI.userModel.refreshCurrentUser();
|
gFFI.userModel.refreshCurrentUser();
|
||||||
runApp(App());
|
runApp(App());
|
||||||
// Set window option.
|
// Set window option.
|
||||||
@ -152,6 +153,7 @@ void runMobileApp() async {
|
|||||||
await initEnv(kAppTypeMain);
|
await initEnv(kAppTypeMain);
|
||||||
if (isAndroid) androidChannelInit();
|
if (isAndroid) androidChannelInit();
|
||||||
platformFFI.syncAndroidServiceAppDirConfigPath();
|
platformFFI.syncAndroidServiceAppDirConfigPath();
|
||||||
|
gFFI.abModel.loadCache();
|
||||||
gFFI.userModel.refreshCurrentUser();
|
gFFI.userModel.refreshCurrentUser();
|
||||||
runApp(App());
|
runApp(App());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import 'dart:io';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_hbb/models/model.dart';
|
import 'package:flutter_hbb/models/model.dart';
|
||||||
import 'package:flutter_hbb/models/peer_model.dart';
|
import 'package:flutter_hbb/models/peer_model.dart';
|
||||||
|
import 'package:flutter_hbb/models/peer_tab_model.dart';
|
||||||
import 'package:flutter_hbb/models/platform_model.dart';
|
import 'package:flutter_hbb/models/platform_model.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:bot_toast/bot_toast.dart';
|
import 'package:bot_toast/bot_toast.dart';
|
||||||
@ -24,7 +25,8 @@ bool shouldSortTags() {
|
|||||||
|
|
||||||
class AbModel {
|
class AbModel {
|
||||||
final abLoading = false.obs;
|
final abLoading = false.obs;
|
||||||
final abError = "".obs;
|
final pullError = "".obs;
|
||||||
|
final pushError = "".obs;
|
||||||
final tags = [].obs;
|
final tags = [].obs;
|
||||||
final peers = List<Peer>.empty(growable: true).obs;
|
final peers = List<Peer>.empty(growable: true).obs;
|
||||||
final sortTags = shouldSortTags().obs;
|
final sortTags = shouldSortTags().obs;
|
||||||
@ -33,8 +35,10 @@ class AbModel {
|
|||||||
final selectedTags = List<String>.empty(growable: true).obs;
|
final selectedTags = List<String>.empty(growable: true).obs;
|
||||||
var initialized = false;
|
var initialized = false;
|
||||||
var licensedDevices = 0;
|
var licensedDevices = 0;
|
||||||
var sync_all_from_recent = true;
|
var _syncAllFromRecent = true;
|
||||||
|
var _syncFromRecentLock = false;
|
||||||
var _timerCounter = 0;
|
var _timerCounter = 0;
|
||||||
|
var _cacheLoadOnceFlag = false;
|
||||||
|
|
||||||
WeakReference<FFI> parent;
|
WeakReference<FFI> parent;
|
||||||
|
|
||||||
@ -51,12 +55,15 @@ class AbModel {
|
|||||||
if (gFFI.userModel.userName.isEmpty) return;
|
if (gFFI.userModel.userName.isEmpty) return;
|
||||||
if (abLoading.value) return;
|
if (abLoading.value) return;
|
||||||
if (!force && initialized) return;
|
if (!force && initialized) return;
|
||||||
if (!initialized) {
|
if (pushError.isNotEmpty) {
|
||||||
await _loadCache();
|
try {
|
||||||
|
// push to retry
|
||||||
|
pushAb(toast: false);
|
||||||
|
} catch (_) {}
|
||||||
}
|
}
|
||||||
if (!quiet) {
|
if (!quiet) {
|
||||||
abLoading.value = true;
|
abLoading.value = true;
|
||||||
abError.value = "";
|
pullError.value = "";
|
||||||
}
|
}
|
||||||
final api = "${await bind.mainGetApiServer()}/api/ab";
|
final api = "${await bind.mainGetApiServer()}/api/ab";
|
||||||
int? statusCode;
|
int? statusCode;
|
||||||
@ -66,19 +73,22 @@ class AbModel {
|
|||||||
authHeaders['Accept-Encoding'] = "gzip";
|
authHeaders['Accept-Encoding'] = "gzip";
|
||||||
final resp = await http.get(Uri.parse(api), headers: authHeaders);
|
final resp = await http.get(Uri.parse(api), headers: authHeaders);
|
||||||
statusCode = resp.statusCode;
|
statusCode = resp.statusCode;
|
||||||
if (resp.body.isNotEmpty && resp.body.toLowerCase() != "null") {
|
if (resp.body.toLowerCase() == "null") {
|
||||||
|
// normal reply, emtpy ab return null
|
||||||
|
tags.clear();
|
||||||
|
peers.clear();
|
||||||
|
} else if (resp.body.isNotEmpty) {
|
||||||
Map<String, dynamic> json;
|
Map<String, dynamic> json;
|
||||||
try {
|
try {
|
||||||
json = jsonDecode(utf8.decode(resp.bodyBytes));
|
json = jsonDecode(utf8.decode(resp.bodyBytes));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (resp.statusCode != 200) {
|
if (resp.statusCode != 200) {
|
||||||
BotToast.showText(
|
throw 'HTTP ${resp.statusCode}, $e';
|
||||||
contentColor: Colors.red, text: 'HTTP ${resp.statusCode}');
|
|
||||||
}
|
}
|
||||||
rethrow;
|
rethrow;
|
||||||
}
|
}
|
||||||
if (json.containsKey('error')) {
|
if (json.containsKey('error')) {
|
||||||
abError.value = json['error'];
|
throw json['error'];
|
||||||
} else if (json.containsKey('data')) {
|
} else if (json.containsKey('data')) {
|
||||||
try {
|
try {
|
||||||
gFFI.abModel.licensedDevices = json['licensed_devices'];
|
gFFI.abModel.licensedDevices = json['licensed_devices'];
|
||||||
@ -101,7 +111,13 @@ class AbModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
abError.value = err.toString();
|
if (!quiet) {
|
||||||
|
pullError.value =
|
||||||
|
'${translate('pull_ab_failed_tip')}: ${translate(err.toString())}';
|
||||||
|
if (gFFI.peerTabModel.currentTab != PeerTabIndex.ab.index) {
|
||||||
|
BotToast.showText(contentColor: Colors.red, text: pullError.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
if (initialized) {
|
if (initialized) {
|
||||||
// make loading effect obvious
|
// make loading effect obvious
|
||||||
@ -112,26 +128,16 @@ class AbModel {
|
|||||||
abLoading.value = false;
|
abLoading.value = false;
|
||||||
}
|
}
|
||||||
initialized = true;
|
initialized = true;
|
||||||
sync_all_from_recent = true;
|
_syncAllFromRecent = true;
|
||||||
_timerCounter = 0;
|
_timerCounter = 0;
|
||||||
if (abError.isNotEmpty) {
|
if (pullError.isNotEmpty) {
|
||||||
if (statusCode == 401) {
|
if (statusCode == 401) {
|
||||||
gFFI.userModel.reset(clearAbCache: true);
|
gFFI.userModel.reset(clearAbCache: true);
|
||||||
} else {
|
|
||||||
reset(clearCache: false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> reset({bool clearCache = false}) async {
|
|
||||||
await bind.mainSetLocalOption(key: "selected-tags", value: '');
|
|
||||||
tags.clear();
|
|
||||||
peers.clear();
|
|
||||||
initialized = false;
|
|
||||||
if (clearCache) await bind.mainClearAb();
|
|
||||||
}
|
|
||||||
|
|
||||||
void addId(String id, String alias, List<dynamic> tags) {
|
void addId(String id, String alias, List<dynamic> tags) {
|
||||||
if (idContainBy(id)) {
|
if (idContainBy(id)) {
|
||||||
return;
|
return;
|
||||||
@ -154,9 +160,13 @@ class AbModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void addPeer(Peer peer) {
|
void addPeer(Peer peer) {
|
||||||
peers.removeWhere((e) => e.id == peer.id);
|
final index = peers.indexWhere((e) => e.id == peer.id);
|
||||||
|
if (index >= 0) {
|
||||||
|
peers[index] = merge(peer, peers[index]);
|
||||||
|
} else {
|
||||||
peers.add(peer);
|
peers.add(peer);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void addPeers(List<Peer> ps) {
|
void addPeers(List<Peer> ps) {
|
||||||
for (var p in ps) {
|
for (var p in ps) {
|
||||||
@ -187,8 +197,21 @@ class AbModel {
|
|||||||
}).toList();
|
}).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> pushAb() async {
|
void changeAlias({required String id, required String alias}) {
|
||||||
|
final it = peers.where((element) => element.id == id);
|
||||||
|
if (it.isEmpty) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
it.first.alias = alias;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> pushAb({bool toast = true}) async {
|
||||||
debugPrint("pushAb");
|
debugPrint("pushAb");
|
||||||
|
pushError.value = '';
|
||||||
|
try {
|
||||||
|
// avoid double pushes in a row
|
||||||
|
_syncAllFromRecent = true;
|
||||||
|
syncFromRecent(push: false);
|
||||||
final api = "${await bind.mainGetApiServer()}/api/ab";
|
final api = "${await bind.mainGetApiServer()}/api/ab";
|
||||||
var authHeaders = getHttpHeaders();
|
var authHeaders = getHttpHeaders();
|
||||||
authHeaders['Content-Type'] = "application/json";
|
authHeaders['Content-Type'] = "application/json";
|
||||||
@ -196,24 +219,44 @@ class AbModel {
|
|||||||
final body = jsonEncode({
|
final body = jsonEncode({
|
||||||
"data": jsonEncode({"tags": tags, "peers": peersJsonData})
|
"data": jsonEncode({"tags": tags, "peers": peersJsonData})
|
||||||
});
|
});
|
||||||
var request = http.Request('POST', Uri.parse(api));
|
http.Response resp;
|
||||||
// support compression
|
// support compression
|
||||||
if (licensedDevices > 0 && body.length > 1024) {
|
if (licensedDevices > 0 && body.length > 1024) {
|
||||||
authHeaders['Content-Encoding'] = "gzip";
|
authHeaders['Content-Encoding'] = "gzip";
|
||||||
request.bodyBytes = GZipCodec().encode(utf8.encode(body));
|
resp = await http.post(Uri.parse(api),
|
||||||
|
headers: authHeaders, body: GZipCodec().encode(utf8.encode(body)));
|
||||||
} else {
|
} else {
|
||||||
request.body = body;
|
resp =
|
||||||
|
await http.post(Uri.parse(api), headers: authHeaders, body: body);
|
||||||
}
|
}
|
||||||
request.headers.addAll(authHeaders);
|
|
||||||
try {
|
try {
|
||||||
await http.Client().send(request);
|
if (resp.statusCode == 200 &&
|
||||||
// await pullAb(quiet: true);
|
(resp.body.isEmpty || resp.body.toLowerCase() == 'null')) {
|
||||||
_saveCache(); // save on success
|
_saveCache();
|
||||||
|
} else {
|
||||||
|
final json = jsonDecode(resp.body);
|
||||||
|
if (json.containsKey('error')) {
|
||||||
|
throw json['error'];
|
||||||
|
} else if (resp.statusCode == 200) {
|
||||||
|
_saveCache();
|
||||||
|
} else {
|
||||||
|
throw 'HTTP ${resp.statusCode}';
|
||||||
|
}
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
BotToast.showText(contentColor: Colors.red, text: e.toString());
|
if (resp.statusCode != 200) {
|
||||||
|
throw 'HTTP ${resp.statusCode}, $e';
|
||||||
|
}
|
||||||
|
rethrow;
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
pushError.value =
|
||||||
|
'${translate('push_ab_failed_tip')}: ${translate(e.toString())}';
|
||||||
|
if (toast && gFFI.peerTabModel.currentTab != PeerTabIndex.ab.index) {
|
||||||
|
BotToast.showText(contentColor: Colors.red, text: pushError.value);
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
sync_all_from_recent = true;
|
_syncAllFromRecent = true;
|
||||||
_timerCounter = 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -290,7 +333,6 @@ class AbModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void syncFromRecent() async {
|
|
||||||
Peer merge(Peer r, Peer p) {
|
Peer merge(Peer r, Peer p) {
|
||||||
return Peer(
|
return Peer(
|
||||||
id: p.id,
|
id: p.id,
|
||||||
@ -298,26 +340,36 @@ class AbModel {
|
|||||||
username: r.username.isEmpty ? p.username : r.username,
|
username: r.username.isEmpty ? p.username : r.username,
|
||||||
hostname: r.hostname.isEmpty ? p.hostname : r.hostname,
|
hostname: r.hostname.isEmpty ? p.hostname : r.hostname,
|
||||||
platform: r.platform.isEmpty ? p.platform : r.platform,
|
platform: r.platform.isEmpty ? p.platform : r.platform,
|
||||||
alias: r.alias,
|
alias: p.alias.isEmpty ? r.alias : p.alias,
|
||||||
tags: p.tags,
|
tags: p.tags,
|
||||||
forceAlwaysRelay: r.forceAlwaysRelay,
|
forceAlwaysRelay: r.forceAlwaysRelay,
|
||||||
rdpPort: r.rdpPort,
|
rdpPort: r.rdpPort,
|
||||||
rdpUsername: r.rdpUsername);
|
rdpUsername: r.rdpUsername);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void syncFromRecent({bool push = true}) async {
|
||||||
|
if (!_syncFromRecentLock) {
|
||||||
|
_syncFromRecentLock = true;
|
||||||
|
_syncFromRecentWithoutLock(push: push);
|
||||||
|
_syncFromRecentLock = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void _syncFromRecentWithoutLock({bool push = true}) async {
|
||||||
bool shouldSync(Peer a, Peer b) {
|
bool shouldSync(Peer a, Peer b) {
|
||||||
return a.hash != b.hash ||
|
return a.hash != b.hash ||
|
||||||
a.username != b.username ||
|
a.username != b.username ||
|
||||||
a.platform != b.platform ||
|
a.platform != b.platform ||
|
||||||
a.hostname != b.hostname;
|
a.hostname != b.hostname ||
|
||||||
|
a.alias != b.alias;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<List<Peer>> getRecentPeers() async {
|
Future<List<Peer>> getRecentPeers() async {
|
||||||
try {
|
try {
|
||||||
if (peers.isEmpty) [];
|
if (peers.isEmpty) [];
|
||||||
List<String> filteredPeerIDs;
|
List<String> filteredPeerIDs;
|
||||||
if (sync_all_from_recent) {
|
if (_syncAllFromRecent) {
|
||||||
sync_all_from_recent = false;
|
_syncAllFromRecent = false;
|
||||||
filteredPeerIDs = peers.map((e) => e.id).toList();
|
filteredPeerIDs = peers.map((e) => e.id).toList();
|
||||||
} else {
|
} else {
|
||||||
final new_stored_str = await bind.mainGetNewStoredPeers();
|
final new_stored_str = await bind.mainGetNewStoredPeers();
|
||||||
@ -372,7 +424,7 @@ class AbModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Be careful with loop calls
|
// Be careful with loop calls
|
||||||
if (changed) {
|
if (changed && push) {
|
||||||
pushAb();
|
pushAb();
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@ -394,8 +446,10 @@ class AbModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_loadCache() async {
|
loadCache() async {
|
||||||
try {
|
try {
|
||||||
|
if (_cacheLoadOnceFlag || abLoading.value) return;
|
||||||
|
_cacheLoadOnceFlag = true;
|
||||||
final access_token = bind.mainGetLocalOption(key: 'access_token');
|
final access_token = bind.mainGetLocalOption(key: 'access_token');
|
||||||
if (access_token.isEmpty) return;
|
if (access_token.isEmpty) return;
|
||||||
final cache = await bind.mainLoadAb();
|
final cache = await bind.mainLoadAb();
|
||||||
|
|||||||
@ -556,9 +556,11 @@ class FileController {
|
|||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
const Icon(Icons.warning_rounded, color: Colors.red),
|
const Icon(Icons.warning_rounded, color: Colors.red),
|
||||||
Text(title).paddingOnly(
|
Expanded(
|
||||||
|
child: Text(title).paddingOnly(
|
||||||
left: 10,
|
left: 10,
|
||||||
),
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
contentBoxConstraints:
|
contentBoxConstraints:
|
||||||
|
|||||||
@ -56,6 +56,7 @@ class Peer {
|
|||||||
"username": username,
|
"username": username,
|
||||||
"hostname": hostname,
|
"hostname": hostname,
|
||||||
"platform": platform,
|
"platform": platform,
|
||||||
|
"alias": alias,
|
||||||
"tags": tags,
|
"tags": tags,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -87,7 +87,7 @@ class UserModel {
|
|||||||
Future<void> reset({bool clearAbCache = false}) async {
|
Future<void> reset({bool clearAbCache = false}) async {
|
||||||
await bind.mainSetLocalOption(key: 'access_token', value: '');
|
await bind.mainSetLocalOption(key: 'access_token', value: '');
|
||||||
await bind.mainSetLocalOption(key: 'user_info', value: '');
|
await bind.mainSetLocalOption(key: 'user_info', value: '');
|
||||||
await gFFI.abModel.reset(clearCache: clearAbCache);
|
if (clearAbCache) await bind.mainClearAb();
|
||||||
await gFFI.groupModel.reset();
|
await gFFI.groupModel.reset();
|
||||||
userName.value = '';
|
userName.value = '';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1499,6 +1499,12 @@ pub struct AbPeer {
|
|||||||
skip_serializing_if = "String::is_empty"
|
skip_serializing_if = "String::is_empty"
|
||||||
)]
|
)]
|
||||||
pub platform: String,
|
pub platform: String,
|
||||||
|
#[serde(
|
||||||
|
default,
|
||||||
|
deserialize_with = "deserialize_string",
|
||||||
|
skip_serializing_if = "String::is_empty"
|
||||||
|
)]
|
||||||
|
pub alias: String,
|
||||||
#[serde(default, deserialize_with = "deserialize_vec_string")]
|
#[serde(default, deserialize_with = "deserialize_vec_string")]
|
||||||
pub tags: Vec<String>,
|
pub tags: Vec<String>,
|
||||||
}
|
}
|
||||||
|
|||||||
@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("List View", ""),
|
("List View", ""),
|
||||||
("Select", ""),
|
("Select", ""),
|
||||||
("Toggle Tags", ""),
|
("Toggle Tags", ""),
|
||||||
|
("pull_ab_failed_tip", ""),
|
||||||
|
("push_ab_failed_tip", ""),
|
||||||
].iter().cloned().collect();
|
].iter().cloned().collect();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("List View", ""),
|
("List View", ""),
|
||||||
("Select", ""),
|
("Select", ""),
|
||||||
("Toggle Tags", ""),
|
("Toggle Tags", ""),
|
||||||
|
("pull_ab_failed_tip", "未成功获取地址簿"),
|
||||||
|
("push_ab_failed_tip", "未成功上传地址簿"),
|
||||||
].iter().cloned().collect();
|
].iter().cloned().collect();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("List View", ""),
|
("List View", ""),
|
||||||
("Select", ""),
|
("Select", ""),
|
||||||
("Toggle Tags", ""),
|
("Toggle Tags", ""),
|
||||||
|
("pull_ab_failed_tip", ""),
|
||||||
|
("push_ab_failed_tip", ""),
|
||||||
].iter().cloned().collect();
|
].iter().cloned().collect();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("List View", ""),
|
("List View", ""),
|
||||||
("Select", ""),
|
("Select", ""),
|
||||||
("Toggle Tags", ""),
|
("Toggle Tags", ""),
|
||||||
|
("pull_ab_failed_tip", ""),
|
||||||
|
("push_ab_failed_tip", ""),
|
||||||
].iter().cloned().collect();
|
].iter().cloned().collect();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("List View", "Listenansicht"),
|
("List View", "Listenansicht"),
|
||||||
("Select", "Auswählen"),
|
("Select", "Auswählen"),
|
||||||
("Toggle Tags", "Tags umschalten"),
|
("Toggle Tags", "Tags umschalten"),
|
||||||
|
("pull_ab_failed_tip", ""),
|
||||||
|
("push_ab_failed_tip", ""),
|
||||||
].iter().cloned().collect();
|
].iter().cloned().collect();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("List View", ""),
|
("List View", ""),
|
||||||
("Select", ""),
|
("Select", ""),
|
||||||
("Toggle Tags", ""),
|
("Toggle Tags", ""),
|
||||||
|
("pull_ab_failed_tip", ""),
|
||||||
|
("push_ab_failed_tip", ""),
|
||||||
].iter().cloned().collect();
|
].iter().cloned().collect();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -74,5 +74,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("clipboard_wait_response_timeout_tip", "Timed out waiting for copy response."),
|
("clipboard_wait_response_timeout_tip", "Timed out waiting for copy response."),
|
||||||
("logout_tip", "Are you sure you want to log out?"),
|
("logout_tip", "Are you sure you want to log out?"),
|
||||||
("exceed_max_devices", "You have reached the maximum number of managed devices."),
|
("exceed_max_devices", "You have reached the maximum number of managed devices."),
|
||||||
|
("pull_ab_failed_tip", "Failed to refresh address book"),
|
||||||
|
("push_ab_failed_tip", "Failed to sync address book to server"),
|
||||||
].iter().cloned().collect();
|
].iter().cloned().collect();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("List View", ""),
|
("List View", ""),
|
||||||
("Select", ""),
|
("Select", ""),
|
||||||
("Toggle Tags", ""),
|
("Toggle Tags", ""),
|
||||||
|
("pull_ab_failed_tip", ""),
|
||||||
|
("push_ab_failed_tip", ""),
|
||||||
].iter().cloned().collect();
|
].iter().cloned().collect();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("List View", "Ver en Lista"),
|
("List View", "Ver en Lista"),
|
||||||
("Select", "Seleccionar"),
|
("Select", "Seleccionar"),
|
||||||
("Toggle Tags", "Alternar Etiquetas"),
|
("Toggle Tags", "Alternar Etiquetas"),
|
||||||
|
("pull_ab_failed_tip", ""),
|
||||||
|
("push_ab_failed_tip", ""),
|
||||||
].iter().cloned().collect();
|
].iter().cloned().collect();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("List View", ""),
|
("List View", ""),
|
||||||
("Select", ""),
|
("Select", ""),
|
||||||
("Toggle Tags", ""),
|
("Toggle Tags", ""),
|
||||||
|
("pull_ab_failed_tip", ""),
|
||||||
|
("push_ab_failed_tip", ""),
|
||||||
].iter().cloned().collect();
|
].iter().cloned().collect();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("List View", ""),
|
("List View", ""),
|
||||||
("Select", ""),
|
("Select", ""),
|
||||||
("Toggle Tags", ""),
|
("Toggle Tags", ""),
|
||||||
|
("pull_ab_failed_tip", ""),
|
||||||
|
("push_ab_failed_tip", ""),
|
||||||
].iter().cloned().collect();
|
].iter().cloned().collect();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("List View", ""),
|
("List View", ""),
|
||||||
("Select", ""),
|
("Select", ""),
|
||||||
("Toggle Tags", ""),
|
("Toggle Tags", ""),
|
||||||
|
("pull_ab_failed_tip", ""),
|
||||||
|
("push_ab_failed_tip", ""),
|
||||||
].iter().cloned().collect();
|
].iter().cloned().collect();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("List View", ""),
|
("List View", ""),
|
||||||
("Select", ""),
|
("Select", ""),
|
||||||
("Toggle Tags", ""),
|
("Toggle Tags", ""),
|
||||||
|
("pull_ab_failed_tip", ""),
|
||||||
|
("push_ab_failed_tip", ""),
|
||||||
].iter().cloned().collect();
|
].iter().cloned().collect();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("List View", "Vista elenco"),
|
("List View", "Vista elenco"),
|
||||||
("Select", "Seleziona"),
|
("Select", "Seleziona"),
|
||||||
("Toggle Tags", "Attiva/disattiva tag"),
|
("Toggle Tags", "Attiva/disattiva tag"),
|
||||||
|
("pull_ab_failed_tip", ""),
|
||||||
|
("push_ab_failed_tip", ""),
|
||||||
].iter().cloned().collect();
|
].iter().cloned().collect();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("List View", ""),
|
("List View", ""),
|
||||||
("Select", ""),
|
("Select", ""),
|
||||||
("Toggle Tags", ""),
|
("Toggle Tags", ""),
|
||||||
|
("pull_ab_failed_tip", ""),
|
||||||
|
("push_ab_failed_tip", ""),
|
||||||
].iter().cloned().collect();
|
].iter().cloned().collect();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("List View", ""),
|
("List View", ""),
|
||||||
("Select", ""),
|
("Select", ""),
|
||||||
("Toggle Tags", ""),
|
("Toggle Tags", ""),
|
||||||
|
("pull_ab_failed_tip", ""),
|
||||||
|
("push_ab_failed_tip", ""),
|
||||||
].iter().cloned().collect();
|
].iter().cloned().collect();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("List View", ""),
|
("List View", ""),
|
||||||
("Select", ""),
|
("Select", ""),
|
||||||
("Toggle Tags", ""),
|
("Toggle Tags", ""),
|
||||||
|
("pull_ab_failed_tip", ""),
|
||||||
|
("push_ab_failed_tip", ""),
|
||||||
].iter().cloned().collect();
|
].iter().cloned().collect();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("List View", ""),
|
("List View", ""),
|
||||||
("Select", ""),
|
("Select", ""),
|
||||||
("Toggle Tags", ""),
|
("Toggle Tags", ""),
|
||||||
|
("pull_ab_failed_tip", ""),
|
||||||
|
("push_ab_failed_tip", ""),
|
||||||
].iter().cloned().collect();
|
].iter().cloned().collect();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("List View", ""),
|
("List View", ""),
|
||||||
("Select", ""),
|
("Select", ""),
|
||||||
("Toggle Tags", ""),
|
("Toggle Tags", ""),
|
||||||
|
("pull_ab_failed_tip", ""),
|
||||||
|
("push_ab_failed_tip", ""),
|
||||||
].iter().cloned().collect();
|
].iter().cloned().collect();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("List View", ""),
|
("List View", ""),
|
||||||
("Select", ""),
|
("Select", ""),
|
||||||
("Toggle Tags", ""),
|
("Toggle Tags", ""),
|
||||||
|
("pull_ab_failed_tip", ""),
|
||||||
|
("push_ab_failed_tip", ""),
|
||||||
].iter().cloned().collect();
|
].iter().cloned().collect();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("List View", ""),
|
("List View", ""),
|
||||||
("Select", ""),
|
("Select", ""),
|
||||||
("Toggle Tags", ""),
|
("Toggle Tags", ""),
|
||||||
|
("pull_ab_failed_tip", ""),
|
||||||
|
("push_ab_failed_tip", ""),
|
||||||
].iter().cloned().collect();
|
].iter().cloned().collect();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("List View", ""),
|
("List View", ""),
|
||||||
("Select", ""),
|
("Select", ""),
|
||||||
("Toggle Tags", ""),
|
("Toggle Tags", ""),
|
||||||
|
("pull_ab_failed_tip", ""),
|
||||||
|
("push_ab_failed_tip", ""),
|
||||||
].iter().cloned().collect();
|
].iter().cloned().collect();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("List View", ""),
|
("List View", ""),
|
||||||
("Select", ""),
|
("Select", ""),
|
||||||
("Toggle Tags", ""),
|
("Toggle Tags", ""),
|
||||||
|
("pull_ab_failed_tip", ""),
|
||||||
|
("push_ab_failed_tip", ""),
|
||||||
].iter().cloned().collect();
|
].iter().cloned().collect();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("List View", "Список"),
|
("List View", "Список"),
|
||||||
("Select", "Выбор"),
|
("Select", "Выбор"),
|
||||||
("Toggle Tags", "Переключить метки"),
|
("Toggle Tags", "Переключить метки"),
|
||||||
|
("pull_ab_failed_tip", ""),
|
||||||
|
("push_ab_failed_tip", ""),
|
||||||
].iter().cloned().collect();
|
].iter().cloned().collect();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("List View", ""),
|
("List View", ""),
|
||||||
("Select", ""),
|
("Select", ""),
|
||||||
("Toggle Tags", ""),
|
("Toggle Tags", ""),
|
||||||
|
("pull_ab_failed_tip", ""),
|
||||||
|
("push_ab_failed_tip", ""),
|
||||||
].iter().cloned().collect();
|
].iter().cloned().collect();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("List View", ""),
|
("List View", ""),
|
||||||
("Select", ""),
|
("Select", ""),
|
||||||
("Toggle Tags", ""),
|
("Toggle Tags", ""),
|
||||||
|
("pull_ab_failed_tip", ""),
|
||||||
|
("push_ab_failed_tip", ""),
|
||||||
].iter().cloned().collect();
|
].iter().cloned().collect();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("List View", ""),
|
("List View", ""),
|
||||||
("Select", ""),
|
("Select", ""),
|
||||||
("Toggle Tags", ""),
|
("Toggle Tags", ""),
|
||||||
|
("pull_ab_failed_tip", ""),
|
||||||
|
("push_ab_failed_tip", ""),
|
||||||
].iter().cloned().collect();
|
].iter().cloned().collect();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("List View", ""),
|
("List View", ""),
|
||||||
("Select", ""),
|
("Select", ""),
|
||||||
("Toggle Tags", ""),
|
("Toggle Tags", ""),
|
||||||
|
("pull_ab_failed_tip", ""),
|
||||||
|
("push_ab_failed_tip", ""),
|
||||||
].iter().cloned().collect();
|
].iter().cloned().collect();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("List View", ""),
|
("List View", ""),
|
||||||
("Select", ""),
|
("Select", ""),
|
||||||
("Toggle Tags", ""),
|
("Toggle Tags", ""),
|
||||||
|
("pull_ab_failed_tip", ""),
|
||||||
|
("push_ab_failed_tip", ""),
|
||||||
].iter().cloned().collect();
|
].iter().cloned().collect();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("List View", ""),
|
("List View", ""),
|
||||||
("Select", ""),
|
("Select", ""),
|
||||||
("Toggle Tags", ""),
|
("Toggle Tags", ""),
|
||||||
|
("pull_ab_failed_tip", ""),
|
||||||
|
("push_ab_failed_tip", ""),
|
||||||
].iter().cloned().collect();
|
].iter().cloned().collect();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("List View", ""),
|
("List View", ""),
|
||||||
("Select", ""),
|
("Select", ""),
|
||||||
("Toggle Tags", ""),
|
("Toggle Tags", ""),
|
||||||
|
("pull_ab_failed_tip", ""),
|
||||||
|
("push_ab_failed_tip", ""),
|
||||||
].iter().cloned().collect();
|
].iter().cloned().collect();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("List View", ""),
|
("List View", ""),
|
||||||
("Select", ""),
|
("Select", ""),
|
||||||
("Toggle Tags", ""),
|
("Toggle Tags", ""),
|
||||||
|
("pull_ab_failed_tip", ""),
|
||||||
|
("push_ab_failed_tip", ""),
|
||||||
].iter().cloned().collect();
|
].iter().cloned().collect();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("List View", ""),
|
("List View", ""),
|
||||||
("Select", ""),
|
("Select", ""),
|
||||||
("Toggle Tags", ""),
|
("Toggle Tags", ""),
|
||||||
|
("pull_ab_failed_tip", "未成功獲取地址簿"),
|
||||||
|
("push_ab_failed_tip", "未成功上傳地址簿"),
|
||||||
].iter().cloned().collect();
|
].iter().cloned().collect();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("List View", ""),
|
("List View", ""),
|
||||||
("Select", ""),
|
("Select", ""),
|
||||||
("Toggle Tags", ""),
|
("Toggle Tags", ""),
|
||||||
|
("pull_ab_failed_tip", ""),
|
||||||
|
("push_ab_failed_tip", ""),
|
||||||
].iter().cloned().collect();
|
].iter().cloned().collect();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
|||||||
("List View", ""),
|
("List View", ""),
|
||||||
("Select", ""),
|
("Select", ""),
|
||||||
("Toggle Tags", ""),
|
("Toggle Tags", ""),
|
||||||
|
("pull_ab_failed_tip", ""),
|
||||||
|
("push_ab_failed_tip", ""),
|
||||||
].iter().cloned().collect();
|
].iter().cloned().collect();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user