3939 "HP iLO 4 All" ,
4040 "HP iLO 4 Discrete" ,
4141 "Supermicro X9" ,
42- "Supermicro X10" ,
43- "Supermicro X11" ,
42+ "Supermicro X10 All" ,
43+ "Supermicro X10 Discrete" ,
44+ "Supermicro X11 All" ,
45+ "Supermicro X11 Discrete" ,
4446 "Cisco M3" ,
4547 "Cisco M4" ,
4648 "Cisco M5" ,
@@ -64,6 +66,7 @@ def _build(self):
6466 self ._ilo4 = {}
6567 self ._smart = {}
6668 self ._shared = {}
69+ self ._supermicro = {}
6770 self ._add_selections ()
6871
6972 def _add_selections (self ):
@@ -90,6 +93,8 @@ def _add_selections(self):
9093 self ._ilo4 ["speed" ].visible = False
9194 self ._shared ["speed" ] = el .WRow ()
9295 self ._shared ["speed" ].visible = False
96+ self ._supermicro ["speed" ] = el .WRow ()
97+ self ._supermicro ["speed" ].visible = False
9398 with el .WRow ():
9499 self ._select ["cpu" ] = ui .select (
95100 cpu_sensor_names ,
@@ -168,6 +173,7 @@ async def _store_select(self, group, value):
168173 await self ._build_ilo4_ctrl (group )
169174 await self ._build_smart_ctrl ()
170175 await self ._build_shared_ctrl (group )
176+ await self ._build_supermicro_ctrl (group )
171177 await Factory .close (self .host , group )
172178 self ._control_rebuild ()
173179
@@ -243,6 +249,29 @@ async def _build_shared_ctrl(self, group):
243249 if group in self ._ilo4 :
244250 self ._shared [group ].visible = False
245251
252+ async def _build_supermicro_ctrl (self , group ):
253+ if self ._select [group ].value == "Supermicro X10 Discrete" or self ._select [group ].value == "Supermicro X11 Discrete" :
254+ self ._skeleton [group ].visible = True
255+ self ._supermicro [group ].bind_visibility_from (self ._skeleton [group ], value = False )
256+ labels = {"speed" : "Supermicro Fan Zones" }
257+ self ._supermicro [group ].clear ()
258+ with self ._supermicro [group ]:
259+ if group == "speed" :
260+ options = ["00" , "01" , "02" , "03" ]
261+ else :
262+ options = []
263+ ui .select (
264+ options ,
265+ label = labels [group ],
266+ value = storage .host (self .host )["supermicro" ].get (group , []),
267+ on_change = lambda e : self ._store_select_supermicro (group , e .value ),
268+ multiple = True ,
269+ ).classes ("col" )
270+ self ._skeleton [group ].visible = False
271+ else :
272+ if group in self ._supermicro :
273+ self ._supermicro [group ].visible = False
274+
246275 async def _update_ctrls (self ):
247276 groups = ["speed" , "cpu" , "pci" , "drive" , "gpu" , "chassis" ]
248277 for group in groups :
@@ -252,12 +281,11 @@ async def _update_ctrls(self):
252281 await self ._build_shared_ctrl (group )
253282 groups = ["speed" , "cpu" , "pci" ]
254283 for group in groups :
255- if self ._select [group ].value == "HP iLO 4 Discrete" :
284+ if "Discrete" in self ._select [group ].value :
256285 self ._skeleton [group ].visible = True
257286 for group in groups :
258287 await self ._build_ilo4_ctrl (group )
259- if self ._select ["drive" ].value == "SMART Discrete" :
260- self ._skeleton ["drive" ].visible = True
288+ await self ._build_supermicro_ctrl (group )
261289 await self ._build_smart_ctrl ()
262290
263291 async def _store_select_ilo4 (self , group , value ):
@@ -272,6 +300,10 @@ async def _store_select_shared(self, group, value):
272300 storage .host (self .host )["shared" ][group ] = value
273301 await Factory .close (self .host , group )
274302
303+ async def _store_select_supermicro (self , group , value ):
304+ storage .host (self .host )["supermicro" ][group ] = value
305+ await Factory .close (self .host , group )
306+
275307 async def _test (self , group ):
276308 device = None
277309 status = None
0 commit comments