mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-29 16:11:01 +03:00
fix: Fix web platform issues
This commit is contained in:
@@ -14,10 +14,7 @@ class HttpService {
|
|||||||
dynamic body,
|
dynamic body,
|
||||||
}) async {
|
}) async {
|
||||||
headers ??= {'Content-Type': 'application/json'};
|
headers ??= {'Content-Type': 'application/json'};
|
||||||
// For web platforms
|
|
||||||
if (kIsWeb) {
|
|
||||||
return await _pollFultterHttp(url, method, headers: headers, body: body);
|
|
||||||
}
|
|
||||||
// Determine if there is currently a proxy setting, and if so, use FFI to call the Rust HTTP method.
|
// Determine if there is currently a proxy setting, and if so, use FFI to call the Rust HTTP method.
|
||||||
final isProxy = await bind.mainGetProxyStatus();
|
final isProxy = await bind.mainGetProxyStatus();
|
||||||
|
|
||||||
|
|||||||
@@ -770,6 +770,24 @@ class RustdeskImpl {
|
|||||||
throw UnimplementedError();
|
throw UnimplementedError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<bool> mainGetProxyStatus({dynamic hint}) {
|
||||||
|
return Future(() => false);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> mainHttpRequest({
|
||||||
|
required String url,
|
||||||
|
required String method,
|
||||||
|
String? body,
|
||||||
|
required String header,
|
||||||
|
dynamic hint,
|
||||||
|
}) {
|
||||||
|
throw UnimplementedError();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<String?> mainGetHttpStatus({required String url, dynamic hint}){
|
||||||
|
throw UnimplementedError();
|
||||||
|
}
|
||||||
|
|
||||||
String mainGetLocalOption({required String key, dynamic hint}) {
|
String mainGetLocalOption({required String key, dynamic hint}) {
|
||||||
return js.context.callMethod('getByName', ['option:local', key]);
|
return js.context.callMethod('getByName', ['option:local', key]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -921,10 +921,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: path
|
name: path
|
||||||
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
|
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.9.0"
|
version: "1.8.3"
|
||||||
path_parsing:
|
path_parsing:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -1526,10 +1526,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: web
|
name: web
|
||||||
sha256: "4188706108906f002b3a293509234588823c8c979dc83304e229ff400c996b05"
|
sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.4.2"
|
version: "0.3.0"
|
||||||
web_socket_channel:
|
web_socket_channel:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ use hbb_common::tokio::sync::mpsc::UnboundedSender;
|
|||||||
use hbb_common::tokio::sync::mpsc::{unbounded_channel, UnboundedReceiver};
|
use hbb_common::tokio::sync::mpsc::{unbounded_channel, UnboundedReceiver};
|
||||||
use hbb_common::{
|
use hbb_common::{
|
||||||
allow_err,
|
allow_err,
|
||||||
anyhow::Context,
|
anyhow::{anyhow, Context},
|
||||||
bail,
|
bail,
|
||||||
config::{
|
config::{
|
||||||
self, Config, LocalConfig, PeerConfig, PeerInfoSerde, Resolution, CONNECT_TIMEOUT,
|
self, Config, LocalConfig, PeerConfig, PeerInfoSerde, Resolution, CONNECT_TIMEOUT,
|
||||||
|
|||||||
Reference in New Issue
Block a user