Browse Source

no more cyber

pull/12/head
jarn0ld 4 years ago
parent
commit
c2e0dd1eb3
  1. BIN
      webapp/db.sqlite3
  2. 2
      webapp/load_schema_from_json.py
  3. 12
      webapp/validator/templates/validator/base.html
  4. 6
      webapp/validator/templates/validator/fields.html
  5. 22
      webapp/validator/templates/validator/index.html

BIN
webapp/db.sqlite3

2
webapp/load_schema_from_json.py

@ -6,7 +6,7 @@ os.environ["DJANGO_SETTINGS_MODULE"] = "webapp.settings"
django.setup()
from validator.models import Field
schema = json.load(open('../../sigmf/schema.json'))
schema = json.load(open('../sigmf/schema.json'))
global_keys = schema["global"]["keys"].keys()
capture_keys = schema["capture"]["keys"].keys()
annotations_keys = schema["annotations"]["keys"].keys()

12
webapp/validator/templates/validator/base.html

@ -10,7 +10,7 @@
<meta name="description" content="">
<meta name="author" content="">
<title>Cyberspectrum-File-Format Validator</title>
<title>SigMF</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
@ -33,6 +33,9 @@
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js">
</script>
<![endif]-->
<script src=
"https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js">
</script>
</head>
<body>
@ -48,11 +51,11 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="{% url 'index' %}">Cyber</a>
<a class="navbar-brand" href="{% url 'index' %}">SigMF</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="{% url 'index' %}">Validate!</a></li>
<li class="active"><a href="{% url 'index' %}">Validator</a></li>
<li><a href="{% url 'fields' %}">Fields</a></li>
</ul>
</div><!--/.nav-collapse -->
@ -67,9 +70,6 @@
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src=
"https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js">
</script>
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"
integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"

6
webapp/validator/templates/validator/fields.html

@ -3,15 +3,15 @@
{% block content %}
<div class="starter-template">
<h1>Cyberspectrum File-Format Fields List</h1>
<h1>SigMF Fields</h1>
{% for cat in categories %}
<h2>Cyber-Category {{cat.name}}</h2>
<h2>Category {{cat.name}}</h2>
<table class="table table-bordered">
<thead>
<tr>
<th style="width:30%;">
Cyber-Key
Key
</th>
<th style="width:10%;">
Type

22
webapp/validator/templates/validator/index.html

@ -3,7 +3,7 @@
{% block content %}
<div class="starter-template">
<h1>Cyberspectrum File-Format Validator</h1>
<h1>SigMF Validator</h1>
{% if validator_result %}
<div class="alert alert-success" role="alert">
@ -16,11 +16,27 @@
</div>
{% endif %}
<form action="{% url 'index' %}" method="post" enctype="multipart/form-data" style="text-align:left;">
<form action="{% url 'index' %}" method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ sigmf_upload_form }}
<input type="file" id="id_sigmf_meta_file" name="sigmf_meta_file"
style="display:none;"/>
<button type="button" id="browse" style="width:80%;height:50px;">
Upload SigMF File
</button>
</br>
<input type="submit" value="Validate!" />
</form>
</div>
<script type="text/javascript">
$('#browse').click(function(){
$(this).parent().find('#id_sigmf_meta_file').click();
});
$('#id_sigmf_meta_file').on("change", function(){
$('#browse').html($(this).val());
});
</script>
{% endblock %}
Loading…
Cancel
Save