Skip to content

Commit

Permalink
Update subscription removal patches for PVE 4.x/5.x, fixes #24
Browse files Browse the repository at this point in the history
  • Loading branch information
lae committed Mar 3, 2018
1 parent f247f50 commit d3afb2a
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- /usr/share/pve-manager/ext6/pvemanagerlib.js 2016-08-19 13:04:19.000000000 +0000
+++ /usr/share/pve-manager/ext6/pvemanagerlib.js.new 2016-09-15 16:37:42.001671120 +0000
@@ -509,37 +509,6 @@
--- /usr/share/pve-manager/js/pvemanagerlib.js 2018-01-17 08:18:41.000000000 +0000
+++ /usr/share/pve-manager/js/pvemanagerlib.js 2018-03-03 09:59:41.521312774 +0000
@@ -788,37 +788,6 @@
}
},

Expand Down Expand Up @@ -36,9 +36,9 @@
- },
-
task_desc_table: {
diskinit: [ 'Disk', gettext('Initialize Disk with GPT') ],
vncproxy: [ 'VM/CT', gettext('Console') ],
spiceproxy: [ 'VM/CT', gettext('Console') + ' (Spice)' ],
@@ -15300,7 +15269,7 @@
@@ -17078,7 +17047,7 @@
var version_btn = new Ext.Button({
text: gettext('Package versions'),
handler: function(){
Expand All @@ -47,7 +47,7 @@
}
});

@@ -16556,7 +16525,7 @@
@@ -18340,7 +18309,7 @@
{
text: gettext('System Report'),
handler: function() {
Expand All @@ -56,7 +56,7 @@
}
}
],
@@ -16645,7 +16614,7 @@
@@ -18431,7 +18400,7 @@
var update_btn = new Ext.Button({
text: gettext('Refresh'),
handler: function(){
Expand All @@ -65,7 +65,7 @@
}
});

@@ -31771,7 +31740,6 @@
@@ -35093,7 +35062,6 @@
handler: function(data) {
me.login = null;
me.updateLoginData(data);
Expand Down
70 changes: 70 additions & 0 deletions files/00_remove_checked_command_stretch.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
diff -ur /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
--- /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js 2018-02-16 12:06:39.000000000 +0000
+++ /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js 2018-03-03 05:43:35.083364592 +0000
@@ -342,37 +342,6 @@
Ext.Ajax.requestopts);
},

- checked_command: function(orig_cmd) {
- Proxmox.Utils.API2Request({
- url: '/nodes/localhost/subscription',
- method: 'GET',
- //waitMsgTarget: me,
- failure: function(response, opts) {
- Ext.Msg.alert(gettext('Error'), response.htmlStatus);
- },
- success: function(response, opts) {
- var data = response.result.data;
-
- if (data.status !== 'Active') {
- Ext.Msg.show({
- title: gettext('No valid subscription'),
- icon: Ext.Msg.WARNING,
- msg: Proxmox.Utils.getNoSubKeyHtml(data.url),
- buttons: Ext.Msg.OK,
- callback: function(btn) {
- if (btn !== 'ok') {
- return;
- }
- orig_cmd();
- }
- });
- } else {
- orig_cmd();
- }
- }
- });
- },
-
assemble_field_data: function(values, data) {
if (Ext.isObject(data)) {
Ext.Object.each(data, function(name, val) {
diff -ur /usr/share/pve-manager/js/pvemanagerlib.js /usr/share/pve-manager/js/pvemanagerlib.js
--- /usr/share/pve-manager/js/pvemanagerlib.js 2018-02-16 14:07:52.000000000 +0000
+++ /usr/share/pve-manager/js/pvemanagerlib.js 2018-03-03 05:48:35.567396692 +0000
@@ -13441,7 +13441,7 @@
var version_btn = new Ext.Button({
text: gettext('Package versions'),
handler: function(){
- Proxmox.Utils.checked_command(function() { me.showVersions(); });
+ me.showVersions();
}
});

@@ -13691,7 +13691,7 @@
{
text: gettext('System Report'),
handler: function() {
- Proxmox.Utils.checked_command(function (){ me.showReport(); });
+ me.showReport();
}
}
],
@@ -30605,7 +30605,6 @@
handler: function(data) {
me.login = null;
me.updateLoginData(data);
- Proxmox.Utils.checked_command(function() {}); // display subscription status
}
});
}
9 changes: 6 additions & 3 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,16 @@

- name: Remove subscription check wrapper function in web UI
patch:
src: 00_remove_checked_command.patch
dest: /usr/share/pve-manager/js/pvemanagerlib.js
src: "00_remove_checked_command_{{ ansible_distribution_release }}.patch"
basedir: /
strip: 1
backup: yes
when:
- "'pve-no-subscription' in pve_repository_line"
- pve_remove_subscription_warning

when:
- "'pve-no-subscription' in pve_repository_line"

- include: kernel_updates.yml

- include: ipmi_watchdog.yml
Expand Down

0 comments on commit d3afb2a

Please sign in to comment.