2018-06-05 14:58:04 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
|
2018-08-02 08:44:47 +00:00
|
|
|
<title>Submit Paste - AIL</title>
|
|
|
|
<link rel="icon" href="{{ url_for('static', filename='image/ail-icon.png') }}">
|
2018-06-05 14:58:04 +00:00
|
|
|
|
|
|
|
<!-- Core CSS -->
|
|
|
|
<link href="{{ url_for('static', filename='css/bootstrap.min.css') }}" rel="stylesheet">
|
|
|
|
<link href="{{ url_for('static', filename='font-awesome/css/font-awesome.css') }}" rel="stylesheet">
|
|
|
|
<link href="{{ url_for('static', filename='css/sb-admin-2.css') }}" rel="stylesheet">
|
|
|
|
<link href="{{ url_for('static', filename='css/dygraph_gallery.css') }}" rel="stylesheet" type="text/css" />
|
|
|
|
<link href="{{ url_for('static', filename='css/tags.css') }}" rel="stylesheet" type="text/css" />
|
|
|
|
<!-- JS -->
|
|
|
|
<script type="text/javascript" src="{{ url_for('static', filename='js/dygraph-combined.js') }}"></script>
|
|
|
|
<script language="javascript" src="{{ url_for('static', filename='js/jquery.js')}}"></script>
|
|
|
|
<script src="{{ url_for('static', filename='js/jquery.flot.js') }}"></script>
|
|
|
|
<script src="{{ url_for('static', filename='js/jquery.flot.pie.js') }}"></script>
|
|
|
|
<script src="{{ url_for('static', filename='js/jquery.flot.time.js') }}"></script>
|
|
|
|
<script src="/static//js/bootstrap.min.js"></script>
|
|
|
|
<script src="{{ url_for('static', filename='js/tags.js') }}"></script>
|
|
|
|
|
2018-06-08 14:49:20 +00:00
|
|
|
<style>
|
|
|
|
.glyphicon-refresh-animate {
|
|
|
|
-animation: spin .7s infinite linear;
|
|
|
|
-webkit-animation: spin2 .7s infinite linear;
|
|
|
|
}
|
|
|
|
|
|
|
|
@-webkit-keyframes spin2 {
|
|
|
|
from { -webkit-transform: rotate(0deg);}
|
|
|
|
to { -webkit-transform: rotate(360deg);}
|
|
|
|
}
|
|
|
|
|
|
|
|
@keyframes spin {
|
|
|
|
from { transform: scale(1) rotate(0deg);}
|
|
|
|
to { transform: scale(1) rotate(360deg);}
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
2018-06-05 14:58:04 +00:00
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
|
2018-06-08 14:49:20 +00:00
|
|
|
{% include 'navbar.html' %}
|
|
|
|
|
|
|
|
<div id="page-wrapper">
|
|
|
|
<div class="row">
|
|
|
|
<!-- /.col-lg-12 -->
|
|
|
|
|
|
|
|
<form action="/PasteSubmit/submit" id="pasteSubmitForm" method="post" enctype=multipart/form-data onsubmit="submitPaste()">
|
|
|
|
|
|
|
|
<input type="hidden" id="tags_taxonomies" name="tags_taxonomies" value="test">
|
|
|
|
<input type="hidden" id="tags_galaxies" name="tags_galaxies" value="test">
|
|
|
|
|
|
|
|
<div class="panel panel-primary pull-left" style="width: 40%;">
|
|
|
|
<div class="panel-heading">Files submission
|
|
|
|
</div>
|
|
|
|
<div class="panel-body">
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="file">Submit a file</label>
|
|
|
|
<input type="file" class="form-control-file" id="file" name="file">
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="paste_name">Archive Password</label>
|
|
|
|
<input type="password" class="form-control" id="password" name="password" placeholder="Optionnal">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="panel panel-info pull-right" style="width: auto;">
|
|
|
|
<div class="panel-heading"> Tags :
|
|
|
|
<ul class="list-group">
|
|
|
|
<li class="list-group-item">
|
|
|
|
|
|
|
|
<div class="form-group input-group" >
|
|
|
|
<input id="ltags" style="width:450%;" type="text">
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="btn-group btn-block">
|
|
|
|
<button type="button" class="btn btn-primary dropdown-toggle btn-block" data-toggle="dropdown">Taxonomie Selection
|
|
|
|
<i class="fa fa-chevron-down"></i>
|
|
|
|
</button>
|
|
|
|
<ul class="dropdown-menu scrollable-menu" role="menu">
|
|
|
|
<li><a href="#" id="all-tags-taxonomies">All Tags <i class="fa fa-tags"></i></a></li>
|
|
|
|
<li role="separator" class="divider"></li>
|
|
|
|
{% for taxo in active_taxonomies %}
|
|
|
|
<li><a href="#" id="{{ taxo }}-id{{ loop.index0 }}">{{ taxo }}</a></li>
|
|
|
|
{% endfor %}
|
2018-06-05 14:58:04 +00:00
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
|
2018-06-08 14:49:20 +00:00
|
|
|
</li>
|
|
|
|
<li class="list-group-item">
|
2018-06-05 14:58:04 +00:00
|
|
|
|
2018-06-08 14:49:20 +00:00
|
|
|
<div class="form-group input-group" >
|
|
|
|
<input id="ltagsgalaxies" style="width:450%;" type="text">
|
|
|
|
</div>
|
2018-06-05 14:58:04 +00:00
|
|
|
|
2018-06-08 14:49:20 +00:00
|
|
|
<div class="btn-group btn-block">
|
|
|
|
<button type="button" class="btn btn-primary dropdown-toggle btn-block" data-toggle="dropdown">Galaxy Selection
|
|
|
|
<i class="fa fa-chevron-down"></i>
|
|
|
|
</button>
|
|
|
|
<ul class="dropdown-menu scrollable-menu" role="menu">
|
|
|
|
<li><a href="#" id="all-tags-galaxies">All Tags <i class="fa fa-tags"></i></a></li>
|
|
|
|
<li role="separator" class="divider"></li>
|
|
|
|
{% for galaxy in active_galaxies %}
|
|
|
|
<li><a href="#" id="{{ galaxy }}-idgalax{{ loop.index0 }}">{{ galaxy }}</a></li>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
2018-06-05 14:58:04 +00:00
|
|
|
</div>
|
|
|
|
|
2018-06-08 14:49:20 +00:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<textarea class="form-control" id="paste_content" name="paste_content" rows="25"></textarea>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<button class="btn btn-primary " name="submit" type="submit">Submit this paste</button>
|
|
|
|
</div>
|
|
|
|
|
2018-06-05 14:58:04 +00:00
|
|
|
</form>
|
|
|
|
|
|
|
|
<!-- /.row -->
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<!-- /#page-wrapper -->
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="modalsubmit" class="modal fade" role="dialog">
|
|
|
|
<div class="modal-dialog modal-lg">
|
|
|
|
|
|
|
|
<!-- Modal content-->
|
|
|
|
<div id="mymodalcontent" class="modal-content">
|
|
|
|
<div class="modal-header" style="border-bottom: 4px solid #cccccc; background-color: #cccccc; color: #ffffff;">
|
|
|
|
<p class="heading"><h1>Submitting Pastes ...</h1></p>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="modal-body">
|
|
|
|
<br></br>
|
|
|
|
|
2018-06-08 14:49:20 +00:00
|
|
|
<div class="progress hidden" id="pr">
|
2018-06-05 14:58:04 +00:00
|
|
|
<div class="progress-bar progress-bar-striped active" role="progressbar"
|
2018-06-08 14:49:20 +00:00
|
|
|
aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width:0%" id="progress-bar">
|
|
|
|
0%
|
2018-06-05 14:58:04 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2018-06-08 14:49:20 +00:00
|
|
|
<span class="btn btn-info hidden" id="files_submitted_btn">
|
2018-06-05 14:58:04 +00:00
|
|
|
Files Submitted <span class="badge badge-light" id="files_submitted">1 / 1</span>
|
|
|
|
</span>
|
|
|
|
|
2018-06-08 14:49:20 +00:00
|
|
|
<button class="btn btn-lg btn-warning" style="margin: auto;" id="loading_button">
|
|
|
|
<span class="glyphicon glyphicon-refresh glyphicon-refresh-animate">
|
|
|
|
</span> Loading . . .
|
|
|
|
</button>
|
|
|
|
|
2018-06-05 14:58:04 +00:00
|
|
|
<br></br>
|
|
|
|
|
|
|
|
<div class="panel panel-danger hidden" id="panel_error">
|
|
|
|
<div class="panel-heading">ERROR</div>
|
|
|
|
<div class="panel-body">
|
|
|
|
<p id="error_message">error</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2018-06-08 14:49:20 +00:00
|
|
|
<div class="list-group hidden" id="submit_pastes">
|
|
|
|
<li class="list-group-item active">Submitted pastes</li>
|
|
|
|
</div>
|
|
|
|
|
2018-06-05 14:58:04 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="modal-footer">
|
|
|
|
<button class="btn btn-success btn-tags hidden " data-dismiss="modal" id="success_submit_button">
|
|
|
|
<span class="label-icon">Success </span>
|
|
|
|
<i class="fa fa-check"></i>
|
|
|
|
</button>
|
|
|
|
<button class="btn btn-danger btn-tags hidden" data-dismiss="modal" id="error_submit_button">
|
|
|
|
<span class="label-icon">ERROR </span>
|
|
|
|
<i class="fa fa-times"></i>
|
|
|
|
</button>
|
2018-06-29 09:29:52 +00:00
|
|
|
<a class="btn btn-tags pull-left hidden" href="{{ url_for('Tags.get_tagged_paste') }}?ltags=infoleak:submission="manual"" target="_blank" id="submit_result">
|
2018-06-05 14:58:04 +00:00
|
|
|
<span class="label-icon">Submitted Pastes </span>
|
|
|
|
<i class="fa fa-paper-plane fa-2x"></i>
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</body>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
var ltags
|
|
|
|
var ltagsgalaxies
|
|
|
|
$(document).ready(function(){
|
|
|
|
|
2018-09-25 14:46:06 +00:00
|
|
|
$.getJSON("{{ url_for('Tags.get_all_tags_taxonomies') }}",
|
2018-06-05 14:58:04 +00:00
|
|
|
function(data) {
|
|
|
|
|
|
|
|
ltags = $('#ltags').tagSuggest({
|
|
|
|
data: data,
|
|
|
|
maxDropHeight: 200,
|
|
|
|
name: 'ltags'
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2018-09-25 14:46:06 +00:00
|
|
|
$.getJSON("{{ url_for('Tags.get_all_tags_galaxy') }}",
|
2018-06-05 14:58:04 +00:00
|
|
|
function(data) {
|
|
|
|
|
|
|
|
ltagsgalaxies = $('#ltagsgalaxies').tagSuggest({
|
|
|
|
data: data,
|
|
|
|
maxDropHeight: 200,
|
|
|
|
name: 'ltagsgalaxies'
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
activePage = "page-PasteSubmit"
|
|
|
|
$("#"+activePage).addClass("active");
|
|
|
|
|
|
|
|
$('#modalsubmit').modal({backdrop: 'static'})
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
function submitPaste(){
|
|
|
|
document.getElementById("tags_taxonomies").value = ltags.getValue();
|
|
|
|
document.getElementById("tags_galaxies").value = ltagsgalaxies.getValue();
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
jQuery("#all-tags-taxonomies").click(function(e){
|
|
|
|
//change input tags list
|
2018-09-25 14:46:06 +00:00
|
|
|
$.getJSON("{{ url_for('Tags.get_all_tags_taxonomies') }}",
|
2018-06-05 14:58:04 +00:00
|
|
|
function(data) {
|
|
|
|
ltags.setData(data)
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
</script>
|
|
|
|
<script>
|
|
|
|
jQuery("#all-tags-galaxies").click(function(e){
|
2018-09-25 14:46:06 +00:00
|
|
|
$.getJSON("{{ url_for('Tags.get_all_tags_galaxy') }}",
|
2018-06-05 14:58:04 +00:00
|
|
|
function(data) {
|
|
|
|
ltagsgalaxies.setData(data)
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
{% for taxo in active_taxonomies %}
|
|
|
|
jQuery("#{{ taxo }}-id{{ loop.index0 }}").click(function(e){
|
2018-09-25 14:46:06 +00:00
|
|
|
$.getJSON("{{ url_for('Tags.get_tags_taxonomie') }}?taxonomie={{ taxo }}",
|
2018-06-05 14:58:04 +00:00
|
|
|
function(data) {
|
|
|
|
ltags.setData(data)
|
|
|
|
});
|
|
|
|
});
|
|
|
|
{% endfor %}
|
|
|
|
</script>
|
|
|
|
<script>
|
|
|
|
{% for galaxy in active_galaxies %}
|
|
|
|
jQuery("#{{ galaxy }}-idgalax{{ loop.index0 }}").click(function(e){
|
2018-09-25 14:46:06 +00:00
|
|
|
$.getJSON("{{ url_for('Tags.get_tags_galaxy') }}?galaxy={{ galaxy }}",
|
2018-06-05 14:58:04 +00:00
|
|
|
function(data) {
|
|
|
|
ltagsgalaxies.setData(data)
|
|
|
|
});
|
|
|
|
});
|
|
|
|
{% endfor %}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
var i = 0;
|
|
|
|
var err = 0;
|
|
|
|
$(".progress-bar").css("width", i + "%").text(i + " %");
|
|
|
|
function makeProgress(){
|
|
|
|
|
2018-09-25 14:46:06 +00:00
|
|
|
$.getJSON("{{ url_for('PasteSubmit.submit_status') }}?UUID={{ UUID }}",
|
2018-06-05 14:58:04 +00:00
|
|
|
function(data) {
|
|
|
|
|
|
|
|
var end = data.end;
|
|
|
|
var prog = data.prog;
|
|
|
|
var in_progress = data.in_progress;
|
2018-06-08 14:49:20 +00:00
|
|
|
var processing = data.processing;
|
2018-06-05 14:58:04 +00:00
|
|
|
var isError = data.isError;
|
|
|
|
var error = data.error;
|
|
|
|
|
2018-06-08 14:49:20 +00:00
|
|
|
if(processing){
|
|
|
|
$("#loading_button").addClass('hidden');
|
|
|
|
$("#pr").removeClass('hidden');
|
|
|
|
$("#files_submitted_btn").removeClass('hidden');
|
|
|
|
}
|
|
|
|
|
2018-06-05 14:58:04 +00:00
|
|
|
if(i < 100){
|
|
|
|
$(".progress-bar").css("width", prog + "%").text(prog + " %");
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!end){
|
|
|
|
|
|
|
|
document.getElementById('files_submitted').innerHTML = in_progress;
|
|
|
|
|
|
|
|
//error handler
|
|
|
|
if(isError){
|
|
|
|
document.getElementById('error_message').innerHTML = error;
|
|
|
|
$("#panel_error").removeClass('hidden');
|
|
|
|
$("#error_submit_button").removeClass('hidden');
|
|
|
|
err = err + 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Wait for sometime before running this script again
|
|
|
|
if(err < 100){
|
|
|
|
setTimeout("makeProgress()", 100);
|
|
|
|
}
|
|
|
|
} else {
|
2018-06-06 08:05:25 +00:00
|
|
|
document.getElementById('files_submitted').innerHTML = in_progress;
|
2018-06-08 14:49:20 +00:00
|
|
|
$("#progress-bar").removeClass('active');
|
|
|
|
$("#submit_result").removeClass('hidden');
|
|
|
|
|
2018-06-05 14:58:04 +00:00
|
|
|
if(isError){
|
|
|
|
document.getElementById('error_message').innerHTML = error;
|
|
|
|
$("#panel_error").removeClass('hidden');
|
|
|
|
$("#error_submit_button").removeClass('hidden');
|
2018-06-08 14:49:20 +00:00
|
|
|
|
2018-06-05 14:58:04 +00:00
|
|
|
} else {
|
|
|
|
$("#success_submit_button").removeClass('hidden');
|
|
|
|
}
|
2018-06-08 14:49:20 +00:00
|
|
|
|
|
|
|
if(in_progress == '0 / '){
|
|
|
|
document.getElementById('files_submitted').innerHTML = '0 / 0'
|
|
|
|
$(".progress-bar").css("width", "100%").text("100 %");
|
|
|
|
$("#progress-bar").addClass('progress-bar-danger')
|
|
|
|
} else {
|
|
|
|
var link = data.link;
|
|
|
|
$("#submit_pastes").append(link);
|
|
|
|
$("#submit_pastes").removeClass('hidden');
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-06-05 14:58:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
makeProgress();
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</html>
|