-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
38 lines (32 loc) · 891 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package main
import (
"fmt"
"qpu-z/pages"
"qpu-z/util"
"runtime"
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/widget"
)
func main() {
app := app.New()
window := app.NewWindow("HacSpeccer")
if runtime.GOOS != "darwin" {
content := widget.NewCard("Unsupported Platform", fmt.Sprintf("HacSpeccer only works on macOS. You are using %s", runtime.GOOS), widget.NewButton("Quit", func() {
window.Close()
}))
window.SetContent(content)
} else {
util.FetchPCIID()
util.IORegistry = util.FetchIORegistry()
tabs := container.NewAppTabs(
container.NewTabItem("Board", pages.BoardPage()),
container.NewTabItem("CPU", pages.CPUPage()),
container.NewTabItem("GPU", pages.GPUPage()),
container.NewTabItem("Memory", pages.MemoryPage()),
container.NewTabItem("PCI", pages.PCIPage()),
)
window.SetContent(tabs)
}
window.ShowAndRun()
}