NAP Dashboard uses the NAP Portal module to generate a ready-made control interface for you NAP application.
Install the packages from NPM:
$ npm installOpen the nap.config.ts file and adjust it to your configuration.
| Property | Description |
|---|---|
socket.host |
The host that exposes the NAP WebSocket server (e.g. localhost, 192.168.1.10) |
socket.port |
The port that exposes the NAP WebSocket server (e.g. 2000) |
socket.user |
The user name for authentication with the NAP WebSocket server |
socket.pass |
The password for authentication with the NAP WebSocket server |
socket.secure |
Whether to use a secure connection (wss, https) or insecure (ws, http) |
portals[].id |
The ID of the portal component specified in the NAP application |
portals[].name |
The name of the portal that will show in the web interface |
portals[].path |
The path of the address route where this component will be available |
layout.showLogin |
Whether to show a login screen or connect automatically using the user and pass as set in config |
Run the dashboard in development mode:
$ npm run devBuild a deployable distribution of the dashboard:
$ npm run buildPreview the distribution build:
$ npm run previewIn case you want to use this repository as your own project starter, you might want more information about the setup. It is created using npm init vite@latest using the vue-ts template.
This template should help get you started developing with Vue 3 and Typescript in Vite. The template uses Vue 3 <script setup> SFCs, check out the script setup docs to learn more.
Since TypeScript cannot handle type information for .vue imports, they are shimmed to be a generic Vue component type by default. In most cases this is fine if you don't really care about component prop types outside of templates. However, if you wish to get actual prop types in .vue imports (for example to get props validation when using manual h(...) calls), you can enable Volar's .vue type support plugin by running Volar: Switch TS Plugin on/off from VSCode command palette.