diff --git a/config/config.json b/config/config.json index 4422a65..78dc0ec 100644 --- a/config/config.json +++ b/config/config.json @@ -23,7 +23,9 @@ /* Maximum filesize to allow when uploading */ "maxUploadSize": 1048576, - /* Provide access point capture redirects on this gateway. -- provides automatic browser launching on Access Point access. */ + /* Provide access point capture redirects on this gateway. -- provides automatic browser launching on Access Point access. + (not implemented) + */ "accessPointGateway": "172.24.1.0/24", "accessPointServerAddress": "172.24.1.1" diff --git a/debugConfig/config.json b/debugConfig/config.json index 029b9c2..1e49995 100644 --- a/debugConfig/config.json +++ b/debugConfig/config.json @@ -23,7 +23,7 @@ /* Maximum filesize to allow when uploading */ "maxUploadSize": 1048576, - /* Provide access point capture redirects on this gateway. */ + /* Provide access point capture redirects on this gateway. (not implemented) */ "accessPointGateway": "192.168.0.0/24", "accessPointServerAddress" : "192.168.0.26:8080" diff --git a/react/public/var/config.json b/react/public/var/config.json index c1902a0..a16e5a4 100644 --- a/react/public/var/config.json +++ b/react/public/var/config.json @@ -1,5 +1,5 @@ { - "socket_server_port": 80, + "socket_server_port": 8080, "socket_server_address": "*", "max_upload_size": 1048576, diff --git a/react/src/JackHostStatus.tsx b/react/src/JackHostStatus.tsx index 9d3d351..626eb40 100644 --- a/react/src/JackHostStatus.tsx +++ b/react/src/JackHostStatus.tsx @@ -26,75 +26,122 @@ const GREEN_COLOR = "#666"; -function tempDisplay(mC: number): string -{ - return (mC/1000).toFixed(1) + "\u00B0C"; // degrees C. +function tempDisplay(mC: number): string { + return (mC / 1000).toFixed(1) + "\u00B0C"; // degrees C. } -function cpuDisplay(cpu: number): string +function cpuDisplay(cpu: number): string { + return cpu.toFixed(1) + "%"; +} + +function fmtCpuFreq(freq: number): string { - return cpu.toFixed(1)+"%"; + if (freq >= 100000000) + { + return (freq/1000000).toFixed(1) + " GHz"; + } + if (freq >= 10000000) + { + return (freq/1000000).toFixed(2) + " GHz"; + } + if (freq >= 1000000) + { + return (freq/1000000).toFixed(3) + " GHz"; + } + if (freq >= 1000) + { + return (freq/1000).toFixed(3) + " MHz"; + } + return freq + " KHz"; } export default class JackHostStatus { - deserialize(input: any): JackHostStatus - { + deserialize(input: any): JackHostStatus { this.active = input.active; this.restarting = input.restarting; this.underruns = input.underruns; this.cpuUsage = input.cpuUsage; this.msSinceLastUnderrun = input.msSinceLastUnderrun; this.temperaturemC = input.temperaturemC; + this.cpuFreqMax = input.cpuFreqMax; + this.cpuFreqMin = input.cpuFreqMin; + this.governor = input.governor; return this; } - hasTemperature() : boolean { + hasTemperature(): boolean { return this.temperaturemC >= -100000; } active: boolean = false; restarting: boolean = false; underruns: number = 0; cpuUsage: number = 0; - msSinceLastUnderrun: number = -5000*1000; + msSinceLastUnderrun: number = -5000 * 1000; temperaturemC: number = -1000000; + cpuFreqMax: number = 0; + cpuFreqMin: number = 0; + governor: string = ""; - static getDisplayView(label: string,status?: JackHostStatus): React.ReactNode { + static getCpuInfo(label: string, status?: JackHostStatus): React.ReactNode { if (!status) { - return (