MemoryLayout Manufacturer Codes Linux
This commit is contained in:
parent
bfa66553e7
commit
67a6cf008f
@ -201,7 +201,7 @@
|
||||
</div>
|
||||
<div class="row number-section">
|
||||
<div class="col-xl-4 col-lg-4 col-md-4 col-12">
|
||||
<div class="numbers">13,024</div>
|
||||
<div class="numbers">13,086</div>
|
||||
<div class="title">Lines of code</div>
|
||||
</div>
|
||||
<div class="col-xl-4 col-lg-4 col-md-4 col-12">
|
||||
|
||||
@ -44,6 +44,28 @@ const OSX_RAM_manufacturers = {
|
||||
'0x04CD': 'G-Skill'
|
||||
};
|
||||
|
||||
const LINUX_RAM_manufacturers = {
|
||||
'017A': 'Apacer',
|
||||
'0198': 'HyperX',
|
||||
'029E': 'Corsair',
|
||||
'04CB': 'A-DATA',
|
||||
'04CD': 'G-Skill',
|
||||
'059B': 'Crucial',
|
||||
'00CE': 'Samsung',
|
||||
'1315': 'Crutial',
|
||||
'014F': 'Transcend Information',
|
||||
'2C00': 'Micron Technology Inc.',
|
||||
'802C': 'Micron Technology Inc.',
|
||||
'80AD': 'Hynix Semiconductor Inc.',
|
||||
'80CE': 'Samsung Electronics Inc.',
|
||||
'AD00': 'Hynix Semiconductor Inc.',
|
||||
'CE00': 'Samsung Electronics Inc.',
|
||||
'02FE': 'Elpida',
|
||||
'5105': 'Qimonda AG i. In.',
|
||||
'8551': 'Qimonda AG i. In.',
|
||||
'859B': 'Crucial'
|
||||
};
|
||||
|
||||
// _______________________________________________________________________________________
|
||||
// | R A M | H D |
|
||||
// |______________________|_________________________| | |
|
||||
@ -265,13 +287,21 @@ exports.mem = mem;
|
||||
|
||||
function memLayout(callback) {
|
||||
|
||||
function getManufacturer(manId) {
|
||||
function getManufacturerDarwin(manId) {
|
||||
if ({}.hasOwnProperty.call(OSX_RAM_manufacturers, manId)) {
|
||||
return (OSX_RAM_manufacturers[manId]);
|
||||
}
|
||||
return manId;
|
||||
}
|
||||
|
||||
function getManufacturerLinux(manId) {
|
||||
const manIdSearch = manId.replace('0x', '').toUpperCase();
|
||||
if (manIdSearch.length === 4 && {}.hasOwnProperty.call(LINUX_RAM_manufacturers, manIdSearch)) {
|
||||
return (LINUX_RAM_manufacturers[manIdSearch]);
|
||||
}
|
||||
return manId;
|
||||
}
|
||||
|
||||
return new Promise((resolve) => {
|
||||
process.nextTick(() => {
|
||||
|
||||
@ -293,7 +323,7 @@ function memLayout(callback) {
|
||||
type: util.getValue(lines, 'Type:'),
|
||||
clockSpeed: (util.getValue(lines, 'Configured Clock Speed:') ? parseInt(util.getValue(lines, 'Configured Clock Speed:'), 10) : (util.getValue(lines, 'Speed:') ? parseInt(util.getValue(lines, 'Speed:'), 10) : null)),
|
||||
formFactor: util.getValue(lines, 'Form Factor:'),
|
||||
manufacturer: util.getValue(lines, 'Manufacturer:'),
|
||||
manufacturer: getManufacturerLinux(util.getValue(lines, 'Manufacturer:')),
|
||||
partNum: util.getValue(lines, 'Part Number:'),
|
||||
serialNum: util.getValue(lines, 'Serial Number:'),
|
||||
voltageConfigured: parseFloat(util.getValue(lines, 'Configured Voltage:') || null),
|
||||
@ -398,7 +428,7 @@ function memLayout(callback) {
|
||||
type: util.getValue(lines, ' Type:'),
|
||||
clockSpeed: parseInt(util.getValue(lines, ' Speed:'), 10),
|
||||
formFactor: '',
|
||||
manufacturer: getManufacturer(util.getValue(lines, ' Manufacturer:')),
|
||||
manufacturer: getManufacturerDarwin(util.getValue(lines, ' Manufacturer:')),
|
||||
partNum: util.getValue(lines, ' Part Number:'),
|
||||
serialNum: util.getValue(lines, ' Serial Number:'),
|
||||
voltageConfigured: null,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user