|
@@ -3,9 +3,11 @@ package main
|
|
|
import (
|
|
|
"encoding/json"
|
|
|
"net/http"
|
|
|
+ "path/filepath"
|
|
|
"runtime"
|
|
|
"time"
|
|
|
|
|
|
+ fs "imuslab.com/arozos/mod/filesystem"
|
|
|
info "imuslab.com/arozos/mod/info/hardwareinfo"
|
|
|
"imuslab.com/arozos/mod/info/logviewer"
|
|
|
usage "imuslab.com/arozos/mod/info/usageinfo"
|
|
@@ -59,17 +61,22 @@ func SystemInfoInit() {
|
|
|
StartDir: "SystemAO/info/overview.html",
|
|
|
})
|
|
|
|
|
|
+ //Load the vendor icon
|
|
|
+ vendorIconSrc := filepath.Join(vendorResRoot, "vendor_icon.png")
|
|
|
+ if !fs.FileExists(vendorIconSrc) {
|
|
|
+ vendorIconSrc = "./web/img/public/vendor_icon.png"
|
|
|
+ }
|
|
|
+ imageBase64, _ := utils.LoadImageAsBase64(vendorIconSrc)
|
|
|
if *allow_hardware_management {
|
|
|
infoServer = info.NewInfoServer(info.ArOZInfo{
|
|
|
BuildVersion: build_version + "." + internal_version,
|
|
|
DeviceVendor: deviceVendor,
|
|
|
DeviceModel: deviceModel,
|
|
|
- //TODO: FIX THIS
|
|
|
- //VendorIcon: "../../" + iconVendor,
|
|
|
- SN: deviceUUID,
|
|
|
- HostOS: runtime.GOOS,
|
|
|
- CPUArch: runtime.GOARCH,
|
|
|
- HostName: *host_name,
|
|
|
+ VendorIcon: imageBase64,
|
|
|
+ SN: deviceUUID,
|
|
|
+ HostOS: runtime.GOOS,
|
|
|
+ CPUArch: runtime.GOARCH,
|
|
|
+ HostName: *host_name,
|
|
|
})
|
|
|
|
|
|
router.HandleFunc("/system/info/getCPUinfo", info.GetCPUInfo)
|
|
@@ -110,12 +117,11 @@ func SystemInfoInit() {
|
|
|
BuildVersion: build_version + "." + internal_version,
|
|
|
DeviceVendor: deviceVendor,
|
|
|
DeviceModel: deviceModel,
|
|
|
- //TODO: FIX THIS
|
|
|
- //VendorIcon: "../../" + iconVendor,
|
|
|
- SN: deviceUUID,
|
|
|
- HostOS: "virtualized",
|
|
|
- CPUArch: "generic",
|
|
|
- HostName: *host_name,
|
|
|
+ VendorIcon: imageBase64,
|
|
|
+ SN: deviceUUID,
|
|
|
+ HostOS: "virtualized",
|
|
|
+ CPUArch: "generic",
|
|
|
+ HostName: *host_name,
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -125,6 +131,15 @@ func SystemInfoInit() {
|
|
|
//ArOZ Info do not need permission router
|
|
|
http.HandleFunc("/system/info/getArOZInfo", infoServer.GetArOZInfo)
|
|
|
|
|
|
+ //Router to handle login background image loading
|
|
|
+ http.HandleFunc("/system/info/wallpaper", func(w http.ResponseWriter, r *http.Request) {
|
|
|
+ imgsrc := filepath.Join(vendorResRoot, "auth_bg.jpg")
|
|
|
+ if !fs.FileExists(imgsrc) {
|
|
|
+ imgsrc = "./web/img/public/auth_bg.jpg"
|
|
|
+ }
|
|
|
+ http.ServeFile(w, r, imgsrc)
|
|
|
+ })
|
|
|
+
|
|
|
go func() {
|
|
|
if updates.CheckLauncherPortResponsive() {
|
|
|
//Launcher port is responsive. Assume launcher exists
|