0
0
mirror of https://github.com/alerta/alerta-webui.git synced 2024-11-21 06:48:01 +00:00
Go to file
2024-04-11 17:04:16 +02:00
.github Replace deprecated upload release asset action (#580) 2024-04-11 17:04:16 +02:00
docs/images Add recent screenshot 2019-08-17 00:21:11 +02:00
public Move beta site to try.alerta.io 2023-03-19 11:00:25 +01:00
scripts Add deploy script for try.alerta.io 2020-07-07 00:38:15 +02:00
src Revert "feat: Implement server-side pagination and filtering (#568)" (#578) 2024-04-10 16:39:38 +02:00
tests feat: Update workflows and lint/format configs (#489) 2021-11-13 10:12:45 +01:00
.browserslistrc First commit 2019-01-17 18:07:37 +01:00
.dockerignore build: use .dockerignore to exclude node_modules (#440) 2021-01-06 15:30:06 +01:00
.env.development Do not hard code ALERTA_ENDPOINT in build artefact 2019-02-22 10:49:51 +01:00
.eslintignore feat: Update workflows and lint/format configs (#489) 2021-11-13 10:12:45 +01:00
.eslintrc.js feat: Update workflows and lint/format configs (#489) 2021-11-13 10:12:45 +01:00
.eslintrc.json feat: Update workflows and lint/format configs (#489) 2021-11-13 10:12:45 +01:00
.gitignore First commit 2019-01-17 18:07:37 +01:00
.prettierignore feat: Update workflows and lint/format configs (#489) 2021-11-13 10:12:45 +01:00
.prettierrc.json feat: Update workflows and lint/format configs (#489) 2021-11-13 10:12:45 +01:00
babel.config.js First commit 2019-01-17 18:07:37 +01:00
CHANGELOG.md build: update changelog for v8.4.0 2021-01-05 23:27:12 +01:00
cypress.json First commit 2019-01-17 18:07:37 +01:00
Dockerfile Pin docker build to node12 2021-11-13 12:09:23 +01:00
jest.config.js fix translation for passed test:unit 2020-01-06 09:23:40 +01:00
LICENSE Update README and add LICENSE 2019-01-17 19:33:05 +01:00
nginx.conf Add nginx config to Docker to handle deep links 2019-04-25 15:01:40 +02:00
package-lock.json Bump version 8.7.0 -> 8.7.1 2024-04-11 12:41:03 +02:00
package.json Bump version 8.7.0 -> 8.7.1 2024-04-11 12:41:03 +02:00
postcss.config.js First commit 2019-01-17 18:07:37 +01:00
README.md build: add build and test status badge and minor fixes 2021-01-09 16:39:49 +01:00
static.json Update heroku static config 2019-07-22 01:05:00 +02:00
tsconfig.json First commit 2019-01-17 18:07:37 +01:00
VERSION Bump version 8.7.0 -> 8.7.1 2024-04-11 12:41:03 +02:00
vue.config.js Add web UI version to About page 2019-08-16 17:10:33 +02:00

Alerta Web UI 7.0

Actions Status Slack chat

Version 7.0 of the Alerta web UI is a VueJS web app.

webui

Installation

To install the web console:

$ wget https://github.com/alerta/alerta-webui/releases/latest/download/alerta-webui.tar.gz
$ tar zxvf alerta-webui.tar.gz
$ cd dist
$ python3 -m http.server 8000

>> browse to http://localhost:8000

Configuration

Most configuration will come from the Alerta API server. The minimum, and most common, configuration is simply to tell the web UI where the API server is located.

Environment variables for some settings can be used at build time:

$ export VUE_APP_ALERTA_ENDPOINT=https://alerta-api.example.com
$ npm install
$ npm run build

or place a config.json configuration file in the dist directory for run time configuration:

{
    "endpoint": "https://alerta-api.example.com"
}

Any setting from the API server can be overridden if included in the local config.json file. For a full list of supported settings see the web UI config settings in the online docs.

As a special case, support for setting an OAuth Client ID using a build-time environment variable is possible but should not be be necessary for most deployments.

$ export VUE_APP_CLIENT_ID=0ffe5d26-6c66-4871-a6fa-593d9fa972b1

Quick Start

A docker container that is built using the most recent master branch is available for download from Docker Hub.

$ docker pull alerta/alerta-beta

It can also be built locally using the Dockerfile in this repository.

$ docker build -t alerta/alerta-beta .

To run, create a config.json file and mount the file into the container

$ echo '{"endpoint": "https://alerta-api.example.com"}' > config.json
$ docker run -v "$PWD/config.json:/usr/share/nginx/html/config.json" \
  -it -p 8000:80 --rm --name alerta-beta alerta/alerta-beta

Note: Update the CORS_ORIGINS setting in the Alerta API server config to include the URL that the beta web console is hosted at otherwise the browser will throw "blocked by CORS policy" errors and not work.

Deployment

Since this is a static web app then a production deployment of Alerta web UI is simply a matter of downloading the release tarball and copying the dist directory to the a location that can be served via a web server or CDN.

See the VueJS platform guide for more information.

Troubleshooting

The two main issues with deployment in production involve CORS and HTML5 history mode.

Cross-origin Errors (CORS)

All modern browsers restrict access of a web app running at one domain to resources at a different origin (domain). This mechanism is known as CORS.

To ensure that the Alerta web app has permission to access the Alerta API at a different origin the web URL needs to be added to the CORS_ORIGINS settings for the API.

See API server configuration for more details.

HTML5 History Mode

The web app uses HTML5 history mode so you must ensure to configure the web server or CDN correctly otherwise users will get 404 errors when accessing deep links such as /alert/:id directly in their browser.

The fix is to provide a catch-all fallback route so that any URL that doesn't match a static asset will be handled by the web app and redirected.

Example using nginx

location / {
  try_files $uri $uri/ /index.html;
}

Development

Project setup

npm install

Compiles and hot-reloads for development

npm run serve

Compiles and minifies for production

npm run build

Tests

Run your tests

npm run test

Lints and fixes files

npm run lint

Run your end-to-end tests

npm run test:e2e

Run your unit tests

npm run test:unit

License

Alerta monitoring system and console
Copyright 2019-2021 Nick Satterly

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.