mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-23 14:37:17 +00:00
121 lines
3.9 KiB
HTML
121 lines
3.9 KiB
HTML
|
<div id="create_hive_case_modal" class="modal fade" role="dialog">
|
||
|
<div class="modal-dialog modal-lg">
|
||
|
|
||
|
<div id="create_hive_case_modal_content" class="modal-content">
|
||
|
<div class="modal-header justify-content-center">
|
||
|
<img id="hive-logo" src="{{url_for('static', filename='image/thehive-logo.png') }}" width="500" >
|
||
|
</div>
|
||
|
|
||
|
<div class="modal-body">
|
||
|
|
||
|
<form method="post" action="{{ url_for('PasteSubmit.create_hive_case') }}" target="_blank">
|
||
|
|
||
|
<div class="input clear required">
|
||
|
<label for="EventThreatLevelId">Threat Level</label>
|
||
|
<select name="threat_level_hive" id="EventThreatLevelId" required="required">
|
||
|
<option value="1">High</option>
|
||
|
<option value="2" selected="selected">Medium</option>
|
||
|
<option value="3">Low</option>
|
||
|
</select>
|
||
|
</div>
|
||
|
<div class="input select required">
|
||
|
<label for="TLP">TLP</label>
|
||
|
<select name="hive_tlp" id="hive_tlp" required="required" class="selectpicker">
|
||
|
<option value="0">White</option>
|
||
|
<option value="1">Green</option>
|
||
|
<option value="2" selected="selected">Amber</option>
|
||
|
<option value="3">Red</option>
|
||
|
</select>
|
||
|
</div>
|
||
|
<div class="clear required">
|
||
|
<label for="hive_case_title">Title</label>
|
||
|
<input name="hive_case_title" class="form-control span6" placeholder="Title" type="text" id="hive_case_title" required="required"/>
|
||
|
</div>
|
||
|
<div class="clear required">
|
||
|
<label for="hive_description">Description</label>
|
||
|
<input name="hive_description" class="form-control span6" placeholder="Quick Case Description" type="text" id="hive_description" required="required"/>
|
||
|
</div>
|
||
|
<input type="hidden" id="paste" name="paste" value="{{ dict_item['id'] }}">
|
||
|
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<div class="modal-footer">
|
||
|
<button class="btn btn-primary" type="submit">
|
||
|
<i class="fas fa-plus"></i>
|
||
|
Create Case
|
||
|
</button>
|
||
|
|
||
|
</form>
|
||
|
<button type="button" class="btn btn-default" data-dismiss="modal" >Close</button>
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<script> // TODO: add tags to PASTE or DOMAIN
|
||
|
var ltags;
|
||
|
var ltagsgalaxies;
|
||
|
|
||
|
$.getJSON("{{ url_for('Tags.get_all_tags_taxonomies') }}",
|
||
|
function(data) {
|
||
|
|
||
|
ltags = $('#ltags').tagSuggest({
|
||
|
data: data,
|
||
|
maxDropHeight: 200,
|
||
|
name: 'ltags'
|
||
|
});
|
||
|
});
|
||
|
|
||
|
$.getJSON("{{ url_for('Tags.get_all_tags_galaxy') }}",
|
||
|
function(data) {
|
||
|
|
||
|
ltagsgalaxies = $('#ltagsgalaxies').tagSuggest({
|
||
|
data: data,
|
||
|
maxDropHeight: 200,
|
||
|
name: 'ltagsgalaxies'
|
||
|
});
|
||
|
});
|
||
|
|
||
|
jQuery("#all-tags-taxonomies").click(function(e){
|
||
|
//change input tags list
|
||
|
$.getJSON("{{ url_for('Tags.get_all_tags_taxonomies') }}",
|
||
|
function(data) {
|
||
|
ltags.setData(data)
|
||
|
});
|
||
|
});
|
||
|
|
||
|
jQuery("#all-tags-galaxies").click(function(e){
|
||
|
$.getJSON("{{ url_for('Tags.get_all_tags_galaxy') }}",
|
||
|
function(data) {
|
||
|
ltagsgalaxies.setData(data)
|
||
|
});
|
||
|
});
|
||
|
|
||
|
{% for taxo in modal_add_tags['active_taxonomies'] %}
|
||
|
jQuery("#{{ taxo }}-id{{ loop.index0 }}").click(function(e){
|
||
|
$.getJSON("{{ url_for('Tags.get_tags_taxonomie') }}?taxonomie={{ taxo }}",
|
||
|
function(data) {
|
||
|
ltags.setData(data)
|
||
|
});
|
||
|
});
|
||
|
{% endfor %}
|
||
|
|
||
|
{% for galaxy in modal_add_tags['active_galaxies'] %}
|
||
|
jQuery("#{{ galaxy }}-idgalax{{ loop.index0 }}").click(function(e){
|
||
|
$.getJSON("{{ url_for('Tags.get_tags_galaxy') }}?galaxy={{ galaxy }}",
|
||
|
function(data) {
|
||
|
ltagsgalaxies.setData(data)
|
||
|
});
|
||
|
});
|
||
|
{% endfor %}
|
||
|
|
||
|
function addTags() {
|
||
|
var tags = ltags.getValue()
|
||
|
var tagsgalaxy = ltagsgalaxies.getValue()
|
||
|
window.location.replace("{{ url_for('tags_ui.add_tags') }}?tags=" + tags + "&tagsgalaxies=" + tagsgalaxy + "&object_id={{ modal_add_tags['object_id'] }}&object_type={{ modal_add_tags['object_type'] }}");
|
||
|
}
|
||
|
</script>
|