On 3/14/22 09:18, Fabian Ebner wrote:
Am 11.03.22 um 15:38 schrieb Aaron Lauterer:
On 3/10/22 11:49, Fabian Ebner wrote:
Am 07.03.22 um 11:07 schrieb Aaron Lauterer:
+    cbindData: function() {
+    let me = this;
+    return {
+        vmid: me.vmid,
+        disk: me.disk,
+        isQemu: me.type === 'qemu',
+        nodename: me.nodename,
+        url: `/nodes/${me.nodename}/${me.type}/${me.vmid}/`,
+    };
+    },
+
+    cbind: {
+    title: get => get('isQemu') ? gettext('Reassign disk') :
gettext('Reassign volume'),
+    submitText: get => get('title'),
+    qemu: '{isQemu}',
+    url: '{url}',
+    },
+
+    submitUrl: function(url, values) {
+    url += this.qemu ? 'move_disk' : 'move_volume';

Why not already construct the full URL above?

I'll see how to do that. First tests show that if I construct the
submitUrl directly, I need to set the 'url' at some point, even if not
used because the edit window does check its existence.


Sorry, by "above" I meant in the cbindData function, not directly above.

Yeah. In the meantime I found out, that I can also just use the `url` as it 
will be used if there is no `submitUrl`.


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to