graphics() improved detection screen resolution (macOS)

This commit is contained in:
Sebastian Hildebrandt 2021-06-15 08:31:47 +02:00
parent fdf55c6c37
commit 8035902cb2
4 changed files with 23 additions and 7 deletions

View File

@ -77,6 +77,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
| Version | Date | Comment | | Version | Date | Comment |
| -------------- | -------------- | -------- | | -------------- | -------------- | -------- |
| 5.7.7 | 2021-06-15 | `graphics()` improved detection screen resolution (macOS) |
| 5.7.6 | 2021-06-09 | `battery()` improved detection (additional batteries windows) | | 5.7.6 | 2021-06-09 | `battery()` improved detection (additional batteries windows) |
| 5.7.5 | 2021-06-08 | `memLayout()` improved clock speed detection (windows) | | 5.7.5 | 2021-06-08 | `memLayout()` improved clock speed detection (windows) |
| 5.7.4 | 2021-05-27 | `osInfo()`, `cpu()` improved hypervisor, virtualization detection (windows) | | 5.7.4 | 2021-05-27 | `osInfo()`, `cpu()` improved hypervisor, virtualization detection (windows) |

View File

@ -56,6 +56,11 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr>
<th scope="row">5.7.7</th>
<td>2021-06-15</td>
<td><span class="code">graphics()</span> improved detection screen resolution (macOS)</td>
</tr>
<tr> <tr>
<th scope="row">5.7.6</th> <th scope="row">5.7.6</th>
<td>2021-06-09</td> <td>2021-06-09</td>

View File

@ -170,7 +170,7 @@
<img class="logo" src="assets/logo.png"> <img class="logo" src="assets/logo.png">
<div class="title">systeminformation</div> <div class="title">systeminformation</div>
<div class="subtitle"><span id="typed"></span>&nbsp;</div> <div class="subtitle"><span id="typed"></span>&nbsp;</div>
<div class="version">New Version: <span id="version">5.7.6</span></div> <div class="version">New Version: <span id="version">5.7.7</span></div>
<button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button> <button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button>
</div> </div>
<div class="down"> <div class="down">
@ -203,7 +203,7 @@
</div> </div>
<div class="row number-section"> <div class="row number-section">
<div class="col-xl-4 col-lg-4 col-md-4 col-12"> <div class="col-xl-4 col-lg-4 col-md-4 col-12">
<div class="numbers">14,231</div> <div class="numbers">14,473</div>
<div class="title">Lines of code</div> <div class="title">Lines of code</div>
</div> </div>
<div class="col-xl-4 col-lg-4 col-md-4 col-12"> <div class="col-xl-4 col-lg-4 col-md-4 col-12">
@ -211,7 +211,7 @@
<div class="title">Downloads last month</div> <div class="title">Downloads last month</div>
</div> </div>
<div class="col-xl-4 col-lg-4 col-md-4 col-12"> <div class="col-xl-4 col-lg-4 col-md-4 col-12">
<div class="numbers">420</div> <div class="numbers">424</div>
<div class="title">Dependents</div> <div class="title">Dependents</div>
</div> </div>
</div> </div>

View File

@ -172,10 +172,20 @@ function graphics(callback) {
if (4 === level) { // display controller details level if (4 === level) { // display controller details level
if (parts.length > 1 && parts[0].replace(/ +/g, '').toLowerCase().indexOf('resolution') !== -1) { if (parts.length > 1 && parts[0].replace(/ +/g, '').toLowerCase().indexOf('resolution') !== -1) {
let resolution = parts[1].split('x'); let resolution = parts[1].split('x');
currentDisplay.resolutionX = (resolution.length > 1 ? parseInt(resolution[0]) : 0); if (resolution.length > 1) {
currentDisplay.resolutionY = (resolution.length > 1 ? parseInt(resolution[1]) : 0); let xpart = resolution[0];
currentDisplay.currentResX = currentDisplay.resolutionX; if (xpart.indexOf('(') !== -1) {
currentDisplay.currentResY = currentDisplay.resolutionY; xpart = xpart.split('(').slice(-1)[0];
}
let ypart = resolution[1];
if (ypart.indexOf(')') !== -1) {
ypart = ypart.split(')')[0];
}
currentDisplay.resolutionX = parseInt(xpart) || 0;
currentDisplay.resolutionY = parseInt(ypart) || 0;
currentDisplay.currentResX = currentDisplay.resolutionX;
currentDisplay.currentResY = currentDisplay.resolutionY;
}
} }
if (parts.length > 1 && parts[0].replace(/ +/g, '').toLowerCase().indexOf('pixeldepth') !== -1) { currentDisplay.pixelDepth = parseInt(parts[1]); } // in BIT if (parts.length > 1 && parts[0].replace(/ +/g, '').toLowerCase().indexOf('pixeldepth') !== -1) { currentDisplay.pixelDepth = parseInt(parts[1]); } // in BIT
if (parts.length > 1 && parts[0].replace(/ +/g, '').toLowerCase().indexOf('framebufferdepth') !== -1) { currentDisplay.pixelDepth = parseInt(parts[1]); } // in BIT if (parts.length > 1 && parts[0].replace(/ +/g, '').toLowerCase().indexOf('framebufferdepth') !== -1) { currentDisplay.pixelDepth = parseInt(parts[1]); } // in BIT