Skip to content

Commit ff0d1f7

Browse files
committed
feat: show cpu cores/threads in summary tab closes #1715
1 parent 3ae5824 commit ff0d1f7

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

api/tacticalrmm/agents/models.py

+14-1
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,20 @@ def cpu_model(self) -> List[str]:
282282
try:
283283
cpus = self.wmi_detail["cpu"]
284284
for cpu in cpus:
285-
ret.append([x["Name"] for x in cpu if "Name" in x][0])
285+
name = [x["Name"] for x in cpu if "Name" in x][0]
286+
lp, nc = "", ""
287+
with suppress(Exception):
288+
lp = [
289+
x["NumberOfLogicalProcessors"]
290+
for x in cpu
291+
if "NumberOfCores" in x
292+
][0]
293+
nc = [x["NumberOfCores"] for x in cpu if "NumberOfCores" in x][0]
294+
if lp and nc:
295+
cpu_string = f"{name}, {nc}C/{lp}T"
296+
else:
297+
cpu_string = name
298+
ret.append(cpu_string)
286299
return ret
287300
except:
288301
return ["unknown cpu model"]

0 commit comments

Comments
 (0)