File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change 139
139
command . send ( null ) ;
140
140
}
141
141
142
+ function relayShowStatus ( response ) {
143
+ document . getElementById ( 'portal' ) . href = 'http://' + response . proxy + '/index.html' ;
144
+ }
145
+
146
+ function relayStatus ( ) {
147
+ var command = new XMLHttpRequest ( ) ;
148
+ command . open ( "GET" , "/relays/status" ) ;
149
+ command . onreadystatechange = function ( ) {
150
+ if ( command . readyState === 4 && command . status === 200 ) {
151
+ relayShowStatus ( JSON . parse ( command . responseText ) ) ;
152
+ }
153
+ }
154
+ command . send ( null ) ;
155
+ }
156
+
142
157
window . onload = function ( ) {
143
158
relayConfig ( ) ;
159
+ relayStatus ( ) ;
144
160
} ;
145
161
</ script >
146
162
< head >
151
167
< tr > < td >
152
168
< table class ="housetop ">
153
169
< tr >
170
+ < td > < a id ="portal " href ="/index.html "> Portal</ a > </ td >
154
171
< td > < a href ="/relays/index.html "> Relays</ a > </ td >
155
172
< td > < a href ="/relays/events.html "> Events</ a > </ td >
156
173
< td > < span > Config</ span > </ td >
Original file line number Diff line number Diff line change 3
3
< head >
4
4
< link rel =stylesheet type ="text/css " href ="/house.css " title ="House ">
5
5
< script >
6
+ function relayShowStatus ( response ) {
7
+ document . getElementById ( 'portal' ) . href = 'http://' + response . proxy + '/index.html' ;
8
+ }
9
+
10
+ function relayStatus ( ) {
11
+ var command = new XMLHttpRequest ( ) ;
12
+ command . open ( "GET" , "/relays/status" ) ;
13
+ command . onreadystatechange = function ( ) {
14
+ if ( command . readyState === 4 && command . status === 200 ) {
15
+ relayShowStatus ( JSON . parse ( command . responseText ) ) ;
16
+ }
17
+ }
18
+ command . send ( null ) ;
19
+ }
6
20
window . onload = function ( ) {
7
21
8
22
function newColumn ( text ) {
71
85
72
86
updateEvents ( ) ;
73
87
setInterval ( function ( ) { checkEvents ( ) } , 1000 ) ;
88
+ relayStatus ( ) ;
74
89
}
75
90
</ script >
76
91
< head >
81
96
< tr > < td >
82
97
< table class ="housetop ">
83
98
< tr >
99
+ < td > < a id ="portal " href ="/index.html "> Portal</ a > </ td >
84
100
< td > < a href ="/relays/index.html "> Relays</ a > </ td >
85
101
< td > < span > Events</ span > </ td >
86
102
< td > < a href ="/relays/config.html "> Config</ a > </ td >
You can’t perform that action at this time.
0 commit comments