[pve-devel] applied: [PATCH pve-flutter-frontend] fix #4749: correctly show lxc rrd data

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Jul 4 17:29:46 CEST 2023


Am 04/07/2023 um 15:53 schrieb Dominik Csapak:
> like we do for qemu guest, by multiplying cpu usage by 100
> 
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
>  lib/bloc/pve_lxc_overview_bloc.dart | 13 +++++++++++--
>  1 file changed, 11 insertions(+), 2 deletions(-)
> 

applied, thanks!

> +
> +  Future<List<PveGuestRRDdataModel>> _preProcessRRDdata() async {
> +    final rrddata = (await apiClient.getNodeQemuRRDdata(
> +            latestState.nodeID, guestID, PveRRDTimeframeType.hour))
> +        .map((element) => element.cpu != null
> +            ? element.rebuild((e) => e..cpu = e.cpu! * 100)
> +            : element)
> +        .toList();
> +    return rrddata;
> +  }
>  }

The intermediate await could have been avoided using .then(...), but not really nicer:

  Future<List<PveGuestRRDdataModel>> _preProcessRRDdata() async {
    return apiClient
        .getNodeQemuRRDdata(
            latestState.nodeID, guestID, PveRRDTimeframeType.hour)
        .then((data) => data
            .map((element) => element.cpu != null
                ? element.rebuild((e) => e..cpu = e.cpu! * 100)
                : element)
            .toList());
  }





More information about the pve-devel mailing list