/
scope.html
62 lines (61 loc) · 2.12 KB
/
scope.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{% extends "base.html" %}
{% set title = "Manage Scope" %}
{% set active_page = "scope" %}
{% block content %}
{% include 'admin/_header.html' %}
<div class="row">
<div class="col">
<h3>Add Scope</h3>
<form class="form-inline" action="{{url_for('admin.scope')}}" method="post">
{{ newForm.hidden_tag() }}
<div class="input-group">
{{ newForm.target(size=32, class="form-control", placeholder="E.g. 10.0.0.0/8") }}
{% for error in newForm.target.errors %}
<span style="color: red;">{{ error }}</span>
{% endfor %}
</div>
{{ newForm.submit(class="btn btn-primary ml-3") }}
</form>
</div>
</div>
<div class="row">
<div class="col">
<h3 class="mt-3">Manage Scope ({{ scopeSize }} hosts)</h3>
<table class="table table-striped dataTable">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Target</th>
<th scope="col">Tags</th>
<th class="table-controls" scope="col"></th>
</tr>
</thead>
<tbody>
{% for item in scope %}
<tr>
<th scope="row">{{ item.id }}</th>
<td>{{ item.target }}</td>
<td id="scopeTags-{{item.id}}">{% for tag in item.tags %}{{ tag.name }}{% if not loop.last %}, {% endif %}{% endfor %}</td>
<td style="text-align:center;">
{% include 'admin/_scope_menu.html' %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<div class="row">
<div class="col">
<h3>Import Scope</h3>
<form method="POST" action="{{ url_for('admin.importScope', scopetype='scope') }}">
{{ importForm.hidden_tag() }}
{{ importForm.scope(rows='10', cols='30') }}
<br />
{{ importForm.submit(class="btn btn-primary", id="submit-import") }}
<a href="{{ url_for('admin.exportScope', scopetype='scope') }}" class="btn btn-primary export-btn inline-submit ml-3" role="button">Export Scope</a>
</form>
</div>
</div>
{% include 'admin/_tagmodal.html' %}
{% endblock %}