mirror of
https://github.com/sipeed/NanoKVM.git
synced 2026-09-11 00:22:56 -05:00
NanoKVM Frontend
This is NanoKVM web project. For more documentation, please refer to the Wiki.
Structure
src
├── api // backend api
├── assets // static resources
├── components // public components
├── i18n // language resources
├── jotai // Global jotai variables
├── lib // util libs
├── pages // web pages
│ ├── auth // login and password
│ ├── desktop // remote desktop
│ └── terminal // web terminal
├── router.tsx // routers
└── types // types
Development
Here are some steps you can follow to develop based on your needs:
- Log in to NanoKVM via SSH:
ssh root@your-nanokvm-ip(default password is root); - Stop the current service:
killall NanoKVM-Server.
- Build the frontend project:
pnpm build; - Remove the files in NanoKVM:
rm -rf /kvmapp/server/web; - Upload the new files:
scp -r dist root@your-nanokvm-ip:/kvmapp/server/web; - Start the service:
/kvmapp/server/NanoKVM-Server.
Then, refresh the page in the browser to see the changes.
Configuration
Note: Do not enable these settings in production environment unless you fully understand their purpose!
In development mode, you can edit the configuration file /etc/kvm/server.yaml for easier development:
- Add
log: debugto print service logs. This option may cause service slowdowns, so avoid using it in production. - Add
authentication: disableto disable all authentication, so don't need to log in again after restarting the service. This option should not be enabled in production!
Browser
It's recommended to disable browser caching to avoid access issues during development:
- Open the browser Developer Tools;
- Go to the
Networktab; - Check
Disable cacheoption; - Refresh the page.
Deployment
Build:
cd web
pnpm install
pnpm build
- After the compilation is complete, the
distfolder will be generated. - Rename the folder to
web. - Upload
webto/kvmapp/server/in NanoKVM. - Restart the service by executing
/etc/init.d/S95nanokvm restartin NanoKVM.
Additionally, browser may have old version cache. If you can't open the page, try a force refresh or clear the cache.