diff --git a/core/globals.ts b/core/globals.ts index 34584c4..b66ee03 100644 --- a/core/globals.ts +++ b/core/globals.ts @@ -10,5 +10,4 @@ export const jwt_globals = reactive({ export const vm_cache = reactive({ vms: [] as VM[], - }) diff --git a/ecosystem.config.cjs b/ecosystem.config.cjs new file mode 100644 index 0000000..a2b2e22 --- /dev/null +++ b/ecosystem.config.cjs @@ -0,0 +1,11 @@ +module.exports = { + apps: [ + { + name: 'ServerPanel', + port: '6060', + exec_mode: 'cluster', + instances: 'max', + script: './.output/server/index.mjs' + } + ] +} diff --git a/pages/index.vue b/pages/index.vue index ef70cd9..5cbcf44 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -8,8 +8,6 @@ import {checkAuth} from "~/util/auth"; - - const startVm = async (vm: any) => { try { const response = await axios.post('/api/controlVM', { diff --git a/panel.config.ts b/panel.config.ts index 8c2d37c..a448412 100644 --- a/panel.config.ts +++ b/panel.config.ts @@ -5,7 +5,8 @@ export const settings = reactive({ //Leave empty to scan all interfaces //or change item to "disabled" to disable interface scanning interfaces_to_scan:[ - "enp4s0" + "eno0", + "virtbr0" ], enable_qemu_controls: true, qemu_vms: [ @@ -25,6 +26,5 @@ export const settings = reactive({ ], password:{ hash: "$2y$10$04HVBBemPypGbaMhTmUxX.DUMir1HA4hT6cst.dGabot1ZWR5IQ.6", - salt_rounds: 10 }, }); \ No newline at end of file diff --git a/server/api/getVMs.ts b/server/api/getVMs.ts index 9ae5274..dd84ca4 100644 --- a/server/api/getVMs.ts +++ b/server/api/getVMs.ts @@ -22,7 +22,11 @@ export default defineEventHandler(async () => { const autostartValue = await getAutostartValue(vm.name); const autostart = autostartValue === "enable"; const stateValue = await getStateValue(vm.name); + + const state: 'on' | 'off' = stateValue === "running" ? 'on' : 'off'; + + vm_cache.vms.push({ name: vm.name, os: vm.os,