-
-
Notifications
You must be signed in to change notification settings - Fork 668
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
355aacc
commit fb90104
Showing
17 changed files
with
264 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import $ from "jquery"; | ||
import "../widget"; | ||
import ace from 'ace-builds'; | ||
import "ace-builds/src-noconflict/theme-tomorrow"; | ||
import "ace-builds/webpack-resolver"; | ||
|
||
$.widget("khq.ace-editor", $.khq.widget, { | ||
|
||
_create: function () { | ||
let textarea = this.element.find('> textarea'); | ||
|
||
let editor = ace.edit(this.element.find('> div')[0], { | ||
minLines: 5, | ||
maxLines: 48, | ||
autoScrollEditorIntoView: true, | ||
theme: "ace/theme/tomorrow" | ||
}); | ||
|
||
editor.renderer.setScrollMargin(10, 10, 10, 10); | ||
|
||
editor.getSession().setValue(textarea.val()); | ||
editor.getSession().on('change', function () { | ||
textarea.val(editor.getSession().getValue()); | ||
}); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.khq-ace-editor { | ||
> div { | ||
height: $input-height-inner * 3 ; | ||
} | ||
|
||
> textarea { | ||
display: none; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import $ from "jquery"; | ||
import "../widget"; | ||
|
||
$.widget("khq.multiple", $.khq.widget, { | ||
|
||
_create: function () { | ||
let self = this; | ||
|
||
self.element.find('button').on("click", function (e) { | ||
e.preventDefault(); | ||
|
||
let clone = $(this).closest('div').clone(); | ||
clone.find('input').each(function(key, value) { | ||
$(value).val(''); | ||
}); | ||
|
||
self.element.append(clone); | ||
}); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.khq-multiple { | ||
> div { | ||
display: flex; | ||
flex-direction: row; | ||
margin-bottom: $form-group-margin-bottom; | ||
|
||
&:last-child { | ||
margin-bottom: 0; | ||
} | ||
|
||
> * { | ||
margin-right: $form-group-margin-bottom; | ||
|
||
&:last-child { | ||
margin-right: 0; | ||
} | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<#-- @ftlvariable name="topic" type="org.kafkahq.models.Topic" --> | ||
|
||
<#import "/includes/template.ftl" as template> | ||
<#import "/includes/functions.ftl" as functions> | ||
|
||
<@template.header "Produce to " + topic.getName(), "topic" /> | ||
|
||
<form enctype="multipart/form-data" method="post" class="khq-form khq-form-config"> | ||
<div class="form-group row"> | ||
<label for="partition" class="col-sm-2 col-form-label">Partition</label> | ||
<div class="col-sm-10"> | ||
<select class="form-control" name="partition" id="partition"> | ||
<option></option> | ||
<#list topic.getPartitions() as partition> | ||
<option>${partition.getId()}</option> | ||
</#list> | ||
</select> | ||
</div> | ||
</div> | ||
<div class="form-group row"> | ||
<label for="key" class="col-sm-2 col-form-label">Key</label> | ||
<div class="col-sm-10"> | ||
<input type="text" class="form-control" name="key" id="key" autocomplete="off" placeholder="Key"> | ||
</div> | ||
</div> | ||
<div class="form-group row"> | ||
<label class="col-sm-2 col-form-label">Headers</label> | ||
<div class="col-sm-10 khq-multiple"> | ||
<div> | ||
<input type="text" class="form-control" name="headers[key][]" autocomplete="off" placeholder="Key"> | ||
<input type="text" class="form-control" name="headers[value][]" autocomplete="off" placeholder="Value"> | ||
<button class="btn btn-secondary"><i class="fa fa-plus"></i></button> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="form-group row"> | ||
<label for="timestamp" class="col-sm-2 col-form-label">Timestamp</label> | ||
<div class="col-sm-10 khq-datetime"> | ||
<input type="text" class="form-control datetimepicker-input" name="timestamp" id="timestamp" autocomplete="off" data-toggle="datetimepicker" data-target="#timestamp" placeholder="Timestamp"/> | ||
</div> | ||
</div> | ||
<div class="form-group row"> | ||
<label for="value" class="col-sm-2 col-form-label">Value</label> | ||
<div class="col-sm-10"> | ||
<div class="khq-ace-editor"> | ||
<div>></div> | ||
<textarea class="form-control" name="value" id="value" placeholder="Value"></textarea> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="khq-submit"> | ||
<button type="submit" class="btn btn-primary">Produce</button> | ||
</div> | ||
</form> | ||
|
||
<@template.footer/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.