- Debug 模式:使用固定的 http://192.168.0.113 和 ws://192.168.0.113
- Release 模式:使用动态域名逻辑
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import 'dart:convert';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:kaer_with_panels/app/modules/kr_main/views/kr_main_view.dart';
|
||||
|
||||
import '../response/kr_node_list.dart';
|
||||
|
||||
/// 表示出站项的模型类
|
||||
class KROutboundItem {
|
||||
int selected = 0; // 是否选中(0=未选中,1=选中)
|
||||
String id = ""; // 标签
|
||||
String tag = ""; // 标签
|
||||
String serverAddr = ""; // 服务器地址
|
||||
@@ -16,8 +16,10 @@ class KROutboundItem {
|
||||
String city = ""; // 城市
|
||||
String country = ""; // 国家
|
||||
|
||||
double latitude = 0.0;
|
||||
double longitude = 0.0;
|
||||
double latitude = 0.0; // 节点纬度
|
||||
double latitudeCountry = 0.0; // 国家中心纬度
|
||||
double longitude = 0.0; // 节点经度
|
||||
double longitudeCountry = 0.0; // 国家中心经度
|
||||
String protocol = "";
|
||||
|
||||
/// 延迟
|
||||
@@ -33,7 +35,9 @@ class KROutboundItem {
|
||||
id = nodeListItem.id.toString();
|
||||
protocol = nodeListItem.protocol;
|
||||
latitude = nodeListItem.latitude;
|
||||
latitudeCountry = nodeListItem.latitudeCountry;
|
||||
longitude = nodeListItem.longitude;
|
||||
longitudeCountry = nodeListItem.longitudeCountry;
|
||||
|
||||
tag = nodeListItem.name; // 设置标签
|
||||
serverAddr = nodeListItem.serverAddr; // 设置服务器地址
|
||||
|
||||
@@ -51,7 +51,9 @@ class KrNodeListItem {
|
||||
final String startTime;
|
||||
final String expireTime;
|
||||
final double latitude;
|
||||
final double latitudeCountry;
|
||||
final double longitude;
|
||||
final double longitudeCountry;
|
||||
|
||||
KrNodeListItem({
|
||||
required this.id,
|
||||
@@ -74,7 +76,9 @@ class KrNodeListItem {
|
||||
required this.startTime,
|
||||
required this.expireTime,
|
||||
required this.latitude,
|
||||
required this.latitudeCountry,
|
||||
required this.longitude,
|
||||
required this.longitudeCountry,
|
||||
});
|
||||
|
||||
factory KrNodeListItem.fromJson(Map<String, dynamic> json) {
|
||||
@@ -100,7 +104,9 @@ class KrNodeListItem {
|
||||
startTime: json['start_time']?.toString() ?? '',
|
||||
expireTime: json['expire_time']?.toString() ?? '',
|
||||
latitude: _parseDoubleSafely(json['latitude']),
|
||||
latitudeCountry: _parseDoubleSafely(json['latitude_country']),
|
||||
longitude: _parseDoubleSafely(json['longitude']),
|
||||
longitudeCountry: _parseDoubleSafely(json['longitude_country']),
|
||||
);
|
||||
} catch (err) {
|
||||
KRLogUtil.kr_e('KrNodeListItem解析错误: $err', tag: 'NodeList');
|
||||
@@ -122,7 +128,9 @@ class KrNodeListItem {
|
||||
startTime: '',
|
||||
expireTime: '',
|
||||
latitude: 0.0,
|
||||
latitudeCountry: 0.0,
|
||||
longitude: 0.0,
|
||||
longitudeCountry: 0.0,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user