[pbs-devel] [PATCH widget-toolkit 3/3] InfoWidget: add setData, so that we can bind it

Dominik Csapak d.csapak at proxmox.com
Fri Oct 23 16:29:54 CEST 2020


with a setData function that calls our updateValue, we can now use
viewModel bind to update those widgets

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 src/panel/InfoWidget.js | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/panel/InfoWidget.js b/src/panel/InfoWidget.js
index 8005fa8..53c2ec7 100644
--- a/src/panel/InfoWidget.js
+++ b/src/panel/InfoWidget.js
@@ -54,6 +54,10 @@ Ext.define('Proxmox.widget.Info', {
 	me.getComponent('label').data.iconCls = iconCls;
     },
 
+    setData: function(data) {
+	this.updateValue(data.text, data.usage);
+    },
+
     updateValue: function(text, usage) {
 	var me = this;
 	var label = me.getComponent('label');
-- 
2.20.1






More information about the pbs-devel mailing list