Skip to content

Commit 68b00ea

Browse files
committed
Add gateway by mdns TXT
1 parent 4daa822 commit 68b00ea

13 files changed

+97
-28
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## [1.0.5+74]
2+
3+
* Add gateway by mdns TXT
4+
15
## [1.0.5+73]
26

37
* Add gateway by mdns TXT

build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
flutter pub upgrade --major-versions
2+
flutter gen-l10n

lib/commPages/findmDNSClientList.dart

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import 'package:openiothub_grpc_api/proto/mobile/mobile.pbgrpc.dart';
1616
import 'package:openiothub_plugin/plugins/mdnsService/components.dart';
1717

1818
import 'package:bonsoir/bonsoir.dart';
19+
import 'package:tdesign_flutter/tdesign_flutter.dart';
1920

2021
const utf8encoder = Utf8Encoder();
2122

@@ -141,7 +142,40 @@ class _FindmDNSClientListPageState extends State<FindmDNSClientListPage> {
141142
onTap: () {
142143
// 对于mdns含有添加信息的,直接在本页面使用api添加
143144
if (pair.info.containsKey("run_id") && !pair.info["run_id"]!.isEmpty) {
144-
_addToMyAccount(pair.info["run_id"]!, pair.info["server_host"]);
145+
// TODO 确认添加
146+
showGeneralDialog(
147+
context: context,
148+
pageBuilder: (BuildContext buildContext, Animation<double> animation,
149+
Animation<double> secondaryAnimation) {
150+
return TDAlertDialog(
151+
title: OpenIoTHubCommonLocalizations.of(context).confirm_add_gateway,
152+
content: "",
153+
titleColor: Colors.black,
154+
contentColor: Colors.redAccent,
155+
// backgroundColor: AppTheme.blockBgColor,
156+
leftBtn: TDDialogButtonOptions(
157+
title: OpenIoTHubCommonLocalizations.of(context).cancel,
158+
// titleColor: AppTheme.color999,
159+
style: TDButtonStyle(
160+
backgroundColor: Colors.grey,
161+
),
162+
action: (){
163+
Navigator.of(context).pop();
164+
},
165+
),
166+
rightBtn: TDDialogButtonOptions(
167+
title: OpenIoTHubCommonLocalizations.of(context).ok,
168+
style: TDButtonStyle(
169+
backgroundColor: Colors.blue,
170+
),
171+
action: (){
172+
Navigator.of(context).pop();
173+
_addToMyAccount(pair.info["run_id"]!, pair.info["server_host"]);
174+
},
175+
),
176+
);
177+
},
178+
);
145179
return;
146180
}
147181
//直接打开内置web浏览器浏览页面

lib/l10n/generated/openiothub_common_localizations.dart

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -916,14 +916,20 @@ abstract class OpenIoTHubCommonLocalizations {
916916
/// No description provided for @location_req_name.
917917
///
918918
/// In en, this message translates to:
919-
/// **'申請位置權限說明'**
919+
/// **'Request location permission'**
920920
String get location_req_name;
921921

922922
/// No description provided for @location_req_desc.
923923
///
924924
/// In en, this message translates to:
925-
/// **'申請位置權限,以獲取WiFi信息用於智能設備配網'**
925+
/// **'Apply for location permission to obtain WiFi information for smart device distribution network'**
926926
String get location_req_desc;
927+
928+
/// No description provided for @confirm_add_gateway.
929+
///
930+
/// In en, this message translates to:
931+
/// **'Are you sure to add a gateway?'**
932+
String get confirm_add_gateway;
927933
}
928934

929935
class _OpenIoTHubCommonLocalizationsDelegate

lib/l10n/generated/openiothub_common_localizations_en.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,8 +448,12 @@ class OpenIoTHubCommonLocalizationsEn extends OpenIoTHubCommonLocalizations {
448448
String get success => 'Success!';
449449

450450
@override
451-
String get location_req_name => '申請位置權限說明';
451+
String get location_req_name => 'Request location permission';
452452

453453
@override
454-
String get location_req_desc => '申請位置權限,以獲取WiFi信息用於智能設備配網';
454+
String get location_req_desc =>
455+
'Apply for location permission to obtain WiFi information for smart device distribution network';
456+
457+
@override
458+
String get confirm_add_gateway => 'Are you sure to add a gateway?';
455459
}

lib/l10n/generated/openiothub_common_localizations_zh.dart

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ class OpenIoTHubCommonLocalizationsZh extends OpenIoTHubCommonLocalizations {
226226
'使用云亿连扫码二维码添加网关,管理您的所有智能设备和私有云';
227227

228228
@override
229-
String get app_name => '使App名称:';
229+
String get app_name => 'App名称:';
230230

231231
@override
232232
String get package_name => '包名:';
@@ -419,12 +419,13 @@ class OpenIoTHubCommonLocalizationsZh extends OpenIoTHubCommonLocalizations {
419419
String get success => '成功!';
420420

421421
@override
422-
String get location_req_name =>
423-
'Explanation of Location Permission Application';
422+
String get location_req_name => '申请位置权限说明';
423+
424+
@override
425+
String get location_req_desc => '申请位置权限,以获取WiFi信息用于智能设备配';
424426

425427
@override
426-
String get location_req_desc =>
427-
'Apply for location permission to obtain WiFi information for smart device distribution network';
428+
String get confirm_add_gateway => '确认添加次网关到账户?';
428429
}
429430

430431
/// The translations for Chinese, as used in China (`zh_CN`).
@@ -650,7 +651,7 @@ class OpenIoTHubCommonLocalizationsZhCn
650651
'使用云亿连扫码二维码添加网关,管理您的所有智能设备和私有云';
651652

652653
@override
653-
String get app_name => '使App名称:';
654+
String get app_name => 'App名称:';
654655

655656
@override
656657
String get package_name => '包名:';
@@ -847,6 +848,9 @@ class OpenIoTHubCommonLocalizationsZhCn
847848

848849
@override
849850
String get location_req_desc => '申请位置权限,以获取WiFi信息用于智能设备配网';
851+
852+
@override
853+
String get confirm_add_gateway => '确认添加次网关到账户?';
850854
}
851855

852856
/// The translations for Chinese, using the Han script (`zh_Hans`).
@@ -1072,7 +1076,7 @@ class OpenIoTHubCommonLocalizationsZhHans
10721076
'使用云亿连扫码二维码添加网关,管理您的所有智能设备和私有云';
10731077

10741078
@override
1075-
String get app_name => '使App名称:';
1079+
String get app_name => 'App名称:';
10761080

10771081
@override
10781082
String get package_name => '包名:';
@@ -1269,6 +1273,9 @@ class OpenIoTHubCommonLocalizationsZhHans
12691273

12701274
@override
12711275
String get location_req_desc => '申请位置权限,以获取WiFi信息用于智能设备配网';
1276+
1277+
@override
1278+
String get confirm_add_gateway => '确认添加次网关到账户?';
12721279
}
12731280

12741281
/// The translations for Chinese, using the Han script (`zh_Hant`).
@@ -1494,7 +1501,7 @@ class OpenIoTHubCommonLocalizationsZhHant
14941501
'使用雲億連掃碼二維碼添加網關,管理您的所有智能設備和私有雲';
14951502

14961503
@override
1497-
String get app_name => '使App名稱:';
1504+
String get app_name => 'App名稱:';
14981505

14991506
@override
15001507
String get package_name => '包名:';
@@ -1691,6 +1698,9 @@ class OpenIoTHubCommonLocalizationsZhHant
16911698

16921699
@override
16931700
String get location_req_desc => '申請位置權限,以獲取WiFi信息用於智能設備配網';
1701+
1702+
@override
1703+
String get confirm_add_gateway => '確認添加網關到本賬號?';
16941704
}
16951705

16961706
/// The translations for Chinese, as used in Taiwan (`zh_TW`).
@@ -1916,7 +1926,7 @@ class OpenIoTHubCommonLocalizationsZhTw
19161926
'使用雲億連掃碼二維碼添加網關,管理您的所有智能設備和私有雲';
19171927

19181928
@override
1919-
String get app_name => '使App名稱:';
1929+
String get app_name => 'App名稱:';
19201930

19211931
@override
19221932
String get package_name => '包名:';
@@ -2113,4 +2123,7 @@ class OpenIoTHubCommonLocalizationsZhTw
21132123

21142124
@override
21152125
String get location_req_desc => '申請位置權限,以獲取WiFi信息用於智能設備配網';
2126+
2127+
@override
2128+
String get confirm_add_gateway => '確認添加網關到本賬號?';
21162129
}

lib/l10n/intl_en.arb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@
146146
"add_to_server": "Add to server",
147147
"add_server": "Add server",
148148
"success": "Success!",
149-
"location_req_name": "申請位置權限說明",
150-
"location_req_desc": "申請位置權限,以獲取WiFi信息用於智能設備配網"
149+
"location_req_name": "Request location permission",
150+
"location_req_desc": "Apply for location permission to obtain WiFi information for smart device distribution network",
151+
"confirm_add_gateway": "Are you sure to add a gateway?"
151152
}

lib/l10n/intl_zh.arb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
"openiothub_gateway_share": "云亿连网关分享",
8080
"openiothub_gateway_share_description": "使用云亿连扫码二维码添加网关,管理您的所有智能设备和私有云",
8181

82-
"app_name": "使App名称:",
82+
"app_name": "App名称:",
8383
"package_name": "包名:",
8484
"version": "版本:",
8585
"version_sn": "版本号:",
@@ -146,6 +146,7 @@
146146
"add_to_server": "添加到服务器",
147147
"add_server": "添加服务器",
148148
"success": "成功!",
149-
"location_req_name": "Explanation of Location Permission Application",
150-
"location_req_desc": "Apply for location permission to obtain WiFi information for smart device distribution network"
149+
"location_req_name": "申请位置权限说明",
150+
"location_req_desc": "申请位置权限,以获取WiFi信息用于智能设备配",
151+
"confirm_add_gateway": "确认添加次网关到账户?"
151152
}

lib/l10n/intl_zh_CN.arb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
"openiothub_gateway_share": "云亿连网关分享",
8080
"openiothub_gateway_share_description": "使用云亿连扫码二维码添加网关,管理您的所有智能设备和私有云",
8181

82-
"app_name": "使App名称:",
82+
"app_name": "App名称:",
8383
"package_name": "包名:",
8484
"version": "版本:",
8585
"version_sn": "版本号:",
@@ -147,5 +147,6 @@
147147
"add_server": "添加服务器",
148148
"success": "成功!",
149149
"location_req_name": "申请位置权限说明",
150-
"location_req_desc": "申请位置权限,以获取WiFi信息用于智能设备配网"
150+
"location_req_desc": "申请位置权限,以获取WiFi信息用于智能设备配网",
151+
"confirm_add_gateway": "确认添加次网关到账户?"
151152
}

lib/l10n/intl_zh_Hans.arb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
"openiothub_gateway_share": "云亿连网关分享",
8080
"openiothub_gateway_share_description": "使用云亿连扫码二维码添加网关,管理您的所有智能设备和私有云",
8181

82-
"app_name": "使App名称:",
82+
"app_name": "App名称:",
8383
"package_name": "包名:",
8484
"version": "版本:",
8585
"version_sn": "版本号:",
@@ -147,5 +147,6 @@
147147
"add_server": "添加服务器",
148148
"success": "成功!",
149149
"location_req_name": "申请位置权限说明",
150-
"location_req_desc": "申请位置权限,以获取WiFi信息用于智能设备配网"
150+
"location_req_desc": "申请位置权限,以获取WiFi信息用于智能设备配网",
151+
"confirm_add_gateway": "确认添加次网关到账户?"
151152
}

0 commit comments

Comments
 (0)