esim: show the profile icon image and its data size

pySim already requests the Icon tag (0x94) together with the other
ProfileInfo tags; the mapping dropped it, so the PWA only had the icon
type.

- esim.profiles(): each profile now carries `icon` (the image bytes as
  hex) and `icon_size` (byte count), null when the card sent no image.
- PWA: esimIconDataUrl() builds a data: URL (png/jpg -> image/png|jpeg)
  and the profile card shows the image unscaled to the left of the
  metadata rows; the Icon row keeps the type and adds the data size
  (e.g. 'png · 1234 B').
- tests: profiles icon/icon_size mapping (+ the absent case) and the
  frontend data URL / row / render checks; docs and sw simple-v231.
This commit is contained in:
2026-09-22 00:21:43 +03:00
parent 86808ce55d
commit d3f5aaa443
10 changed files with 76 additions and 13 deletions
+3
View File
@@ -419,6 +419,7 @@ def profiles(app):
out = []
for p in _repeated(seq, 'profile_info'):
owner = p.get('profile_owner')
icon = p.get('icon')
out.append({
'iccid': p.get('iccid'),
'isdp_aid': p.get('isdp_aid'),
@@ -428,6 +429,8 @@ def profiles(app):
'name': p.get('profile_name'),
'class': p.get('profile_class'),
'icon_type': p.get('icon_type'),
'icon': icon,
'icon_size': len(icon) // 2 if icon else None,
'owner': owner.get('profile_owner_plmn') if isinstance(owner, dict) else None,
})
return {'profiles': out, 'error': None}