Remove Proxmox Subscription Popup

 remove the alert popup message without buying it

Promox: No valid subscription message popup

Intro

Sometimes, the popup message — “No valid subscription” bothers me.

Fortunately, the popup window only show up only during the initial login.

Today, I got curios if there is a way

what brings up the popup?

In the javascript, `/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js`, there is a logic checking the subscription by making API call to Proxmox.

If there is no valid subscription, then “No valid subscription” will popup.

Here is the logic in the proxmoxlib.js

    checked_command: function(orig_cmd) {
Proxmox.Utils.API2Request(
{
url: '/nodes/localhost/subscription',
method: 'GET',
failure: function(response, opts) {
Ext.Msg.alert(gettext('Error'), response.htmlStatus);
},
success: function(response, opts) {
let res = response.result;
if (res === null || res === undefined || !res || res
.data.status.toLowerCase() !== 'active') {
Ext.Msg.show({
title: gettext('No valid subscription'),
icon: Ext.Msg.WARNING,
message: Proxmox.Utils.getNoSubKeyHtml(res.data.url),
buttons: Ext.Msg.OK,
callback: function(btn) {
if (btn !== 'ok') {
return;
}
orig_cmd();
},
});
} else {
orig_cmd();
}
},
},
);
},

How to disable the popup?

step1: disable the popup

Run this cmd through Proxmox’s node shell. This cmd will make a backup and create a new file which has the patch.

sed -Ezi.bak "s/(Ext.Msg.show\(\{\s+title: gettext\('No valid sub)/void\(\{ \/\/\1/g" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js

After that, you can see that a new file is created. — proxmoxlib.js.bak

root@pve:/usr/share/javascript/proxmox-widget-toolkit# ls -al
total 1380
drwxr-xr-x 5 root root 4096 Aug 9 02:21 .
drwxr-xr-x 8 root root 4096 Jul 22 01:27 ..
drwxr-xr-x 2 root root 4096 Jul 22 03:08 css
drwxr-xr-x 2 root root 4096 Jul 22 03:08 images
-rw-r--r-- 1 root root 543047 Aug 9 02:21 proxmoxlib.js
-rw-r--r-- 1 root root 543038 Aug 9 01:10 proxmoxlib.js.bak
-rw-r--r-- 1 root root 303036 Jun 26 11:24 proxmoxlib.min.js
drwxr-xr-x 2 root root 4096 Jul 22 03:08 themes

You can see the diff as well.

root@pve:/usr/share/javascript/proxmox-widget-toolkit# diff proxmoxlib.js proxmoxlib.js.bak dsd


Source

Comments

Popular posts from this blog

xpipe

tmux