[pve-devel] [PATCH widget-toolkit] node/Tasks: show correct node-specific task log

Dominik Csapak d.csapak at proxmox.com
Fri Jul 23 08:59:35 CEST 2021


while refactoring, we forgot to replace the 'localhost' url
(which is valid for pmg/pbs) with the actual nodename we have in pve

do this by setting the correct url in the viewModel right at the start
of the initComponent

we now also have the possiblitiy to overwrite the url if we want

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 src/node/Tasks.js | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/node/Tasks.js b/src/node/Tasks.js
index c852615..3d7113d 100644
--- a/src/node/Tasks.js
+++ b/src/node/Tasks.js
@@ -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'));
-- 
2.30.2






More information about the pve-devel mailing list