mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-15 07:20:26 +00:00
api, ui: allow to remove subscription
Signed-off-by: Moayad Almalat <m.almalat@proxmox.com> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
bc92b15f84
commit
85222f8237
@ -245,4 +245,28 @@ __PACKAGE__->register_method ({
|
|||||||
return undef;
|
return undef;
|
||||||
}});
|
}});
|
||||||
|
|
||||||
|
__PACKAGE__->register_method ({
|
||||||
|
name => 'delete',
|
||||||
|
path => '',
|
||||||
|
method => 'DELETE',
|
||||||
|
permissions => {
|
||||||
|
check => ['perm', '/nodes/{node}', [ 'Sys.Modify' ]],
|
||||||
|
},
|
||||||
|
description => "Set subscription key.",
|
||||||
|
proxyto => 'node',
|
||||||
|
protected => 1,
|
||||||
|
parameters => {
|
||||||
|
additionalProperties => 0,
|
||||||
|
properties => {
|
||||||
|
node => get_standard_option('pve-node'),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
returns => { type => 'null'},
|
||||||
|
code => sub {
|
||||||
|
my $subscription_file = '/etc/subscription';
|
||||||
|
return if ! -e $subscription_file;
|
||||||
|
unlink($subscription_file) or die "cannot delete subscription key: $!";
|
||||||
|
return undef;
|
||||||
|
}});
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
@ -28,6 +28,7 @@ our $cmddef = {
|
|||||||
}
|
}
|
||||||
}],
|
}],
|
||||||
set => [ 'PVE::API2::Subscription', 'set', ['key'], { node => $nodename } ],
|
set => [ 'PVE::API2::Subscription', 'set', ['key'], { node => $nodename } ],
|
||||||
|
delete => [ 'PVE::API2::Subscription', 'delete', undef, { node => $nodename } ],
|
||||||
};
|
};
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
@ -163,6 +163,15 @@ Ext.define('PVE.node.Subscription', {
|
|||||||
win.on('destroy', reload);
|
win.on('destroy', reload);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
text: gettext('Remove Subscription'),
|
||||||
|
xtype: 'proxmoxStdRemoveButton',
|
||||||
|
confirmMsg: gettext('Are you sure to remove the subscription key?'),
|
||||||
|
baseurl: baseurl,
|
||||||
|
dangerous: true,
|
||||||
|
selModel: false,
|
||||||
|
callback: reload,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
text: gettext('Check'),
|
text: gettext('Check'),
|
||||||
handler: function() {
|
handler: function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user