net-suite frontend
Development setup
The initial setup consists of the following steps:
- Install the following
pip
-module usinggit
to be able to generate api configurationspip3 install git+https://gitlab.kit.edu/scc-net/netvs/api-generator.git@main#egg=net-api-generator
- Enter the
frontend
folder usingcd frontend/
- Generate API-Endpoints in
frontend/public/api.yml
usingnet-api-generator openapi --default_endpoint=devel > public/api.yml
devel
,test
can also be used. Additionally, you need generate the files for theapi-services.gen
folder using the following commandnet-api-generator es-webpack
--version=${API_VERSION}
parameter, if you need a specific version. - Create a netvs-configuration
netvs.config.js
. Seenetvs.config.js.example
for more information. In most cases it's enough to simply copy and rename the example config. -
- Set the
FONTAWESOME_NPM_AUTH_TOKEN
environment variable - Run the development server either with
docker
and the docker compose plugin (docker compose
, recommended way)docker-compose up -d netvs-core_run
npm install npm run serve
- Set the
Recommended Setup with Docker and JetBrains WebStorm
docker pull node:16-bullseye
- Settings -> Languages & Frameworks -> Node.js
- Node-Interpreter -> Add...
- Add Remote...
- Docker
- Image name: node:16-bullseye
- Node.js interpreter path: node
- OK
- Select the newly added interpreter
- OK
- Create regular npm run configuration. Add
FONTAWESOME_NPM_AUTH_TOKEN
to environment - In the run configuration: "Browse" docker container settings
- Add port binding for port 8080 from the container to port 8080 on the host.
Local project setup
FONTAWESOME_NPM_AUTH_TOKEN=<token> npm install
Compiles and minifies for production
npm run build
Run your tests
npm run test
Lints and fixes files
npm run lint
Customize configuration
Localization
Done using Vue I18n (v8!).
Locale files are in src/locales
Simple strings
{{$t('label')}}
Using slots
<i18n path="info" tag="p">
<template #limit>
<span>{{ changeLimit }}</span>
</template>
<template #action>
<a :href="changeUrl">{{ $t('change') }}</a>
</template>
</i18n>