Commit 5c3fdbc5 authored by André Espaze's avatar André Espaze
Browse files

Activate permalink by fetching series from url query

parent df85cd778b44
......@@ -213,7 +213,9 @@ update msg model =
series =
Dict.keys x
in
newModel { model | series = series }
( { model | series = series }
, Task.attempt RenderPlot <| fetchSeries model.selectedSeries model
)
CatalogReceived (Err x) ->
let
......@@ -358,7 +360,7 @@ view model =
]
main : Program String Model Msg
main : Program { urlPrefix : String, selectedSeries : List String } Model Msg
main =
let
initialGet urlPrefix =
......@@ -370,15 +372,15 @@ main =
[]
}
init urlPrefix =
init flags =
let
p =
Common.checkUrlPrefix urlPrefix
Common.checkUrlPrefix flags.urlPrefix
c =
LruCache.empty 100
in
( Model p [] "" [] [] [] True c, initialGet p )
( Model p [] "" [] flags.selectedSeries [] True c, initialGet p )
sub model =
if model.activeSelection then
......
......@@ -47,7 +47,8 @@ def tsview(engine, tshclass=timeseries, serie_names=serie_names):
@bp.route('/tsview')
def home():
return render_template('tsview.html',
homeurl=homeurl())
homeurl=homeurl(),
series=request.args.getlist("series"))
class logargs(_argsdict):
defaults = {
......
......@@ -8,7 +8,10 @@
const baseurl = "{{ homeurl }}"
var app = Elm.Plot.init({
node: document.getElementById("app"),
flags: baseurl
flags: {
urlPrefix : baseurl,
selectedSeries : {{ series | safe }}
}
});
</script>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment