* [pve-devel] [PATCH pve_flutter_frontend] refactor: remove unused files and address deprecated import
@ 2025-05-06 8:25 Shan Shaji
2025-05-07 8:07 ` [pve-devel] applied: " Thomas Lamprecht
0 siblings, 1 reply; 2+ messages in thread
From: Shan Shaji @ 2025-05-06 8:25 UTC (permalink / raw)
To: pve-devel
This patch removes the `utils_web.dart` file, which contained a
deprecated `dart:html` import. Flutter suggest using `package:web` [0].
However this package is an external package [1] and are not included
by default with flutter or dart.
The `registerConsoleIframe` function had one usage inside the
`PveConsoleWidget` , but since the widget is no longer being
used, this patch deletes both the `utils_web.dart` and
`pve_console_widget.dart` files.
- [0] https://dart.dev/interop/js-interop/package-web
- [1] https://pub.dev/packages/web
Signed-off-by: Shan Shaji <s.shaji@proxmox.com>
---
lib/utils/utils.dart | 2 --
lib/utils/utils_web.dart | 15 ---------------
lib/widgets/pve_console_widget.dart | 24 ------------------------
3 files changed, 41 deletions(-)
delete mode 100644 lib/utils/utils_web.dart
delete mode 100644 lib/widgets/pve_console_widget.dart
diff --git a/lib/utils/utils.dart b/lib/utils/utils.dart
index 0507d90..026fad6 100644
--- a/lib/utils/utils.dart
+++ b/lib/utils/utils.dart
@@ -8,8 +8,6 @@ import 'package:pve_flutter_frontend/states/pve_task_log_viewer_state.dart';
import 'package:pve_flutter_frontend/widgets/pve_console_menu_widget.dart';
import 'package:pve_flutter_frontend/widgets/pve_task_log_widget.dart';
-void registerConsoleIframe(String nodeid) => throw UnimplementedError();
-
Future<T?> showTaskLogBottomSheet<T>(BuildContext context,
ProxmoxApiClient apiClient, String targetNode, String upid,
{Widget icon = const Icon(Icons.work),
diff --git a/lib/utils/utils_web.dart b/lib/utils/utils_web.dart
deleted file mode 100644
index d09ff67..0000000
--- a/lib/utils/utils_web.dart
+++ /dev/null
@@ -1,15 +0,0 @@
-import 'dart:html';
-import 'dart:ui' as ui;
-
-void registerConsoleIframe(String nodeid) {
- // analyzer
- // ignore: undefined_prefixed_name
- ui.platformViewRegistry.registerViewFactory(
- 'console-html',
- (int viewId) => IFrameElement()
- ..width = '640'
- ..height = '360'
- ..src =
- 'http://localhost/?console=shell&node=$nodeid&resize=scale&xtermjs=1'
- ..style.border = 'none');
-}
diff --git a/lib/widgets/pve_console_widget.dart b/lib/widgets/pve_console_widget.dart
deleted file mode 100644
index f71c5f0..0000000
--- a/lib/widgets/pve_console_widget.dart
+++ /dev/null
@@ -1,24 +0,0 @@
-import 'package:flutter/foundation.dart';
-import 'package:flutter/material.dart';
-import 'package:pve_flutter_frontend/utils/utils.dart'
- if (dart.library.html) 'package:pve_flutter_frontend/utils/utils_web.dart';
-
-class PveConsoleWidget extends StatelessWidget {
- static const routeName = '/console';
- final String? vmid;
- final String nodeid;
- const PveConsoleWidget({super.key, this.vmid, required this.nodeid});
-
- @override
- Widget build(BuildContext context) {
- //TODO change this when there's a more official way to determine web e.g. Platform.isWeb or similar
- if (kIsWeb) {
- registerConsoleIframe(nodeid);
- return const HtmlElementView(
- viewType: 'console-html',
- );
- } else {
- return Container();
- }
- }
-}
--
2.39.5
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
* [pve-devel] applied: [PATCH pve_flutter_frontend] refactor: remove unused files and address deprecated import
2025-05-06 8:25 [pve-devel] [PATCH pve_flutter_frontend] refactor: remove unused files and address deprecated import Shan Shaji
@ 2025-05-07 8:07 ` Thomas Lamprecht
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2025-05-07 8:07 UTC (permalink / raw)
To: pve-devel, Shan Shaji
On Tue, 06 May 2025 10:25:01 +0200, Shan Shaji wrote:
> This patch removes the `utils_web.dart` file, which contained a
> deprecated `dart:html` import. Flutter suggest using `package:web` [0].
> However this package is an external package [1] and are not included
> by default with flutter or dart.
>
> The `registerConsoleIframe` function had one usage inside the
> `PveConsoleWidget` , but since the widget is no longer being
> used, this patch deletes both the `utils_web.dart` and
> `pve_console_widget.dart` files.
>
> [...]
Applied, thanks!
[1/1] refactor: remove unused files and address deprecated import
commit: c2118d1f4d41a1a9a71a9314925b31158cca0c84
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-05-07 8:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-06 8:25 [pve-devel] [PATCH pve_flutter_frontend] refactor: remove unused files and address deprecated import Shan Shaji
2025-05-07 8:07 ` [pve-devel] applied: " Thomas Lamprecht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox