mirror of https://github.com/MISP/misp-dashboard
Added typeahead orgname
parent
4293ad52c9
commit
9fc82589ab
|
@ -246,6 +246,11 @@ def getCategPerContrib():
|
||||||
]
|
]
|
||||||
return jsonify(data*2)
|
return jsonify(data*2)
|
||||||
|
|
||||||
|
@app.route("/_getAllOrg")
|
||||||
|
def getAllOrg():
|
||||||
|
data = ['CIRCL', 'CASES', 'SMILE' ,'ORG4' ,'ORG5']
|
||||||
|
return jsonify(data)
|
||||||
|
|
||||||
@app.route("/_getTopCoord")
|
@app.route("/_getTopCoord")
|
||||||
def getTopCoord():
|
def getTopCoord():
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
<script src="{{ url_for('static', filename='js/jquery.flot.resize.js') }}"></script>
|
<script src="{{ url_for('static', filename='js/jquery.flot.resize.js') }}"></script>
|
||||||
<!-- Bootstrap Core JavaScript -->
|
<!-- Bootstrap Core JavaScript -->
|
||||||
<script src="{{ url_for('static', filename='js/bootstrap.js') }}"></script>
|
<script src="{{ url_for('static', filename='js/bootstrap.js') }}"></script>
|
||||||
|
<script src="{{ url_for('static', filename='js/bootstrap3-typeahead.min.js') }}"></script>
|
||||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/font-awesome.min.css') }}" rel="text/css">
|
<link rel="stylesheet" href="{{ url_for('static', filename='css/font-awesome.min.css') }}" rel="text/css">
|
||||||
|
|
||||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/jquery-jvectormap-2.0.3.css') }}" type="text/css" media="screen"/>
|
<link rel="stylesheet" href="{{ url_for('static', filename='css/jquery-jvectormap-2.0.3.css') }}" type="text/css" media="screen"/>
|
||||||
|
@ -112,6 +113,11 @@ small {
|
||||||
<li><a href="{{ url_for('geo') }}">MISP Geolocalisation</a></li>
|
<li><a href="{{ url_for('geo') }}">MISP Geolocalisation</a></li>
|
||||||
<li><a href="{{ url_for('contrib') }}">MISP Contributors</a></li>
|
<li><a href="{{ url_for('contrib') }}">MISP Contributors</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<div id="ledsHolder" style="float: right; height: 50px;">
|
||||||
|
<div class='leftSepa textTopHeader'>
|
||||||
|
<strong>Your organisation name: <input type="text" id="orgName" data-provide="typeahead" size="30" style="margin-bottom: 5px;"></strong>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.navbar-header -->
|
<!-- /.navbar-header -->
|
||||||
</nav>
|
</nav>
|
||||||
|
@ -278,39 +284,18 @@ small {
|
||||||
return img.outerHTML;
|
return img.outerHTML;
|
||||||
}
|
}
|
||||||
|
|
||||||
function create_stars_dom(n) {
|
var allOrg = [];
|
||||||
var n = 4-n; //1 is best -> 3 stars
|
var typeaheadOption = {
|
||||||
var div = document.createElement('DIV');
|
source: function (query, process) {
|
||||||
div.classList.add('ranking');
|
if (allOrg.length == 0) { // caching
|
||||||
for(var i=1; i<=n; i++) {
|
return $.getJSON("{{ url_for('getAllOrg') }}", function (data) {
|
||||||
var span = document.createElement('span');
|
allOrg = data;
|
||||||
span.classList.add("glyphicon");
|
return process(data);
|
||||||
span.classList.add("glyphicon-star");
|
});
|
||||||
span.classList.add("star"+n+"-"+i);
|
} else {
|
||||||
div.appendChild(span);
|
return process(allOrg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return div.outerHTML;
|
|
||||||
}
|
|
||||||
|
|
||||||
var datatableIndex = 1;
|
|
||||||
function getIndexRank() {
|
|
||||||
var to_return;
|
|
||||||
switch (datatableIndex) {
|
|
||||||
case 1:
|
|
||||||
to_return = create_stars_dom(1);
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
to_return = create_stars_dom(2);
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
to_return = create_stars_dom(3);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
to_return = datatableIndex;
|
|
||||||
}
|
|
||||||
datatableIndex++;
|
|
||||||
return to_return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var datatableTop;
|
var datatableTop;
|
||||||
|
@ -367,6 +352,7 @@ small {
|
||||||
};
|
};
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
$('#orgName').typeahead(typeaheadOption);
|
||||||
datatableTop = $('#topContribTable').DataTable(optionDatatable_top);
|
datatableTop = $('#topContribTable').DataTable(optionDatatable_top);
|
||||||
datatableFame = $('#fameTable').DataTable(optionDatatable_fame);
|
datatableFame = $('#fameTable').DataTable(optionDatatable_fame);
|
||||||
datatableCateg = $('#categTable').DataTable(optionDatatable_Categ);
|
datatableCateg = $('#categTable').DataTable(optionDatatable_Categ);
|
||||||
|
@ -389,7 +375,6 @@ small {
|
||||||
|
|
||||||
// hall of fame
|
// hall of fame
|
||||||
$.getJSON( "{{ url_for('getTopContributor') }}", function( data ) {
|
$.getJSON( "{{ url_for('getTopContributor') }}", function( data ) {
|
||||||
datatableIndex = 1;
|
|
||||||
for (i in data) {
|
for (i in data) {
|
||||||
var row = data[i];
|
var row = data[i];
|
||||||
i = parseInt(i);
|
i = parseInt(i);
|
||||||
|
|
|
@ -58,7 +58,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.textTopHeader {
|
.textTopHeader {
|
||||||
height: 50px;
|
height: 50px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-left: 8px;
|
margin-left: 8px;
|
||||||
float: left;
|
float: left;
|
||||||
|
@ -90,6 +90,7 @@ small {
|
||||||
<ul class="dropdown-menu">
|
<ul class="dropdown-menu">
|
||||||
<li><a href="{{ url_for('index') }}">MISP Live Dashboard</a></li>
|
<li><a href="{{ url_for('index') }}">MISP Live Dashboard</a></li>
|
||||||
<li><a href="{{ url_for('geo') }}">MISP Geolocalisation</a></li>
|
<li><a href="{{ url_for('geo') }}">MISP Geolocalisation</a></li>
|
||||||
|
<li><a href="{{ url_for('contrib') }}">MISP Contributors</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div id="ledsHolder" style="float: right; height: 50px;">
|
<div id="ledsHolder" style="float: right; height: 50px;">
|
||||||
|
@ -184,7 +185,7 @@ small {
|
||||||
</div><!-- /.col-lg-6 -->
|
</div><!-- /.col-lg-6 -->
|
||||||
|
|
||||||
<div class="col-lg-6">
|
<div class="col-lg-6">
|
||||||
|
|
||||||
<div class="panel panel-default" style="height: 100%;">
|
<div class="panel panel-default" style="height: 100%;">
|
||||||
<div class="panel-heading bg-info" style="font-weight: bold;">
|
<div class="panel-heading bg-info" style="font-weight: bold;">
|
||||||
<b id="worldMapHeader">Hit map </b>
|
<b id="worldMapHeader">Hit map </b>
|
||||||
|
@ -198,7 +199,7 @@ small {
|
||||||
<div class="panel panel-default" style="height: 100%;">
|
<div class="panel panel-default" style="height: 100%;">
|
||||||
<div class="panel-heading bg-info" style="font-weight: bold; padding: 5px 10px;">
|
<div class="panel-heading bg-info" style="font-weight: bold; padding: 5px 10px;">
|
||||||
<b id="radiusHeader" style="font-size: 18px;">Geospatial information</b>
|
<b id="radiusHeader" style="font-size: 18px;">Geospatial information</b>
|
||||||
<strong class='leftSepa textTopHeader' style="float: none; padding: 11px;">Dates:
|
<strong class='leftSepa textTopHeader' style="float: none; padding: 11px;">Dates:
|
||||||
<input type="text" id="datepickerRadiusFrom" size="20" style="">
|
<input type="text" id="datepickerRadiusFrom" size="20" style="">
|
||||||
<input type="text" id="datepickerRadiusTo" size="20" style="">
|
<input type="text" id="datepickerRadiusTo" size="20" style="">
|
||||||
</strong>
|
</strong>
|
||||||
|
@ -225,7 +226,7 @@ small {
|
||||||
<!-- /#wrapper -->
|
<!-- /#wrapper -->
|
||||||
|
|
||||||
<!-- Index -->
|
<!-- Index -->
|
||||||
<script>
|
<script>
|
||||||
/* URL */
|
/* URL */
|
||||||
var urlTopCoord = "{{ url_for('getTopCoord') }}";
|
var urlTopCoord = "{{ url_for('getTopCoord') }}";
|
||||||
var urlHitMap = "{{ url_for('getHitMap') }}";
|
var urlHitMap = "{{ url_for('getHitMap') }}";
|
||||||
|
|
Loading…
Reference in New Issue