@@ -26,16 +26,16 @@ <h1>Need more help?</h1>
26
26
27
27
< script >
28
28
/**
29
- * Category display mode
30
- * |
31
- * Chart Embed URL https://localhost:8224/pi/?categoryMode=1#PA-CA###category /23
32
- * |________________________||__________| |_________________ |
33
- * | | |
34
- * This is your | And this bit identifies
35
- * dashboard URL | which category you want
29
+ * Category display mode
30
+ * |
31
+ * Category Embed URL https://localhost:8224/pi/?categoryMode=1#/dashboard-system/#/redirectToDefaultCategoryState /23
32
+ * |________________________||__________| |__ |
33
+ * | | |
34
+ * This is your | And this bit identifies
35
+ * dashboard URL | which category you want
36
36
* |
37
37
* This bit tells the dashboard
38
- * that you want a chart
38
+ * that you want a category
39
39
*/
40
40
41
41
//I'm separating this here because it makes it easier to insert the token after /chart
@@ -44,9 +44,8 @@ <h1>Need more help?</h1>
44
44
var password = "dashboard" ; //Change this to user's password
45
45
var categoryId = "23" ; //Change this to the category you want to see
46
46
var mode = "0" ; //Change this to change the category mode you want to use
47
- var categoryKey = "#PA-CA###category/" ;
48
- var categoryFragment = categoryKey + categoryId ;
49
47
var modeKey = "?categoryMode=" ;
48
+ var redirect = "#/dashboard-system/#/redirectToDefaultCategoryState/"
50
49
var modeParam = modeKey + mode ;
51
50
52
51
var apiToken = "pi/api/v2/tokens"
@@ -83,14 +82,14 @@ <h1>Need more help?</h1>
83
82
} ,
84
83
success : function ( data ) {
85
84
// Once we have a succesful ajax request with authentication we can just forward the browser and it will use the live session
86
- document . getElementById ( "category" ) . src = url + "pi/" + modeParam + categoryFragment ;
85
+ document . getElementById ( "category" ) . src = url + "pi/" + modeParam + redirect + categoryId ;
87
86
}
88
87
} ) ;
89
88
}
90
89
91
90
function changeCategoryMode ( catMode ) {
92
- var catId = document . getElementById ( "category" ) . src . split ( categoryKey ) [ 1 ] . split ( '/' ) [ 0 ] ;
93
- document . getElementById ( "category" ) . src = url + "/pi" + modeKey + catMode + categoryKey + catId ;
91
+ var catId = document . getElementById ( "category" ) . src . split ( redirect ) [ 1 ] ;
92
+ document . getElementById ( "category" ) . src = url + "/pi" + modeKey + catMode + redirect + catId ;
94
93
}
95
94
</ script >
96
95
</ div >
0 commit comments