Show image size under DEVICE INFO (#314)

This commit is contained in:
Daniel Markstedt 2021-10-13 17:56:53 -07:00 committed by GitHub
parent 9bd0b9802b
commit f2d889aca1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 3 deletions

View File

@ -304,10 +304,24 @@ def list_devices(scsi_id=None, un=None):
dprod = result.devices_info.devices[n].product
drev = result.devices_info.devices[n].revision
dblock = result.devices_info.devices[n].block_size
dsize = int(result.devices_info.devices[n].block_count) * int(dblock)
device_list.append({"id": did, "un": dun, "device_type": dtype, \
"status": ", ".join(dstat_msg), "image": dpath, "file": dfile, "params": dparam,\
"vendor": dven, "product": dprod, "revision": drev, "block_size": dblock})
device_list.append(
{
"id": did,
"un": dun,
"device_type": dtype,
"status": ", ".join(dstat_msg),
"image": dpath,
"file": dfile,
"params": dparam,
"vendor": dven,
"product": dprod,
"revision": drev,
"block_size": dblock,
"size": dsize,
}
)
n += 1
return {"status": True, "device_list": device_list}

View File

@ -436,6 +436,7 @@ def device_info():
flash(f"Type: {device['device_type']}")
flash(f"Status: {device['status']}")
flash(f"File: {device['image']}")
flash(f"File Size: {device['size']} bytes")
flash(f"Parameters: {device['params']}")
flash(f"Vendor: {device['vendor']}")
flash(f"Product: {device['product']}")