问题描述

Proxmox VE登陆的时候(免费版)提示没有有效的订阅You do not have a valid subscription for this server. Please visit www.proxmox.com to get a list of available options.
Proxmox VE登陆的时候提示没有有效的订阅

问题解决

  • 修改前注意备份

方法一

修改 Ext.Msg.showExt.Msg.noshow

root@pve:~# vim /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
 442             }
 443         }
 444         Ext.Ajax.request(newopts);
 445     },
 446
 447     checked_command: function(orig_cmd) {
 448         Proxmox.Utils.API2Request(
 449             {
 450                 url: '/nodes/localhost/subscription',
 451                 method: 'GET',
 452                 failure: function(response, opts) {
 453                     Ext.Msg.alert(gettext('Error'), response.htmlStatus);
 454                 },
 455                 success: function(response, opts) {
 456                     let res = response.result;
 457                     if (res === null || res === undefined || !res || res
 458                         .data.status.toLowerCase() !== 'active') {
 459                         Ext.Msg.noshow({
 460                             title: gettext('No valid subscription'),
 461                             icon: Ext.Msg.WARNING,
 462                             message: Proxmox.Utils.getNoSubKeyHtml(res.data.url),
 463                             buttons: Ext.Msg.OK,
 464                             callback: function(btn) {
 465                                 if (btn !== 'ok') {
 466                                     return;
 467                                 }
 468                                 orig_cmd();
-- VISUAL --                                                             18        464,33-54      4%

方法二

对如下代码进行修改

# 修改前
if (res === null || res === undefined || !res || res
    .data.status.toLowerCase() !== 'active') {

# 修改后
if (false) {

测试

修改完之后,记得systemctl restart pveproxy。然后清理一下浏览器cookie重新登录就可以了。

文章目录