@@ -325,6 +325,12 @@ const app = Vue.createApp({
325
325
}
326
326
return result ;
327
327
} ,
328
+ createUrlForMetric ( metric ) {
329
+ let start = findQueryParam ( "start" ) ;
330
+ let end = findQueryParam ( "end" ) ;
331
+
332
+ return createUrlFromParams ( createSearchParamsForMetric ( metric , start , end ) ) ;
333
+ } ,
328
334
} ,
329
335
} ) ;
330
336
@@ -486,14 +492,23 @@ function makeData(state, app) {
486
492
} ) ;
487
493
}
488
494
489
- function submitSettings ( ) {
490
- let start = document . getElementById ( "start-bound" ) . value ;
491
- let end = document . getElementById ( "end-bound" ) . value ;
492
- let stat = getSelected ( "stats" ) ;
495
+ function createSearchParamsForMetric ( stat , start , end ) {
493
496
let params = new URLSearchParams ( ) ;
494
497
params . append ( "start" , start ) ;
495
498
params . append ( "end" , end ) ;
496
499
params . append ( "stat" , stat ) ;
500
+ return params . toString ( ) ;
501
+ }
502
+
503
+ function createUrlFromParams ( params ) {
504
+ return window . location . protocol + "//" + window . location . host + window . location . pathname + "?" + params ;
505
+ }
506
+
507
+ function submitSettings ( ) {
508
+ let stat = getSelected ( "stats" ) ;
509
+ let start = document . getElementById ( "start-bound" ) . value ;
510
+ let end = document . getElementById ( "end-bound" ) . value ;
511
+ let params = createSearchParamsForMetric ( stat , start , end ) ;
497
512
window . location . search = params . toString ( ) ;
498
513
}
499
514
0 commit comments