├── web
├── js
│ └── tools.js
├── img
│ ├── win.webp
│ └── linux.jpg
├── css
│ ├── fonts
│ │ ├── element-icons.ttf
│ │ └── element-icons.woff
│ └── reset.css
└── AGENTS.md
├── android-h5
├── app
│ ├── .gitignore
│ ├── src
│ │ ├── main
│ │ │ ├── res
│ │ │ │ ├── values
│ │ │ │ │ ├── strings.xml
│ │ │ │ │ ├── colors.xml
│ │ │ │ │ └── themes.xml
│ │ │ │ ├── mipmap-hdpi
│ │ │ │ │ ├── ic_launcher.webp
│ │ │ │ │ └── ic_launcher_round.webp
│ │ │ │ ├── mipmap-mdpi
│ │ │ │ │ ├── ic_launcher.webp
│ │ │ │ │ └── ic_launcher_round.webp
│ │ │ │ ├── mipmap-xhdpi
│ │ │ │ │ ├── ic_launcher.webp
│ │ │ │ │ └── ic_launcher_round.webp
│ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ │ ├── ic_launcher.webp
│ │ │ │ │ └── ic_launcher_round.webp
│ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ │ ├── ic_launcher.webp
│ │ │ │ │ └── ic_launcher_round.webp
│ │ │ │ ├── mipmap-anydpi-v26
│ │ │ │ │ ├── ic_launcher.xml
│ │ │ │ │ └── ic_launcher_round.xml
│ │ │ │ ├── layout
│ │ │ │ │ └── activity_main.xml
│ │ │ │ ├── values-night
│ │ │ │ │ └── themes.xml
│ │ │ │ ├── xml
│ │ │ │ │ └── network_security_config.xml
│ │ │ │ ├── drawable-v24
│ │ │ │ │ └── ic_launcher_foreground.xml
│ │ │ │ └── drawable
│ │ │ │ │ └── ic_launcher_background.xml
│ │ │ ├── AndroidManifest.xml
│ │ │ └── java
│ │ │ │ └── io
│ │ │ │ └── github
│ │ │ │ └── cctyl
│ │ │ │ └── starnode
│ │ │ │ └── h5
│ │ │ │ ├── utils
│ │ │ │ ├── JsResultParser.java
│ │ │ │ └── JsExecUtil.java
│ │ │ │ ├── AssetsWebServer.java
│ │ │ │ └── MainActivity.java
│ │ ├── test
│ │ │ └── java
│ │ │ │ └── io
│ │ │ │ └── github
│ │ │ │ └── cctyl
│ │ │ │ └── starnode
│ │ │ │ └── h5
│ │ │ │ └── ExampleUnitTest.java
│ │ └── androidTest
│ │ │ └── java
│ │ │ └── io
│ │ │ └── github
│ │ │ └── cctyl
│ │ │ └── starnode
│ │ │ └── h5
│ │ │ └── ExampleInstrumentedTest.java
│ ├── proguard-rules.pro
│ └── build.gradle
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
├── .gitignore
├── build.gradle
├── settings.gradle
├── gradle.properties
├── gradlew.bat
└── gradlew
├── img
├── a.png
├── b.png
├── c.jpg
├── d.jpg
├── e.jpg
├── armbian 4c 4g x64.png
├── ubuntu18 2c 4g x64.png
├── ubuntu22 2c 1g x64.png
├── win10 4c 12g x64.png
├── win10 8c 16g x64.png
├── rust_armbian_4c_4g_x64.png
├── rust_debian_2c_4g_x64.png
└── rust_win10_8c_16g_x64.png
├── client
├── linux-client
│ ├── devinfo.cpp
│ ├── config.json
│ ├── README.md
│ ├── CMakeLists.txt
│ ├── info.h
│ ├── main.cpp
│ ├── devinfo.h
│ ├── easywsclient.hpp
│ └── reflect_json.hpp
├── qt-client
│ ├── devinfo.cpp
│ ├── config.json
│ ├── info.h
│ ├── main.cpp
│ ├── CMakeLists.txt
│ ├── devinfo.h
│ ├── wininfo.cpp
│ ├── info.cpp
│ └── qtjson.hpp
├── rust-client
│ ├── src
│ │ ├── lib.rs
│ │ ├── utils.rs
│ │ ├── main.rs
│ │ └── modles.rs
│ ├── config.json
│ └── Cargo.toml
└── js-client
│ ├── config.js
│ ├── test.js
│ ├── app
│ ├── utils
│ │ ├── functions.js
│ │ └── os-data.js
│ └── client.js
│ └── package.json
├── web-h5-vue2
├── public
│ ├── favicon.ico
│ └── index.html
├── src
│ ├── assets
│ │ ├── logo.png
│ │ ├── 问题清单.md
│ │ └── icons
│ │ │ ├── other.svg
│ │ │ ├── linux.svg
│ │ │ ├── windows.svg
│ │ │ └── server.svg
│ ├── App.vue
│ ├── main.js
│ ├── router
│ │ └── index.js
│ ├── components
│ │ ├── DeviceList.vue
│ │ ├── MonitorHeader.vue
│ │ ├── SummaryCards.vue
│ │ ├── HelloWorld.vue
│ │ ├── HardwareCharts.vue
│ │ ├── DeviceCard.vue
│ │ └── SettingsModal.vue
│ ├── services
│ │ └── websocket.js
│ ├── mixins
│ │ └── chartMixin.js
│ └── views
│ │ └── Monitor.vue
├── babel.config.js
├── settings_interface.png
├── .claude
│ └── settings.local.json
├── .mcp.json
├── vue.config.js
├── .gitignore
├── jsconfig.json
├── README.md
├── 原型图
│ ├── 需求文档.md
│ └── index.html
├── package.json
└── CLAUDE.md
├── server
├── config.js
├── test
│ └── test.js
├── package.json
└── app
│ ├── utils
│ ├── functions.js
│ └── os-data.js
│ ├── simpleHttpServer.js
│ └── server.js
├── other-client.md
├── .gitignore
└── README.md
/web/js/tools.js:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/android-h5/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/img/a.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cctyl/starsnode/HEAD/img/a.png
--------------------------------------------------------------------------------
/img/b.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cctyl/starsnode/HEAD/img/b.png
--------------------------------------------------------------------------------
/img/c.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cctyl/starsnode/HEAD/img/c.jpg
--------------------------------------------------------------------------------
/img/d.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cctyl/starsnode/HEAD/img/d.jpg
--------------------------------------------------------------------------------
/img/e.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cctyl/starsnode/HEAD/img/e.jpg
--------------------------------------------------------------------------------
/web/img/win.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cctyl/starsnode/HEAD/web/img/win.webp
--------------------------------------------------------------------------------
/client/linux-client/devinfo.cpp:
--------------------------------------------------------------------------------
1 | #include "devinfo.h"
2 |
3 | DevInfo::DevInfo() {}
4 |
--------------------------------------------------------------------------------
/client/qt-client/devinfo.cpp:
--------------------------------------------------------------------------------
1 | #include "devinfo.h"
2 |
3 | DevInfo::DevInfo() {}
4 |
--------------------------------------------------------------------------------
/web/img/linux.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cctyl/starsnode/HEAD/web/img/linux.jpg
--------------------------------------------------------------------------------
/client/rust-client/src/lib.rs:
--------------------------------------------------------------------------------
1 | pub mod modles;
2 | pub mod services;
3 | pub mod utils;
4 |
--------------------------------------------------------------------------------
/img/armbian 4c 4g x64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cctyl/starsnode/HEAD/img/armbian 4c 4g x64.png
--------------------------------------------------------------------------------
/img/ubuntu18 2c 4g x64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cctyl/starsnode/HEAD/img/ubuntu18 2c 4g x64.png
--------------------------------------------------------------------------------
/img/ubuntu22 2c 1g x64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cctyl/starsnode/HEAD/img/ubuntu22 2c 1g x64.png
--------------------------------------------------------------------------------
/img/win10 4c 12g x64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cctyl/starsnode/HEAD/img/win10 4c 12g x64.png
--------------------------------------------------------------------------------
/img/win10 8c 16g x64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cctyl/starsnode/HEAD/img/win10 8c 16g x64.png
--------------------------------------------------------------------------------
/client/linux-client/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "server": "服务端地址",
3 | "port": 6080,
4 | "token": "你的token"
5 | }
6 |
--------------------------------------------------------------------------------
/client/qt-client/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "server": "服务端地址",
3 | "port": 6080,
4 | "token": "你的token"
5 | }
6 |
--------------------------------------------------------------------------------
/client/rust-client/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "server": "服务端地址",
3 | "port": 服务端端口,
4 | "token": "token"
5 | }
6 |
--------------------------------------------------------------------------------
/img/rust_armbian_4c_4g_x64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cctyl/starsnode/HEAD/img/rust_armbian_4c_4g_x64.png
--------------------------------------------------------------------------------
/img/rust_debian_2c_4g_x64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cctyl/starsnode/HEAD/img/rust_debian_2c_4g_x64.png
--------------------------------------------------------------------------------
/img/rust_win10_8c_16g_x64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cctyl/starsnode/HEAD/img/rust_win10_8c_16g_x64.png
--------------------------------------------------------------------------------
/web-h5-vue2/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cctyl/starsnode/HEAD/web-h5-vue2/public/favicon.ico
--------------------------------------------------------------------------------
/web-h5-vue2/src/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cctyl/starsnode/HEAD/web-h5-vue2/src/assets/logo.png
--------------------------------------------------------------------------------
/web/css/fonts/element-icons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cctyl/starsnode/HEAD/web/css/fonts/element-icons.ttf
--------------------------------------------------------------------------------
/web/css/fonts/element-icons.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cctyl/starsnode/HEAD/web/css/fonts/element-icons.woff
--------------------------------------------------------------------------------
/web-h5-vue2/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: [
3 | '@vue/cli-plugin-babel/preset'
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------
/web-h5-vue2/settings_interface.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cctyl/starsnode/HEAD/web-h5-vue2/settings_interface.png
--------------------------------------------------------------------------------
/android-h5/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | starnode-h5
3 |
--------------------------------------------------------------------------------
/client/linux-client/README.md:
--------------------------------------------------------------------------------
1 |
2 | ### 开发环境依赖
3 | - sudo apt install libssl-dev
4 | - sudo apt install libcurl4-openssl-dev
--------------------------------------------------------------------------------
/android-h5/app/src/main/res/mipmap-hdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cctyl/starsnode/HEAD/android-h5/app/src/main/res/mipmap-hdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/android-h5/app/src/main/res/mipmap-mdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cctyl/starsnode/HEAD/android-h5/app/src/main/res/mipmap-mdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/client/js-client/config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | port: 6080,
3 | token: '你的token',
4 | serverHost:'服务端地址',
5 | endpointName: null
6 | };
7 |
8 |
--------------------------------------------------------------------------------
/web-h5-vue2/.claude/settings.local.json:
--------------------------------------------------------------------------------
1 | {
2 | "enabledMcpjsonServers": [
3 | "chrome-devtools"
4 | ],
5 | "enableAllProjectMcpServers": true
6 | }
7 |
--------------------------------------------------------------------------------
/android-h5/app/src/main/res/mipmap-xhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cctyl/starsnode/HEAD/android-h5/app/src/main/res/mipmap-xhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/android-h5/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cctyl/starsnode/HEAD/android-h5/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/android-h5/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cctyl/starsnode/HEAD/android-h5/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/android-h5/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cctyl/starsnode/HEAD/android-h5/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/android-h5/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cctyl/starsnode/HEAD/android-h5/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/android-h5/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cctyl/starsnode/HEAD/android-h5/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/android-h5/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cctyl/starsnode/HEAD/android-h5/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/android-h5/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cctyl/starsnode/HEAD/android-h5/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/web-h5-vue2/.mcp.json:
--------------------------------------------------------------------------------
1 | {
2 | "mcpServers": {
3 | "chrome-devtools": {
4 | "command": "npx",
5 | "args": ["-y","--browserUrl" ,"chrome-devtools-mcp@latest"]
6 | }
7 | }
8 | }
--------------------------------------------------------------------------------
/server/config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | port: 6080,
3 | token: '你的token',
4 | endpointName: null,
5 | warnApi:'告警信息api地址',
6 | warnToken:'告警信息的token'
7 | };
8 |
9 |
--------------------------------------------------------------------------------
/web-h5-vue2/vue.config.js:
--------------------------------------------------------------------------------
1 | const { defineConfig } = require('@vue/cli-service')
2 | module.exports = defineConfig({
3 | // publicPath:"./",
4 | transpileDependencies: true,
5 | outputDir:"D:\\project\\starsnode\\android-h5\\app\\src\\main\\assets\\www"
6 | })
7 |
--------------------------------------------------------------------------------
/android-h5/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Jun 18 09:36:29 CST 2025
2 | distributionBase=GRADLE_USER_HOME
3 | distributionUrl=https://mirrors.cloud.tencent.com/gradle/gradle-7.2-bin.zip
4 | distributionPath=wrapper/dists
5 | zipStorePath=wrapper/dists
6 | zipStoreBase=GRADLE_USER_HOME
7 |
--------------------------------------------------------------------------------
/client/rust-client/src/utils.rs:
--------------------------------------------------------------------------------
1 |
2 |
3 | pub fn byte_to_gb(byte: f32) -> f32 {
4 | byte / 1024.0 / 1024.0 / 1024.0
5 | }
6 | pub fn byte_to_mb(byte: f32) -> f32 {
7 | byte / 1024.0 / 1024.0
8 | }
9 |
10 | pub fn round_f32(n: f32) -> f32 {
11 | (n * 100.0).round() / 100.0
12 | }
--------------------------------------------------------------------------------
/web-h5-vue2/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
19 |
--------------------------------------------------------------------------------
/client/js-client/test.js:
--------------------------------------------------------------------------------
1 | const osu = require('node-os-utils')
2 | const os = require('os')
3 | const getOsData = require('./app/utils/os-data');
4 |
5 |
6 | (
7 | async function () {
8 | let result = await os.networkInterfaces();
9 | console.log(result)
10 | }
11 | )();
12 |
--------------------------------------------------------------------------------
/android-h5/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 | .cxx
15 | local.properties
16 | release
--------------------------------------------------------------------------------
/server/test/test.js:
--------------------------------------------------------------------------------
1 | const osu = require('node-os-utils')
2 | const os = require('os')
3 | const getOsData = require('../app/utils/os-data');
4 |
5 |
6 | (
7 | async function () {
8 | let result = await os.networkInterfaces();
9 | console.log(result)
10 | }
11 | )();
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/android-h5/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 | plugins {
3 | id 'com.android.application' version '7.1.3' apply false
4 | id 'com.android.library' version '7.1.3' apply false
5 | }
6 |
7 | task clean(type: Delete) {
8 | delete rootProject.buildDir
9 | }
--------------------------------------------------------------------------------
/android-h5/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/android-h5/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/web-h5-vue2/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | /dist
4 |
5 |
6 | # local env files
7 | .env.local
8 | .env.*.local
9 |
10 | # Log files
11 | npm-debug.log*
12 | yarn-debug.log*
13 | yarn-error.log*
14 | pnpm-debug.log*
15 |
16 | # Editor directories and files
17 | .idea
18 | .vscode
19 | *.suo
20 | *.ntvs*
21 | *.njsproj
22 | *.sln
23 | *.sw?
24 |
--------------------------------------------------------------------------------
/web-h5-vue2/src/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 | import router from './router'
4 | import './assets/monitor.css'
5 | import VConsole from 'vconsole';
6 |
7 |
8 |
9 | // const vConsole = new VConsole();
10 |
11 | Vue.config.productionTip = false
12 |
13 | new Vue({
14 | router,
15 | render: h => h(App),
16 | }).$mount('#app')
17 |
--------------------------------------------------------------------------------
/web-h5-vue2/jsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es5",
4 | "module": "esnext",
5 | "baseUrl": "./",
6 | "moduleResolution": "node",
7 | "paths": {
8 | "@/*": [
9 | "src/*"
10 | ]
11 | },
12 | "lib": [
13 | "esnext",
14 | "dom",
15 | "dom.iterable",
16 | "scripthost"
17 | ]
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/web-h5-vue2/src/assets/问题清单.md:
--------------------------------------------------------------------------------
1 |
2 | # 加载不了图片问题
3 |
4 | 放在public下的图片,打包后变成/img/xxx.svg,
5 | 但是在android加载时,会变成file:///img/xxx.svg。
6 |
7 |
8 | ## 排除法
9 | - 不是android webview的问题,因为simple-backup的html放在这个app里,图片可以正常加载,所以确定是web项目的问题
10 | - 在index.html用./img/xxx.svg 可以正常加载
11 | - /img 或者 img ,都不行,都是 file:///img/xxx.svg
12 | - ./img不行,会提示打包失败
13 | - 不是文件类型的问题,.svg改为.jpg也不行
14 | - 和simple-backup打包后文件对比,发现那边也是 /img作为路径,打包后也是/img,但是它的可以正常加载
--------------------------------------------------------------------------------
/web-h5-vue2/README.md:
--------------------------------------------------------------------------------
1 | # starnode-h5
2 |
3 | ## Project setup
4 | ```
5 | npm install
6 | ```
7 |
8 | ### Compiles and hot-reloads for development
9 | ```
10 | npm run serve
11 | ```
12 |
13 | ### Compiles and minifies for production
14 | ```
15 | npm run build
16 | ```
17 |
18 | ### Lints and fixes files
19 | ```
20 | npm run lint
21 | ```
22 |
23 | ### Customize configuration
24 | See [Configuration Reference](https://cli.vuejs.org/config/).
25 |
--------------------------------------------------------------------------------
/android-h5/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFBB86FC
4 | #FF6200EE
5 | #FF3700B3
6 | #FF03DAC5
7 | #FF018786
8 | #FF000000
9 | #FFFFFFFF
10 |
--------------------------------------------------------------------------------
/web-h5-vue2/src/router/index.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue';
2 | import VueRouter from 'vue-router';
3 | import Monitor from '../views/Monitor.vue';
4 |
5 | Vue.use(VueRouter);
6 |
7 | const routes = [
8 | {
9 | path: '/',
10 | name: 'Monitor',
11 | component: Monitor
12 | },
13 | {
14 | path: '*',
15 | redirect: '/'
16 | }
17 | ];
18 |
19 | const router = new VueRouter({
20 | mode: 'history',
21 | base: process.env.BASE_URL,
22 | routes
23 | });
24 |
25 | export default router;
--------------------------------------------------------------------------------
/android-h5/app/src/test/java/io/github/cctyl/starnode/h5/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package io.github.cctyl.starnode.h5;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/web-h5-vue2/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | 设备监控平台
9 |
10 |
11 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/android-h5/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
12 |
16 |
--------------------------------------------------------------------------------
/client/rust-client/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "starnode"
3 | version = "0.1.0"
4 | edition = "2024"
5 |
6 | [dependencies]
7 | clap = { version = "4.5.39", features = ["derive"] }
8 | serde = { version = "1.0.219", features = ["derive"] }
9 | serde_json = "1.0.140"
10 | tungstenite = "0.26.2"
11 | network-interface = "2.0.1"
12 | sysinfo = "0.35.1"
13 | chrono = "0.4.41"
14 |
15 | minreq = { version = "2.13.4", features = ["https-rustls"] }
16 |
17 | [target.'cfg(target_os = "windows")'.dependencies]
18 | windows = { version = "0.54", features = ["Win32_System_RemoteDesktop", "Win32_System_StationsAndDesktops"] }
19 |
20 |
21 |
--------------------------------------------------------------------------------
/web-h5-vue2/原型图/需求文档.md:
--------------------------------------------------------------------------------
1 |
2 | # 目标
3 | 制作一个手机端使用的监控平台
4 |
5 | # 数据格式
6 | data.json 就是实际数据
7 |
8 | # 要求
9 |
10 | 你需要制作一个html页面,把data.json中的数据完整的解析出来。
11 | 先出一个原型图用html来展示。
12 |
13 |
14 | ## 布局
15 | 因为是提供给手机端查看的,所以字体、缩放等要按照手机的标准设计
16 |
17 | ## 汇总
18 | 页面的最顶端,需要一个汇总,把所有设备的信息汇总在一起,方便查看。
19 | 具体来说,有这些:
20 | - 总在线设备数
21 | - win系统在线设备数
22 | - linux系统在线设备数
23 | - 其他系统在线设备数
24 | - 设备硬件汇总信息
25 | - CPU核心数汇总
26 | - cpu平均使用率
27 | - 磁盘总大小
28 | - 内存总大小
29 |
30 | 最好用图表展示
31 |
32 |
33 | ## 单个设备详情
34 |
35 | 需要首先需要展示设备的基本信息,cpu,内存,硬盘,以及该设备当前网络总上传下载速度,最好能用图表展示。
36 | 然后需要罗列该设备每个网卡信息。
37 | 然后要显示设备每个网卡的网络上传下载速度。
38 |
39 |
40 |
--------------------------------------------------------------------------------
/client/js-client/app/utils/functions.js:
--------------------------------------------------------------------------------
1 | const axios = require('axios');
2 | module.exports = {
3 |
4 | guid() {
5 | return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
6 | var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
7 | return v.toString(16);
8 | });
9 | },
10 | async getIpInfo() {
11 | try {
12 | let {data} = await axios.get('http://ip-api.com/json?lang=zh-CN');
13 | console.log('getIpInfo Success: ', new Date());
14 | return data;
15 | } catch (error) {
16 | console.log('getIpInfo Error: ', new Date(), error)
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/android-h5/settings.gradle:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | repositories {
3 | gradlePluginPortal()
4 | google()
5 | mavenCentral()
6 | maven { url 'https://maven.aliyun.com/repository/jcenteer' }
7 | maven { url 'https://maven.aliyun.com/repository/google' }
8 | maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
9 | maven { url 'https://maven.aliyun.com/repository/public' }
10 |
11 |
12 | }
13 | }
14 | dependencyResolutionManagement {
15 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
16 | repositories {
17 | google()
18 | mavenCentral()
19 | }
20 | }
21 | rootProject.name = "starnode-h5"
22 | include ':app'
23 |
--------------------------------------------------------------------------------
/android-h5/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/server/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "easynode-client",
3 | "version": "1.0.0",
4 | "description": "easynode-client",
5 | "bin": "./app/websocket.js",
6 | "pkg": {
7 | "outputPath": "dist"
8 | },
9 | "scripts": {
10 | "client": "nodemon ./app/main.js",
11 | "pkgwin": "pkg . -t node16-win-x64",
12 | "pkglinux:x86": "pkg . -t node16-linux-x64",
13 | "pkglinux:arm": "pkg . -t node16-linux-arm64"
14 | },
15 | "keywords": [],
16 | "author": "",
17 | "license": "ISC",
18 | "nodemonConfig": {
19 | "ignore": [
20 | "*.json"
21 | ]
22 | },
23 | "dependencies": {
24 | "axios": "^0.21.4",
25 | "node-os-utils": "^1.3.6",
26 | "node-schedule": "^2.1.0",
27 | "ws": "^8.16.0"
28 | },
29 | "devDependencies": {
30 | "eslint": "^7.32.0",
31 | "nodemon": "^2.0.15",
32 | "pkg": "5.6"
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/web-h5-vue2/src/assets/icons/other.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/client/js-client/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "easynode-client",
3 | "version": "1.0.0",
4 | "description": "easynode-client",
5 | "bin": "./app/websocket.js",
6 | "pkg": {
7 | "outputPath": "dist"
8 | },
9 | "scripts": {
10 | "client": "nodemon ./app/main.js",
11 | "pkgwin": "pkg . -t node16-win-x64",
12 | "pkglinux:x86": "pkg . -t node16-linux-x64",
13 | "pkglinux:arm": "pkg . -t node16-linux-arm64"
14 | },
15 | "keywords": [],
16 | "author": "",
17 | "license": "ISC",
18 | "nodemonConfig": {
19 | "ignore": [
20 | "*.json"
21 | ]
22 | },
23 | "dependencies": {
24 | "axios": "^0.21.4",
25 | "node-os-utils": "^1.3.6",
26 | "node-schedule": "^2.1.0",
27 | "ws": "^8.16.0"
28 | },
29 | "devDependencies": {
30 | "eslint": "^7.32.0",
31 | "nodemon": "^2.0.15",
32 | "pkg": "5.6"
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/web-h5-vue2/src/components/DeviceList.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
🖥️ 设备详情
4 |
5 |
6 |
7 |
{{ loadingMessage }}
8 |
9 |
10 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/client/linux-client/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.0)
2 |
3 | project(qt-websocket LANGUAGES CXX)
4 |
5 |
6 | set(CMAKE_CXX_STANDARD 14)
7 | set(CMAKE_CXX_STANDARD_REQUIRED ON)
8 | file(GLOB fileList ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
9 | file(GLOB jsonFileList ${CMAKE_CURRENT_SOURCE_DIR}/json/*.h)
10 | file(GLOB hppFileList ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp)
11 | set(fileList ${fileList} ${jsonFileList} ${hppFileList})
12 | file(COPY config.json DESTINATION ${CMAKE_BINARY_DIR} )
13 | message("库文件有:${fileList}")
14 | #add_executable(qt-websocket
15 | # main.cpp
16 | # info.h info.cpp
17 | # devinfo.h devinfo.cpp reflect.hpp
18 | # linuxinfo.cpp
19 | # reflect_json.hpp
20 | # jsoncpp.cpp
21 | # json/json.h
22 | # json/json-forwards.h
23 | #
24 | #)
25 |
26 | add_executable(qt-websocket ${fileList})
27 | target_link_libraries(qt-websocket ssl crypto curl pthread)
28 |
--------------------------------------------------------------------------------
/android-h5/app/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
--------------------------------------------------------------------------------
/android-h5/app/src/main/res/values-night/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
--------------------------------------------------------------------------------
/client/rust-client/src/main.rs:
--------------------------------------------------------------------------------
1 | #![windows_subsystem = "windows"]
2 |
3 | use clap::Parser;
4 | use std::error::Error;
5 | use std::fs::{self, OpenOptions};
6 | use std::io::Write;
7 | use tungstenite::{Message, connect};
8 |
9 | #[derive(Parser)]
10 | #[command(
11 | version,
12 | about = "star node",
13 | long_about = "star node 轻量级、跨平台的系统监控软件"
14 | )]
15 | struct Cli {
16 | #[arg(short, long)]
17 | config: Option,
18 | }
19 |
20 | fn main() -> Result<(), Box> {
21 | let cliparse = Cli::parse();
22 |
23 | let mut path: String = "config.json".to_string();
24 | match cliparse.config {
25 | Some(s) => {
26 | println!("指定的配置文件路径是:{path}");
27 | path = s
28 | }
29 | None => {
30 | println!("未指定配置文件路径,使用默认路径 ./config.json")
31 | }
32 | }
33 |
34 |
35 | starnode::services::run(path)?;
36 |
37 | Ok(())
38 | }
39 |
--------------------------------------------------------------------------------
/android-h5/app/src/androidTest/java/io/github/cctyl/starnode/h5/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package io.github.cctyl.starnode.h5;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.test.platform.app.InstrumentationRegistry;
6 | import androidx.test.ext.junit.runners.AndroidJUnit4;
7 |
8 | import org.junit.Test;
9 | import org.junit.runner.RunWith;
10 |
11 | import static org.junit.Assert.*;
12 |
13 | /**
14 | * Instrumented test, which will execute on an Android device.
15 | *
16 | * @see Testing documentation
17 | */
18 | @RunWith(AndroidJUnit4.class)
19 | public class ExampleInstrumentedTest {
20 | @Test
21 | public void useAppContext() {
22 | // Context of the app under test.
23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24 | assertEquals("io.github.cctyl.starnode.h5", appContext.getPackageName());
25 | }
26 | }
--------------------------------------------------------------------------------
/client/linux-client/info.h:
--------------------------------------------------------------------------------
1 | #ifndef INFO_H
2 | #define INFO_H
3 | #include "devinfo.h"
4 | #include
5 | #include "easywsclient.hpp"
6 | #define GB (1024.0 * 1024.0 * 1024.0)
7 | #define MB (1024.0 * 1024.0 )
8 | class Info {
9 |
10 |
11 | public:
12 | Info();
13 |
14 | ~Info();
15 |
16 | void initConfig();
17 |
18 | DevInfo d;
19 |
20 | // 通用实现
21 |
22 | void netInterface();
23 |
24 | void ipInfo();
25 |
26 | void refreshDataFast();
27 |
28 | easywsclient::WebSocket::pointer openWs(std::string &url);
29 |
30 | /*
31 | * 获取计算机名称
32 | */
33 | const std::string localmachineName();
34 |
35 | // 不同操作系统分别实现
36 | void memInfo();
37 |
38 | void cpuInfo();
39 |
40 | void driveInfo();
41 |
42 | void netstatInfo();
43 |
44 | void osInfo();
45 | bool firstInit = true;
46 | easywsclient::WebSocket::pointer ws = nullptr;
47 | std::string urlStr;
48 | };
49 |
50 | double formatDouble(double source);
51 |
52 | #endif // INFO_H
53 |
--------------------------------------------------------------------------------
/android-h5/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
15 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/android-h5/app/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.android.application'
3 | }
4 |
5 | android {
6 | compileSdk 32
7 |
8 | defaultConfig {
9 | applicationId "io.github.cctyl.starnode.h5"
10 | minSdk 21
11 | targetSdk 32
12 | versionCode 1
13 | versionName "1.0"
14 |
15 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
16 | }
17 |
18 | buildTypes {
19 | release {
20 | minifyEnabled false
21 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
22 | }
23 | }
24 | compileOptions {
25 | sourceCompatibility JavaVersion.VERSION_1_8
26 | targetCompatibility JavaVersion.VERSION_1_8
27 | }
28 | }
29 |
30 | dependencies {
31 | implementation 'org.nanohttpd:nanohttpd:2.3.1'
32 | implementation 'androidx.appcompat:appcompat:1.3.0'
33 | implementation 'com.google.android.material:material:1.4.0'
34 | implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
35 | testImplementation 'junit:junit:4.13.2'
36 | androidTestImplementation 'androidx.test.ext:junit:1.1.3'
37 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
38 | }
--------------------------------------------------------------------------------
/android-h5/app/src/main/res/xml/network_security_config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 10.0.8.1
6 | 192.168.1.1
7 | 192.168.0.1
8 | localhost
9 | 127.0.0.1
10 |
11 |
12 | 10.0.0.0
13 | 192.168.0.0
14 | 172.16.0.0
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/web-h5-vue2/src/assets/icons/linux.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/web-h5-vue2/src/assets/icons/windows.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/web-h5-vue2/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "starnode-h5",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "serve": "vue-cli-service serve",
7 | "build": "vue-cli-service build",
8 | "lint": "vue-cli-service lint"
9 | },
10 | "dependencies": {
11 | "chart.js": "^4.5.1",
12 | "core-js": "^3.8.3",
13 | "vconsole": "^3.15.1",
14 | "vue": "^2.6.14",
15 | "vue-router": "^3.6.5"
16 | },
17 | "devDependencies": {
18 | "@babel/core": "^7.12.16",
19 | "@babel/eslint-parser": "^7.12.16",
20 | "@vue/cli-plugin-babel": "~5.0.0",
21 | "@vue/cli-plugin-eslint": "~5.0.0",
22 | "@vue/cli-service": "~5.0.0",
23 | "eslint": "^7.32.0",
24 | "eslint-plugin-vue": "^8.0.3",
25 | "vue-template-compiler": "^2.6.14"
26 | },
27 | "eslintConfig": {
28 | "root": true,
29 | "env": {
30 | "node": true
31 | },
32 | "extends": [
33 | "plugin:vue/essential",
34 | "eslint:recommended"
35 | ],
36 | "parserOptions": {
37 | "parser": "@babel/eslint-parser"
38 | },
39 | "rules": {
40 | "no-unused-vars": "off",
41 | "vue/multi-word-component-names": "off"
42 | }
43 | },
44 | "browserslist": [
45 | "> 1%",
46 | "last 2 versions",
47 | "not dead"
48 | ]
49 | }
50 |
--------------------------------------------------------------------------------
/web-h5-vue2/src/components/MonitorHeader.vue:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/android-h5/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app"s APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Enables namespacing of each library's R class so that its R class includes only the
19 | # resources declared in the library itself and none from the library's dependencies,
20 | # thereby reducing the size of the R class for that library
21 | android.nonTransitiveRClass=true
--------------------------------------------------------------------------------
/web/css/reset.css:
--------------------------------------------------------------------------------
1 | /* http://meyerweb.com/eric/tools/css/reset/
2 | v5.0.1 | 20191019
3 | License: none (public domain)
4 | */
5 |
6 | html, body, div, span, applet, object, iframe,
7 | h1, h2, h3, h4, h5, h6, p, blockquote, pre,
8 | a, abbr, acronym, address, big, cite, code,
9 | del, dfn, em, img, ins, kbd, q, s, samp,
10 | small, strike, strong, sub, sup, tt, var,
11 | b, u, i, center,
12 | dl, dt, dd, menu, ol, ul, li,
13 | fieldset, form, label, legend,
14 | table, caption, tbody, tfoot, thead, tr, th, td,
15 | article, aside, canvas, details, embed,
16 | figure, figcaption, footer, header, hgroup,
17 | main, menu, nav, output, ruby, section, summary,
18 | time, mark, audio, video {
19 | margin: 0;
20 | padding: 0;
21 | border: 0;
22 | font-size: 100%;
23 | font: inherit;
24 | vertical-align: baseline;
25 | }
26 | /* HTML5 display-role reset for older browsers */
27 | article, aside, details, figcaption, figure,
28 | footer, header, hgroup, main, menu, nav, section {
29 | display: block;
30 | }
31 | /* HTML5 hidden-attribute fix for newer browsers */
32 | *[hidden] {
33 | display: none;
34 | }
35 | body {
36 | line-height: 1;
37 | }
38 | menu, ol, ul {
39 | list-style: none;
40 | }
41 | blockquote, q {
42 | quotes: none;
43 | }
44 | blockquote:before, blockquote:after,
45 | q:before, q:after {
46 | content: '';
47 | content: none;
48 | }
49 | table {
50 | border-collapse: collapse;
51 | border-spacing: 0;
52 | }
53 |
--------------------------------------------------------------------------------
/client/linux-client/main.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include "info.h"
3 | #include
4 | #include"devinfo.h"
5 | #include
6 | #include
7 | #include "reflect_json.hpp"
8 |
9 |
10 | int main(int argc, char *argv[]) {
11 |
12 |
13 | std::shared_ptr info = std::make_shared();
14 |
15 |
16 | // while(true){
17 | //
18 | // std::cout<<"循环"<cpuInfo();
22 | //// std::cout<d.cpuInfo)<memInfo();
27 | //// std::cout<d.memInfo);
28 | //
29 | //
30 | //// driverInfo
31 | //// info->driveInfo();
32 | //// std::cout<d.driveInfo);
33 | //
34 | //// netstatInfo
35 | //// info->netstatInfo();
36 | //// std::cout<d.netstatInfo);
37 | //
38 | // //netInterface
39 | //// info-> netInterface();
40 | //// std::cout<d.netInterface);
41 | //
42 | // //osInfo
43 | //// info-> osInfo();
44 | //// std::cout<d.osInfo);
45 | ////
46 | // sleep(1);
47 | // info->firstInit = false;
48 | // }
49 |
50 |
51 |
52 | std::cout << "主线程退出" << std::endl;
53 |
54 |
55 | return 0;
56 | }
57 |
58 |
--------------------------------------------------------------------------------
/client/qt-client/info.h:
--------------------------------------------------------------------------------
1 | #ifndef INFO_H
2 | #define INFO_H
3 | #include "devinfo.h"
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include
14 | #include
15 | #include
16 | #include
17 | #include
18 | #include
19 | #include
20 | #include
21 | #include
22 |
23 | #define GB (1024.0 * 1024.0 * 1024.0)
24 | #define MB (1024.0 * 1024.0 )
25 | class Info : public QObject {
26 |
27 | Q_OBJECT
28 | public:
29 | Info();
30 |
31 | ~Info();
32 |
33 | void initConfig();
34 |
35 | DevInfo d;
36 |
37 | // 通用实现
38 |
39 | void netInterface();
40 |
41 | void ipInfo();
42 |
43 | void onTextMessageReceived(const QString &message);
44 |
45 | void onConnected();
46 |
47 | void onDisconnected();
48 |
49 | /*
50 | * 获取计算机名称
51 | */
52 | const QString localmachineName();
53 |
54 | // 不同操作系统分别实现
55 | void memInfo();
56 |
57 | void cpuInfo();
58 |
59 | void driveInfo();
60 |
61 | void netstatInfo();
62 |
63 | void osInfo();
64 | bool firstInit = true;
65 | private:
66 | QWebSocket *clientSocket;
67 | QString urlStr;
68 | QUrl url;
69 | };
70 |
71 | double formatDouble(double source);
72 |
73 | #endif // INFO_H
74 |
--------------------------------------------------------------------------------
/client/qt-client/main.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include "info.h"
3 | #include
4 | #include
5 | #include"qtjson.hpp"
6 | #include"devinfo.h"
7 | #include
8 | #include
9 | #include
10 |
11 |
12 |
13 | int main(int argc, char *argv[])
14 | {
15 |
16 |
17 | QCoreApplication a(argc,argv);
18 |
19 |
20 | std::shared_ptr info = std::make_shared();
21 |
22 |
23 | // while(true){
24 |
25 | // // //cpuInfo 的封装
26 | // // info->cpuInfo();
27 | // // qDebug().noquote()<d.cpuInfo);
28 |
29 |
30 | // // //memInfo
31 | // //info->memInfo();
32 | // //qDebug().noquote()<d.memInfo);
33 |
34 |
35 | // // driverInfo
36 | // //info->driveInfo();
37 | // //qDebug().noquote()<d.driveInfo);
38 |
39 | // //netstatInfo
40 | // // info->netstatInfo();
41 | // // qDebug().noquote()<d.netstatInfo);
42 |
43 | // //netInterface
44 | // // info-> netInterface();
45 | // // qDebug().noquote()<d.netInterface);
46 |
47 | // //osInfo
48 | // info-> osInfo();
49 | // qDebug().noquote()<d.osInfo);
50 |
51 |
52 | // sleep(1);
53 | // info->firstInit = false;
54 | // }
55 |
56 |
57 |
58 | int r = a.exec();
59 | return r;
60 |
61 |
62 | // return 0;
63 | }
64 |
65 |
--------------------------------------------------------------------------------
/web-h5-vue2/CLAUDE.md:
--------------------------------------------------------------------------------
1 | # CLAUDE.md
2 |
3 | This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4 |
5 | ## 项目概述
6 |
7 | 这是一个基于 Vue 2 的 H5 Web 项目,名为 "starnode-h5"。项目使用 Vue CLI 5 构建工具进行开发和打包。
8 |
9 | ## 常用命令
10 |
11 | ### 开发服务器
12 | ```bash
13 | npm run serve
14 | ```
15 | 启动开发服务器,支持热重载。
16 |
17 | ### 生产构建
18 | ```bash
19 | npm run build
20 | ```
21 | 编译并压缩代码用于生产环境。
22 |
23 | ### 代码检查
24 | ```bash
25 | npm run lint
26 | ```
27 | 运行 ESLint 检查并修复代码风格问题。
28 |
29 | ### 依赖安装
30 | ```bash
31 | npm install
32 | ```
33 | 安装项目所需的所有依赖包。
34 |
35 | ## 项目结构
36 |
37 | ```
38 | ├── public/ # 静态资源目录
39 | │ ├── index.html # HTML 模板
40 | │ └── favicon.ico # 网站图标
41 | ├── src/ # 源代码目录
42 | │ ├── assets/ # 静态资源文件
43 | │ ├── components/ # Vue 组件
44 | │ ├── App.vue # 根组件
45 | │ └── main.js # 应用入口文件
46 | ├── babel.config.js # Babel 配置
47 | ├── vue.config.js # Vue CLI 配置
48 | └── package.json # 项目配置和依赖
49 | ```
50 |
51 | ## 技术栈
52 |
53 | - **前端框架**: Vue 2.6.14
54 | - **构建工具**: Vue CLI 5.0.0
55 | - **代码检查**: ESLint + Vue 插件
56 | - **JavaScript 编译**: Babel
57 | - **CSS 预处理**: 无(原生 CSS)
58 |
59 | ## 开发配置
60 |
61 | ### ESLint 配置
62 | - 使用 Vue Essential 规则集
63 | - 集成 ESLint 推荐规则
64 | - 使用 Babel 解析器支持现代 JavaScript 语法
65 |
66 | ### Babel 配置
67 | 项目配置了 Babel 用于转译现代 JavaScript 语法,确保浏览器兼容性。
68 |
69 | ### Vue CLI 配置
70 | 当前的 Vue CLI 配置较为简洁,启用了 `transpileDependencies` 选项来转译依赖包。
71 |
72 | ## 浏览器支持
73 |
74 | 项目支持以下浏览器:
75 | - > 1% 市场份额的浏览器
76 | - 最新 2 个版本
77 | - 不支持已停止维护的浏览器
--------------------------------------------------------------------------------
/android-h5/app/src/main/java/io/github/cctyl/starnode/h5/utils/JsResultParser.java:
--------------------------------------------------------------------------------
1 | package io.github.cctyl.starnode.h5.utils;
2 |
3 | import org.json.JSONArray;
4 | import org.json.JSONException;
5 | import org.json.JSONObject;
6 |
7 | public class JsResultParser {
8 | public static Object parse(String jsonValue) {
9 | if (jsonValue == null) return null; // undefined
10 | if ("null".equals(jsonValue)) return null; // null
11 | if ("undefined".equals(jsonValue)) return null; // null
12 | try {
13 |
14 | // 尝试解析为 JSON 对象
15 | return new JSONObject(jsonValue);
16 | } catch (JSONException e1) {
17 | try {
18 | // 尝试解析为 JSON 数组
19 | return new JSONArray(jsonValue);
20 | } catch (JSONException e2) {
21 | // 尝试解析基本类型
22 | if (jsonValue.startsWith("\"") && jsonValue.endsWith("\"")) {
23 | // 字符串类型(去除引号)
24 | return jsonValue.substring(1, jsonValue.length() - 1);
25 | } else if ("true".equals(jsonValue) || "false".equals(jsonValue)) {
26 | // 布尔类型
27 | return Boolean.parseBoolean(jsonValue);
28 | } else {
29 | try {
30 | // 数字类型
31 | return Double.parseDouble(jsonValue);
32 | } catch (NumberFormatException e) {
33 | // 无法识别的格式
34 | return jsonValue;
35 | }
36 | }
37 | }
38 | }
39 | }
40 | }
41 |
42 |
--------------------------------------------------------------------------------
/server/app/utils/functions.js:
--------------------------------------------------------------------------------
1 | const axios = require('axios');
2 | const path = require('path');
3 | const config = require(path.join(process.cwd(), './config.js'));
4 | module.exports = {
5 |
6 | guid() {
7 | return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
8 | var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
9 | return v.toString(16);
10 | });
11 | },
12 | async getIpInfo() {
13 | try {
14 | let {data} = await axios.get('http://ip-api.com/json?lang=zh-CN');
15 | console.log('getIpInfo Success: ', new Date());
16 | return data;
17 | } catch (error) {
18 | console.log('getIpInfo Error: ', new Date(), error)
19 | }
20 | },
21 |
22 | /**
23 | * 发送告警信息
24 | * @param messgae
25 | * @returns {Promise}
26 | */
27 | async sendAlert(messgae){
28 | console.log("sendAlert messgae="+messgae)
29 | if (!config.warnApi){
30 | console.log("未配置告警信息,不推送");
31 | return;
32 | }
33 | try {
34 | const encodedMessage = encodeURIComponent(messgae);
35 | let {data} = await axios.post(`${config.warnApi}/messages?content=${encodedMessage}`,null,{
36 | headers: {
37 | 'token': config.warnToken
38 | }
39 | });
40 | console.log("sendAlert resp="+JSON.stringify(data));
41 |
42 | } catch (error) {
43 | console.log(`${config.warnApi}/messages?content=${messgae}`)
44 | console.log('sendAlert Error: ', new Date(), error)
45 | }
46 | },
47 | }
48 |
--------------------------------------------------------------------------------
/android-h5/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
--------------------------------------------------------------------------------
/web-h5-vue2/src/components/SummaryCards.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |

6 |
7 |
8 |
在线设备总数
9 |
{{ summary.total }}
10 |
11 |
12 |
13 |
14 |
15 |

16 |
17 |
18 |
Windows 设备
19 |
{{ summary.windows }}
20 |
21 |
22 |
23 |
24 |
25 |

26 |
27 |
28 |
Linux 设备
29 |
{{ summary.linux }}
30 |
31 |
32 |
33 |
34 |
35 |

36 |
37 |
38 |
其他系统
39 |
{{ summary.other }}
40 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/client/qt-client/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.14)
2 |
3 | project(qt-websocket LANGUAGES CXX)
4 |
5 | set(CMAKE_AUTOUIC ON)
6 | set(CMAKE_AUTOMOC ON)
7 | set(CMAKE_AUTORCC ON)
8 |
9 | set(CMAKE_CXX_STANDARD 17)
10 | set(CMAKE_CXX_STANDARD_REQUIRED ON)
11 |
12 | find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
13 | find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core)
14 | find_package(Qt6 REQUIRED COMPONENTS Network)
15 | find_package(Qt6 REQUIRED COMPONENTS WebSockets)
16 |
17 | #隐藏console
18 | if(WIN32)
19 | link_libraries("IPHLPAPI.lib")
20 | if(MSVC)
21 | set_target_properties(${PROJECT_NAME} PROPERTIES
22 | WIN32_EXECUTABLE YES
23 | LINK_FLAGS "/ENTRY:mainCRTStartup"
24 | )
25 | elseif(CMAKE_COMPILER_IS_GNUCXX)
26 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mwindows") # Not tested
27 | else()
28 | message(SEND_ERROR "You are using an unsupported Windows compiler! (Not MSVC or GCC)")
29 | endif(MSVC)
30 | elseif(APPLE)
31 | set_target_properties(${PROJECT_NAME} PROPERTIES
32 | MACOSX_BUNDLE YES
33 | )
34 | elseif(UNIX)
35 | # Nothing special required
36 | else()
37 | message(SEND_ERROR "You are on an unsupported platform! (Not Win32, Mac OS X or Unix)")
38 | endif(WIN32)
39 |
40 | add_executable(qt-websocket
41 | main.cpp
42 | info.h info.cpp
43 | devinfo.h devinfo.cpp
44 | qtjson.hpp reflect.hpp
45 | wininfo.cpp
46 | linuxinfo.cpp
47 | )
48 | target_link_libraries(qt-websocket Qt${QT_VERSION_MAJOR}::Core Qt6::Network Qt6::WebSockets)
49 |
50 | include(GNUInstallDirs)
51 | install(TARGETS qt-websocket
52 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
53 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
54 | )
55 |
--------------------------------------------------------------------------------
/other-client.md:
--------------------------------------------------------------------------------
1 |
2 | # 其他客户端的安装配置
3 | QT客户端和C++Linux客户端已经被rust客户端统一代替,不推荐使用。这里提供之前的打包方式
4 |
5 | ## 性能展示
6 |
7 | ### qt客户端
8 |
9 | win10以及win11实测,只占用5m左右的内存,百分之0.几的cpu
10 |
11 | #### win10 4c 12g x64
12 |
13 |
14 |
15 |
16 | #### win10 8c 16g x64
17 |
18 |
19 |
20 |
21 |
22 | ### linux客户端
23 |
24 | 在ubuntu和armbian均进行过测试,约占用14m左右的内存,百分之0.几的cpu。
25 |
26 | 如果你不需要主机所在地的ip信息,甚至只占用3.9M。
27 |
28 | #### armbian 4c 4g arm64
29 |
30 |
31 |
32 |
33 | #### ubuntu18 2c 4g x64
34 |
35 |
36 |
37 |
38 | #### ubuntu22 2c 1g x64
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 | ## 安装
47 |
48 | ### qt客户端
49 |
50 | #### win平台
51 | 下载release文件,直接双击exe启动即可,启动后窗口会关闭,并在后台运行
52 |
53 |
54 | #### linux平台
55 | 下载release文件(如果我打包了的话)
56 | ```
57 | chmod 755 ./qt-websocket
58 | ./qt-websocket
59 | ```
60 |
61 |
62 | ### linux客户端
63 |
64 | #### 使用编译好的
65 | 直接下载解压并执行即可(如果我提供了的话)
66 |
67 | #### 本地编译
68 | 灰常简单。
69 |
70 | ##### 环境要求
71 | ```
72 | gcc >= 5.4
73 | c++ >= 14
74 | cmake >= 3.0
75 | ```
76 |
77 | ```
78 | # 安装常见开发环境
79 | sudo apt-get install build-essential libgl1-mesa-dev
80 |
81 | # 安装cmake
82 | sudo apt install cmake
83 |
84 | # 安装libcurl
85 | sudo apt-get install libcurl4-openssl-dev
86 |
87 | # 安装openssl开发工具
88 | sudo apt-get install libssl-dev
89 |
90 | # 下载源码并解压
91 | git clone https://github.com/cctyl/starsnode.git
92 | cd starsnode/client/linux-client
93 |
94 | #开始编译
95 | mkdir build
96 | cd build
97 | cmake ..
98 | make
99 |
100 | #执行
101 | ./qt-websocket
102 |
103 |
104 | ```
105 |
--------------------------------------------------------------------------------
/server/app/utils/os-data.js:
--------------------------------------------------------------------------------
1 | const osu = require('node-os-utils')
2 | const os = require('os')
3 |
4 | let cpu = osu.cpu
5 | let mem = osu.mem
6 | let drive = osu.drive
7 | let netstat = osu.netstat
8 | let osuOs = osu.os
9 | let users = osu.users
10 |
11 | async function cpuInfo() {
12 | let cpuUsage = await cpu.usage(200)
13 | let cpuCount = cpu.count()
14 | let cpuModel = cpu.model()
15 | return {
16 | cpuUsage,
17 | cpuCount,
18 | cpuModel
19 | }
20 | }
21 |
22 | async function memInfo() {
23 | let memInfo = await mem.info()
24 | return {
25 | ...memInfo
26 | }
27 | }
28 |
29 | async function driveInfo() {
30 | let driveInfo = {}
31 | try {
32 | driveInfo = await drive.info()
33 | } catch {
34 | // console.log(driveInfo)
35 | }
36 | return driveInfo
37 | }
38 |
39 | async function netstatInfo() {
40 | let netstatInfo = await netstat.inOut()
41 | return netstatInfo === 'not supported' ? {} : netstatInfo
42 | }
43 |
44 | async function netInterface() {
45 | let result = await os.networkInterfaces();
46 | return result;
47 | }
48 |
49 | async function osInfo() {
50 | let type = os.type()
51 | let platform = os.platform()
52 | let release = os.release()
53 | let uptime = osuOs.uptime()
54 | let ip = osuOs.ip()
55 | let hostname = osuOs.hostname()
56 | let arch = osuOs.arch()
57 | return {
58 | type,
59 | platform,
60 | release,
61 | ip,
62 | hostname,
63 | arch,
64 | uptime
65 | }
66 | }
67 |
68 | async function openedCount() {
69 | let openedCount = await users.openedCount()
70 | return openedCount === 'not supported' ? 0 : openedCount
71 | }
72 |
73 | module.exports = async () => {
74 | let data = {}
75 | try {
76 | data = {
77 | cpuInfo: await cpuInfo(),
78 | memInfo: await memInfo(),
79 | driveInfo: await driveInfo(),
80 | netstatInfo: await netstatInfo(),
81 | netInterface: await netInterface(),
82 | osInfo: await osInfo(),
83 | openedCount: await openedCount()
84 | }
85 | return data
86 | } catch(err){
87 | return err.toString()
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/client/js-client/app/utils/os-data.js:
--------------------------------------------------------------------------------
1 | const osu = require('node-os-utils')
2 | const os = require('os')
3 |
4 | let cpu = osu.cpu
5 | let mem = osu.mem
6 | let drive = osu.drive
7 | let netstat = osu.netstat
8 | let osuOs = osu.os
9 | let users = osu.users
10 |
11 | async function cpuInfo() {
12 | let cpuUsage = await cpu.usage(200)
13 | let cpuCount = cpu.count()
14 | let cpuModel = cpu.model()
15 | return {
16 | cpuUsage,
17 | cpuCount,
18 | cpuModel
19 | }
20 | }
21 |
22 | async function memInfo() {
23 | let memInfo = await mem.info()
24 | return {
25 | ...memInfo
26 | }
27 | }
28 |
29 | async function driveInfo() {
30 | let driveInfo = {}
31 | try {
32 | driveInfo = await drive.info()
33 | } catch {
34 | // console.log(driveInfo)
35 | }
36 | return driveInfo
37 | }
38 |
39 | async function netstatInfo() {
40 | let netstatInfo = await netstat.inOut()
41 | return netstatInfo === 'not supported' ? {} : netstatInfo
42 | }
43 |
44 | async function netInterface() {
45 | let result = await os.networkInterfaces();
46 | return result;
47 | }
48 |
49 | async function osInfo() {
50 | let type = os.type()
51 | let platform = os.platform()
52 | let release = os.release()
53 | let uptime = osuOs.uptime()
54 | let ip = osuOs.ip()
55 | let hostname = osuOs.hostname()
56 | let arch = osuOs.arch()
57 | return {
58 | type,
59 | platform,
60 | release,
61 | ip,
62 | hostname,
63 | arch,
64 | uptime
65 | }
66 | }
67 |
68 | async function openedCount() {
69 | let openedCount = await users.openedCount()
70 | return openedCount === 'not supported' ? 0 : openedCount
71 | }
72 |
73 | module.exports = async () => {
74 | let data = {}
75 | try {
76 | data = {
77 | cpuInfo: await cpuInfo(),
78 | memInfo: await memInfo(),
79 | driveInfo: await driveInfo(),
80 | netstatInfo: await netstatInfo(),
81 | netInterface: await netInterface(),
82 | osInfo: await osInfo(),
83 | openedCount: await openedCount()
84 | }
85 | return data
86 | } catch(err){
87 | return err.toString()
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/web-h5-vue2/src/components/HelloWorld.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
{{ msg }}
4 |
5 | For a guide and recipes on how to configure / customize this project,
6 | check out the
7 | vue-cli documentation.
8 |
9 |
Installed CLI Plugins
10 |
14 |
Essential Links
15 |
22 |
Ecosystem
23 |
30 |
31 |
32 |
33 |
41 |
42 |
43 |
59 |
--------------------------------------------------------------------------------
/client/rust-client/src/modles.rs:
--------------------------------------------------------------------------------
1 | use serde::{Deserialize, Serialize};
2 | use serde_json::Value;
3 | use std::{collections::HashMap};
4 |
5 | #[derive(Debug, Serialize, Deserialize)]
6 | pub struct Config {
7 | pub server: String,
8 | pub port: u16,
9 | pub token: String,
10 | }
11 |
12 | #[derive(Debug, Serialize, Deserialize)]
13 | #[serde(rename_all = "camelCase")]
14 | pub struct CpuInfo {
15 | pub cpu_count: u16,
16 | pub cpu_model: String,
17 | pub cpu_usage: f32,
18 | }
19 | #[derive(Debug, Serialize, Deserialize)]
20 | #[serde(rename_all = "camelCase")]
21 | pub struct DriveInfo {
22 | pub free_gb: f32,
23 | pub free_percentage: f32,
24 | pub total_gb: f32,
25 | pub used_gb: f32,
26 | pub used_percentage: f32,
27 | }
28 |
29 | #[derive(Debug, Serialize, Deserialize)]
30 | #[serde(rename_all = "camelCase")]
31 | pub struct MemInfo {
32 | pub free_mem_mb: f32,
33 | pub free_mem_percentage: f32,
34 | pub total_mem_mb: f32,
35 | pub used_mem_mb: f32,
36 | pub used_mem_percentage: f32,
37 | }
38 | #[derive(Debug, Serialize, Deserialize)]
39 | #[serde(rename_all = "camelCase")]
40 | pub struct OsInfo {
41 | pub arch: String,
42 | pub hostname: Option,
43 | pub platform: String,
44 | pub release: Option,
45 | pub r#type: String, // 使用 r# 前缀因为 type 是保留字
46 | pub uptime: u64,
47 | }
48 | #[derive(Debug, Serialize, Deserialize)]
49 | #[serde(rename_all = "camelCase")]
50 | pub struct NetstatInfo {
51 | pub input_mb: f32,
52 | pub output_mb: f32,
53 | }
54 |
55 | #[derive(Debug, Default,Serialize, Deserialize)]
56 | #[serde(rename_all = "camelCase")]
57 | pub struct NetworkInterfaceInfo {
58 | pub address: String,
59 | pub boardcast: String,
60 | pub family:String,
61 | pub mac: Option,
62 | pub netmask: String,
63 | }
64 | #[derive(Debug,Default,Serialize, Deserialize)]
65 | #[serde(rename_all = "camelCase")]
66 | pub struct DevInfo<> {
67 | pub cpu_info: Option,
68 | pub drive_info: Option,
69 | pub mem_info: Option< MemInfo>,
70 | pub net_interface: Option>>,
71 | pub netstat_info: HashMap,
72 | pub opened_count: u16,
73 | pub os_info: Option,
74 | pub ip_info: Option,
75 | }
76 |
--------------------------------------------------------------------------------
/web-h5-vue2/src/assets/icons/server.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/client/qt-client/devinfo.h:
--------------------------------------------------------------------------------
1 | #ifndef DEVINFO_H
2 | #define DEVINFO_H
3 |
4 | #include
5 | #include
6 | #include
7 | #include"qtjson.hpp"
8 |
9 | class CpuInfo{
10 |
11 | public:
12 |
13 | double cpuUsage = 0;
14 | unsigned short cpuCount = 0;
15 | QString cpuModel;
16 |
17 | REFLECT(cpuUsage,cpuCount,cpuModel)
18 | };
19 |
20 | class MemInfo{
21 |
22 |
23 | public:
24 | double totalMemMb;
25 | double usedMemMb;
26 | double freeMemMb;
27 | double usedMemPercentage;
28 | double freeMemPercentage;
29 |
30 | REFLECT(totalMemMb,usedMemMb,freeMemMb,usedMemPercentage,freeMemPercentage)
31 | };
32 | class DriverInfo{
33 |
34 | public:
35 | double totalGb;
36 | double usedGb;
37 | double freeGb ;
38 | double usedPercentage;
39 | double freePercentage;
40 | REFLECT(totalGb,usedGb,freeGb,usedPercentage,freePercentage)
41 | };
42 |
43 | /**
44 | * 网速相关信息
45 | * @brief The NetstatInfo class
46 | */
47 | class NetstatInfo{
48 | public:
49 | double inputMb;
50 | double outputMb;
51 | REFLECT(inputMb,outputMb)
52 | };
53 |
54 | /**
55 | * 网卡信息
56 | *
57 | * @brief The NetInterfaceInfo class
58 | */
59 | class NetInterfaceInfo{
60 | public:
61 |
62 | QString address;
63 | QString netmask;
64 | QString family;
65 | QString mac;
66 | QString boardcast;
67 | bool internal;
68 | REFLECT(address,netmask,family,mac,internal,boardcast)
69 |
70 |
71 |
72 | };
73 |
74 | /**
75 | * 操作系统相关信息
76 | * @brief The OsInfo class
77 | */
78 | class OsInfo{
79 | public:
80 |
81 | QString type = "Windows";//系统类型,Windows 或 Linux
82 | QString platform = "win";
83 | QString release;//系统版本
84 | QString hostname;//机器名
85 | QString arch;//cpu架构
86 | double uptime;//开机时间
87 |
88 |
89 | REFLECT(type,platform,release,hostname,arch,uptime)
90 | };
91 |
92 |
93 |
94 | class DevInfo
95 | {
96 | public:
97 | DevInfo();
98 | CpuInfo cpuInfo;
99 | MemInfo memInfo;
100 | DriverInfo driveInfo;
101 | std::map netstatInfo;
102 | std::map> netInterface;
103 | OsInfo osInfo;
104 | short openedCount = 0;
105 | QJsonObject ipInfo;
106 |
107 | REFLECT(cpuInfo,memInfo,driveInfo,netstatInfo,netInterface,osInfo,openedCount,ipInfo)
108 | };
109 |
110 | #endif // DEVINFO_H
111 |
--------------------------------------------------------------------------------
/client/linux-client/devinfo.h:
--------------------------------------------------------------------------------
1 | #ifndef DEVINFO_H
2 | #define DEVINFO_H
3 |
4 | #include
5 | #include