[pmg-devel] [PATCH pmg-gui 1/1] quarantine view: add option to switch to mobile view

Dominik Csapak d.csapak at proxmox.com
Tue Sep 23 15:20:07 CEST 2025


by appending '?mobile=1' to the url

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 js/QuarantineView.js | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/js/QuarantineView.js b/js/QuarantineView.js
index 496ed38..6a740b0 100644
--- a/js/QuarantineView.js
+++ b/js/QuarantineView.js
@@ -161,6 +161,12 @@ Ext.define('PMG.QuarantineView', {
             PMG.Utils.doQuarantineAction(qa.action, qa.cselect);
         },
 
+        switchToMobile: function () {
+            let params = new URLSearchParams(document.location.search);
+            params.set('mobile', '1');
+            document.location.search = params.toString();
+        },
+
         control: {
             '[reference=logoutButton]': {
                 click: 'logout',
@@ -171,6 +177,9 @@ Ext.define('PMG.QuarantineView', {
             '[reference=themeButton]': {
                 click: 'changeTheme',
             },
+            '[reference=mobileButton]': {
+                click: 'switchToMobile',
+            },
         },
 
         init: function (view) {
@@ -263,6 +272,11 @@ Ext.define('PMG.QuarantineView', {
                             text: gettext('Language'),
                             reference: 'languageButton',
                         },
+                        {
+                            iconCls: 'fa fa-mobile',
+                            text: gettext('Switch to Mobile View'),
+                            reference: 'mobileButton',
+                        },
                         '-',
                         {
                             reference: 'logoutButton',
-- 
2.47.3





More information about the pmg-devel mailing list