File tree Expand file tree Collapse file tree 4 files changed +49
-12
lines changed
java/com/ericsson/ei/frontend Expand file tree Collapse file tree 4 files changed +49
-12
lines changed Original file line number Diff line number Diff line change @@ -32,15 +32,15 @@ public class WebController {
32
32
private String backendServerHost ;
33
33
private int backendServerPort ;
34
34
35
- private String eiffelDocumentationUrl ;
35
+ private String eiffelDocumentationUrls ;
36
36
37
37
38
38
@ RequestMapping ("/" )
39
39
public String greeting (Model model ) {
40
40
41
- String eiffelDocumentationUrlLink = String .format ("%s" , eiffelDocumentationUrl );
41
+ String eiffelDocumentationUrlLinks = String .format ("%s" , eiffelDocumentationUrls );
42
42
43
- model .addAttribute ("eiffelDocumentationUrlLink " , eiffelDocumentationUrlLink ); // inject in DOM for AJAX etc
43
+ model .addAttribute ("eiffelDocumentationUrlLinks " , eiffelDocumentationUrlLinks ); // inject in DOM for AJAX etc
44
44
45
45
46
46
@@ -126,11 +126,11 @@ public void setBackendServerPort(int backendServerPort) {
126
126
this .backendServerPort = backendServerPort ;
127
127
}
128
128
129
- public String getEiffelDocumentationUrl () {
130
- return eiffelDocumentationUrl ;
129
+ public String getEiffelDocumentationUrls () {
130
+ return eiffelDocumentationUrls ;
131
131
}
132
132
133
- public void setEiffelDocumentationUrl (String eiffelDocumentationUrl ) {
134
- this .eiffelDocumentationUrl = eiffelDocumentationUrl ;
133
+ public void setEiffelDocumentationUrls (String eiffelDocumentationUrls ) {
134
+ this .eiffelDocumentationUrls = eiffelDocumentationUrls ;
135
135
}
136
136
}
Original file line number Diff line number Diff line change @@ -16,7 +16,9 @@ ei.backendServerPort=8090
16
16
ei.subscriptionFilePath =subscriptions/subscriptionsTemplate.json
17
17
18
18
# ##### EI Documentation Link Url ##########
19
- ei.eiffelDocumentationUrl =https://github.com/Ericsson/eiffel-intelligence-frontend
19
+ ei.eiffelDocumentationUrls ={ "EI GitHub": "https://github.com/Ericsson/eiffel-intelligence-frontend",\
20
+ "Eiffel Github": "https://github.com/Ericsson/eiffel",\
21
+ "Eiffel Github main page": "http://ericsson.github.io/eiffel" }
20
22
21
23
# ### LOGGING #########
22
24
logging.level.root : INFO
Original file line number Diff line number Diff line change 1
1
2
2
jQuery ( document ) . ready ( function ( ) {
3
3
4
+ // Fetch injected URL from DOM
5
+ var eiffelDocumentationUrlLinks = $ ( '#eiffelDocumentationUrlLinks' ) . text ( ) ;
6
+
4
7
document . getElementById ( "testRulesBtn" ) . onclick = function ( ) {
5
8
6
9
var iframe = document . getElementById ( "mainFrame" ) ;
@@ -49,10 +52,36 @@ jQuery(document).ready(function() {
49
52
document . getElementById ( "subscriptionBtn" ) . onclick = function ( ) {
50
53
51
54
loadMainPage ( ) ;
55
+ }
56
+
57
+ function loadDocumentLinks ( ) {
58
+ // eiffelDocumentationUrlLinks variable is configure in application.properties
59
+ var linksList = JSON . parse ( eiffelDocumentationUrlLinks ) ;
60
+
61
+ var docLinksDoc = document . getElementById ( 'collapseDocPages' ) ;
62
+ var liTag = null ;
63
+ var aTag = null ;
64
+
65
+ Object . keys ( linksList ) . forEach ( function ( linkKey ) {
66
+ liTag = document . createElement ( 'li' ) ;
67
+ aTag = document . createElement ( 'a' ) ;
68
+ aTag . innerHTML = linkKey ;
69
+ aTag . setAttribute ( 'href' , linksList [ linkKey ] ) ;
70
+ aTag . setAttribute ( 'target' , '_blanc' ) ;
71
+ liTag . appendChild ( aTag ) ;
72
+ docLinksDoc . appendChild ( liTag ) ;
73
+ } ) ;
74
+
75
+
76
+
77
+
78
+
79
+
52
80
}
53
81
54
82
var initOneTime = function ( ) {
55
83
initOneTime = function ( ) { } ; // kill it as soon as it was called
84
+ loadDocumentLinks ( ) ;
56
85
loadMainPage ( ) ;
57
86
} ;
58
87
Original file line number Diff line number Diff line change 19
19
</ head >
20
20
21
21
< body class ="fixed-nav bg-dark " id ="page-top ">
22
+
23
+ < div class ="hidden " id ="eiffelDocumentationUrlLinks " th:text ="${eiffelDocumentationUrlLinks} "> </ div >
24
+
22
25
<!-- Navigation-->
23
26
< nav class ="navbar navbar-expand-lg navbar-dark bg-dark fixed-top " id ="mainNav ">
24
27
< a class ="navbar-brand " href ="/ "> Eiffel Intelligence</ a >
62
65
</ li >
63
66
</ ul >
64
67
</ li >
65
- < li class ="nav-item " data-toggle ="tooltip " data-placement ="right " title ="Link ">
66
- < a class ="nav-link " th: href ="${eiffelDocumentationUrlLink} " target =" _blanc ">
67
- < i class ="fa fa-fw fa-link "> </ i >
68
- < span class ="nav-link-text "> Documentation Link </ span >
68
+ < li class ="nav-item " data-toggle ="tooltip " data-placement ="right " title ="Documentation Links ">
69
+ < a class ="nav-link nav-link-collapse collapsed " data-toggle =" collapse " href ="#collapseDocPages " data-parent =" #exampleAccordion ">
70
+ < i class ="fa fa-fw fa-file "> </ i >
71
+ < span class ="nav-link-text "> Documentation Links </ span >
69
72
</ a >
73
+ < ul class ="sidenav-second-level collapse " id ="collapseDocPages ">
74
+ <!-- Li and A tags and document links content is injected from main.js -->
75
+ </ ul >
70
76
</ li >
71
77
</ ul >
72
78
< ul class ="navbar-nav sidenav-toggler ">
You can’t perform that action at this time.
0 commit comments