mirror of https://github.com/D4-project/d4-core
311 lines
12 KiB
HTML
311 lines
12 KiB
HTML
<!DOCTYPE html>
|
|
|
|
<html>
|
|
<head>
|
|
<title>D4-Project</title>
|
|
<link rel="icon" href="{{ url_for('static', filename='img/d4-logo.png')}}">
|
|
<!-- 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/dataTables.bootstrap.min.css') }}" rel="stylesheet">
|
|
|
|
<!-- JS -->
|
|
<script src="{{ url_for('static', filename='js/jquery.js')}}"></script>
|
|
<script src="{{ url_for('static', filename='js/bootstrap.min.js')}}"></script>
|
|
<script src="{{ url_for('static', filename='js/jquery.dataTables.min.js')}}"></script>
|
|
<script src="{{ url_for('static', filename='js/dataTables.bootstrap.min.js')}}"></script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<nav class="navbar navbar-expand-sm navbar-dark bg-dark">
|
|
<a class="navbar-brand" href="{{ url_for('index') }}">
|
|
<img src="{{ url_for('static', filename='img/d4-logo.png')}}" alt="D4 Project" style="width:80px;">
|
|
</a>
|
|
<ul class="navbar-nav">
|
|
<li class="nav-item">
|
|
<a class="nav-link mr-3" href="{{ url_for('index') }}">Home <span class="sr-only">(current)</span></a>
|
|
</li>
|
|
<li class="nav-item" mr-3>
|
|
<a class="nav-link mr-3" href="{{ url_for('sensors_status') }}">Sensors Status</a>
|
|
</li>
|
|
<li class="nav-item mr-3">
|
|
<a class="nav-link active" href="{{ url_for('server_management') }}" tabindex="-1" aria-disabled="true">Server Management</a>
|
|
</li>
|
|
</ul>
|
|
</nav>
|
|
|
|
<div class="card-deck justify-content-center ml-0 mr-0">
|
|
<div class="card text-center mt-3 ml-4">
|
|
<div class="card-header bg-danger text-white">
|
|
Blacklist IP
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="card-deck justify-content-center">
|
|
<div class="card text-center border-danger" style="max-width: 20rem;">
|
|
<div class="card-body text-danger">
|
|
<h5 class="card-title">Blacklist IP</h5>
|
|
<input type="text" class="form-control {%if blacklisted_ip is not none %}{%if blacklisted_ip==1 %}is-valid{% else %}is-invalid{%endif%}{%endif%}" id="blacklist_ip_input" placeholder="IP Address">
|
|
<div class="invalid-feedback">
|
|
{%if blacklisted_ip==2 %}
|
|
This IP is already blacklisted
|
|
{% else %}
|
|
Incorrect IP address
|
|
{% endif %}
|
|
</div>
|
|
<div class="valid-feedback">
|
|
IP Blacklisted
|
|
</div>
|
|
<button type="button" class="btn btn-danger mt-2" onclick="window.location.href ='{{ url_for('blacklist_ip') }}?redirect=0&ip='+$('#blacklist_ip_input').val();">Blacklist IP</button>
|
|
</div>
|
|
</div>
|
|
<div class="card text-center border-light" style="max-width: 20rem;">
|
|
<div class="card-body">
|
|
<h5 class="card-title">Manage IP Blacklist</h5>
|
|
<a href="{{ url_for('blacklisted_ip') }}">
|
|
<button type="button" class="btn btn-outline-primary">Show Blacklisted IP</button>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
<div class="card text-center border-success" style="max-width: 20rem;">
|
|
<div class="card-body">
|
|
<h5 class="card-title">Unblacklist IP</h5>
|
|
<input type="text" class="form-control {%if unblacklisted_ip is not none %}{%if unblacklisted_ip==1 %}is-valid{% else %}is-invalid{%endif%}{%endif%}" id="unblacklist_ip_input" placeholder="IP Address">
|
|
<div class="invalid-feedback">
|
|
{%if unblacklisted_ip==2 %}
|
|
This IP is not blacklisted
|
|
{% else %}
|
|
Incorrect IP address
|
|
{% endif %}
|
|
</div>
|
|
<div class="valid-feedback">
|
|
IP Unblacklisted
|
|
</div>
|
|
<button type="button" class="btn btn-outline-secondary mt-2" onclick="window.location.href ='{{ url_for('unblacklist_ip') }}?redirect=0&ip='+$('#unblacklist_ip_input').val();">Unblacklist IP</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card text-center mt-3 mr-4">
|
|
<div class="card-header bg-danger text-white">
|
|
Blacklist UUID
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="card-deck justify-content-center">
|
|
<div class="card text-center border-danger" style="max-width: 20rem;">
|
|
<div class="card-body text-danger">
|
|
<h5 class="card-title">Blacklist UUID</h5>
|
|
<input type="text" class="form-control {%if blacklisted_uuid is not none %}{%if blacklisted_uuid==1 %}is-valid{% else %}is-invalid{%endif%}{%endif%}" id="blacklist_uuid_input" placeholder="UUID">
|
|
<div class="invalid-feedback">
|
|
{%if blacklisted_uuid==2 %}
|
|
This UUID is already blacklisted
|
|
{% else %}
|
|
Incorrect UUID
|
|
{% endif %}
|
|
</div>
|
|
<div class="valid-feedback">
|
|
UUID Blacklisted
|
|
</div>
|
|
<button type="button" class="btn btn-danger mt-2" onclick="window.location.href ='{{ url_for('blacklist_uuid') }}?redirect=0&uuid='+$('#blacklist_uuid_input').val();">Blacklist UUID</button>
|
|
</div>
|
|
</div>
|
|
<div class="card text-center border-light" style="max-width: 20rem;">
|
|
<div class="card-body">
|
|
<h5 class="card-title">Manage UUID Blacklist</h5>
|
|
<a href="{{ url_for('blacklisted_uuid') }}">
|
|
<button type="button" class="btn btn-outline-primary">Show Blacklisted UUID</button>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
<div class="card text-center border-success" style="max-width: 20rem;">
|
|
<div class="card-body">
|
|
<h5 class="card-title">Unblacklist UUID</h5>
|
|
<input type="text" class="form-control {%if unblacklisted_uuid is not none %}{%if unblacklisted_uuid==1 %}is-valid{% else %}is-invalid{%endif%}{%endif%}" id="unblacklist_uuid_input" placeholder="UUID">
|
|
<div class="invalid-feedback">
|
|
{%if unblacklisted_uuid==2 %}
|
|
This UUID is not Blacklisted
|
|
{% else %}
|
|
Incorrect UUID
|
|
{% endif %}
|
|
</div>
|
|
<div class="valid-feedback">
|
|
UUID Unblacklisted
|
|
</div>
|
|
<button type="button" class="btn btn-outline-secondary mt-2" onclick="window.location.href ='{{ url_for('unblacklist_uuid') }}?redirect=0&uuid='+$('#unblacklist_uuid_input').val();">Unblacklist UUID</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card-deck justify-content-center ml-0 mr-0">
|
|
<div class="card border-dark mt-3 ml-4 mr-4">
|
|
<div class="card-header bg-dark text-white">
|
|
Header Accepted Types
|
|
</div>
|
|
<div class="card-body text-dark">
|
|
|
|
<div class="row">
|
|
<div class="col-sm-8">
|
|
<table class="table table-striped table-bordered table-hover" id="myTable_">
|
|
<thead class="thead-dark">
|
|
<tr>
|
|
<th>Type</th>
|
|
<th style="max-width: 800px;">Description</th>
|
|
<th style="max-width: 800px;">Remove Type</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for type in list_accepted_types %}
|
|
<tr>
|
|
<td>{{type['id']}}</td>
|
|
<td>{{type['description']}}</td>
|
|
<td>
|
|
<a href="{{ url_for('remove_accepted_type') }}?redirect=1&type={{type['id']}}">
|
|
<button type="button" class="btn btn-outline-danger">Remove Type</button>
|
|
</a>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="col-sm-4">
|
|
<div class="card border-dark mt-3" style="max-width: 18rem;">
|
|
<div class="card-body text-dark">
|
|
<h5 class="card-title">Add New Types</h5>
|
|
<input class="form-control" type="number" id="accepted_type" value="1" min="1" max="8" required>
|
|
<button type="button" class="btn btn-outline-primary mt-1" onclick="window.location.href ='{{ url_for('add_accepted_type') }}?redirect=1&type='+$('#accepted_type').val();">Add New Type</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
<div class="card-deck justify-content-center ml-0 mr-0">
|
|
<div class="card border-dark mt-3 ml-4 mr-4">
|
|
<div class="card-header bg-dark text-white">
|
|
Analyzer Management
|
|
</div>
|
|
<div class="card-body text-dark">
|
|
|
|
<div class="row">
|
|
<div class="col-sm-8">
|
|
<table class="table table-striped table-bordered table-hover" id="myTable_1">
|
|
<thead class="thead-dark">
|
|
<tr>
|
|
<th>Type</th>
|
|
<th style="max-width: 800px;">uuid</th>
|
|
<th style="max-width: 800px;">last updated</th>
|
|
<th style="max-width: 800px;">Change max size limit</th>
|
|
<th style="max-width: 800px;">Analyzer Queue</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for type in list_accepted_types %}
|
|
{% if type['list_analyzer_uuid'] %}
|
|
{% for analyzer in type['list_analyzer_uuid'] %}
|
|
<tr>
|
|
<td>{{type['id']}}</td>
|
|
<td>{{analyzer['uuid']}}</td>
|
|
<td>{{analyzer['last_updated']}}</td>
|
|
<td>
|
|
<div class="d-flex justify-content-center">
|
|
<input class="form-control mr-1" style="max-width: 100px;" type="number" id="max_size_analyzer_{{analyzer['uuid']}}" value="{{analyzer['size_limit']}}" min="0" required="">
|
|
<button type="button" class="btn btn-outline-secondary" onclick="window.location.href ='{{ url_for('analyzer_change_max_size') }}?analyzer_uuid={{analyzer['uuid']}}&redirect=0&max_size_analyzer='+$('#max_size_analyzer_{{analyzer['uuid']}}').val();">Change Max Size</button>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<a href="{{ url_for('remove_analyzer') }}?redirect=1&type={{type['id']}}&analyzer_uuid={{analyzer['uuid']}}">
|
|
<button type="button" class="btn btn-outline-danger"><i class="fa fa-trash"></i></button>
|
|
</a>
|
|
<button type="button" class="btn btn-outline-info ml-3" onclick="get_analyser_sample('{{type['id']}}', '{{analyzer['uuid']}}');"><i class="fa fa-database"></i> {{analyzer['length']}}</button>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="col-sm-4">
|
|
<div class="card border-dark mt-3" style="max-width: 18rem;">
|
|
<div class="card-body text-dark">
|
|
<h5 class="card-title">Add New Analyzer Queue</h5>
|
|
<input class="form-control" type="number" id="analyzer_type" value="1" min="1" max="8" required>
|
|
<input class="form-control" type="text" id="analyzer_uuid" required>
|
|
<button type="button" class="btn btn-outline-primary mt-1" onclick="window.location.href ='{{ url_for('add_new_analyzer') }}?redirect=1&type='+$('#analyzer_type').val()+'&analyzer_uuid='+$('#analyzer_uuid').val();">Add New Analyzer</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="modal fade" id="modal_analyser_sample" tabindex="-1" role="dialog" aria-labelledby="AnalyserModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog modal-xl" role="document">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title" id="modal_analyser_sample_label"></h5>
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
</div>
|
|
<div class="d-flex modal-body justify-content-center">
|
|
<pre id="analyzer_content">
|
|
</pre>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{% include 'navfooter.html' %}
|
|
</body>
|
|
|
|
<script>
|
|
var table
|
|
$(document).ready(function(){
|
|
|
|
table = $('#myTable_').DataTable(
|
|
{
|
|
/*"aLengthMenu": [[5, 10, 15, 20, -1], [5, 10, 15, 20, "All"]],
|
|
"iDisplayLength": 10,*/
|
|
"order": [[ 0, "asc" ]]
|
|
}
|
|
);
|
|
|
|
table = $('#myTable_1').DataTable(
|
|
{
|
|
/*"aLengthMenu": [[5, 10, 15, 20, -1], [5, 10, 15, 20, "All"]],
|
|
"iDisplayLength": 10,*/
|
|
"order": [[ 0, "asc" ]]
|
|
}
|
|
);
|
|
|
|
});
|
|
|
|
|
|
function get_analyser_sample(type, analyzer_uuid){
|
|
$.getJSON( "{{url_for('get_analyser_sample')}}?type="+type+"&analyzer_uuid="+analyzer_uuid, function( data ) {
|
|
$( "#modal_analyser_sample_label" ).text("analyzer:"+type+":"+analyzer_uuid);
|
|
$( "#analyzer_content" ).text(data);
|
|
$( "#modal_analyser_sample" ).modal('show');
|
|
});
|
|
}
|
|
</script>
|