This repository has been archived by the owner on Sep 4, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
520 lines (491 loc) · 22.4 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Kontroller v0.0.2</title>
<link href="css/main.css" rel="stylesheet">
<link href="css-lib/modalEffects.css" rel="stylesheet">
<link href="css-lib/bootstrap-theme.min.css" rel="stylesheet">
<link href="css-lib/bootstrap.min.css" rel="stylesheet">
<script src="js-lib/jquery-2.1.3.js"></script>
<script src="js-lib/bootstrap.min.js"></script>
<script src="js-lib/handlebars-v3.0.1.js"></script>
<script src="js-lib/underscore-1.8.3.js"></script>
<script src="js-lib/backbone-min-1.1.2.js"></script>
</head>
<body role="document" id="body">
<script id="flashed-msg-template" type="text/x-handlebars-template">
<div class="alert alert-{{type}}" role="alert">
<strong>{{strong_message}}</strong> {{message}}
</div>
</script>
<script id="home-template" type="text/x-handlebars-template">
<h1>Home Page</h1>
{{greeting}}
</script>
<script id="header-nav-bar-template" type="text/x-handlebars-template">
<nav id="top-header-nav-bar" class="navbar navbar-inverse">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!--<a class="navbar-brand" href="/#">Kontroller</a>-->
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
{{#each menuItems}}
{{#if subMenu}}
<li class="dropdown" id="headerMenu_{{link}}">
<a href="#" class="dropdown-toggle"
data-toggle="dropdown"
role="button"
aria-expanded="false">{{title}}<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
{{#each subMenu}}
<li id="headerMenu_{{link}}"><a href="#{{link}}">{{title}}</a></li>
{{/each}}
</ul>
</li>
{{else}}
<li id="headerMenu_{{link}}"><a href="#{{link}}">{{title}}</a></li>
{{/if}}
{{/each}}
</ul>
</div>
</div>
</nav>
</script>
<script id="editable-ro-text-input" type="text/x-handlebars-template">
<input readonly
class="disabledTextInput"
type="text"
ondblclick="enableTextInput(this)"
onblur="disableTextInput(this)"
onkeypress="textInputKeypress(this, event)"
id="{{indexed-array-id id array index}}"
name="{{indexed-array-id id array index}}"
value="{{value}}" />
</script>
<script id="editable-ro-checkbox" type="text/x-handlebars-template">
<div class="disabledTextInput" id="div-{{indexed-array-id id array index}}">
<input readonly
class="disabledCheckbox"
type="checkbox"
onclick="return false"
ondblclick="enableCheckbox(this, 'div-{{indexed-array-id id array index}}')"
onblur="disableCheckbox(this, 'div-{{indexed-array-id id array index}}')"
id="{{indexed-array-id id array index}}"
name="{{indexed-array-id id array index}}"
{{{checkedBoxFromBool bool }}}/>
</div>
</script>
<script id="kafka-broker-list" type="text/x-handlebars-template">
<h2 style="margin-top: 0px;">Kafka Brokers</h2>
<p>There are {{kafkaBrokers.length}} brokers. This is a read only list (you cannot edit these fields).</p>
{{#each kafkaBrokers}}
{{>kafka-broker-template attributes}}
<hr />
{{/each}}
</script>
<script id="kafka-broker-template" type="text/x-handlebars-template">
<table class="table table-striped table-nonfluid">
<!--
Deprecated until MetaData from Krackle supports these fields
<tr>
<td>ID:</td>
<td>{{id}}</td>
</tr>
<tr>
<td>JMX Port:</td>
<td>{{jmx_port}}</td>
</tr>
<tr>
<td>Version:</td>
<td>{{version}}</td>
</tr>
<tr>
<td>Timestamp:</td>
<td>{{timestamp}}</td>
</tr>
-->
<tr>
<td>Hostname:</td>
<td>{{host}}</td>
</tr>
<tr>
<td>Port:</td>
<td>{{port}}</td>
</tr>
</table>
</script>
<script id="kafka-topic-show-template" type="text/x-handlebars-template">
{{>kafka-topic-list-template kafkaTopics=kafkaTopics}}
{{#if currentTopic}}
{{>kafka-topic-showTopic-template currentTopic.attributes}}
{{else}}
<div>Click any topic to the left to view it's configuration</div>
{{/if}}
</script>
<script id="kafka-topic-list-template" type="text/x-handlebars-template">
<div class="col-sm-4">
<div class="list-group">
{{#each kafkaTopics}}
<a id="{{attributes.name}}" class="list-group-item" href='#kafka-topics/{{attributes.name}}'>{{attributes.name}} ({{attributes.partitions.length}})</a>
{{/each}}
</div>
</div>
</script>
<script id="kafka-topic-showTopic-template" type="text/x-handlebars-template">
<div class="col-sm-5">
<h2 style="margin-top: 0px;">Topic {{name}}</h2>
<table class="table table-striped table-nonfluid">
<tr>
<th>ID</th>
<th>Leader</th>
<!-- Deprecated until MetaData from Krackle supports these attributes
<th>Error Code</th>
<th>Replicas</th>
<th>Min. ISR</th>
<th>Earliest Offset</th>
<th>Latest Offset</th>
-->
</tr>
{{#each partitions}}
<tr>
<td>{{partitionId}}</td>
<td>{{leader.nodeId}}</td>
<!-- Deprecated until MetaData from Krackle supports these attributes
<td>{{errorCode}}</td>
<td>{{replicas}}</td>
<td>{{inSyncReplicas}}</td>
<td>{{earliestOffset}}</td>
<td>{{latestOffset}}</td>
-->
</tr>
{{/each}}
</table>
</div>
</script>
<script id="kaboom-topic-show-template" type="text/x-handlebars-template">
{{>kaboom-topic-list-template kaboomTopics=kaboomTopics}}
{{#if currentTopic}}
{{>kaboom-topic-showTopic-template currentTopic.attributes}}
{{else}}
<div>Click any topic to the left to view it's configuration</div>
{{/if}}
</script>
<script id="kaboom-topic-list-template" type="text/x-handlebars-template">
<div class="col-sm-4">
<div class="list-group">
{{#each kaboomTopics}}
<a id="{{attributes.kafkaTopic.name}}" class="list-group-item" href='#kaboom-topics/{{attributes.kafkaTopic.name}}'>{{attributes.kafkaTopic.name}} ({{attributes.partitions.length}})</a>
{{/each}}
</div>
</div>
</script>
<script id="kaboom-topic-showTopic-template" type="text/x-handlebars-template">
<div class="col-sm-7">
<h2 style="margin-top: 0px;">Topic {{topicName}}</h2>
<table class="table table-striped table-nonfluid">
<tr>
<th>ID</th>
<th>Assigned Client</th>
<th>Offset</th>
<th>Offset Timestamp</th>
</tr>
{{#each partitions}}
<tr>
<td>{{kafkaPartition.partitionId}}</td>
<td>{{assignedClient.id}}</td>
<td>{{offset}}</td>
<td>{{offsetTimestamp}} ({{dateFromTs offsetTimestamp}})</td>
</tr>
{{/each}}
</table>
</div>
</script>
<script id="kaboom-config-template" type="text/x-handlebars-template">
<h1>KaBoom Running Configuration Page</h1>
<br />
<p>This configuration will take affect immediately and affect all running KaBoom clients</p>
<p><strong><i>EDITING:</i></strong> To edit a field, double-click the value.</p>
{{>kaboom-running-config-form-template runningConfig}}
</script>
<script id="kaboom-running-config-form-template" type="text/x-handlebars-template">
<h4><strong>Running Config Version: <span class="badge">{{version}}</span></strong></h4>
<table class="table table-striped table-nonfluid" width="">
<tr>
<td>{{>editable-ro-text-input id="leaderSleepDurationMs" value=leaderSleepDurationMs}}</td>
<td><label for="leaderSleepDurationMs">Leader Sleep Duration (ms)</label></td>
</tr>
<tr>
<td>{{>editable-ro-text-input id="compressionLevel" value=compressionLevel}}</td>
<td><label for="compressionLevel">Compression Level</label></td>
</tr>
<tr>
<td>{{>editable-ro-text-input id="boomFileBufferSize" value=boomFileBufferSize}}</td>
<td><label for="boomFileBufferSize">Boom File Buffer Size</label></td>
</tr>
<tr>
<td>{{>editable-ro-text-input id="boomFileReplicas" value=boomFileReplicas}}</td>
<td><label for="boomFileReplicas">Boom File Replicas</label></td>
</tr>
<tr>
<td>{{>editable-ro-text-input id="boomFileBlocksize" value=boomFileBlocksize}}</td>
<td><label for="boomFileBlocksize">Boom File Block Size</label></td>
</tr>
<tr>
<td>{{>editable-ro-text-input id="boomFileTmpPrefix" value=boomFileTmpPrefix}}</td>
<td><label for="boomFileTmpPrefix">Boom File Temp Prefix</label></td>
</tr>
<tr>
<td>{{>editable-ro-text-input id="periodicHdfsFlushInterval" value=periodicHdfsFlushInterval}}</td>
<td><label for="periodicHdfsFlushInterval">Periodic HDFS Flush Interval (ms)</label></td>
</tr>
<tr>
<td>{{>editable-ro-text-input id="kaboomServerSleepDurationMs" value=kaboomServerSleepDurationMs}}</td>
<td><label for="kaboomServerSleepDurationMs">KaBoom Server Sleep Duration (ms)</label></td>
</tr>
<tr>
<td>{{>editable-ro-text-input id="fileCloseGraceTimeAfterExpiredMs" value=fileCloseGraceTimeAfterExpiredMs}}</td>
<td><label for="fileCloseGraceTimeAfterExpiredMs">Grace Time After Expired File Before Closing (ms)</label></td>
</tr>
<tr>
<td>{{>editable-ro-text-input id="forcedZkOffsetTsUpdateMs" value=forcedZkOffsetTsUpdateMs}}</td>
<td><label for="forcedZkOffsetTsUpdateMs">Forced ZK Offset Timestamp Delay (ms)</label></td>
</tr>
<tr>
<td>{{>editable-ro-text-input id="workerShiftDurationSeconds" value=workerShiftDurationSeconds}}</td>
<td><label for="workerShiftDurationSeconds">Worker Shift Duration (seconds)</label></td>
</tr>
<tr>
<td>{{>editable-ro-text-input id="newLeaderCalmDownDelay" value=newLeaderCalmDownDelay}}</td>
<td><label for="newLeaderCalmDownDelay">New Leader Calm Down Delay (ms)</label></td>
</tr>
<tr>
<td>{{>editable-ro-text-input id="assignmentLockTimeout" value=assignmentLockTimeout}}</td>
<td><label for="assignmentLockTimeout">Assignment Lock Timeout (ms)</label></td>
</tr>
<tr>
<td>{{>editable-ro-text-input id="maxOpenBoomFilesPerPartition" value=maxOpenBoomFilesPerPartition}}</td>
<td><label for="maxOpenBoomFilesPerPartition">Max Open Boom Files Per Partition</label></td>
</tr>
<tr>
<td>{{>editable-ro-text-input id="leaderNodeDisconnectionWaittimeSeconds" value=leaderNodeDisconnectionWaittimeSeconds}}</td>
<td><label for="leaderNodeDisconnectionWaittimeSeconds">Wait After Leader Finds Disconnected Assignee (sec)</label></td>
</tr>
<tr>
<td>{{>editable-ro-text-input id="nodeOpenFileWaittimeMs" value=nodeOpenFileWaittimeMs}}</td>
<td><label for="nodeOpenFileWaittimeMs">Sleep Between Open Boom File Checks (ms)</label></td>
</tr>
<tr>
<td>{{>editable-ro-text-input id="nodeOpenFileForceDeleteSeconds" value=nodeOpenFileForceDeleteSeconds}}</td>
<td><label for="nodeOpenFileForceDeleteSeconds">Wait Before Force-delete of Open Boom Files (sec)</label></td>
</tr>
<tr>
<td>{{>editable-ro-text-input id="skewedTsSecondsFuture" value=skewedTsSecondsFuture}}</td>
<td><label for="skewedTsSecondsFuture">Future Message Timing Before Considered Skewed (sec)</label></td>
</tr>
<tr>
<td>{{>editable-ro-text-input id="skewedTsSecondsPast" value=skewedTsSecondsPast}}</td>
<td><label for="skewedTsSecondsPast">Past Message Timing Before Considered Skewed (sec)</label></td>
</tr>
<tr>
<td>{{>editable-ro-text-input id="skewedTsDataDir" value=skewedTsDataDir}}</td>
<td><label for="skewedTsDataDir">Directory to Store Skewed Boom Files In</label></td>
</tr>
<tr>
<td>{{>editable-ro-text-input id="skewedTsBoomFilenamePrefix" value=skewedTsBoomFilenamePrefix}}</td>
<td><label for="skewedTsBoomFilenamePrefix">Prefix for Skewed Boom Files</label></td>
</tr>
<!-- Checkboxes --->
<tr>
<td>{{>editable-ro-checkbox id="sinkToHighWatermark" bool=sinkToHighWatermark}}</td>
<td><label for="sinkToHighWatermark">Sink to High Watermark</label></td>
</tr>
<tr>
<td>{{>editable-ro-checkbox id="allowOffsetOverrides" bool=allowOffsetOverrides}}</td>
<td><label for="allowOffsetOverrides">Offset Overrides</label></td>
</tr>
<tr>
<td>{{>editable-ro-checkbox id="useTempOpenFileDirectory" bool=useTempOpenFileDirectory}}</td>
<td><label for="useTempOpenFileDirectory">Use Temp Open File Dirs</label></td>
</tr>
<tr>
<td>{{>editable-ro-checkbox id="useNativeCompression" bool=useNativeCompression}}</td>
<td><label for="useNativeCompression">Use Native Compression</label></td>
</tr>
<tr>
<td>{{>editable-ro-checkbox id="skewedTsDateDirToNow" bool=skewedTsDateDirToNow}}</td>
<td><label for="skewedTsDateDirToNow">Use now() for Date Dirs of Skewed Boom Files </label></td>
</tr>
<tr>
<td> </td>
<td>
<button class="save">Save</button>
<button class="revert">Revert to Default</button>
<button class="cancel">Cancel</button>
</td>
</tr>
</table>
</script>
<script id="kaboom-editTopic-edit-template" type="text/x-handlebars-template">
{{>kaboom-editTopic-list-template topics=topics}}
{{#if currentTopic}}
{{>kaboom-editTopic-edit-form-template topic=currentTopic.attributes isNew=isNew}}
{{else}}
<div>Click any topic to the left to edit it's configuration</div>
{{/if}}
</script>
<script id="kaboom-editTopic-list-template" type="text/x-handlebars-template">
<div class="col-sm-3">
<button type="button" class="btn btn-xs btn-primary newTopic">New Topic</button>
<div class="list-group">
{{#each topics}}
<a id="{{id}}" class="list-group-item" href='#kaboom-topic-configs/{{id}}'>{{id}}</a>
{{/each}}
</div>
</div>
</script>
<script id="kaboom-editTopic-edit-form-template" type="text/x-handlebars-template">
<div class="col-sm-5">
<h2 style="margin-top: 0px;">{{topic.id}}</h2>
<p>Topic Config Version: <span class="badge">{{topic.version}}</span></p>
<table class="table table-striped table-nonfluid">
{{#if isNew}}
<tr>
<td>{{>editable-ro-text-input id="id" value=topic.id}}</td>
<td><label for="id">New Topic Name</label></td>
</tr>
{{/if}}
<tr>
<td>{{>editable-ro-text-input id="hdfsRootDir" value=topic.hdfsRootDir}}</td>
<td><label for="hdfsRootDir">HDFS Root Directory</label></td>
</tr>
<tr>
<td>{{>editable-ro-text-input id="proxyUser" value=topic.proxyUser}}</td>
<td><label for="proxyUser">Proxy User</label></td>
</tr>
<tr>
<td>{{>editable-ro-text-input id="defaultDirectory" value=topic.defaultDirectory}}</td>
<td><label for="defaultDirectory">Default Directory</label></td>
</tr>
</table>
<p>
There are <span class="badge">{{topic.filterSet.length}}</span> filter(s) configured
<button type="button" class="btn btn-xs btn-primary addFilter">Add Filter</button>
</p>
{{#each topic.filterSet}}
{{>kaboom-topic-filter-form-template filter=attributes numFilters=../topic.filterSet.length}}
{{/each}}
<hr />
<button class="save">Save</button>
<button class="destroy">Destroy</button>
<button class="cancel">Cancel</button>
</div>
</script>
<script>
Handlebars.registerHelper('drawMoveUp', function(filter) {
var disabled = '';
if(filter.number == 1) {
disabled = ' disabled ';
}
return '<button value="' + filter.number + '" type="button" class="btn btn-default btn-sm filterUp" ' + disabled +'>' +
'<span class="glyphicon glyphicon-arrow-up" aria-hidden="true"></span></button>';
});
Handlebars.registerHelper('drawMoveDown', function(filter, numFilters) {
var disabled = '';
if(filter.number == numFilters) {
disabled = ' disabled ';
}
return '<button value="' + filter.number + '" type="button" class="btn btn-default btn-sm filterDown" ' + disabled +'>' +
'<span class="glyphicon glyphicon-arrow-down" aria-hidden="true"></span>' +
'</button>';
});
</script>
<script id="topic-filter-mgmt-butons" type="text/x-handlebars-template">
{{{drawMoveUp filter}}}
{{{drawMoveDown filter numFilters}}}
<button value="{{filter.number}}" type="button" class="btn btn-default btn-sm filterRemove">
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
</button>
</script>
<script id="kaboom-topic-filter-form-template" type="text/x-handlebars-template">
<hr>
<div>
<p><strong>Filter #{{filter.number}}</strong> {{>topic-filter-mgmt-butons numFilters=numFilters filter=filter}}</p>
<table class="table table-striped table-nonfluid">
<tr>
<td>{{>editable-ro-text-input id="name" value=filter.name array="filterSet" index=filter.number}}</td>
<td><label for="filterSet[{{filter.number}}][name]">Filter Name</label></td>
</tr>
<tr>
<td>{{>editable-ro-text-input id="type" value=filter.type array="filterSet" index=filter.number}}</td>
<td><label for="filterSet[{{filter.number}}][type]">Filter Type</label></td>
</tr>
<tr>
<td>{{>editable-ro-text-input id="filter" value=filter.filter array="filterSet" index=filter.number}}</td>
<td><label for="filterSet[{{filter.number}}][filter]">Filter Value</label></td>
</tr>
<tr>
<td>{{>editable-ro-text-input id="duration" value=filter.duration array="filterSet" index=filter.number}}</td>
<td><label for="filterSet[{{filter.number}}][filter]">Duration</label></td>
</tr>
<tr>
<td>{{>editable-ro-text-input id="directory" value=filter.directory array="filterSet" index=filter.number}}</td>
<td><label for="filterSet[{{filter.number}}][directory]">Directory</label></td>
</tr>
<tr>
<td>{{>editable-ro-checkbox id="filterIntentionIsToMatch" bool=filter.filterIntentionIsToMatch array="filterSet" index=filter.number}}</td>
<td><label for="filterSet[{{filter.number}}][filterIntentionIsToMatch]">Filter's Intention is to Match?</label></td>
</tr>
</table>
</div>
</script>
<script id="modal-confirm-action" type="text/x-handlebars-template">
<div class="md-modal md-effect-1" id="confirm-modal">
<div class="md-content">
<h3>{{title}}</h3>
<div>
<p>{{message}}</p>
<p>
<button class="md-cancel md-button">{{cancelText}}</button>
<button class="md-confirm md-button">{{confirmText}}</button>
</p>
</div>
</div>
</div>
<div class="md-overlay"></div>
</script>
<div id="modal-container"></div>
<div id="header-container"></div>
<div class="container" id="flash-messages"></div>
<div class="container" id="content-container"></div>
<script src="js-lib/classie.js"></script>
<script src="js/utils.js"></script>
<script src="js/helpersAndPartials.js"></script>
<script src="js/models/KafkaBroker.js"></script>
<script src="js/models/KafkaTopic.js"></script>
<script src="js/models/KaBoomConfig.js"></script>
<script src="js/models/KaBoomTopic.js"></script>
<script src="js/models/KaBoomTopicConfig.js"></script>
<script src="js/models/KaBoomTopicFilter.js"></script>
<script src="js/views/FlashView.js"></script>
<script src="js/views/HomeView.js"></script>
<script src="js/views/KafkaBrokerView.js"></script>
<script src="js/views/KafkaTopicShowView.js"></script>
<script src="js/views/KaBoomTopicShowView.js"></script>
<script src="js/views/KaBoomRunningConfigView.js"></script>
<script src="js/views/KaBoomTopicEditView.js"></script>
<script src="js/menu.js"></script>
<script src="js/main.js"></script>
</body>
</html>