86 | {/* CPU */}
87 | {status.cpu && (
88 |
89 |
CPU
90 |
91 | {cpu.modelName}
92 | {cpu.temperatures.length > 0
93 | && ` | ${cpu.temperatures.map((t) => `${t}°C`).join(", ")}`}
94 |
95 |
96 |
97 |
98 |
99 | {cpu.usage.map(({ user, kernel, total }, index) => (
100 |
108 | ))}
109 |
110 | )}
111 |
112 | {/* memory */}
113 | {status.memory && (
114 |
115 |
Memory
116 |
117 | Available: {toGiga(memory.availableCapacity)}GB/{toGiga(memory.capacity)}GB
118 |
119 |
123 |
124 | )}
125 |
126 | {/* battery */}
127 | {state.supportBatteryAPI && status.battery && (
128 |
129 |
Battery
130 |
131 | {(battery.level * 100).toFixed(2)}% (
132 | {battery.isCharging ? "Charging" : "Not charging"})
133 |
134 |
138 |
139 | )}
140 |
141 | {/* storage */}
142 | {status.storage && (
143 |
144 |
Storage
145 | {storage.storage.map(({ name, capacity, id }) => (
146 | {`${name || "Unknown"} / ${toGiga(capacity)}GB`}
147 | ))}
148 |
149 | )}
150 |
151 | {/* new window */}
152 | {location.search === "" && (
153 |
170 | )}
171 |
172 | );
173 | };
174 |
175 | const root = document.createElement("div");
176 | document.body.appendChild(root);
177 |
178 | getStatus().then(status => {
179 | createRoot(root).render(