]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
fix #3542: node task logs: query correct node for tasks in clusters
authorDominik Csapak <d.csapak@proxmox.com>
Fri, 23 Jul 2021 06:59:35 +0000 (08:59 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 27 Jul 2021 14:32:38 +0000 (16:32 +0200)
While refactoring, we forgot to replace the 'localhost' URL (which is
valid for PMG/PBS) with the actual nodename we have in Proxmox VE.

Do this by setting the correct URL in the viewModel right at the
start of the initComponent

We now also have the possibility to overwrite the url if we want

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
src/node/Tasks.js

index c852615aa820212927f17579aba2204fb693e0d7..3d7113dd653c0899b545eec515af37edcef1fc7e 100644 (file)
@@ -199,7 +199,7 @@ Ext.define('Proxmox.node.Tasks', {
                    startParam: 'start',
                    limitParam: 'limit',
                    extraParams: '{extraParams}',
-                   url: "/api2/json/nodes/localhost/tasks",
+                   url: '{url}',
                },
                listeners: {
                    prefetch: 'updateLayout',
@@ -443,6 +443,10 @@ Ext.define('Proxmox.node.Tasks', {
     initComponent: function() {
        const me = this;
 
+       let nodename = me.nodename || 'localhost';
+       let url = me.url || `/api2/json/nodes/${nodename}/tasks`;
+       me.getViewModel().set('url', url);
+
        let updateExtraFilters = function(name, value) {
            let vm = me.getViewModel();
            let extraFilter = Ext.clone(vm.get('extraFilter'));