Skip to content

Remove enterprise subscription pop-up

Modify the checked_command function in /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js file.

Strip out the subscription check from the success callback so that the function simply runs the original command without any validation or popup.

Remove the response from fuction on success

Original funcion

  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();
              }
          },
      });
  },

Updated function

  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) {
                  orig_cmd();
          },
      });
  },