如何关闭Proxmox VE的订阅提示?
- By : Will
- Category : Virtualization

Virtualization
1 前言
一个问题,一篇文章,一出故事。
本章将总结关闭Proxmox VE的订阅提示,通常登陆成功后提示为,
~~~
您没有此服务器的有效订阅。请访问 www.proxmox.com 获取可用选项列表。
You do not have a valid subscription for this server. Please visit www.proxmox.com to get a list of available options.
~~~
2 最佳实践
2.1 备份与修改源代码
cp /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js.default vim /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
// can be useful for catching displaying errors from the API, e.g.: // Proxmox.Async.api2({ // ... // }).catch(Proxmox.Utils.alertResponseFailure); alertResponseFailure: res => Ext.Msg.alert(gettext('Error'), res.htmlStatus || res.result.message), 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.noshow({ 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(); } }, }, ); },
注:请把加粗部分的源代码修改为“Ext.Msg.noshow”
2.2 重启服务是配置生效
systemctl restart pveproxy
2.3 清理浏览器缓存并测试
谷歌浏览器请按下【Ctrl + Shift + Del】并根据提示清理浏览器缓存然后重新登陆测试。
参阅文档
==============
https://cloud.tencent.com/developer/article/2347559
没有评论