[pbs-devel] [PATCH v2 proxmox-backup 2/3] node: status: added bootmode

Lukas Wagner l.wagner at proxmox.com
Fri Nov 24 15:20:23 CET 2023



On 11/24/23 13:02, Gabriel Goller wrote:
>   
> +fn boot_mode_to_info(bm: boot_mode::BootModeInformation) -> BootModeInformation {
> +    match bm {
> +        boot_mode::BootModeInformation::Efi => BootModeInformation::Efi,
> +        boot_mode::BootModeInformation::EfiSecureBoot => BootModeInformation::EfiSecureBoot,
> +        boot_mode::BootModeInformation::Bios => BootModeInformation::Bios,
> +    }
> +}

Mini nit: Maybe a From<boot_mode::BootModeInformation> impl would be a 
bit more idiomatic?

> +
>   #[api(
>       input: {
>           properties: {
> @@ -79,6 +89,8 @@ async fn get_status(
>   
>       let disk = crate::tools::fs::fs_info_static(proxmox_lang::c_str!("/")).await?;
>   
> +    let boot_info = boot_mode_to_info(boot_mode::boot_mode());
> +
>       Ok(NodeStatus {
>           memory,
>           swap,
> @@ -96,6 +108,7 @@ async fn get_status(
>           info: NodeInformation {
>               fingerprint: crate::cert_info()?.fingerprint()?,
>           },
> +        boot_info,
>       })
>   }
>   
> diff --git a/www/panel/NodeInfo.js b/www/panel/NodeInfo.js
> index 2551c9a5..14f84a2e 100644
> --- a/www/panel/NodeInfo.js
> +++ b/www/panel/NodeInfo.js
> @@ -147,6 +147,23 @@ Ext.define('PBS.NodeInfoPanel', {
>   	    textField: 'kversion',
>   	    value: '',
>   	},
> +	{
> +	    colspan: 2,
> +	    title: gettext('Boot Mode'),
> +	    printBar: false,
> +	    textField: 'boot-info',
> +	    renderer: boot_mode => {
> +	        if (boot_mode === 'bios') {
> +	            return 'Legacy BIOS';
> +	        } else if (boot_mode === 'efi') {
> +	            return 'EFI';
> +	        } else if (boot_mode === 'efisecureboot') {
> +	            return 'EFI (Secure Boot)';
> +	        }
> +	        return Proxmox.Utils.unknownText;
> +	    },
> +	    value: '',
> +	},
>   	{
>   	    xtype: 'pmxNodeInfoRepoStatus',
>   	    itemId: 'repositoryStatus',

-- 
- Lukas





More information about the pbs-devel mailing list