[pve-devel] applied: [PATCH widget-toolkit 4/4] panel: add StatusView from PVE

Thomas Lamprecht t.lamprecht at proxmox.com
Thu Apr 22 20:38:33 CEST 2021


On 19.04.21 13:00, Dominik Csapak wrote:
> with 2 minor fixups:
> * one lint error
> * binding of the 'updateValues' function in the event
>   (we want to avoid breaking this when used in a context where
>   a controller exists, in that case using a string will only look in
>   the controller and not in the component itself anymore, so use
>   the function directly)
> 
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
>  src/Makefile            |   1 +
>  src/panel/StatusView.js | 125 ++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 126 insertions(+)
>  create mode 100644 src/panel/StatusView.js

applied, with a some unimportant cleanups and an important fix (or better said, workaround)
for the use in PVE, see below.

> diff --git a/src/panel/StatusView.js b/src/panel/StatusView.js
> new file mode 100644
> index 0000000..059508a
> --- /dev/null
> +++ b/src/panel/StatusView.js

> +    updateValues: function(store, records, success) {
> +	if (!success) {
> +	    return; // do not update if store load was not successful
> +	}
> +	var me = this;
> +	var itemsToUpdate = me.query('pmxInfoWidget');

does not finds the pveInfoWidgets from, well, PVE, and makes for a pretty boring
view there ;-)

> +
> +	itemsToUpdate.forEach(me.updateField, me);
> +
> +	me.updateTitle(store);
> +    },
> +





More information about the pve-devel mailing list