updated README.md
This commit is contained in:
parent
520058f18e
commit
f6b3c35b70
3 changed files with 131 additions and 12 deletions
102
README.md
Normal file
102
README.md
Normal file
|
@ -0,0 +1,102 @@
|
||||||
|
# Server Control Panel
|
||||||
|
|
||||||
|
|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
Server Control Panel is a web-based interface for monitoring and managing QEMU virtual machines and system services. Built with **Nuxt.js** and styled using **DaisyUI**, this panel provides real-time system information using the **systeminformation** NPM package.
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- Display OS, CPU, and Memory Information
|
||||||
|
- Manage QEMU Virtual Machines (Start/Shutdown)
|
||||||
|
- View and Control System Services (Start/Stop functionality removed in the latest version)
|
||||||
|
- Clean and modern UI
|
||||||
|
|
||||||
|
## Technologies Used
|
||||||
|
|
||||||
|
- **Nuxt.js** - Vue.js-based framework for SSR and static site generation
|
||||||
|
- **DaisyUI** - Tailwind CSS component library for styling
|
||||||
|
- **systeminformation** - Node.js library for retrieving system and hardware details
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
### Prerequisites
|
||||||
|
|
||||||
|
- Node.js (v16+ recommended)
|
||||||
|
- NPM or Yarn
|
||||||
|
- QEMU installed on the host system
|
||||||
|
|
||||||
|
### Steps
|
||||||
|
|
||||||
|
1. Clone the repository:
|
||||||
|
```sh
|
||||||
|
git clone https://github.com/WeeXnes/server_panel.git
|
||||||
|
cd server_panel
|
||||||
|
```
|
||||||
|
2. Install dependencies:
|
||||||
|
```sh
|
||||||
|
npm install
|
||||||
|
```
|
||||||
|
3. Start the development server:
|
||||||
|
```sh
|
||||||
|
npm run dev
|
||||||
|
```
|
||||||
|
4. Open the panel in your browser at `http://localhost:3000`
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
Modify the `panel.config.ts` file (if needed) to configure VM management and system services settings.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { reactive } from "vue";
|
||||||
|
|
||||||
|
export const settings = reactive({
|
||||||
|
ignoreCache: true,
|
||||||
|
// Leave empty to scan all interfaces
|
||||||
|
// or change item to "disabled" to disable interface scanning
|
||||||
|
interfaces_to_scan:[
|
||||||
|
"eth0"
|
||||||
|
],
|
||||||
|
// enable or disable QEMU controls
|
||||||
|
enable_qemu_controls: true,
|
||||||
|
// list the qemu vm names you want to monitor/scan for
|
||||||
|
qemu_vms: [
|
||||||
|
{
|
||||||
|
name: "Gameserver",
|
||||||
|
// OS Info has to be declared here due to technical
|
||||||
|
// limitations of not being able to gather vm OS info
|
||||||
|
os: "Ubuntu 24.04"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Ubuntu_VM1",
|
||||||
|
os: "Ubuntu 24.04"
|
||||||
|
},
|
||||||
|
],
|
||||||
|
//enable or disable systemctl service monitoring
|
||||||
|
enable_services: true,
|
||||||
|
//list systemctl services to monitor/scan for
|
||||||
|
systemctl_services:[
|
||||||
|
"libvirt",
|
||||||
|
"frp"
|
||||||
|
]
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
- The dashboard provides an overview of system information.
|
||||||
|
- You can start or shut down virtual machines.
|
||||||
|
- Service monitoring
|
||||||
|
|
||||||
|
|
||||||
|
## Author
|
||||||
|
|
||||||
|
Developed by **WeeXnes**
|
||||||
|
|
|
@ -2,7 +2,11 @@ import { reactive } from "vue";
|
||||||
|
|
||||||
export const settings = reactive({
|
export const settings = reactive({
|
||||||
ignoreCache: true,
|
ignoreCache: true,
|
||||||
enable_services: true,
|
//Leave empty to scan all interfaces
|
||||||
|
//or change item to "disabled" to disable interface scanning
|
||||||
|
interfaces_to_scan:[
|
||||||
|
"eth0"
|
||||||
|
],
|
||||||
enable_qemu_controls: true,
|
enable_qemu_controls: true,
|
||||||
qemu_vms: [
|
qemu_vms: [
|
||||||
{
|
{
|
||||||
|
@ -14,6 +18,7 @@ export const settings = reactive({
|
||||||
os: "Ubuntu 24.04"
|
os: "Ubuntu 24.04"
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
enable_services: true,
|
||||||
systemctl_services:[
|
systemctl_services:[
|
||||||
"libvirt",
|
"libvirt",
|
||||||
"frp"
|
"frp"
|
||||||
|
|
|
@ -2,17 +2,18 @@ import { execSync } from 'child_process';
|
||||||
import si from 'systeminformation';
|
import si from 'systeminformation';
|
||||||
import {VM} from "~/types/VM";
|
import {VM} from "~/types/VM";
|
||||||
import {networkInterface} from "~/types/networkInterface";
|
import {networkInterface} from "~/types/networkInterface";
|
||||||
|
import {settings} from "~/panel.config";
|
||||||
|
|
||||||
export default defineEventHandler(async () => {
|
export default defineEventHandler(async () => {
|
||||||
try {
|
try {
|
||||||
const cpuData = await si.cpu();
|
|
||||||
const cpuTemp = await si.cpuTemperature();
|
|
||||||
const osInfo = await si.osInfo();
|
|
||||||
const network = await si.networkInterfaces();
|
const network = await si.networkInterfaces();
|
||||||
|
const interfaces_to_scan = settings.interfaces_to_scan || [];
|
||||||
|
|
||||||
const interfaces: networkInterface[] = [];
|
const interfaces: networkInterface[] = [];
|
||||||
if (Array.isArray(network)) {
|
if (Array.isArray(network)) {
|
||||||
network.forEach((interface_obj) => {
|
network.forEach((interface_obj) => {
|
||||||
|
if(interfaces_to_scan.length > 0){
|
||||||
|
if(interfaces_to_scan.includes(interface_obj.ifaceName)){
|
||||||
interfaces.push({
|
interfaces.push({
|
||||||
name: interface_obj.ifaceName,
|
name: interface_obj.ifaceName,
|
||||||
ip4: interface_obj.ip4,
|
ip4: interface_obj.ip4,
|
||||||
|
@ -21,6 +22,17 @@ export default defineEventHandler(async () => {
|
||||||
ip6subnet: interface_obj.ip6subnet,
|
ip6subnet: interface_obj.ip6subnet,
|
||||||
state: interface_obj.operstate as "up" | "down" | "unknown"
|
state: interface_obj.operstate as "up" | "down" | "unknown"
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
interfaces.push({
|
||||||
|
name: interface_obj.ifaceName,
|
||||||
|
ip4: interface_obj.ip4,
|
||||||
|
ip6: interface_obj.ip6,
|
||||||
|
ip4subnet: interface_obj.ip4subnet,
|
||||||
|
ip6subnet: interface_obj.ip6subnet,
|
||||||
|
state: interface_obj.operstate as "up" | "down" | "unknown"
|
||||||
|
})
|
||||||
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
console.log(network.ifaceName + " is reachable at " + network.ip4);
|
console.log(network.ifaceName + " is reachable at " + network.ip4);
|
||||||
|
|
Loading…
Add table
Reference in a new issue