Commit Graph

1180 Commits

Author SHA1 Message Date
Max Leonard Inden
f3a3be8191 Update template/internal/deftmpl/bindata.go & ui/bindata.go
Additionaly linting AlertList/Types.elm
2017-04-25 11:34:31 +02:00
Max Leonard Inden
a8d7f92c66 test: Ensure bindata.go is always up to date
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
2017-04-25 11:33:57 +02:00
stuart nelson
d58e81db46 Generate assets 2017-04-25 10:36:48 +02:00
stuart nelson
06a37d66e2 Remove unused MatchOperator import 2017-04-24 14:59:58 +02:00
stuart nelson
2ae96e845d Add the fns for all match op types
They aren't use, but we might as well be correct.
2017-04-24 14:56:54 +02:00
stuart nelson
b29afb80a2 Receiver key is always an anchored regex match 2017-04-24 14:54:25 +02:00
stuart nelson
dc90e8dec3 Allow filtering receiver with a regex
e.g.:
http://localhost:5000/#/alerts?receiver=~(backend|ops)-warn
2017-04-23 21:04:53 +02:00
Andrey Kuzmin
88ec956973 Improve filter (#714)
* Update elm-tools/parser

* Improve filter UI

* Pressing backspace edits the last matcher

* Put escape char back into the output

* Allow editing the matcher

* Update bindata.go

* Const for key codes

* Use qualified imports

* Update bindata.go

* Commented the backspacePressed attribute
2017-04-18 20:49:52 +02:00
Max Leonard Inden
c3850708c1 Make assets generation deterministic
By passing "-modtime 1" flag into go-bindata command it uses the same
unix timestamp (1) for every file in the fake filesystem. Thereby every
execution of "make assets" results in the same asset outputs if the
inputs were the same. This forces us to set the "Cache-Control"
attribute to "no-cache".
2017-04-10 13:47:13 +02:00
stuart nelson
8e4c29f5b8 Click alert matchers (#690)
* Clicks update alerts filter text

- Normal click replaces filter with selected label
- Modifier (ctrl, cmd) + click appends to filter

* Auto-filter when clicking labels

* ctrl+click removes already present matcher

* Match arbitrary whitespace before/after comma

* Run elm make with --yes

* Always add labels to the filter

* Updating filter currently sends Noop msg

For now we are still going to require the user to
explicitly click "filter" before we send an API
request to update the list.
2017-04-08 13:00:21 +02:00
Max Leonard Inden
f50a9ef9db test: Add elm-format + elm-make job to ci
This runs elm-format and elm-make inside a docker container which servs
the Elm environment.

Related to issue #671
2017-04-07 11:19:42 +02:00
Max Inden
eeee29c65b Use vanilla Bootstrap as ui framework (#695)
* Transition NavBar to basic Bootstrap

* Restyle filter bar

* Highlight currently active tab in navbar

* Remove Bootstrap JS plugins
2017-04-05 18:26:39 +02:00
stuart nelson
4288292365 Add CONTRIBUTING.md for front-end code 2017-03-31 17:49:50 +02:00
stuart nelson
3f9494e32d Add correct repository format in elm-package.json 2017-03-31 16:25:56 +02:00
stuart nelson
cc8f3bb866 Update short date format (fixes #670) 2017-03-31 16:25:24 +02:00
Max Inden
78d5030f36 Merge pull request #668 from mxinden/ui-rewrite
Add Elm UI rewrite from github.com/stuartnelson3/am-ui with history to "ui-rewrite" branch
2017-03-29 23:16:00 +02:00
Andrey Kuzmin
bdd65fdfd7
Extract a model for the silence form (#22)
* Extract a model for the silence form

* Use empty in initSilenceForm

* Use plural silences in urls

* Populate matchers from alert

* Updating bindata.go file
2017-03-29 22:13:35 +02:00
Max Leonard Inden
b6243f55e4
Remove front-end specific license
Now that this is being merged it is opperating under the Apache 2.0 of
the Alertmanager project (See LICENSE file in the root directory).
2017-03-29 22:13:25 +02:00
Max Leonard Inden
10d018b7a2
Update repository url specified in elm-package.json 2017-03-27 17:51:43 +02:00
Max Leonard Inden
85ee536937
Merge commit '62c9421f2438bf572663d05ec16d84fecf0d0dcd' into ui-rewrite
Subtree commit from https://github.com/stuartnelson3/am-ui/
2017-03-24 18:21:54 +01:00
stuart nelson
62c9421f24 Parse filter directly in alerts route (#21)
* Parse filter directly in alerts route

* Fix filtering order and updating

* SilencesList parses directly to Filter too
2017-03-24 18:08:59 +01:00
Max Leonard Inden
0faf0f531f
Add Elm UI rewrite from github.com/stuartnelson3/am-ui with history
* Including glue between Alertmanager server and Elm UI.
* Rebuilding assets (ui/bindata.go).
* Exact commit: 'bd78de6b16bcefaacf4229304d439b33aa09cc72'
* Subdirectory: ui/app
2017-03-24 17:48:50 +01:00
Max Leonard Inden
971a6b4660
Remove old alertmanager ui 2017-03-24 16:24:16 +01:00
Conor Broderick
b7bea3df5c Renamed from and message options for VictorOps to monitoring_tool and state_message as per the VictorOps documentation (#667) 2017-03-24 14:06:39 +00:00
stuart nelson
bd78de6b16 Use generic getAlerts api function 2017-03-24 14:14:51 +01:00
Max Inden
af473363ca Rearchitecture (#12)
* Extract update function from Main.elm into Updates.elm

* Refactor Alerts view to use MsgForAlerts instead of Translator

Related to Issue #8

* Prevent decode failure when alert annotation is not present

Previously if one alert wouldn't have an annotation field the entire
decoding of the block would fail, due to the Maybe unwrapping of the
block type (line 46). Now if an alert does not have an annotation field
it just returns an empty list for that alert instead.

Fixes #11

* Move AlertList code to Views/AlertList/.

Related to issue #8

* Move Alert entity related types to Alerts/Types.elm

Related to issue #8

* Refactor Silences view to use MsgForSilences instead of Translator

Related to issue #8

* Move Silences view code to Views/SilenceList

TODO: Split up SilenceList into SilenceList, SilenceEdit, SilenceView,

Related to issue #8
...

* Rename MsgFor{Alerts,Silences} to MsgFor{AlertList,SilenceList}

Related to issue #8

* Seperate SilenceView from SilencesListView

Extracting all SilenceView related code to seperate
Views/Silence/{Views,Types,Parsing,Updates} files.

Related to Issue #8

* Seperate SilenceForm from SilencesListView

Extracting all SilenceForm related code to seperate
Views/SilenceForm/{Views,Types,Parsing,Updates} files.

Related to issue #8

* Flatten route tree

Instead of having sub routes under silences this commit flattens the
route tree and introduces the SilenceListRoute as a top level route.

Related to issue #8

* Run elm-format on entire elm code base

* Introduce NotFoundPage to prevent default case conditions

Having (_ ->) in case declarations is error-prone. This removes them in
the routing code.

* Move Status view code to Views/Status/.

Introduce InitView event to keep logic inside view update function
instead of global update function

Related to issue #8

* Introduce Init*View pattern to SilenceView

Instead of triggering the initialization of the view (loading silences,
loading alerts, ...) inside the global update function, the global
update function just triggers the message Init*View which is picked up
by e.g. the Silence update function which then triggers requesting the
silence.

Related to issue #8

* Remove unused Silences Msg and corresponding update case

* Remove unused Alerts Msg and corresponding update case

* Prevent empty filters to be specified

If the user inputs only a space into the filter textbox it crashes the
request to the server.

* Move NavBar code into Views folder

Additionally making silence available under /silence/<id>.

* Use type variable "msg" instead of concrete type "Msg"

Related to issue #8

* Use import alias on qualified view imports

Related to issue #8

* Rename {edit,new}Form to {new,edit} in SilenceForm.Views

Related to issue #8

* Pass only model.silence and not the entire model down to SilenceForm

Related to issue #8

* Refactor AlertListCompact.views function

Credit goes to @w0rm.

Related to issue #8

* Refactor SilenceBase.view function

Related to issue #8

* Refactor Views.Silence.Updates.update function

Related to issue #8

* Refactor Alerts.Types and global parsing function

Related to issue #8

* Remove accidentally added files
2017-03-23 09:56:34 +01:00
stuart nelson
1dd7ef96a1 Add empty state view for alerts affected by sil 2017-03-20 12:19:32 +01:00
stuart nelson
d229abac97 Silence preview (#7)
* Wip

* Add placeholder preview html

* Show affected alerts on silence show page
2017-03-17 17:14:49 +01:00
stuart nelson
080f850270 Update status on page load 2017-03-17 17:12:14 +01:00
Max Leonard Inden
46012db1ec Approach app structure via MsgFor* instead of translators
Instead of using ForSelf and ForParent, messages are wrapped by a message
per view, like e.g. MsgForStatus. The global update function then hands
each message to its corresponding sub-update function. So the message
"MsgForStatus getStatus" is redirected to the Status.Update.update
function.
2017-03-17 17:06:40 +01:00
Max Leonard Inden
e028dcaaae Add routing to status page 2017-03-17 17:04:06 +01:00
stuart nelson
d725cb01a4 Update silence decoders for empty comment 2017-03-16 13:54:42 +01:00
Andrey Kuzmin
4113d9dec4 Add the duration field 2017-03-16 12:42:18 +01:00
stuart nelson
f3e1985c58 Fix default startsAt time 2017-03-16 12:33:42 +01:00
stuart nelson
476dfa3f59 Update "Filter Alerts" button color 2017-03-16 12:23:06 +01:00
stuart nelson
5cea0efc46 Filter for alertname in silence view 2017-03-16 12:19:54 +01:00
stuart nelson
1e34f29532 Filter alerts (#633)
* Vendor dependencies.

This updates several old dependencies, removes
some that are no longer needed, and adds
`pkg/labels` from prometheus `dev-2.0` branch.

* Add metrics selector parsing code

This is a temporary simplified re-implementation
of promQL's metric selector parsing.

* Add alerts filtering

Filter alerts through `?filter=` query string.

* Add silences filtering

Filter silences through `?filter=` query string.

* Move `parse` to `pkg/parse`
2017-03-16 11:16:10 +01:00
stuart nelson
5a9953d5ce Add basic debouncer 2017-03-14 11:15:23 +01:00
stuart nelson
5004299b83 Pull out some appHeader code 2017-03-14 10:37:39 +01:00
Max Inden
0790930343 Render page header aka nav bar with elm (#4)
This replaces the static nav bar specification in the index.html file.
2017-03-14 10:27:52 +01:00
Max Inden
fced9e126b api: Expose mesh status (#644)
* api: Expose mesh status

The weaveworks mesh package reveals information about the current status
of the mesh network between alertmanager instances. This commit exposes
the current address and connection status of each instance connected to
the targeted alertmanager instance via the /status API endpoint.

* api: Replace LocalConnectionStatus with PeerStatus

Now meshStatus contains all peers (Name, NickName, UID) of the network.
Additionally adding Name and Nickname of current target to toplevel of
meshNetwork object.
2017-03-07 18:17:03 +01:00
stuart nelson
5e56d34e88 Show active/pending/expired on silences 2017-03-06 16:35:29 +01:00
stuart nelson
c53bb2f357 Set silences and silence resulting from update 2017-03-06 16:06:47 +01:00
stuart nelson
2243546edf Update README.md 2017-03-06 14:06:39 +01:00
stuart nelson
1b416e9394 Massive extraction of Silences
Pull rest of silences from top-level namespace
into its own namespace.
2017-03-06 13:53:20 +01:00
stuart nelson
c01a86372d Pass filter query string for silences to API 2017-03-06 12:34:20 +01:00
stuart nelson
a454792595 Remove unused parsefilter
Filter parsing is handled on the server side.
2017-03-06 12:34:09 +01:00
stuart nelson
812588a61c Re-add "New Silence" button
Got deleted at some point. Oops.
2017-03-06 11:56:10 +01:00
James O'Gorman
00e3b98614 template: Add reReplaceAll function (#639)
This allows for using regexp replacement in templates.
2017-03-04 12:07:31 +00:00
stuart nelson
412d33336d Update README.md (#641)
Make it more clear that -mesh.peer flag should be
repeated for each peer.
2017-03-02 12:35:04 +01:00