From: Shan Shaji <s.shaji@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH pve_flutter_frontend] refactor: remove unused files and address deprecated import
Date: Tue, 6 May 2025 10:25:01 +0200 [thread overview]
Message-ID: <20250506082501.28185-1-s.shaji@proxmox.com> (raw)
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
next reply other threads:[~2025-05-06 8:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-06 8:25 Shan Shaji [this message]
2025-05-07 8:07 ` [pve-devel] applied: " Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250506082501.28185-1-s.shaji@proxmox.com \
--to=s.shaji@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal