The elm npm package doesn't support linux/arm64. The easiest option
is to force docker to run this as a AMD64 container.
Upstream issue:
https://github.com/elm/compiler/issues/2283
Signed-off-by: Holger Hans Peter Freyther <holger@freyther.de>
* Allow week to start at Monday or Sunday
Signed-off-by: Martin Schimandl <martin.schimandl@gmail.com>
* refactor from Int to DataType
Signed-off-by: Martin Schimandl <martin.schimandl@gmail.com>
* refactor to use name 'firstDayOfWeek' everywhere
Signed-off-by: Martin Schimandl <martin.schimandl@gmail.com>
* CSS fine tuning
Signed-off-by: Martin Schimandl <martin.schimandl@gmail.com>
* Check firstDayOfWeek with case statements
Signed-off-by: Martin Schimandl <martin.schimandl@gmail.com>
* Change default to Sunday. Use radio buttons
Signed-off-by: Martin Schimandl <martin.schimandl@gmail.com>
* Update ui/app/src/Views/Settings/Views.elm
Co-authored-by: Andrey Kuzmin <unsoundscapes@gmail.com>
Signed-off-by: Martin Schimandl <martin.schimandl@gmail.com>
* Regenerate assets_vfsdata.go
Signed-off-by: Martin Schimandl <martin.schimandl@gmail.com>
Signed-off-by: Martin Schimandl <martin.schimandl@gmail.com>
Co-authored-by: Andrey Kuzmin <unsoundscapes@gmail.com>
* add 'Link' button
adds a button to each alert that allows linking to a single alert.
This works by generating a link that filters on _all_ of the alert's
label values, similar to the button to create a new silence from an
alert.
Signed-off-by: Christopher Taylor <chris.taylor@soundcloud.com>
* update asset/assets_vfsdata.go
Signed-off-by: Christopher Taylor <chris.taylor@soundcloud.com>
Signed-off-by: Christopher Taylor <chris.taylor@soundcloud.com>
Some frameworks issue HEAD requests to determine health.
This is meant to be the alertmanager equivalent of prometheus/prometheus#11160
Signed-off-by: Nicolas Dumazet <nicdumz.commits@gmail.com>
Signed-off-by: Nicolas Dumazet <nicdumz.commits@gmail.com>
* 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>
* Support negative matchers in silence form
Signed-off-by: Andrey Kuzmin <unsoundscapes@gmail.com>
* Extract url manipulation from filterBar
This is needed for silence form, where we don't have to
manipulate the url.
Signed-off-by: Andrey Kuzmin <unsoundscapes@gmail.com>
* Only show the silence button in the alert list
Signed-off-by: Andrey Kuzmin <unsoundscapes@gmail.com>
* Validate matchers
Signed-off-by: Andrey Kuzmin <unsoundscapes@gmail.com>
* Improve silence form layout
Signed-off-by: Andrey Kuzmin <unsoundscapes@gmail.com>
* Fix for editing existing silence
Signed-off-by: Andrey Kuzmin <unsoundscapes@gmail.com>
* Fix for resetting the form
Signed-off-by: Andrey Kuzmin <unsoundscapes@gmail.com>
* Update assets_vfsdata.go
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>
* .circleci/config.yml: collect test metadata
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* Store frontend test results too
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* textarea with auto resize
Signed-off-by: mizukoshi-m <mizukoshi@mfeed.ad.jp>
* implement resize textarea on type
Signed-off-by: m-masataka <m.mizukoshi.wakuwaku@gmail.com>
* remove scrollHeight
Signed-off-by: m-masataka <m.mizukoshi.wakuwaku@gmail.com>
* Add new function for textarea field
Signed-off-by: m-masataka <m.mizukoshi.wakuwaku@gmail.com>
* remove unnecessary code
Signed-off-by: m-masataka <m.mizukoshi.wakuwaku@gmail.com>
* Create Silence from filters
Signed-off-by: m-masataka <m.mizukoshi.wakuwaku@gmail.com>
* Get rid of unnecessary things
Signed-off-by: m-masataka <m.mizukoshi.wakuwaku@gmail.com>
We can simplify the view flow by parsing the list
of alerts for custom grouping as soon as they are
returned to the update function.
Signed-off-by: stuart nelson <stuartnelson3@gmail.com>
Updating the api in
bc373f562f
resulted in the UI sending query strings for the
filter that no longer match what the backend
expects. This brings that in to line.
Signed-off-by: stuart nelson <stuartnelson3@gmail.com>
This patch adds HTTP headers to each web asset response, disabling
caching for the payload. This prevents users running an old version of
the UI against a new version of Alertmanager once they updated. On the
down-side it increases page load size on subsequent page loads.
Signed-off-by: Max Leonard Inden <IndenML@gmail.com>
The ELM_HOME variable needs to be set to the mounted volume
directory when building to prevent permissions errors caused
by using root as the default home dir.
Signed-off-by: Paul Gier <pgier@redhat.com>
- make clean shouldn't print errors when files/directories have already
been removed
- add copyright header to generated api files to pass license check
Signed-off-by: Paul Gier <pgier@redhat.com>
Even if an alert is already silenced and/or muted, I still want to
know that my newly created silence will affect it.
Signed-off-by: beorn7 <beorn@soundcloud.com>
If a users chooses to disable the Alertmanager cluster feature, there is
no cluster name nor cluster peers. Hence these should be optional. Only
cluster status is set to "disabled".
Signed-off-by: Max Leonard Inden <IndenML@gmail.com>
When users start Alertmanager with `--cluster.listen-address=`, the
cluster will not be initialized, hence api.peer will be `nil`. So far
this would result in a nil pointer dereference by the API v2 accessing
the api.peer field.
With this patch, api v2 skips populating the peers array, sets the name
to an empty string and the status to "disabled" in case `api.peer` is
nil.
Signed-off-by: Max Leonard Inden <IndenML@gmail.com>
* Remove inhibited/silenced text
In the alert list, this is already seen via the
icons. In the silence preview, since it's in the
silence preview, clearly it's affected by the
silence.
* Generate assets
Signed-off-by: stuart nelson <stuartnelson3@gmail.com>
With issue 1465 on openapi-generator [1] being fixed, we can not extract
shared properties of the gettable and postable alert definition into a
shared object (`alert`) like we do for silence, gettable silence and
postable silence.
In addition this patch does the following changes to the UI:
- Use `List GettableAlert` instead of plural type definition like
`GettableAlerts` because the plural definitions are not generated.
- Fix openapi-generator-cli docker image to specific hash.
[1] https://github.com/OpenAPITools/openapi-generator/issues/1465
Signed-off-by: Max Leonard Inden <IndenML@gmail.com>
Previously the api url was hardcoded in the elm logic fetching the
status of an Alertmanager. Instead it is now being passed down like we
already did for /alerts, /silences and /receivers.
Signed-off-by: Max Leonard Inden <IndenML@gmail.com>
Instead of having one general silence, differentiate between postable
and gettable silence, hence making more fields required.
Signed-off-by: Max Leonard Inden <IndenML@gmail.com>
With the previous patch /status and /silences were requested from api
v2. Requesting alerts from api v1 is done in a separate commit to be
able to revert it once alerts also come from api v2.
Signed-off-by: Max Leonard Inden <IndenML@gmail.com>
This patch makes the Alertmanager UI (/status & /silences) use the
api/v2 endpoint. In addition it adds logic to generate the elm side data
model based on the OpenAPI specification.
Signed-off-by: Max Leonard Inden <IndenML@gmail.com>
Support `w` duration when making silences. Remove
`y` as a supported duration, silences are for
short term notification prevention.
Signed-off-by: stuart nelson <stuartnelson3@gmail.com>
* Migrate from go-bindata to vfsgen
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* Ensure idempotent generation for vfsgen
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* asset: update generated files
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* Fix asset paths for Windows platforms
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* Regenerate assets
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* Add vfs wrapper that returns constant mod time
This is identical to what we had with go-bindata and avoids the extra
step of storing the identity of the complete file system in another
location.
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* Additional cleanup
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* Use a button instead of a for buttons
Using <a> was causing an unintended redirect to
the root. It appears this behavior has changed in
0.19.
Signed-off-by: stuart nelson <stuartnelson3@gmail.com>
* bindata
Signed-off-by: stuart nelson <stuartnelson3@gmail.com>
* Include Makefile.common
* Fix the bindata.go files to make the style target happy
* Inline `.PHONY` statements
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
This change replaces the deprecated InstrumentHandler function by
the equivalent functions from the promhttp package.
The following metrics are removed:
* http_request_duration_microseconds (Summary).
* http_request_size_bytes (Summary).
* http_requests_total (Counter).
And the following metrics are added instead:
* alertmanager_http_request_duration_seconds (Histogram).
* alertmanager_http_response_size_bytes (Histogram).
* promhttp_metric_handler_requests_in_flight (Gauge).
* promhttp_metric_handler_requests_total (Counter).