[pve-devel] [PATCH v5 proxmox-widget-toolkit 09/23] add upgrade button
Fabian Ebner
f.ebner at proxmox.com
Fri May 28 16:29:48 CEST 2021
Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---
No dependency problem, because of the majorUpgradeAllowed option, which
needs to specified by the user
New in v5.
src/node/APTRepositories.js | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/src/node/APTRepositories.js b/src/node/APTRepositories.js
index 5f8b2e5..7490bbf 100644
--- a/src/node/APTRepositories.js
+++ b/src/node/APTRepositories.js
@@ -345,6 +345,37 @@ Ext.define('Proxmox.node.APTRepositories', {
me.up('proxmoxNodeAPTRepositories').reload();
},
},
+ {
+ xtype: 'proxmoxButton',
+ text: gettext('Upgrade Package Distribution'),
+ cbind: {
+ nodename: '{nodename}',
+ hidden: '{!majorUpgradeAllowed}',
+ },
+ confirmMsg: gettext('Upgrade from \'buster\' to \'bullseye\' for enabled repositories'),
+ handler: function() {
+ let me = this;
+ let panel = me.up('proxmoxNodeAPTRepositories');
+
+ let params = {};
+ if (panel.digest !== undefined) {
+ params.digest = panel.digest;
+ }
+
+ Proxmox.Utils.API2Request({
+ url: `/nodes/${me.nodename}/apt/upgraderepositories`,
+ method: 'PUT',
+ params: params,
+ failure: function(response, opts) {
+ Ext.Msg.alert(gettext('Error'), response.htmlStatus);
+ panel.reload();
+ },
+ success: function(response, opts) {
+ panel.reload();
+ },
+ });
+ },
+ },
],
check_subscription: function() {
--
2.20.1
More information about the pve-devel
mailing list