Skip to content

Commit

Permalink
board info, support for LX120 fans
Browse files Browse the repository at this point in the history
  • Loading branch information
jurkovic-nikola committed Aug 24, 2024
1 parent 7e76486 commit 637f84e
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/devices/linksystemhub/linksystemhub.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ var (
maxLCDBufferSizePerRequest = lcdBufferSize - lcdHeaderSize
supportedDevices = []SupportedDevice{
{DeviceId: 1, Model: 0, Name: "iCUE LINK QX RGB", LedChannels: 34, ContainsPump: false, Desc: "Fan"},
{DeviceId: 2, Model: 0, Name: "iCUE LINK LX RGB", LedChannels: 18, ContainsPump: false, Desc: "Fan"},
{DeviceId: 19, Model: 0, Name: "iCUE LINK RX", LedChannels: 0, ContainsPump: false, Desc: "Fan"},
{DeviceId: 15, Model: 0, Name: "iCUE LINK RX RGB", LedChannels: 8, ContainsPump: false, Desc: "Fan"},
{DeviceId: 4, Model: 0, Name: "iCUE LINK RX MAX", LedChannels: 8, ContainsPump: false, Desc: "Fan"},
Expand Down
46 changes: 42 additions & 4 deletions src/systeminfo/systeminfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,18 @@ type KernelData struct {
Architecture string
}

type MotherboardData struct {
Model string
BIOS string
BIOSDate string
}

type SystemInfo struct {
CPU *CpuData
GPU *GpuData
Kernel *KernelData
Storage *[]StorageData
CPU *CpuData
GPU *GpuData
Kernel *KernelData
Storage *[]StorageData
Motherboard *MotherboardData
}

var info *SystemInfo
Expand All @@ -50,6 +57,7 @@ func Init() {
info.getKernelData()
info.getGpuData()
info.GetStorageData()
info.GetBoardData()
}

// GetInfo will return currently stored system info
Expand Down Expand Up @@ -270,3 +278,33 @@ func (si *SystemInfo) GetStorageData() {

si.Storage = &storageList
}

// GetBoardData will return motherboard details
func (si *SystemInfo) GetBoardData() {
board := &MotherboardData{}

// Motherboard model
f, err := os.ReadFile("/sys/class/dmi/id/product_name")
if err != nil {
logger.Log(logger.Fields{"error": err}).Error("Unable to read kernel ostype")
return
}
board.Model = strings.TrimSpace(string(f))

// BIOS version
f, err = os.ReadFile("/sys/class/dmi/id/bios_version")
if err != nil {
logger.Log(logger.Fields{"error": err}).Error("Unable to read kernel ostype")
return
}
board.BIOS = strings.TrimSpace(string(f))

// BIOS release date
f, err = os.ReadFile("/sys/class/dmi/id/bios_date")
if err != nil {
logger.Log(logger.Fields{"error": err}).Error("Unable to read kernel ostype")
return
}
board.BIOSDate = strings.TrimSpace(string(f))
si.Motherboard = board
}
5 changes: 5 additions & 0 deletions web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,11 @@ <h2 class="h5 mb-0">Temperatures</h2>
<p class="mb-0 text-dash-gray fa-pull-left">Build: {{ .BuildInfo.Revision }}</p><br />
<p class="mb-0 text-dash-gray fa-pull-left">{{ .BuildInfo.Time }}</p>
</div>

<div class="container-fluid fa-pull-right">
<p class="mb-0 text-dash-gray fa-pull-right">{{ .SystemInfo.CPU.Model }} ({{ .SystemInfo.CPU.Cores }}C - {{ .SystemInfo.CPU.Threads }}T)</p><br />
<p class="mb-0 text-dash-gray fa-pull-right">{{ .SystemInfo.Motherboard.Model }} ({{ .SystemInfo.Motherboard.BIOS }} - {{ .SystemInfo.Motherboard.BIOSDate }})</p>
</div>
</footer>
</div>
</div>
Expand Down

0 comments on commit 637f84e

Please sign in to comment.