diff --git a/.vscode/settings.json b/.vscode/settings.json index 87fc838f..a4423d54 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -39,6 +39,7 @@ "rcompare", "rerender", "respawn", + "rockchip", "rpio", "svgr", "swaptotal", diff --git a/packages/tcore-api/src/Services/Hardware.ts b/packages/tcore-api/src/Services/Hardware.ts index 85f11e1c..18c75be9 100644 --- a/packages/tcore-api/src/Services/Hardware.ts +++ b/packages/tcore-api/src/Services/Hardware.ts @@ -45,12 +45,13 @@ export async function getOSInfo() { const osInfo = await si.osInfo(); const osPlatform = os.platform(); - let version = osInfo.release; + let version = `Version ${osInfo.release}`; let code = ""; let hardware = ""; let name = osInfo.distro || osInfo.codename; const arch = osInfo.arch; const hostname = os.hostname(); + const osVersion = os.version(); // debian // redhat @@ -75,9 +76,14 @@ export async function getOSInfo() { break; } + if (String(osVersion).includes("rockchip")) { + name = "Rock Pi"; + version = `${osInfo.distro || osInfo.codename} ${osInfo.release}`; + hardware = "rock-pi"; + } if (system.raspberry) { hardware = "raspberry-pi"; - version = system.raspberry?.type; + version = `Version ${system.raspberry.type}`; name = "Raspberry Pi"; } diff --git a/packages/tcore-console/assets/icons/rock-pi.svg b/packages/tcore-console/assets/icons/rock-pi.svg new file mode 100644 index 00000000..73f0c4be --- /dev/null +++ b/packages/tcore-console/assets/icons/rock-pi.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/tcore-console/src/Components/Home/OperatingSystem/OperatingSystem.tsx b/packages/tcore-console/src/Components/Home/OperatingSystem/OperatingSystem.tsx index 0a7dcfad..040e0279 100644 --- a/packages/tcore-console/src/Components/Home/OperatingSystem/OperatingSystem.tsx +++ b/packages/tcore-console/src/Components/Home/OperatingSystem/OperatingSystem.tsx @@ -30,6 +30,8 @@ function OperatingSystem(props: IOperatingSystemProps) { const getHardwareIcon = () => { if (os.hardware === "raspberry-pi") { return EIcon["raspberry-pi"]; + } else if (os.hardware === "rock-pi") { + return EIcon["rock-pi"]; } }; @@ -71,7 +73,7 @@ function OperatingSystem(props: IOperatingSystemProps) {