@@ -37,7 +37,9 @@ ${commonheader("Topology", app_name, user) | n,unicode}
37
37
" sPaginationType" : " bootstrap" ,
38
38
" bLengthChange" : true ,
39
39
" sDom" : " <'row-fluid'<l><f>r>t<'row-fluid'<'dt-pages'p><'dt-records'i>>" ,
40
- " oLanguage" : {
40
+ " oLanguage" : {
41
+ " sLengthMenu" : " ${_('Show _MENU_ entries')}" ,
42
+ " sSearch" : " ${_('Search')}" ,
41
43
" sEmptyTable" : " ${_('No data available')}" ,
42
44
" sInfo" : " ${_('Showing _START_ to _END_ of _TOTAL_ entries')}" ,
43
45
" sInfoEmpty" : " ${_('Showing 0 to 0 of 0 entries')}" ,
@@ -58,6 +60,8 @@ ${commonheader("Topology", app_name, user) | n,unicode}
58
60
" bLengthChange" : true ,
59
61
" sDom" : " <'row-fluid'<l><f>r>t<'row-fluid'<'dt-pages'p><'dt-records'i>>" ,
60
62
" oLanguage" : {
63
+ " sLengthMenu" : " ${_('Show _MENU_ entries')}" ,
64
+ " sSearch" : " ${_('Search')}" ,
61
65
" sEmptyTable" : " ${_('No data available')}" ,
62
66
" sInfo" : " ${_('Showing _START_ to _END_ of _TOTAL_ entries')}" ,
63
67
" sInfoEmpty" : " ${_('Showing 0 to 0 of 0 entries')}" ,
@@ -80,7 +84,7 @@ ${commonheader("Topology", app_name, user) | n,unicode}
80
84
]
81
85
%>
82
86
83
- % if not cluster :
87
+ % if not clusters :
84
88
<div class =" container-fluid" >
85
89
<div class =" card" >
86
90
<h1 class =" card-heading simple" >${ _(' There are currently no clusters to browse.' ) } </h1 >
@@ -97,101 +101,123 @@ ${commonheader("Topology", app_name, user) | n,unicode}
97
101
${ kafka.header(_breadcrumbs) }
98
102
% endif
99
103
100
- ${ kafka.menubar(section = ' Topology' ,c_id = cluster[' cluster' ][' id' ]) }
104
+ ${ kafka.menubar(section = ' Topology' ,c_id = clusters[0 ][' cluster' ][' id' ]) }
105
+
106
+ % for cluster in clusters:
101
107
102
- <div class =" container-fluid" >
103
- <div class =" card" >
104
- <h2 class =" card-heading simple" >${ _(' Topology of Kakfa cluster:' ) } ${ cluster[' cluster' ][' nice_name' ] } </h2 >
105
- <div class =" card-body" >
106
- <div class =" alert alert-info" >${ _(' The zookeper REST server:' ) } <b >${ cluster[' cluster' ][' zk_rest_url' ]} </b ></div >
108
+ <div class =" container-fluid" >
109
+ <div class =" card" >
110
+ <h2 class =" card-heading simple" >${ _(' Topology of Kakfa cluster:' ) } ${ cluster[' cluster' ][' nice_name' ] } </h2 >
111
+ <div class =" card-body" >
107
112
108
- <h4 class =" card-heading simple" >${ _(' Zookepers' ) } </h4 >
109
- </br >
110
- <table class =" table table-hover table-striped table-condensed" >
111
- <thead >
112
- <tr >
113
- <th >${ _(' Hostname' ) } </th >
114
- <th >${ _(' Port' ) } </th >
115
- <th >${ _(' Status' ) } </th >
116
- </tr >
117
- </thead >
118
- <tbody >
119
- % for zookeeper in cluster[' cluster' ][' zk_host_ports' ].split(' ,' ):
120
- <tr >
121
- <td >${ zookeeper.split(' :' )[0 ]} </td >
122
- <td >${ zookeeper.split(' :' )[1 ]} </td >
123
- <%
124
- error = test_connection(zookeeper.split(' :' )[0 ],int (zookeeper.split(' :' )[1 ]))
125
- %>
126
- <td >
127
- % if not error:
128
- <span class =" label label-success" >${ _(' ONLINE' ) } </span >
129
- % else :
130
- <span class =" label label-warning" >${ _(' OFFLINE' ) } </span >
131
- % endif
132
- </td >
133
- </tr >
134
- % endfor
135
- </tbody >
136
- </table >
137
- </br >
138
- <h4 class =" card-heading simple" >${ _(' Brokers' ) } </h4 >
139
- </br >
140
- <table class =" table datatables table-striped table-hover table-condensed" id =" brokersTable" data-tablescroller-disable =" true" >
141
- <thead >
142
- <tr >
143
- <th >${ _(' Broker ID' ) } </th >
144
- <th >${ _(' Hostname' ) } </th >
145
- <th >${ _(' Port' ) } </th >
146
- <th >${ _(' Status' ) } </th >
147
- </tr >
148
- </thead >
149
- <tbody >
150
- % for broker in cluster[' brokers' ]:
151
- <tr >
152
- <td >${ broker[' id' ]} </td >
153
- <td >${ broker[' host' ]} </td >
154
- <td >${ broker[' port' ]} </td >
155
- <%
156
- error = test_connection(broker[' host' ],broker[' port' ])
157
- %>
158
- <td >
159
- % if not error:
160
- <span class =" label label-success" >${ _(' ONLINE' ) } </span >
161
- % else :
162
- <span class =" label label-warning" >${ _(' OFFLINE' ) } </span >
163
- % endif
164
- </td >
165
- </tr >
166
- % endfor
167
- </tbody >
168
- </table >
169
- </br >
170
- <h4 class =" card-heading simple" >${ _(' Consumer Groups' ) } </h4 >
171
- </br >
172
- <table class =" table datatables table-striped table-hover table-condensed" id =" consumerGroupsTable" data-tablescroller-disable =" true" >
173
- <thead >
174
- <tr >
175
- <th >${ _(' Name' ) } </th >
176
- <th >${ _(' Status' ) } </th >
177
- </tr >
178
- </thead >
179
- <tbody >
180
- % for consumer in cluster[' consumer_groups' ]:
181
- <tr >
182
- <td ><a href =" ${url('kafka:consumer_group', cluster_id=cluster['cluster']['id'], group_id=consumer)}" >${ consumer} </a ></td >
183
- <td >
184
- % if cluster[' consumer_groups_status' ][consumer] == 0 :
185
- <span class =" label label-warning" >${ _(' OFFLINE' ) } </span >
186
- % else :
187
- <span class =" label label-success" >${ _(' ONLINE' ) } </span >
188
- % endif
189
- </td >
190
- </tr >
191
- % endfor
192
- </tbody >
193
- </table >
113
+ % if cluster[' error' ] == 0 :
114
+ <div class =" alert alert-info" >${ _(' The zookeper REST server:' ) } <b >${ cluster[' cluster' ][' zk_rest_url' ]} </b ></div >
115
+ % else :
116
+ <div class =" alert alert-error" >
117
+ ${ _(' Error connecting to the zookeper REST server:' ) } <b >${ cluster[' cluster' ][' zk_rest_url' ]} </b ><br >
118
+ ${ _(' Please contact your administrator to solve this.' ) }
119
+ </div >
120
+ % endif
121
+
122
+ <h4 class =" card-heading simple" >${ _(' Zookepers' ) } </h4 >
123
+ </br >
124
+ <table class =" table table-hover table-striped table-condensed" >
125
+ <thead >
126
+ <tr >
127
+ <th >${ _(' Hostname' ) } </th >
128
+ <th >${ _(' Port' ) } </th >
129
+ <th >${ _(' Status' ) } </th >
130
+ </tr >
131
+ </thead >
132
+ <tbody >
133
+ % for zookeeper in cluster[' cluster' ][' zk_host_ports' ].split(' ,' ):
134
+ <tr >
135
+ <td >${ zookeeper.split(' :' )[0 ]} </td >
136
+ <td >${ zookeeper.split(' :' )[1 ]} </td >
137
+ <%
138
+ error = test_connection(zookeeper.split(' :' )[0 ],int (zookeeper.split(' :' )[1 ]))
139
+ %>
140
+ <td >
141
+ % if not error:
142
+ <span class =" label label-success" >${ _(' ONLINE' ) } </span >
143
+ % else :
144
+ <span class =" label label-warning" >${ _(' OFFLINE' ) } </span >
145
+ % endif
146
+ </td >
147
+ </tr >
148
+ % endfor
149
+ </tbody >
150
+ </table >
151
+ </br >
152
+ % if cluster[' error' ] == 0 :
153
+ <h4 class =" card-heading simple" >${ _(' Brokers' ) } </h4 >
154
+ </br >
155
+ <table class =" table datatables table-striped table-hover table-condensed" id =" brokersTable" data-tablescroller-disable =" true" >
156
+ <thead >
157
+ <tr >
158
+ <th >${ _(' Broker ID' ) } </th >
159
+ <th >${ _(' Hostname' ) } </th >
160
+ <th >${ _(' Port' ) } </th >
161
+ <th >${ _(' Status' ) } </th >
162
+ </tr >
163
+ </thead >
164
+ <tbody >
165
+ % for broker in cluster[' brokers' ]:
166
+ <tr >
167
+ <td >${ broker[' id' ]} </td >
168
+ <td >${ broker[' host' ]} </td >
169
+ <td >${ broker[' port' ]} </td >
170
+ <%
171
+ error = test_connection(broker[' host' ],broker[' port' ])
172
+ %>
173
+ <td >
174
+ % if not error:
175
+ <span class =" label label-success" >${ _(' ONLINE' ) } </span >
176
+ % else :
177
+ <span class =" label label-warning" >${ _(' OFFLINE' ) } </span >
178
+ % endif
179
+ </td >
180
+ </tr >
181
+ % endfor
182
+ </tbody >
183
+ </table >
184
+ </br >
185
+ <h4 class =" card-heading simple" >${ _(' Consumer Groups' ) } </h4 >
186
+ </br >
187
+ <table class =" table datatables table-striped table-hover table-condensed" id =" consumerGroupsTable" data-tablescroller-disable =" true" >
188
+ <thead >
189
+ <tr >
190
+ <th >${ _(' Name' ) } </th >
191
+ <th >${ _(' Status' ) } </th >
192
+ </tr >
193
+ </thead >
194
+ <tbody >
195
+ % for consumer in cluster[' consumer_groups' ]:
196
+ <tr >
197
+ <td ><a href =" ${url('kafka:consumer_group', cluster_id=cluster['cluster']['id'], group_id=consumer)}" >${ consumer} </a ></td >
198
+ <td >
199
+ % if cluster[' consumer_groups_status' ][consumer] == 0 :
200
+ <span class =" label label-warning" >${ _(' OFFLINE' ) } </span >
201
+ % else :
202
+ <span class =" label label-success" >${ _(' ONLINE' ) } </span >
203
+ % endif
204
+ </td >
205
+ </tr >
206
+ % endfor
207
+ </tbody >
208
+ </table >
209
+ % else :
210
+ <h4 class =" card-heading simple" >${ _(' Brokers' ) } </h4 >
211
+ </br >
212
+ <div class =" alert alert-error" >${ _(' No data available' ) } </div >
213
+ <br >
214
+ <h4 class =" card-heading simple" >${ _(' Consumer Groups' ) } </h4 >
215
+ </br >
216
+ <div class =" alert alert-error" >${ _(' No data available' ) } </div >
217
+ <br >
218
+ % endif
219
+ </div >
220
+ </div >
194
221
</div >
195
- </div >
196
- </div >
222
+ % endfor
197
223
${ commonfooter(messages) | n,unicode }
0 commit comments