* Run elm-review from CI
Signed-off-by: Andrey Kuzmin <unsoundscapes@gmail.com>
* Use the jfmengels/elm-review-simplify rule
Signed-off-by: Andrey Kuzmin <unsoundscapes@gmail.com>
* Make assets
Signed-off-by: Andrey Kuzmin <unsoundscapes@gmail.com>
The frontend CI job started to fail for some obscure reasons, most
probably because we use a very old version of NodeJS.
To make it work again, this change does the following:
* Bump to the latest NodeJS LTS version and use the buster variant.
* Use Yarn instead of npm to install Javascript packages.
* Bump Elm components to their latest versions.
There should be no functional change to the UI code.
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
Infer path from Navigation.Location
Build uses template, local dev uses elm-reactor
Remove unneeded local dev go server
Add script.js make target
Compiles and uglifies script.js
Before:
~570kb
After:
~170kb
Bootstrap loading state
Add trailing slash via JS & add routePrefix console param
Add Javascript script tag to `index.html` which adds a trailing slash to
the url pathname if none is present. This is done to ensure assets like
`script.js` are loaded properly.
Example without patch:
If the pathname is "mxinden.com/alertmanager" the browser will try to
download the `script.js` asset from "mxinden.com/script.js". This
request will fail.
Example with patch:
If the pathname is "mxinden.com/alertmanager", Javascript redirects the
browser to "mxinden.com/alertmanager/" and then the `script.js` asset
will be downloaded from "mxinden.com/alertmanager/script.js". This
request will succeed.
Add `-web.route-prefix` as a console parameter. This configures a
Prefix for the internal routes of web endpoints. Defaults to path of
-web.external-url like in *Prometheus*.
Trim slashes off of route prefix and add one slash at the beginning.
Make sure route prefix is not empty or just a slash before prefixing
router.
This adds three more steps to the Travis tests.
1. Compile Elm -> script.js
2. Bundle html.index & script.js -> bindata.go
3. Check if bindata.go hasn't changed