added ecosystem.config.cjs

This commit is contained in:
WeeXnes 2025-02-27 10:55:22 +01:00
parent 8615047c9b
commit 35728822c2
5 changed files with 17 additions and 5 deletions

View file

@ -10,5 +10,4 @@ export const jwt_globals = reactive({
export const vm_cache = reactive({ export const vm_cache = reactive({
vms: [] as VM[], vms: [] as VM[],
}) })

11
ecosystem.config.cjs Normal file
View file

@ -0,0 +1,11 @@
module.exports = {
apps: [
{
name: 'ServerPanel',
port: '6060',
exec_mode: 'cluster',
instances: 'max',
script: './.output/server/index.mjs'
}
]
}

View file

@ -8,8 +8,6 @@ import {checkAuth} from "~/util/auth";
const startVm = async (vm: any) => { const startVm = async (vm: any) => {
try { try {
const response = await axios.post('/api/controlVM', { const response = await axios.post('/api/controlVM', {

View file

@ -5,7 +5,8 @@ export const settings = reactive({
//Leave empty to scan all interfaces //Leave empty to scan all interfaces
//or change item to "disabled" to disable interface scanning //or change item to "disabled" to disable interface scanning
interfaces_to_scan:[ interfaces_to_scan:[
"enp4s0" "eno0",
"virtbr0"
], ],
enable_qemu_controls: true, enable_qemu_controls: true,
qemu_vms: [ qemu_vms: [
@ -25,6 +26,5 @@ export const settings = reactive({
], ],
password:{ password:{
hash: "$2y$10$04HVBBemPypGbaMhTmUxX.DUMir1HA4hT6cst.dGabot1ZWR5IQ.6", hash: "$2y$10$04HVBBemPypGbaMhTmUxX.DUMir1HA4hT6cst.dGabot1ZWR5IQ.6",
salt_rounds: 10
}, },
}); });

View file

@ -22,7 +22,11 @@ export default defineEventHandler(async () => {
const autostartValue = await getAutostartValue(vm.name); const autostartValue = await getAutostartValue(vm.name);
const autostart = autostartValue === "enable"; const autostart = autostartValue === "enable";
const stateValue = await getStateValue(vm.name); const stateValue = await getStateValue(vm.name);
const state: 'on' | 'off' = stateValue === "running" ? 'on' : 'off'; const state: 'on' | 'off' = stateValue === "running" ? 'on' : 'off';
vm_cache.vms.push({ vm_cache.vms.push({
name: vm.name, name: vm.name,
os: vm.os, os: vm.os,