├── client ├── .gitignore ├── config │ ├── ping.go │ ├── ws.go │ ├── struct.go │ └── info.go ├── tool │ ├── Decimal.go │ └── mem.go ├── proc │ ├── ping.go │ └── status.go ├── go.mod ├── go.sum └── main.go ├── .gitignore ├── web ├── public │ ├── robots.txt │ └── index.html ├── src │ ├── config.js │ ├── class │ │ ├── byteToSize.js │ │ ├── timestampToDate.js │ │ └── timeTransform.js │ └── index.js ├── .gitignore └── package.json ├── server ├── composer.json ├── Applications │ ├── config.php │ ├── start_register.php │ ├── Includes │ │ └── Tool.php │ ├── start_businessworker.php │ ├── start_gateway.php │ ├── start_web.php │ └── Events.php ├── start.php └── composer.lock ├── README.md ├── .github └── workflows │ └── go.yml └── LICENSE /client/.gitignore: -------------------------------------------------------------------------------- 1 | main 2 | serverStatus -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | vendor 3 | server/Applications/Web/* -------------------------------------------------------------------------------- /web/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /server/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": { 3 | "workerman/gateway-worker": "^3.0" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /client/config/ping.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | type Ping struct { 4 | Type string `json:"type"` 5 | Msg string `json:"msg"` 6 | } 7 | -------------------------------------------------------------------------------- /web/src/config.js: -------------------------------------------------------------------------------- 1 | 2 | const config = { 3 | server: 'ws://127.0.0.1:8282', //服务器信息 ws(s)://ip:port 4 | title: 'serverStatus' 5 | } 6 | 7 | export default config 8 | -------------------------------------------------------------------------------- /server/Applications/config.php: -------------------------------------------------------------------------------- 1 | { 3 | if (bytes === 0) return '0 B'; 4 | var k = 1024, 5 | sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'], 6 | i = Math.floor(Math.log(bytes) / Math.log(k)); 7 | 8 | return Number((bytes / Math.pow(k, i)).toPrecision(3)).toLocaleString() + ' ' + sizes[i]; 9 | } 10 | export default bytesToSize; -------------------------------------------------------------------------------- /web/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /web/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 |进程数: -
137 |在线时间: -
138 |负载:-, -, -
139 |主机名: {itemData.Host.HostName}
163 |开机时间: {timestampToDate(itemData.Host.BootTime)}
164 |内核架构: {itemData.Host.KernelArch}
166 |内核版本: {itemData.Host.KernelVersion}
167 |系统类型: {itemData.Host.Os}
168 |平台: {itemData.Host.Platform}
170 |平台家族: {itemData.Host.PlatformFamily}
171 |平台版本: {itemData.Host.PlatformVersion}
172 |虚拟化角色: {itemData.Host.VirtualizationRole}
174 |虚拟化类型: {itemData.Host.VirtualizationSystem}
175 |数据更新时间: {timestampToDate(itemData.Time)}
177 | > 178 | )} 179 | > 180 | 181 | 182 | )} 183 | > 184 | 185 |{itemData.Cpu.ModalName}
198 |{itemData.Cpu.PhysicalCores}个物理核心
199 |{itemData.Cpu.LogicalCores}个逻辑核心
200 | > 201 | )} 202 | > 203 |进程数: {itemData.Host.Procs}
248 |在线时间: {timeTransform(itemData.Host.UpTime)}
249 |负载:{itemData.Load.M1}, {itemData.Load.M5}, {itemData.Load.M15}
250 |